version 1.6, 2007/02/06 19:06:13 |
version 1.8, 2007/02/06 20:59:10 |
|
|
#!perl -T |
#!perl -T |
# $RedRiver: 51-network-add_su-ap.t,v 1.5 2007/02/06 17:40:02 andrew Exp $ |
# $RedRiver: 51-network-add_su-ap.t,v 1.7 2007/02/06 19:09:25 andrew Exp $ |
|
|
use Test::More tests => 16; |
use Test::More tests => 17; |
use File::Spec; |
use File::Spec; |
|
|
BEGIN { |
BEGIN { |
use_ok( 'Net::Telnet::Trango' ); |
use_ok( 'Net::Telnet::Trango' ); |
} |
} |
|
|
diag("Testing Net::Telnet::Trango $Net::Telnet::Trango::VERSION, Perl $], $^X"); |
diag("51: AP tests when adding an SU to an AP"); |
diag(" AP tests when adding an SU to an AP"); |
|
|
|
my $cfg_file = File::Spec->catfile('t', 'tests.cfg'); |
my $cfg_file = File::Spec->catfile('t', 'tests.cfg'); |
my ($cir, $mir, $new_mir) = (128, 256, 1024); |
my ($cir, $mir, $new_mir) = (128, 256, 1024); |
|
|
SKIP: { |
SKIP: { |
my $skipped = 15; |
my $skipped = 16; |
my %cfg; |
my %cfg; |
if (-e $cfg_file) { |
if (-e $cfg_file) { |
if (open my $fh, $cfg_file) { |
if (open my $fh, $cfg_file) { |
|
|
} |
} |
|
|
$in_sudb = 0; |
$in_sudb = 0; |
|
my $su_mir = 0; |
foreach my $su (@{ $sudb }) { |
foreach my $su (@{ $sudb }) { |
if ($su_id == $su->{suid}) { |
if ($su_id == $su->{suid}) { |
if (lc($su_mac) eq lc($su->{mac})) { |
if (lc($su_mac) eq lc($su->{mac})) { |
|
$su_mir = $su->{mir}; |
$in_sudb = 1; |
$in_sudb = 1; |
} else { |
} else { |
$in_sudb = -1; |
$in_sudb = -1; |
|
|
diag('ERR: ' . $t->last_error); |
diag('ERR: ' . $t->last_error); |
} |
} |
|
|
|
is($mir, $su_mir, "SU has correct mir"); |
|
|
if ( (! ok($t->sudb_modify($su_id, 'mir', $new_mir), "modifying su mir")) |
if ( (! ok($t->sudb_modify($su_id, 'mir', $new_mir), "modifying su mir")) |
&& $t->last_error ) { |
&& $t->last_error ) { |