version 1.4, 2007/02/05 21:36:42 |
version 1.6, 2007/02/06 00:41:49 |
|
|
use warnings; |
use warnings; |
use Module::Build; |
use Module::Build; |
use File::Spec; |
use File::Spec; |
# $RedRiver: Build.PL,v 1.3 2007/02/05 19:39:33 andrew Exp $ |
# $RedRiver: Build.PL,v 1.5 2007/02/05 23:10:37 andrew Exp $ |
|
|
my $cfg_file = File::Spec->catfile('t', 'tests.cfg'); |
my $cfg_file = File::Spec->catfile('t', 'tests.cfg'); |
|
|
|
|
}, |
}, |
); |
); |
|
|
my %cfg; |
get_config(); |
get_ap_config(\%cfg); |
|
|
|
if (%cfg && open T,">$cfg_file") { |
$builder->create_build_script(); |
while (my ($key, $value) = each %cfg) { |
|
print T $key, "\t", $value,"\n"; |
sub get_config { |
|
my %cfg; |
|
print <<EOB; |
|
|
|
Net::Telnet::Trango needs some additional information and setup to |
|
perform it\'s full suite of tests. |
|
|
|
These tests MAY change settings on the units it connects to, so please |
|
do not use equipment that is in production. |
|
|
|
To skip these tests, hit "return". |
|
|
|
EOB |
|
|
|
get_ap_config(\%cfg); |
|
|
|
get_sudb_config(\%cfg) if $cfg{AP} && $cfg{AP_PASSWD}; |
|
|
|
get_su_config(\%cfg); |
|
|
|
if (open T,">$cfg_file") { |
|
while (my ($key, $value) = each %cfg) { |
|
print T $key, "\t", $value,"\n"; |
|
} |
|
close T; |
} |
} |
close T; |
|
} |
} |
|
|
$builder->create_build_script(); |
sub get_ap_config { |
|
my $cfg = shift; |
|
|
sub get_ap_config |
print 'To run the AP tests, we need an IP and a password for an AP.', "\n"; |
{ |
|
|
$cfg->{AP} = $builder->prompt("AP IP: ", $cfg->{AP}) || return; |
|
$cfg->{AP_PASSWD} = $builder->prompt("AP Password:", $cfg->{AP_PASSWD}) |
|
|| return; |
|
} |
|
|
|
sub get_sudb_config { |
my $cfg = shift; |
my $cfg = shift; |
|
|
print <<EOB; |
print <<EOL; |
|
To run the SUDB tests, we need an suid and mac address of an |
|
SU that can reliably link to the AP. |
|
EOL |
|
|
Net::Telnet::Trango needs to log into an AP to |
$cfg->{SU_ID} = $builder->prompt("SU ID: ", $cfg->{SU_ID}) || return; |
perform it\'s full suite of tests. To log in, we |
$cfg->{SU_MAC} = $builder->prompt("SU MAC:", $cfg->{SU_MAC}) || return; |
need a test AP and a password. |
} |
|
|
To skip these tests, hit "return". |
sub get_su_config { |
|
my $cfg = shift; |
|
|
EOB |
print 'To run the SU tests, we need an IP and a password of an SU.', "\n"; |
|
|
$cfg->{AP} = $builder->prompt("AP: ", $cfg->{AP}) || return; |
$cfg->{SU} = $builder->prompt("SU IP: ", $cfg->{SU}) || return; |
$cfg->{AP_PASSWD} = $builder->prompt("Password:", $cfg->{AP_PASSWD}) || return; |
$cfg->{SU_PASSWD} = $builder->prompt("SU Password:", $cfg->{SU_PASSWD}) |
|
|| return; |
} |
} |
|
|