mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 03:07:56 +00:00
lf_icemod.pl: fixes command switches and library paths
This commit is contained in:
37
lf_icemod.pl
37
lf_icemod.pl
@@ -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.
|
||||||
@@ -9,16 +9,28 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use diagnostics;
|
||||||
|
use Carp;
|
||||||
|
$SIG{ __DIE__ } = sub { Carp::confess( @_ ) };
|
||||||
|
$SIG{ __WARN__ } = sub { Carp::confess( @_ ) };
|
||||||
|
|
||||||
# Un-buffer output
|
# Un-buffer output
|
||||||
$| = 1;
|
$| = 1;
|
||||||
|
|
||||||
|
if ( -d "./LANforge" ) {
|
||||||
|
use lib ".";
|
||||||
|
use lib "./LANforge";
|
||||||
|
}
|
||||||
|
elsif ( -d "/home/lanforge/scripts/LANforge" ) {
|
||||||
|
use lib "/home/lanforge/scripts";
|
||||||
|
use lib "/home/lanforge/scripts/LANforge";
|
||||||
|
}
|
||||||
|
|
||||||
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";
|
||||||
@@ -80,6 +92,7 @@ Example:
|
|||||||
";
|
";
|
||||||
|
|
||||||
my $i = 0;
|
my $i = 0;
|
||||||
|
my $show_help;
|
||||||
|
|
||||||
GetOptions
|
GetOptions
|
||||||
(
|
(
|
||||||
@@ -91,10 +104,10 @@ GetOptions
|
|||||||
'latency|l=i' => \$latency,
|
'latency|l=i' => \$latency,
|
||||||
'jitter|j=i' => \$jitter,
|
'jitter|j=i' => \$jitter,
|
||||||
'switch|w=s' => \$switch,
|
'switch|w=s' => \$switch,
|
||||||
'manager|m=s' => \$lfmgr_host,
|
'manager|mgr|m=s' => \$lfmgr_host,
|
||||||
'pcap|p=s' => \$pcap,
|
'pcap|p=s' => \$pcap,
|
||||||
'load|L=s' => \$load,
|
'load|o=s' => \$load,
|
||||||
'state|S=s' => \$state,
|
'state|a=s' => \$state,
|
||||||
'quiet|q=i' => \$quiet,
|
'quiet|q=i' => \$quiet,
|
||||||
) || die("$usage");
|
) || die("$usage");
|
||||||
|
|
||||||
@@ -103,12 +116,12 @@ if ($show_help) {
|
|||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! ($quiet == 0xffff)) {
|
#if (! ($quiet == 0xffff)) {
|
||||||
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");
|
||||||
if (! ($quiet & 0x2)) {
|
# if (! ($quiet & 0x2)) {
|
||||||
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";
|
||||||
}
|
# }
|
||||||
}
|
#}
|
||||||
|
|
||||||
# Open connection to the LANforge server.
|
# Open connection to the LANforge server.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user