mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 03:07:56 +00:00
port_test: parameterized ssid and passwd
This commit is contained in:
@@ -21,6 +21,7 @@ use LANforge::JsonUtils qw(logg err json_request get_links_from get_thru json_po
|
|||||||
|
|
||||||
package main;
|
package main;
|
||||||
# Default values for ye ole cmd-line args.
|
# Default values for ye ole cmd-line args.
|
||||||
|
|
||||||
our $Resource = 1;
|
our $Resource = 1;
|
||||||
our $quiet = "yes";
|
our $quiet = "yes";
|
||||||
our $Host = "localhost";
|
our $Host = "localhost";
|
||||||
@@ -28,9 +29,13 @@ our $Port = 8080;
|
|||||||
our $HostUri = "http://$Host:$Port";
|
our $HostUri = "http://$Host:$Port";
|
||||||
our $Web = LWP::UserAgent->new;
|
our $Web = LWP::UserAgent->new;
|
||||||
our $Decoder = JSON->new->utf8;
|
our $Decoder = JSON->new->utf8;
|
||||||
|
our $use_ssid = "kedtest-wpa2";
|
||||||
|
our $use_pass = "kedtest-wpa2";
|
||||||
|
|
||||||
my $usage = qq("$0 --host {ip or hostname} # connect to this
|
my $usage = qq("$0 --host {ip or hostname} # connect to this
|
||||||
--port {port number} # defaults to 8080
|
--port {port number} # defaults to 8080
|
||||||
|
--ssid {ssid}
|
||||||
|
--pass {passwd}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -44,6 +49,8 @@ GetOptions
|
|||||||
(
|
(
|
||||||
'host=s' => \$::Host,
|
'host=s' => \$::Host,
|
||||||
'port=i' => \$::Port,
|
'port=i' => \$::Port,
|
||||||
|
'ssid=s' => \$::use_ssid,
|
||||||
|
'pass=s' => \$::use_pass,
|
||||||
) || (print($usage) && exit(1));
|
) || (print($usage) && exit(1));
|
||||||
|
|
||||||
$::HostUri = "http://$Host:$Port";
|
$::HostUri = "http://$Host:$Port";
|
||||||
@@ -69,7 +76,7 @@ for $uri (@$ra_links) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# destroy stations on resource 3
|
# destroy stations
|
||||||
my @radios = ();
|
my @radios = ();
|
||||||
my @destroy_me = ();
|
my @destroy_me = ();
|
||||||
for my $rh_alias_link (@$ra_alias_links) {
|
for my $rh_alias_link (@$ra_alias_links) {
|
||||||
@@ -157,8 +164,8 @@ for $rh_radio (@radios) {
|
|||||||
#'alias'=>'vsta'.$i, # deprecated, use set_port + interest.set_alias
|
#'alias'=>'vsta'.$i, # deprecated, use set_port + interest.set_alias
|
||||||
#'flags'=>68862086144, # has port-down set
|
#'flags'=>68862086144, # has port-down set
|
||||||
'flags'=>142609408,
|
'flags'=>142609408,
|
||||||
'ssid'=>'idtest-1200-wpa2',
|
'ssid'=> $::use_ssid,
|
||||||
'key'=>'idtest-1200-wpa2',
|
'key'=> $::use_pass,
|
||||||
'mac'=>'xx:xx:xx:xx:*:xx',
|
'mac'=>'xx:xx:xx:xx:*:xx',
|
||||||
'mode'=>0,
|
'mode'=>0,
|
||||||
'rate'=>'DEFAULT'
|
'rate'=>'DEFAULT'
|
||||||
|
|||||||
Reference in New Issue
Block a user