mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 11:18:03 +00:00
lf_many_conn: fixed many minor perl errors, removes unused cmd_log options
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
# This program is used to stress test the LANforge system, and may be used as
|
# This program is used to stress test the LANforge system, and may be used as
|
||||||
# an example for others who wish to automate LANforge tests.
|
# an example for others who wish to automate LANforge tests.
|
||||||
@@ -17,16 +17,17 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use diagnostics;
|
||||||
|
|
||||||
# Un-buffer output
|
# Un-buffer output
|
||||||
$| = 1;
|
$| = 1;
|
||||||
|
|
||||||
|
use lib '/home/lanforge/scripts';
|
||||||
use LANforge::Endpoint;
|
use LANforge::Endpoint;
|
||||||
use LANforge::Port;
|
use LANforge::Port;
|
||||||
use LANforge::Utils;
|
use LANforge::Utils;
|
||||||
|
|
||||||
use Net::Telnet ();
|
use Net::Telnet ();
|
||||||
|
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
my $lfmgr_host = "localhost";
|
my $lfmgr_host = "localhost";
|
||||||
@@ -81,9 +82,9 @@ my $do_run_cxs = 1; #Should usually be 1
|
|||||||
my $fail_msg = "";
|
my $fail_msg = "";
|
||||||
my $manual_check = 0;
|
my $manual_check = 0;
|
||||||
|
|
||||||
my $cmd_log_name = "lf_conn_cmds.txt";
|
#my $cmd_log_name = "lf_conn_cmds.txt";
|
||||||
open(CMD_LOG, ">$cmd_log_name") or die("Can't open $cmd_log_name for writing...\n");
|
#open(CMD_LOG, ">$cmd_log_name") or die("Can't open $cmd_log_name for writing...\n");
|
||||||
print "History of all commands can be found in $cmd_log_name\n";
|
#print "History of all commands can be found in $cmd_log_name\n";
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Nothing to configure below here, most likely.
|
# Nothing to configure below here, most likely.
|
||||||
@@ -100,8 +101,6 @@ my $usage = "$0 [--lf1_port {\"port_num ip mask gateway\"}]
|
|||||||
Example:
|
Example:
|
||||||
$0 --lf1_port \"1 172.22.22.2 255.255.255.0 172.22.22.1\" --lf2_port \"1 172.22.22.3 255.255.255.0 172.22.22.1\" --init_to_dflts yes\n";
|
$0 --lf1_port \"1 172.22.22.2 255.255.255.0 172.22.22.1\" --lf2_port \"1 172.22.22.3 255.255.255.0 172.22.22.1\" --init_to_dflts yes\n";
|
||||||
|
|
||||||
my $i = 0;
|
|
||||||
|
|
||||||
GetOptions
|
GetOptions
|
||||||
(
|
(
|
||||||
'protocol|p=s' => \$proto,
|
'protocol|p=s' => \$proto,
|
||||||
@@ -109,8 +108,8 @@ GetOptions
|
|||||||
'quiet|q=s' => \$quiet,
|
'quiet|q=s' => \$quiet,
|
||||||
'num_cxs|n=i' => \$to_do_at_a_time,
|
'num_cxs|n=i' => \$to_do_at_a_time,
|
||||||
'init_ports|i=s' => \$init_to_dflts,
|
'init_ports|i=s' => \$init_to_dflts,
|
||||||
'lf1_port|l=s' => \$lf1_port,
|
'lf1_port|a=s' => \$lf1_port,
|
||||||
'lf2_port|L=s' => \$lf2_port,
|
'lf2_port|b=s' => \$lf2_port,
|
||||||
'init_to_dflts|d=s' => \$init_to_dflts,
|
'init_to_dflts|d=s' => \$init_to_dflts,
|
||||||
) || die("$usage");
|
) || die("$usage");
|
||||||
|
|
||||||
@@ -129,18 +128,12 @@ $t->open(Host => $lfmgr_host,
|
|||||||
|
|
||||||
$t->waitfor("/btbits\>\>/");
|
$t->waitfor("/btbits\>\>/");
|
||||||
|
|
||||||
my $dt = "";
|
|
||||||
|
|
||||||
|
|
||||||
# Configure our utils.
|
# Configure our utils.
|
||||||
my $utils = new LANforge::Utils();
|
my $utils = new LANforge::Utils();
|
||||||
$utils->telnet($t); # Set our telnet object.
|
$utils->telnet($t); # Set our telnet object.
|
||||||
$utils->cli_send_silent(0); # Do show input to CLI
|
$utils->cli_send_silent(0); # Do show input to CLI
|
||||||
$utils->cli_rcv_silent(1); # Repress output from CLI ??
|
$utils->cli_rcv_silent(1); # Repress output from CLI ??
|
||||||
|
|
||||||
|
|
||||||
my $dt = "";
|
|
||||||
|
|
||||||
if ($init_to_dflts eq "yes") {
|
if ($init_to_dflts eq "yes") {
|
||||||
initToDefaults();
|
initToDefaults();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user