Merge branch 'master' of github.com:greearb/lanforge-scripts

This commit is contained in:
Logan Lipke
2020-04-17 15:20:55 -07:00
11 changed files with 547 additions and 24 deletions

57
cisco_wifi_ctl.py Executable file → Normal file
View File

@@ -1,9 +1,9 @@
#!/usr/bin/python3
'''
LANforge 192.168.100.178
Controller at 192.168.100.112 admin/Cisco123
LANforge 172.19.27.91
Controller at 172.19.27.95 2013 cisco/Cisco123
Controller is 192.1.0.10
AP is 192.1.0.2
AP is 172.19.27.95 2014
make sure pexpect is installed:
$ sudo yum install python3-pexpect
@@ -11,7 +11,7 @@ $ sudo yum install python3-pexpect
You might need to install pexpect-serial using pip:
$ pip3 install pexpect-serial
./cisco_wifi_ctl.py -d 192.168.100.112 -u admin -p Cisco123 -s ssh --port 22
./cisco_wifi_ctl.py -d 172.19.27.95 -o 2013 -l stdout -a AxelMain -u cisco -p Cisco123 -s telnet
'''
@@ -51,6 +51,8 @@ def usage():
print("-s|--scheme (serial|telnet|ssh): connect via serial, ssh or telnet")
print("-l|--log file: log messages here")
print("-b|--band: a (5Ghz) or b (2.4Ghz) or abgn for dual-band 2.4Ghz AP")
print("-w|--wlan: WLAN name")
print("-i|--wlanID: WLAN ID")
print("-h|--help")
# see https://stackoverflow.com/a/13306095/11014343
@@ -75,12 +77,14 @@ def main():
parser.add_argument("-t", "--tty", type=str, help="tty serial device")
parser.add_argument("-l", "--log", type=str, help="logfile for messages, stdout means output to console")
#parser.add_argument("-r", "--radio", type=str, help="select radio")
parser.add_argument("-w", "--wlan", type=str, help="wlan name")
parser.add_argument("-i", "--wlanID", type=str, help="wlan ID")
parser.add_argument("-a", "--ap", type=str, help="select AP")
parser.add_argument("-b", "--band", type=str, help="Select band (a | b | abgn)",
choices=["a", "b", "abgn"])
parser.add_argument("--action", type=str, help="perform action",
choices=["config", "country", "ap_country", "enable", "disable", "summary", "advanced",
"cmd", "txPower", "bandwidth", "channel", "show" ])
"cmd", "txPower", "bandwidth", "channel", "show", "wlan", "enable_wlan", "delete_wlan", "wlan_qos" ])
parser.add_argument("--value", type=str, help="set value")
args = None
@@ -88,7 +92,8 @@ def main():
args = parser.parse_args()
host = args.dest
scheme = args.scheme
port = (default_ports[scheme], args.port)[args.port != None]
port = args.port
#port = (default_ports[scheme], args.port)[args.port != None]
user = args.user
passwd = args.passwd
logfile = args.log
@@ -160,13 +165,20 @@ def main():
logg.info("Spawn: "+cmd+NL)
egg = pexpect.spawn(cmd)
egg.logfile = FileAdapter(logg)
egg.expect('login:', timeout=3)
time.sleep(0.1)
egg.sendline(' ')
egg.expect('User\:')
egg.sendline(user)
time.sleep(0.1)
egg.expect('password:')
time.sleep(0.1)
egg.expect('Password\:')
egg.sendline(passwd)
egg.sendline('config paging disable')
#egg.expect('(Voice-Talwar) >', timeout=3)
#time.sleep(0.1)
#egg.sendline(user)
#time.sleep(0.1)
#egg.expect('password:')
#time.sleep(0.1)
#egg.sendline(passwd)
else:
usage()
exit(1)
@@ -175,7 +187,8 @@ def main():
command = None
time.sleep(0.1)
CCPROMPT = '\(Cisco Controller\) >'
CCPROMPT = '\(Voice-Talwar\) >'
LOGOUTPROMPT = 'User:'
EXITPROMPT = "Would you like to save them now\? \(y/N\)"
AREYOUSURE = "Are you sure you want to continue\? \(y/n\)"
CLOSEDBYREMOTE = "closed by remote host."
@@ -236,6 +249,26 @@ def main():
if (args.action == "channel"):
command = "config 802.11%s channel ap %s %s"%(band, args.ap, args.value)
if (args.action == "wlan" and (args.wlanID is None)):
raise Exception("wlan ID is required")
if (args.action == "wlan"):
command = "config wlan create %s %s %s"%(args.wlanID, args.wlan, args.wlan)
if (args.action == "enable_wlan" and (args.wlanID is None)):
raise Exception("wlan ID is required")
if (args.action == "enable_wlan"):
command = "config wlan enable %s"%(args.wlanID)
if (args.action == "delete_wlan" and (args.wlanID is None)):
raise Exception("wlan ID is required")
if (args.action == "delete_wlan"):
command = "config wlan delete %s"%(args.wlanID)
if (args.action == "wlan_qos" and (args.wlanID is None)):
raise Exception("wlan ID is required")
if (args.action == "wlan_qos"):
command = "config wlan qos %s %s"%(args.wlanID, args.value)
if (command is None):
logg.info("No command specified, going to log out.")
@@ -255,7 +288,7 @@ def main():
egg.sendline("logout")
i = egg.expect([EXITPROMPT, CLOSEDBYREMOTE, CLOSEDCX])
i = egg.expect([LOGOUTPROMPT, EXITPROMPT, CLOSEDBYREMOTE, CLOSEDCX])
if i == 0:
egg.sendline("y")

