From d89dab7712d4a19a6e9555f435facceb6d2fac01 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Fri, 17 Apr 2020 14:27:05 -0700 Subject: [PATCH 1/8] tos-plus: Add fixes from Pankaj. --- tos_plus_auto.py | 114 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 94 insertions(+), 20 deletions(-) diff --git a/tos_plus_auto.py b/tos_plus_auto.py index e09055aa..e03648f2 100755 --- a/tos_plus_auto.py +++ b/tos_plus_auto.py @@ -25,13 +25,28 @@ import pprint import telnetlib import argparse import pexpect +import subprocess ptype="QCA" +FORMAT = '%(asctime)s %(name)s %(levelname)s: %(message)s' 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") + print("-l|--log file: log messages here") + +# see https://stackoverflow.com/a/13306095/11014343 +class FileAdapter(object): + def __init__(self, logger): + self.logger = logger + def write(self, data): + # NOTE: data can be a partial line, multiple lines + data = data.strip() # ignore leading/trailing whitespace + if data: # non-blank + self.logger.info(data) + def flush(self): + pass # leave it to logging to flush properly def main(): global ptype @@ -39,42 +54,99 @@ def main(): parser = argparse.ArgumentParser(description="TOS Plus automation script") parser.add_argument("-p", "--ptype", type=str, help="AP Hardware type") + parser.add_argument("-l", "--log", type=str, help="logfile for messages, stdout means output to console") args = None try: args = parser.parse_args() if (args.ptype != None): ptype = args.ptype + logfile = args.log 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)) + console_handler = logging.StreamHandler() + formatter = logging.Formatter(FORMAT) + logg = logging.getLogger(__name__) + logg.setLevel(logging.DEBUG) + file_handler = None + if (logfile is not None): + if (logfile != "stdout"): + file_handler = logging.FileHandler(logfile, "w") + file_handler.setLevel(logging.DEBUG) + file_handler.setFormatter(formatter) + logg.addHandler(file_handler) + logging.basicConfig(format=FORMAT, handlers=[file_handler]) + else: + # stdout logging + logging.basicConfig(format=FORMAT, handlers=[console_handler]) + + # Set up cisco controller. For now, variables are hard-coded. + dest = '172.19.27.95' + port = '2013' + port_ap = '2014' + ap = 'AxelMain' + user = 'cisco' + passwd = 'Cisco123' + user_ap = 'cisco' + passwd_ap = 'Cisco123' + wlan = 'wlan_open' + wlanID = '6' + + subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-w", wlan, "-i", wlanID, + "--action", "wlan"], capture_output=True) + subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-w", wlan, "-i", wlanID, + "--action", "wlan_security"], capture_output=True) + subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-w", wlan, "-i", wlanID, + "--action", "wlan_qos", "--value", "platinum"], capture_output=True) + subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-w", wlan, "-i", wlanID, + "--action", "enable_wlan"], capture_output=True) + output01 = subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "--action", "show", + "--value", "wlan summary"], capture_output=True) + #pss = output01.stdout.decode('utf-8', 'ignore'); + #print(pss) + print(output01) + subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-b", "b", "--action", + "disable"], capture_output=True) + subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-b", "a", "--action", + "disable"], capture_output=True) + subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-b", "a", "--action", + "channel", "--value", "149"], capture_output=True) + subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-b", "a", "--action", + "bandwidth", "--value", "80"], capture_output=True) + subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-b", "a", "--action", + "enable"], capture_output=True) + #subprocess.run("python3 cisco_wifi_ctl.py -d %s -o %s -s telnet -l stdout -a %s -u %s -p %s -w %s -i %s --action wlan"%(dest, port, ap, user, passwd, wlan, wlanID)) + #subprocess.run("./cisco_wifi_ctl.py", "-d %s -o %s -s telnet -l stdout -a %s -u %s -p %s -w %s -i %s --action wlan_qos --value platinum"%(dest, port, ap, user, passwd, wlan, wlanID)) + #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)) + + #Clear Stormbreaker stats on AP + subprocess.run(["./cisco_ap.py", "-d", dest, "-o", port_ap, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "--action", "clear_counter"], capture_output=True) # 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\"") + os.system('python3 ./lf_tos_plus_test.py --dur 1 --lfmgr localhost --ssid wlan_open --radio "1.wiphy0 2 0" --txpkts 9999 --wait_sniffer 1 --cx "1.wiphy0 1.wlan0 anAX 1.eth2 udp 1024 10000 5000000000 184" --sniffer_radios "1.wiphy2"') + #output02 = subprocess.run(["./lf_tos_plus_test.py", "--dur", "1", "--lfmgr", "localhost", "--ssid", wlan, "--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"], capture_output=True) + + #Read Stormbreaker exported stats after the test + output02 = subprocess.run(["./cisco_ap.py", "-d", dest, "-o", port_ap, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "--action", "show", + "--value", "interfaces dot11Radio 1 traffic distribution periodic data exported"], capture_output=True) + print(output02) file1 = open('TOS_PLUS.sh', 'r') lines = file1.readlines() + csv_file = "" capture_dir = "" # Strips the newline character @@ -82,15 +154,16 @@ def main(): tok_val = line.split("=", 1) if tok_val[0] == "CAPTURE_DIR": capture_dir = tok_val[1] - else if tok_val[0] == "CSV_FILE": + elif 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)) + os.system('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() @@ -101,8 +174,9 @@ def main(): # 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)) + subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-w", wlan, "-i", wlanID, + "--action", "delete_wlan"], capture_output=True) + #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__': From 4caa83ffeeaed29367a7ac1ec500b0c87f226414 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Fri, 17 Apr 2020 14:28:58 -0700 Subject: [PATCH 2/8] tos-plus: Fix str vs int bug. --- lf_tos_plus_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lf_tos_plus_test.py b/lf_tos_plus_test.py index a298dce6..ff2d1545 100755 --- a/lf_tos_plus_test.py +++ b/lf_tos_plus_test.py @@ -85,7 +85,7 @@ passwd = "" ssid = "Test-SSID" security = "open" radio_strs = [] # Radios to modify: radio nss channel -txpkts = 0 # 0 == Run forever +txpkts = "0" # 0 == Run forever sniffer_radios = "" wait_sniffer = False From 0fee9b87a622789cbe2e6fa347bb530536974962 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Fri, 17 Apr 2020 16:02:53 -0700 Subject: [PATCH 3/8] tos-plus: Attempt to add some pass/fail comparison logic. --- tos_plus_auto.py | 92 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 90 insertions(+), 2 deletions(-) diff --git a/tos_plus_auto.py b/tos_plus_auto.py index e03648f2..7a5dce5f 100755 --- a/tos_plus_auto.py +++ b/tos_plus_auto.py @@ -28,11 +28,14 @@ import pexpect import subprocess ptype="QCA" +tos="BE" + FORMAT = '%(asctime)s %(name)s %(levelname)s: %(message)s' 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("--tos: TOS type we are testing, used to find output in csv data: BE BK VI VO") print("-h|--help") print("-l|--log file: log messages here") @@ -50,11 +53,12 @@ class FileAdapter(object): def main(): global ptype - + global tos parser = argparse.ArgumentParser(description="TOS Plus automation script") parser.add_argument("-p", "--ptype", type=str, help="AP Hardware type") parser.add_argument("-l", "--log", type=str, help="logfile for messages, stdout means output to console") + parser.add_argument("-t", "--tos", type=str, help="TOS type we are testing, used to find output in csv data: BE BK VI VO") args = None try: @@ -143,6 +147,52 @@ def main(): "--value", "interfaces dot11Radio 1 traffic distribution periodic data exported"], capture_output=True) print(output02) + ap_at_us = -1 + ap_lat_us = -1 + in_pkg2 = False + in_pkg3 = False + pkg_prefix = "" + if tos == "BK": + pkg_prefix = "Background" + else if tos == "BE": + pkg_prefix = "Best" + else if tos == "VI": + pkg_prefix = "Video" + else if tos == "VO": + pkg_prefix = "Voice" + + for line in output02.split("\n"): + if line.startswith("Pkg 2"): + in_pkg2 = True + in_pkg3 = False + else if line.startswith("Pkg 3"): + in_pkg3 = True + in_pkg2 = False + else: + toks = line.split() + if toks[0] == "1": # Something like: 1 Background TX 11ax Good-RSSI 457013940 3683370 + us_idx = 6 + lat_idx = 4 + offset = 0 + if toks[1] == "Best": + # Tokenization is broken due to space, work-around + offset = 1 + + if toks[1] == pkg_prefix: + if in_pkg2: + if toks[2 + offset] == "TX" and toks[3 + offset] == "11ax": + ap_at_us = int(toks[us_idx + offset]) + else if in_pkg3: + ap_lat_us = int(toks[lat_idx + offset]) + + if ap_at_us == -1: + print("ERROR: Could not find AP airtime, tos: %s pkg_prefix: %s"%(tos, pkg_prefix)) + exit(1) + + if ap_lat_us == -1: + print("ERROR: Could not find AP avg latency, tos: %s pkg_prefix: %s"%(tos, pkg_prefix)) + exit(2) + file1 = open('TOS_PLUS.sh', 'r') lines = file1.readlines() @@ -162,17 +212,55 @@ def main(): # Run third-party tool to process the capture files. os.system('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() + avglat = 0 # Assumes single connection # 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])) + if cols[1].endswith("-A"): + avglat = cols[15] + + # Compare pcap csv data + file3 = open("airtime.csv", 'r') + lines = file3.readlines() + + at_row = [] + # Strips the newline character + for line in lines: + cols = line.split(",") + if cols[0].endswith(tos): + at_row = line.split(",") + break + + #at_row holds air-time fairness csv row created by pcap analyzer + #avglat is AVG one-way download latency reported by LANforge + #ap_at_lat is airtime in usec reported by AP for the specified type-of-service + #ap_lat_us is latency in usec reported by AP for the specified type-of-service + + # Check latency + avglat *= 1000 # Convert LF latency to usec + latdiff = abs(avglat - ap_lat_us) + if latdiff <= 2000: + # Assume 2ms is close enough + print("AVG-LAT: PASSED ## Within 2ms, AP Reports: %ius LANforge reports: %ius"%(ap_at_lat, avglat)) + else: + upper = ap_lat_us * 1.2 + lower = ap_lat_us * 0.8 + + if avglat >= lower and avglat <= upper: + print("AVG-LAT: PASSED ## Within +=20%, AP Reports: %ius LANforge reports: %ius"%(ap_at_lat, avglat)) + else: + print("AVG-LAT: FAILED ## AP Reports: %ius LANforge reports: %ius"%(ap_at_lat, avglat)) + + # Check Airtime + # TODO: Not sure what at_row column(s) to compare + subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-w", wlan, "-i", wlanID, "--action", "delete_wlan"], capture_output=True) From 45decb8fef1ab4606301b6a29fb50c5300e8f8d4 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Mon, 20 Apr 2020 13:07:43 -0700 Subject: [PATCH 4/8] tos-plus-auto: Fixes from Pankaj, and proper use of .run output. --- tos_plus_auto.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) mode change 100755 => 100644 tos_plus_auto.py diff --git a/tos_plus_auto.py b/tos_plus_auto.py old mode 100755 new mode 100644 index 7a5dce5f..c089bcbc --- a/tos_plus_auto.py +++ b/tos_plus_auto.py @@ -28,7 +28,7 @@ import pexpect import subprocess ptype="QCA" -tos="BE" +tos="BE" #Allowed values are BE/BK/VI/VO FORMAT = '%(asctime)s %(name)s %(levelname)s: %(message)s' @@ -144,28 +144,28 @@ def main(): #Read Stormbreaker exported stats after the test output02 = subprocess.run(["./cisco_ap.py", "-d", dest, "-o", port_ap, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "--action", "show", - "--value", "interfaces dot11Radio 1 traffic distribution periodic data exported"], capture_output=True) - print(output02) + "--value", "interfaces dot11Radio 1 traffic distribution periodic data exported"], capture_output=True) + rslt = output02.stdout.decode('utf-8', 'ignore'); ap_at_us = -1 ap_lat_us = -1 in_pkg2 = False in_pkg3 = False pkg_prefix = "" - if tos == "BK": + if (tos == "BK"): pkg_prefix = "Background" - else if tos == "BE": + elif (tos == "BE"): pkg_prefix = "Best" - else if tos == "VI": + elif (tos == "VI"): pkg_prefix = "Video" - else if tos == "VO": + elif (tos == "VO"): pkg_prefix = "Voice" - for line in output02.split("\n"): + for line in rslt.splitlines(): if line.startswith("Pkg 2"): in_pkg2 = True in_pkg3 = False - else if line.startswith("Pkg 3"): + elif line.startswith("Pkg 3"): in_pkg3 = True in_pkg2 = False else: @@ -182,7 +182,7 @@ def main(): if in_pkg2: if toks[2 + offset] == "TX" and toks[3 + offset] == "11ax": ap_at_us = int(toks[us_idx + offset]) - else if in_pkg3: + elif in_pkg3: ap_lat_us = int(toks[lat_idx + offset]) if ap_at_us == -1: @@ -248,13 +248,13 @@ def main(): latdiff = abs(avglat - ap_lat_us) if latdiff <= 2000: # Assume 2ms is close enough - print("AVG-LAT: PASSED ## Within 2ms, AP Reports: %ius LANforge reports: %ius"%(ap_at_lat, avglat)) + print("AVG-LAT: PASSED ## Within 2ms, AP Reports: %ius Candela reports: %ius"%(ap_at_lat, avglat)) else: upper = ap_lat_us * 1.2 lower = ap_lat_us * 0.8 if avglat >= lower and avglat <= upper: - print("AVG-LAT: PASSED ## Within +=20%, AP Reports: %ius LANforge reports: %ius"%(ap_at_lat, avglat)) + print("AVG-LAT: PASSED ## Within +-20%, AP Reports: %ius LANforge reports: %ius"%(ap_at_lat, avglat)) else: print("AVG-LAT: FAILED ## AP Reports: %ius LANforge reports: %ius"%(ap_at_lat, avglat)) @@ -262,6 +262,7 @@ def main(): # TODO: Not sure what at_row column(s) to compare + #Clear config on WLAN subprocess.run(["./cisco_wifi_ctl.py", "-d", dest, "-o", port, "-s", "telnet", "-l", "stdout", "-a", ap, "-u", "cisco", "-p", "Cisco123", "-w", wlan, "-i", wlanID, "--action", "delete_wlan"], capture_output=True) #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)) From 8fb6e956e0145129cd5150ec87c4c7c00caa022b Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Mon, 20 Apr 2020 14:11:24 -0700 Subject: [PATCH 5/8] Update tos-plus-auto mode. --- tos_plus_auto.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tos_plus_auto.py diff --git a/tos_plus_auto.py b/tos_plus_auto.py old mode 100644 new mode 100755 From c4929ffb87d024c688c2247dfcd3af2e7e53648a Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Wed, 22 Apr 2020 06:43:55 -0700 Subject: [PATCH 6/8] tos-plus: Enable using wpa3 --- lf_gui_cmd.pl | 15 ++++++++++++--- lf_tos_plus_test.py | 4 ++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lf_gui_cmd.pl b/lf_gui_cmd.pl index 57b0d4d4..dcaf1e48 100755 --- a/lf_gui_cmd.pl +++ b/lf_gui_cmd.pl @@ -151,9 +151,18 @@ if ($ttype ne "") { else { # Copy some place it can be seen easily? if ($rpt_dest ne "") { - my $cp = "cp -ar $loc $rpt_dest"; - print "Copy test results: $cp\n"; - system($cp); + if (-d $loc) { + # Must be on the local system + my $cp = "cp -ar $loc $rpt_dest"; + print "Copy test results: $cp\n"; + system($cp); + } + else { + # Must be on remote system, try scp to get it. + my $cp = "scp -r lanforge@$lfmgr_host:$loc $rpt_dest"; + print "Secure Copy test results: $cp\n"; + system($cp); + } } last; } diff --git a/lf_tos_plus_test.py b/lf_tos_plus_test.py index ff2d1545..f110efd7 100755 --- a/lf_tos_plus_test.py +++ b/lf_tos_plus_test.py @@ -100,6 +100,7 @@ def usage(): print("--duration: Duration to run traffic, in minutes") print("--ssid: AP's SSID") print("--passwd: Optional: password (do not add this option for OPEN)") + print("--security: Default is 'open', or if passwd is configured, default is wpa2. wpa3 is also valid option") print("--txpkts: Optional: amount of packets to transmit (and then stop the data connections)") print("--sniffer_radios: Optional: list of radios to sniff wifi traffic \"1.wiphy2 1.wiphy4\")") print("--wait_sniffer: Optional: 1 means wait on sniffer to finish before existing script") @@ -128,6 +129,7 @@ def main(): parser.add_argument("--duration", type=float, help="Duration to run traffic, in minutes. If txpkts is specified, that may stop the test earlier.") parser.add_argument("--ssid", type=str, help="AP's SSID") parser.add_argument("--passwd", type=str, help="AP's password if using PSK authentication, skip this argement for OPEN") + parser.add_argument("--security", type=str, help="Default is 'open', or if passwd is configured, default is wpa2. wpa3 is also valid option") parser.add_argument("--txpkts", type=str, help="Optional: Packets (PDUs) to send before stopping data connections Default (0) means infinite") parser.add_argument("--sniffer_radios", type=str, help="Optional: list of radios to sniff wifi traffic \"1.wiphy2 1.wiphy4\"") parser.add_argument("--wait_sniffer", type=str, help="Optional: 1 means wait on sniffer to finish before existing script.\"") @@ -147,6 +149,8 @@ def main(): if (args.passwd != None): passwd = args.passwd security = "wpa2" + if (args.security != None): + security = args.security if (args.outfile != None): outfile = args.outfile if (args.txpkts != None): From 1decfbaa9d3804a85060a0da00ffdc1ea56a2ba9 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Wed, 22 Apr 2020 16:41:50 -0700 Subject: [PATCH 7/8] Update GUI readme. --- gui/README.txt | 12 ++++++++---- gui/basic_regression.bash | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gui/README.txt b/gui/README.txt index 3a4b8ee9..6898d3a3 100644 --- a/gui/README.txt +++ b/gui/README.txt @@ -20,17 +20,21 @@ test_rig: TR-398 test bed Save this text to a file for later use: AP-Auto-ap-auto-32-64-dual.txt -# Save this text using the ../lf_testmod.pl script: +# Save AP-Auto configuration 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 +# Save WiFi-Capacity configuration (saved as 'fb-192' using the ../lf_testmod.pl script: +../lf_testmod.pl --mgr 192.168.100.156 --action show --test_name Wifi-Capacity-fb-192 > test_configs/mytest.txt + +# Save Chamber View scenario: +../lf_testmod.pl --mgr 192.168.100.156 --action show --test_name simpleThput --test_type Network-Connectivity > test_configs/myscenario.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 diff --git a/gui/basic_regression.bash b/gui/basic_regression.bash index 1a467bef..be5ad82e 100755 --- a/gui/basic_regression.bash +++ b/gui/basic_regression.bash @@ -246,3 +246,4 @@ then fi echo "Done with regression test." +echo "Results-Dir: $RSLTS_DIR" From abb91afb8dfc19022715e676db1adf2f33a55fff Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Thu, 23 Apr 2020 11:15:48 -0700 Subject: [PATCH 8/8] gui-cmd: Fix problem in scp call. --- lf_gui_cmd.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lf_gui_cmd.pl b/lf_gui_cmd.pl index dcaf1e48..1cf172f4 100755 --- a/lf_gui_cmd.pl +++ b/lf_gui_cmd.pl @@ -150,6 +150,7 @@ if ($ttype ne "") { } else { # Copy some place it can be seen easily? + print("LANforge GUI test complete, rpt-dest: $rpt_dest location: $loc\n"); if ($rpt_dest ne "") { if (-d $loc) { # Must be on the local system @@ -159,7 +160,7 @@ if ($ttype ne "") { } else { # Must be on remote system, try scp to get it. - my $cp = "scp -r lanforge@$lfmgr_host:$loc $rpt_dest"; + my $cp = "scp -r lanforge\@$lfmgr_host:$loc $rpt_dest"; print "Secure Copy test results: $cp\n"; system($cp); }