#!/usr/bin/perl -wT # vim: ft=xml ts=8 sw=4 noet: #---------------------------------------------------------------------- # heading : Security # description : Remote access # navigation : 5000 5200 #---------------------------------------------------------------------- #---------------------------------------------------------------------- # copyright (C) 2002 Mitel Networks Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #---------------------------------------------------------------------- use strict; use esmith::FormMagick::Panel::remoteaccess; my $f = esmith::FormMagick::Panel::remoteaccess->new(); $f->display(); =head1 TESTING =begin testing use esmith::FormMagick::Tester; use esmith::TestUtils; use esmith::ConfigDB; my $panel = 'remoteaccess'; my $panel_path = "/etc/e-smith/web/functions/".$panel; my $ua = esmith::FormMagick::Tester->new(); is (mode($panel_path), '4750', "Check permissions on script"); ok ($ua->get_panel($panel), "ABOUT TO RUN L10N TESTS"); is ($ua->{status}, 200, "200 OK"); like($ua->{content}, qr/FORM_TITLE/, "Saw untranslated form title"); ok ($ua->set_language("en-us"), "Set language to U.S. English"); ok ($ua->get_panel($panel), "Get panel"); is ($ua->{status}, 200, "200 OK"); like($ua->{content}, qr/remote access settings/, "Saw translated form title"); # Testing changes ok ($ua->get_panel($panel), "Testing panel retrieval"); can_ok($ua, "field"); ok ($ua->{form}->find_input('FTPAccess'), 'Finding the FTPAccess field'); ok ($ua->{form}->find_input('sshAccess'), 'Finding the sshAccess field'); ok ($ua->{form}->find_input('sshPermitRootLogin'), 'Finding the sshPermitRootLogin field'); ok ($ua->{form}->find_input('sshTCPPort'), 'Finding the sshTCPPort field'); ok ($ua->{form}->find_input('vpnSessions'), 'Finding the vpnSessions field'); ok ($ua->{form}->find_input('sshPasswordAuthentication'), 'Finding the sshPasswordAuthentication field'); ok ($ua->{form}->find_input('FTPLimits'), 'Finding the FTPLimits field'); ok ($ua->{form}->find_input('TelnetAccess'), 'Finding the TelnetAccess field'); if (destruction_ok()) { $ua->field('FTPAccess' => 'private'); $ua->field('sshAccess' => 'public'); $ua->field('sshPermitRootLogin' => 'yes'); $ua->field('sshTCPPort' => '22'); $ua->field('vpnSessions' => '10'); $ua->field('sshPasswordAuthentication' => 'yes'); $ua->field('FTPLimits' => 'normal'); $ua->field('TelnetAccess' => 'private'); } ok ($ua->click("Save"), "Click Save"); is ($ua->{status}, 200, "200 OK"); like($ua->{content}, qr/settings have been saved/, "Saw validation messages"); # Gotta open this later, so we don't cache stale data my $db = esmith::ConfigDB->open; SKIP: { skip 9, "Unsafe!" unless destruction_ok(); is($db->get('sshd')->prop('access'), 'public', "We have public ssh"); is($db->get('sshd')->prop('PasswordAuthentication'), 'yes', "We have password auth"); is($db->get('sshd')->prop('PermitRootLogin'), 'yes', "We have root login"); is($db->get('sshd')->prop('TCPPort'), '22', "Got the right tcp port for ssh'); is($db->get('sshd')->prop('status'), 'enabled', "ssh is enabled"); is ($db->get('ftp')->prop('access'), 'private', "ftp access is private"); is ($db->get('ftp')->prop('accessLimits'), 'normal', "ftp access limits are normal"); is ($db->get('vpn')->prop('sessions') ,'10', "Got the right session count for vpn"); is ($db->get('vpn')->prop('status') ,'enabled', "vpn is enabled"); is ($db->get('telnet')->prop('access'), 'private', "Private telnet turned on"); } =end testing =cut __DATA__
DESC_VPN DESC_VALID_FROM_ENTRIES DESC_SSH