View File

@@ -20,26 +20,33 @@ test_rig: TR-398 test bed
Save this text to a file for later use: AP-Auto-ap-auto-32-64-dual.txt
You can also use the ../lf_testmod.pl script to do this:
# The head and tail stuff trims leading and trailing lines, respectively.
../lf_testmod.pl --mgr 192.168.100.156 --action show --test_name AP-Auto-ap-auto-32-64-dual|tail -n +2 | head -n -2 > test_configs/mytest.txt
# Save this text using the ../lf_testmod.pl script:
../lf_testmod.pl --mgr 192.168.100.156 --action show --test_name AP-Auto-ap-auto-32-64-dual > test_configs/mytest.txt
To load a test file:
lf_testmod.pl --mgr 192.168.100.156 --action set --test_name AP-Auto-ben --file test_configs/mytest.txt
# To load a test file into the LANforge server configuration:
../lf_testmod.pl --mgr 192.168.100.156 --action set --test_name AP-Auto-ben --file test_configs/mytest.txt
# Save print and scenario:
../lf_testmod.pl --mgr 192.168.100.156 --action show --test_name simpleThput --test_type Network-Connectivity > test_configs/myscenario.txt
# Load a scenario into the LANforge server configuration
../lf_testmod.pl --mgr 192.168.100.156 --action set --test_type Network-Connectivity --test_name 64sta --file test_configs/myscenario.txt
###
Once test cases have been loaded, you can tell the GUI to run tests for you, potentially modifying the
Once test cases have been loaded into the server, you can tell the GUI to run tests for you, potentially modifying the
test configuration through the GUI.
First, tell the GUI to read the latest test config from the server.
# Tell the GUI to read the latest test config from the server.
../lf_gui_cmd.pl --manager localhost --port 3990 --cmd "cli show_text_blob"
# Tell the Chamber-View GUI widget to load and build the specified scenario.
../lf_gui_cmd.pl --manager localhost --port 3990 --load 64sta
Now, tell the GUI to run a test with the new config.
# Now, tell the GUI to run a test with the new config.
# Note that the --tconfig option does not have the "AP-Auto-" prepended to it, that is automatically
# done by the GUI in order to make sure each test has its own namespace.
../lf_gui_cmd.pl --manager localhost --port 3990 --ttype "AP-Auto" --tname ap-auto-ben --tconfig ben --rpt_dest /tmp/lf_reports/

View File

@@ -12,6 +12,9 @@
#
AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-test_configs/AP-Auto-ap-auto-32-64-dual.txt}
WCT_CFG_FILE=${WCT_CFG_FILE:-test_configs/WCT-64sta.txt}
DPT_CFG_FILE=${DPT_CFG_FILE:-test_configs/dpt-pkt-sz.txt}
SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-test_configs/64_sta_scenario.txt}
# LANforge target machine
LFMANAGER=${LFMANAGER:-localhost}
@@ -23,9 +26,32 @@ MY_TMPDIR=${MY_TMPDIR:-/tmp}
# Test configuration (10 minutes by default, in interest of time)
STABILITY_DURATION=${STABILITY_DURATION:-600}
TEST_RIG_ID=${TEST_RIG_ID:-Unspecified}
# DUT configuration
DUT_FLAGS=${DUT_FLAGS:-NA}
DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-NA}
DUT_SW_VER=${DUT_SW_VER:-NA}
DUT_HW_VER=${DUT_HW_VER:-NA}
DUT_MODEL=${DUT_MODEL:-NA}
DUT_SERIAL=${DUT_SERIAL:-NA}
DUT_SSID1=${DUT_SSID1:-NA}
DUT_SSID2=${DUT_SSID2:-NA}
DUT_SSID3=${DUT_SSID3:-NA}
DUT_PASSWD1=${DUT_PASSWD1:-NA}
DUT_PASSWD2=${DUT_PASSWD2:-NA}
DUT_PASSWD3=${DUT_PASSWD3:-NA}
DUT_BSSID1=${DUT_BSSID1:-NA}
DUT_BSSID2=${DUT_BSSID2:-NA}
DUT_BSSID3=${DUT_BSSID3:-NA}
# Tests to run
DEFAULT_ENABLE=${DEFAULT_ENABLE:-1}
DO_DPT_PKT_SZ=${DO_DPT_PKT_SZ:-$DEFAULT_ENABLE}
DO_WCT_DL=${DO_WCT_DL:-$DEFAULT_ENABLE}
DO_WCT_UL=${DO_WCT_UL:-$DEFAULT_ENABLE}
DO_WCT_BI=${DO_WCT_BI:-$DEFAULT_ENABLE}
DO_SHORT_AP_BASIC_CX=${DO_SHORT_AP_BASIC_CX:-$DEFAULT_ENABLE}
DO_SHORT_AP_TPUT=${DO_SHORT_AP_TPUT:-$DEFAULT_ENABLE}
DO_SHORT_AP_STABILITY_RESET=${DO_SHORT_AP_STABILITY_RESET:-$DEFAULT_ENABLE}
@@ -38,23 +64,117 @@ RSLTS_DIR=${RSLTS_DIR:-basic_regression_results_$DATESTR}
# Probably no config below here
AP_AUTO_CFG=ben
WCT_CFG=ben
DPT_CFG=ben
SCENARIO=64sta
RPT_TMPDIR=${MY_TMPDIR}/lf_reports
# Query DUT from the scenario
DUT=`grep DUT: $SCENARIO_CFG_FILE |head -1|grep -o "DUT: .*"|cut -f2 -d ' '`
echo "Found DUT: $DUT from scenario $SCENARIO_CFG_FILE"
mkdir -p $RSLTS_DIR
set -x
# Load scenario file
../lf_testmod.pl --mgr $LFMANAGER --action set --test_type Network-Connectivity --test_name $SCENARIO --file $SCENARIO_CFG_FILE
# Load AP-Auto config file
../lf_testmod.pl --mgr $LFMANAGER --action set --test_name AP-Auto-$AP_AUTO_CFG --file $AP_AUTO_CFG_FILE
# Load Wifi Capacity config file
../lf_testmod.pl --mgr $LFMANAGER --action set --test_name Wifi-Capacity-$WCT_CFG --file $WCT_CFG_FILE
# Load Dataplane config file
../lf_testmod.pl --mgr $LFMANAGER --action set --test_name dataplane-test-latest-$DPT_CFG --file $DPT_CFG_FILE
# Set DUT info if configured.
if [ "_$DUT" != "_" ]
then
../lf_portmod.pl --manager $LFMANAGER \
--cli_cmd "add_dut $DUT $DUT_FLAGS NA '$DUT_SW_VER' '$DUT_HW_VER' '$DUT_MODEL' '$DUT_SERIAL' NA NA NA '$DUT_SSID1' '$DUT_PASSWD1' '$DUT_SSID2' '$DUT_PASSWD2' '$DUT_SSID3' '$DUT_PASSWD3' NA NA $DUT_FLAGS_MASK NA NA NA $DUT_BSSID1 $DUT_BSSID2 $DUT_BSSID3"
fi
# Make sure GUI is synced up with the server
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli show_text_blob"
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli show_dut"
# Pause to let GUI finish getting data from the server
sleep 10
# Tell GUI to load and build the scenario
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --scenario $SCENARIO
# Clean out temp report directory
if [ -d $RPT_TMPDIR ]
then
rm -fr $RPT_TMPDIR/*
fi
# Do dataplane pkt size test
echo "Checking if we should run Dataplane packet size test."
if [ "_$DO_DPT_PKT_SZ" == "_1" ]
then
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --ttype "Dataplane" --tname dpt-ben --tconfig $DPT_CFG \
--modifier_key "Test Rig ID:" --modifier_val "$TEST_RIG_ID" \
--modifier_key "DUT_NAME" --modifier_val "$DUT" \
--modifier_key "Show Low-Level Graphs" --modifier_val true \
--rpt_dest $RPT_TMPDIR > $MY_TMPDIR/basic_regression_log.txt 2>&1
mv $RPT_TMPDIR/* $RSLTS_DIR/dataplane_pkt_sz
mv $MY_TMPDIR/basic_regression_log.txt $RSLTS_DIR/dataplane_pkt_sz/test_automation.txt
fi
# Do capacity test
echo "Checking if we should run WCT Download test."
if [ "_$DO_WCT_DL" == "_1" ]
then
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --ttype "WiFi Capacity" --tname wct-ben --tconfig $WCT_CFG \
--modifier_key "Test Rig ID:" --modifier_val "$TEST_RIG_ID" \
--modifier_key "DUT_NAME" --modifier_val "$DUT" \
--modifier_key "RATE_DL" --modifier_val "1Gbps" \
--modifier_key "RATE_UL" --modifier_val "0" \
--rpt_dest $RPT_TMPDIR > $MY_TMPDIR/basic_regression_log.txt 2>&1
mv $RPT_TMPDIR/* $RSLTS_DIR/wifi_capacity_dl
mv $MY_TMPDIR/basic_regression_log.txt $RSLTS_DIR/wifi_capacity_dl/test_automation.txt
fi
echo "Checking if we should run WCT Upload test."
if [ "_$DO_WCT_UL" == "_1" ]
then
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --ttype "WiFi Capacity" --tname wct-ben --tconfig $WCT_CFG \
--modifier_key "Test Rig ID:" --modifier_val "$TEST_RIG_ID" \
--modifier_key "DUT_NAME" --modifier_val "$DUT" \
--modifier_key "RATE_UL" --modifier_val "1Gbps" \
--modifier_key "RATE_DL" --modifier_val "0" \
--rpt_dest $RPT_TMPDIR > $MY_TMPDIR/basic_regression_log.txt 2>&1
mv $RPT_TMPDIR/* $RSLTS_DIR/wifi_capacity_ul
mv $MY_TMPDIR/basic_regression_log.txt $RSLTS_DIR/wifi_capacity_ul/test_automation.txt
fi
echo "Checking if we should run WCT Bi-Direction test."
if [ "_$DO_WCT_BI" == "_1" ]
then
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --ttype "WiFi Capacity" --tname wct-ben --tconfig $WCT_CFG \
--modifier_key "Test Rig ID:" --modifier_val "$TEST_RIG_ID" \
--modifier_key "DUT_NAME" --modifier_val "$DUT" \
--modifier_key "RATE_UL" --modifier_val "1Gbps" \
--modifier_key "RATE_DL" --modifier_val "1Gbps" \
--modifier_key "Protocol:" --modifier_val "TCP-IPv4" \
--rpt_dest $RPT_TMPDIR > $MY_TMPDIR/basic_regression_log.txt 2>&1
mv $RPT_TMPDIR/* $RSLTS_DIR/wifi_capacity_bi
mv $MY_TMPDIR/basic_regression_log.txt $RSLTS_DIR/wifi_capacity_bi/test_automation.txt
fi
# Run basic-cx test
echo "Checking if we should run Short-AP Basic CX test."
if [ "_$DO_SHORT_AP_BASIC_CX" == "_1" ]
then
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --ttype "AP-Auto" --tname ap-auto-ben --tconfig $AP_AUTO_CFG \
--modifier_key "Test Rig ID:" --modifier_val "$TEST_RIG_ID" \
--modifier_key "DUT_NAME" --modifier_val "$DUT" \
--rpt_dest $RPT_TMPDIR > $MY_TMPDIR/basic_regression_log.txt 2>&1
mv $RPT_TMPDIR/* $RSLTS_DIR/ap_auto_basic_cx
mv $MY_TMPDIR/basic_regression_log.txt $RSLTS_DIR/ap_auto_basic_cx/test_automation.txt
@@ -62,9 +182,12 @@ fi
# Run Throughput, Dual-Band, Capacity test in a row, the Capacity will use results from earlier
# tests.
echo "Checking if we should run Short-AP Throughput test."
if [ "_$DO_SHORT_AP_TPUT" == "_1" ]
then
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --ttype "AP-Auto" --tname ap-auto-ben --tconfig $AP_AUTO_CFG \
--modifier_key "Test Rig ID:" --modifier_val "$TEST_RIG_ID" \
--modifier_key "DUT_NAME" --modifier_val "$DUT" \
--modifier_key "Basic Client Connectivity" --modifier_val false \
--modifier_key "Throughput vs Pkt Size" --modifier_val true \
--modifier_key "Dual Band Performance" --modifier_val true \
@@ -75,9 +198,12 @@ then
fi
# Run Stability test (single port resets, voip, tcp, udp)
echo "Checking if we should run Short-AP Stability Reset test."
if [ "_$DO_SHORT_AP_STABILITY_RESET" == "_1" ]
then
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --ttype "AP-Auto" --tname ap-auto-ben --tconfig $AP_AUTO_CFG \
--modifier_key "Test Rig ID:" --modifier_val "$TEST_RIG_ID" \
--modifier_key "DUT_NAME" --modifier_val "$DUT" \
--modifier_key "Basic Client Connectivity" --modifier_val false \
--modifier_key "Stability" --modifier_val true \
--modifier_key "Stability Duration:" --modifier_val $STABILITY_DURATION \
@@ -87,9 +213,12 @@ then
fi
# Run Stability test (radio resets, voip, tcp, udp)
echo "Checking if we should run Short-AP Stability Radio Reset test."
if [ "_$DO_SHORT_AP_STABILITY_RADIO_RESET" == "_1" ]
then
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --ttype "AP-Auto" --tname ap-auto-ben --tconfig $AP_AUTO_CFG \
--modifier_key "Test Rig ID:" --modifier_val "$TEST_RIG_ID" \
--modifier_key "DUT_NAME" --modifier_val "$DUT" \
--modifier_key "Basic Client Connectivity" --modifier_val false \
--modifier_key "Stability" --modifier_val true \
--modifier_key "Stability Duration:" --modifier_val $STABILITY_DURATION \
@@ -100,9 +229,12 @@ then
fi
# Run Stability test (no resets, no voip, tcp, udp)
echo "Checking if we should run Short-AP Stability No-Reset test."
if [ "_$DO_SHORT_AP_STABILITY_NO_RESET" == "_1" ]
then
../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --ttype "AP-Auto" --tname ap-auto-ben --tconfig $AP_AUTO_CFG \
--modifier_key "Test Rig ID:" --modifier_val "$TEST_RIG_ID" \
--modifier_key "DUT_NAME" --modifier_val "$DUT" \
--modifier_key "Basic Client Connectivity" --modifier_val false \
--modifier_key "Stability" --modifier_val true \
--modifier_key "Stability Duration:" --modifier_val $STABILITY_DURATION \
@@ -112,3 +244,5 @@ then
mv $RPT_TMPDIR/* $RSLTS_DIR/ap_auto_stability_no_reset
mv $MY_TMPDIR/basic_regression_log.txt $RSLTS_DIR/ap_auto_stability_no_reset/test_automation.txt
fi
echo "Done with regression test."

View File

@@ -0,0 +1,12 @@
profile_link 1.1 STA-AC 64 'DUT: TR398-DUT Radio-1' NA wiphy0,AUTO -1
profile_link 1.1 upstream 1 'DUT: TR398-DUT LAN' NA eth1,AUTO -1
chamber TR-398 495 239 NA 10.0
chamber MobileStations 305 240 NA 10.0
dut Lexus 0 0
dut SurfacePro 110 152
dut iphone 0 0
dut Comcast 565 309
dut NetgearAP 987 177
resource 1.2 0 0

View File

@@ -0,0 +1,126 @@
[BLANK]
sel_port-0: 1.1.eth1
sel_port-1: 1.1.sta00000
sel_port-2: 1.1.sta00001
sel_port-3: 1.1.sta00002
sel_port-4: 1.1.sta00003
sel_port-5: 1.1.sta00004
sel_port-6: 1.1.sta00005
sel_port-7: 1.1.sta00006
sel_port-8: 1.1.sta00007
sel_port-9: 1.1.sta00008
sel_port-10: 1.1.sta00009
sel_port-11: 1.1.sta00010
sel_port-12: 1.1.sta00011
sel_port-13: 1.1.sta00012
sel_port-14: 1.1.sta00013
sel_port-15: 1.1.sta00014
sel_port-16: 1.1.sta00015
sel_port-17: 1.1.sta00016
sel_port-18: 1.1.sta00017
sel_port-19: 1.1.sta00018
sel_port-20: 1.1.sta00019
sel_port-21: 1.1.sta00020
sel_port-22: 1.1.sta00021
sel_port-23: 1.1.sta00022
sel_port-24: 1.1.sta00023
sel_port-25: 1.1.sta00024
sel_port-26: 1.1.sta00025
sel_port-27: 1.1.sta00026
sel_port-28: 1.1.sta00027
sel_port-29: 1.1.sta00028
sel_port-30: 1.1.sta00029
sel_port-31: 1.1.sta00030
sel_port-32: 1.1.sta00031
sel_port-33: 1.1.sta00032
sel_port-34: 1.1.sta00033
sel_port-35: 1.1.sta00034
sel_port-36: 1.1.sta00035
sel_port-37: 1.1.sta00036
sel_port-38: 1.1.sta00037
sel_port-39: 1.1.sta00038
sel_port-40: 1.1.sta00039
sel_port-41: 1.1.sta00040
sel_port-42: 1.1.sta00041
sel_port-43: 1.1.sta00042
sel_port-44: 1.1.sta00043
sel_port-45: 1.1.sta00044
sel_port-46: 1.1.sta00045
sel_port-47: 1.1.sta00046
sel_port-48: 1.1.sta00047
sel_port-49: 1.1.sta00048
sel_port-50: 1.1.sta00049
sel_port-51: 1.1.sta00050
sel_port-52: 1.1.sta00051
sel_port-53: 1.1.sta00052
sel_port-54: 1.1.sta00053
sel_port-55: 1.1.sta00054
sel_port-56: 1.1.sta00055
sel_port-57: 1.1.sta00056
sel_port-58: 1.1.sta00057
sel_port-59: 1.1.sta00058
sel_port-60: 1.1.sta00059
sel_port-61: 1.1.sta00060
sel_port-62: 1.1.sta00061
sel_port-63: 1.1.sta00062
sel_port-64: 1.1.sta00063
show_events: 1
show_log: 0
port_sorting: 0
bg: 0xE0ECF8
test_rig:
show_scan: 1
auto_helper: 1
skip_2: 0
skip_5: 0
batch_size: 1,2,5,10,20,40,64
loop_iter: 1
duration: 20000
test_groups: 0
test_groups_subset: 0
protocol: UDP-IPv4
dl_rate_sel: Total Download Rate:
dl_rate: 1000000000
ul_rate_sel: Total Upload Rate:
ul_rate: 0
prcnt_tcp: 100000
l4_endp:
pdu_sz: -1
mss_sel: 1
sock_buffer: 0
ip_tos: 0
multi_conn: -1
min_speed: -1
ps_interval: 60-second Running Average
fairness: 0
naptime: 0
before_clear: 5000
rpt_timer: 1000
try_lower: 0
rnd_rate: 1
leave_ports_up: 0
down_quiesce: 0
udp_nat: 1
record_other_ssids: 0
clear_reset_counters: 1
do_pf: 0
pf_min_period_dl: 1544000
pf_min_period_ul: 0
pf_max_reconnects: 0
use_mix_pdu: 0
pdu_prcnt_pps: 1
pdu_prcnt_bps: 0
pdu_mix_ln-0:
show_scan: 1
show_golden_3p: 0
save_csv: 0
show_realtime: 1
show_pie: 1
show_per_loop_totals: 1
show_cx_time: 1
show_dhcp: 1
show_anqp: 1
show_4way: 1
show_latency: 1

View File

@@ -0,0 +1,55 @@
[BLANK]
sel_port-0: 1.1.sta0000
show_events: 1
show_log: 0
port_sorting: 0
bg: 0xE0ECF8
test_rig:
show_scan: 1
auto_helper: 0
skip_2: 0
skip_5: 0
selected_dut: TR398-DUT
duration: 10000
traffic_port: 1.1.10 sta00000
upstream_port: 1.1.1 eth1
path_loss: 10
speed: 75%
speed2: 56Kbps
min_rssi_bound: -150
max_rssi_bound: 0
channels: AUTO
modes: Auto
pkts: 60;142;256;512;1024;MTU;4000
spatial_streams: AUTO
security_options: AUTO
bandw_options: AUTO
traffic_types: UDP
directions: DUT Transmit
txo_preamble: OFDM
txo_mcs: 0 CCK, OFDM, HT, VHT
txo_retries: No Retry
txo_sgi: OFF
txo_txpower: 15
attenuator: 0
attenuator2: 0
attenuator_mod: 255
attenuator_mod2: 255
attenuations: 0 300
attenuations2: 0 300
chamber: 0
tt_deg: 0..+45..359
cust_pkt_sz:
show_3s: 0
show_ll_graphs: 0
show_gp_graphs: 1
show_1m: 1
pause_iter: 0
show_realtime: 1
operator:
mconn: 1
mpkt: 1000
tos: 0
loop_iterations: 1

View File

@@ -19,6 +19,7 @@ $| = 1;
# use lib prepends to @INC, so put lower priority first
# This is before run-time, so cannot condition this with normal 'if' logic.
use lib '/home/lanforge/scripts';
use lib "../";
use lib "./";
use LANforge::Endpoint;

View File

@@ -28,6 +28,7 @@ my $port = "";
my $cmd = "";
my $ttype = ""; # Test type
my $tname = "lfgui-test";
my $scenario = "";
my $tconfig = ""; # test config
my $rpt_dest = "";
my $show_help = 0;
@@ -43,6 +44,8 @@ my $usage = qq($0 [--manager { hostname or address of LANforge GUI machine } ]
# careful, your cli-socket might be 3390!
[--ttype {test instance type} ]
# likely types: "cv", "WiFi Capacity", "Port Bringup", "Port Reset"
[--scenario {scenario name} ]
# Apply and build the scenario.
[--tname {test instance name} ]
[--tconfig {test configuration name, use defaults if not specified} ]
[--rpt_dest {Copy report to destination once it is complete} ]
@@ -52,6 +55,7 @@ my $usage = qq($0 [--manager { hostname or address of LANforge GUI machine } ]
Example:
lf_gui_cmd.pl --manager localhost --port 3990 --ttype TR-398 --tname mytest --tconfig comxim --rpt_dest /var/www/html/lf_reports
lf_gui_cmd.pl --manager localhost --port 3990 --cmd \"help\"
lf_gui_cmd.pl --manager localhost --port 3990 --scenario 64sta
);
if (@ARGV < 2) {
@@ -66,6 +70,7 @@ GetOptions (
'modifier_val=s' => \@modifiers_val,
'ttype=s' => \$ttype,
'tname=s' => \$tname,
'scenario=s' => \$scenario,
'tconfig=s' => \$tconfig,
'rpt_dest=s' => \$rpt_dest,
'port=s' => \$port,
@@ -102,6 +107,23 @@ if ($cmd ne "") {
print doCmd("$cmd");
}
if ($scenario ne "") {
print doCmd("cv apply '$scenario'");
print doCmd("cv build");
sleep(3);
while (1) {
my $rslt = doCmd("cv is_built");
print "Result-built -:$rslt:-\n";
if ($rslt =~ /NO/) {
sleep(3);
}
else {
last;
}
}
}
if ($ttype ne "") {
print doCmd("cv create '$ttype' '$tname'");
if ($tconfig ne "") {
@@ -164,6 +186,7 @@ if ($ttype ne "") {
sleep(3);
}
else {
print("Chamber-View is (re)built, exiting.\n");
last;
}
}

View File

@@ -34,6 +34,7 @@ my $cwd = getcwd();
# use lib prepends to @INC, so put lower priority first
# This is before run-time, so cannot condition this with normal 'if' logic.
use lib '/home/lanforge/scripts';
use lib "../";
use lib "./";
use LANforge::Endpoint;

View File

@@ -134,9 +134,27 @@ $::utils->connect($lfmgr_host, $lfmgr_port);
if ($::action eq "show") {
$cmd = "show_text_blob $test_type $test_name";
my $r = $::utils->doCmd($cmd);
print $r;
print "\n\n";
my $txt = $::utils->doCmd($cmd);
my @r = split(/\n/, $txt);
my $first = $r[0];
chomp($first);
if ($first =~ /.*::(.*)/) {
print "$1\n";
}
my $i;
for ($i = 1; $i<@r; $i++) {
my $ln = $r[$i];
chomp($ln);
if ($ln =~ /\s*>>RSLT.*/) {
# ignore
}
elsif ($ln =~ /\s*default\@btbits.*/) {
# ignore
}
else {
print "$ln\n";
}
}
}
elsif ($::action eq "set") {
if ($file_name eq "") {

113
tos_plus_auto.py Executable file
View File

@@ -0,0 +1,113 @@
#!/usr/bin/python3
'''
make sure pexpect is installed:
$ sudo yum install python3-pexpect
You might need to install pexpect-serial using pip:
$ pip3 install pexpect-serial
./tos_plus_auto.py
'''
import sys
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit()
import os
import re
import logging
import time
from time import sleep
import pprint
import telnetlib
import argparse
import pexpect
ptype="QCA"
def usage():
print("$0 used connect to automated a test case using cisco controller and LANforge tos-plus script:")
print("-p|--ptype: AP Hardware type")
print("-h|--help")
def main():
global ptype
parser = argparse.ArgumentParser(description="TOS Plus automation script")
parser.add_argument("-p", "--ptype", type=str, help="AP Hardware type")
args = None
try:
args = parser.parse_args()
if (args.ptype != None):
ptype = args.ptype
except Exception as e:
logging.exception(e);
usage()
exit(2);
# Set up cisco controller. For now, variables are hard-coded.
dest = 172.19.27.95
port = 2013
ap = AxelMain
user = cisco
passwd = Cisco123
subprocess.run("python3 cisco_wifi_ctl.py -d %s -o %s -s telnet -l stdout -a %s -u %s -p %s -w wlan_open -i 6 --action wlan"%(dest, port, ap, user, passwd))
subprocess.run("python3 cisco_wifi_ctl.py -d %s -o %s -s telnet -l stdout -a %s -u %s -p %s -w wlan_open -i 6 --action wlan_qos --value platinum"%(dest, port, ap, user, passwd))
subprocess.run("python3 cisco_wifi_ctl.py -d %s -o %s -s telnet -l stdout -a %s -u %s -p %s --action show --value \"wlan summary\""%(dest, port, ap, user, passwd))
subprocess.run("python3 cisco_wifi_ctl.py -d %s -o %s -s telnet -l stdout -a %s -u %s -p %s -b b --action disable"%(dest, port, ap, user, passwd))
subprocess.run("python3 cisco_wifi_ctl.py -d %s -o %s -s telnet -l stdout -a %s -u %s -p %s -b a --action disable"%(dest, port, ap, user, passwd))
subprocess.run("python3 cisco_wifi_ctl.py -d %s -o %s -s telnet -l stdout -a %s -u %s -p %s -b a --action channel --value 149"%(dest, port, ap, user, passwd))
subprocess.run("python3 cisco_wifi_ctl.py -d %s -o %s -s telnet -l stdout -a %s -u %s -p %s -b a --action bandwidth --value 80"%(dest, port, ap, user, passwd))
subprocess.run("python3 cisco_wifi_ctl.py -d %s -o %s -s telnet -l stdout -a %s -u %s -p %s -b a --action enable"%(dest, port, ap, user, passwd))
# Run the tos plus script to generate traffic and grab capture files.
# You may edit this command as needed for different behaviour.
subprocess.run("./lf_tos_plus_test.py --dur 1 --lfmgr localhost --ssid 11ax-open --radio \"1.wiphy0 2 0\" --txpkts 10000 --wait_sniffer 1 --cx \"1.wiphy0 1.wlan0 anAX 1.eth2 udp 1024 10000 50000000 184\" --sniffer_radios \"1.wiphy2\"")
file1 = open('TOS_PLUS.sh', 'r')
lines = file1.readlines()
csv_file = ""
capture_dir = ""
# Strips the newline character
for line in lines:
tok_val = line.split("=", 1)
if tok_val[0] == "CAPTURE_DIR":
capture_dir = tok_val[1]
else if tok_val[0] == "CSV_FILE":
capture_dir = tok_val[1]
# Remove third-party tool's tmp file tmp file
os.unlink("stormbreaker.log")
# Run third-party tool to process the capture files.
subprocess.run("python3 sb -p %s -subdir %s"%(ptype, capture_dir))
# Print out one-way latency reported by LANforge
file2 = open(csv_file, 'r')
lines = file2.readlines()
# Strips the newline character
for line in lines:
cols = line.split("\t")
# Print out endp-name and avg latency
print("%s\t%s"%(cols[1], cols[15]))
subprocess.run("python3 cisco_wifi_ctl.py -d %s -o %s -s telnet -l stdout -a %s -u %s -p %s -w wlan_open -i 6 --action delete_wlan"%(dest, port, ap, user, passwd))
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
if __name__ == '__main__':
main()
####
####
####