From f2418e0d030e416d988607094f927a456bb4737e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 13 Dec 2021 08:43:49 -0800 Subject: [PATCH 01/40] create_macvlan: Use LFUtils.name_to_eid to parse the resource and shelf Signed-off-by: Matthew Stidham --- py-scripts/create_macvlan.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/py-scripts/create_macvlan.py b/py-scripts/create_macvlan.py index 7123b23e..aa89abd2 100755 --- a/py-scripts/create_macvlan.py +++ b/py-scripts/create_macvlan.py @@ -52,7 +52,9 @@ class CreateMacVlan(Realm): self.mvlan_profile.num_macvlans = int(num_ports) self.mvlan_profile.desired_macvlans = self.port_list - self.mvlan_profile.macvlan_parent = self.macvlan_parent + self.mvlan_profile.macvlan_parent = self.macvlan_parent[2] + self.mvlan_profile.shelf = self.macvlan_parent[0] + self.mvlan_profile.resource = self.macvlan_parent[1] self.mvlan_profile.dhcp = dhcp self.mvlan_profile.netmask = netmask self.mvlan_profile.first_ip_addr = first_mvlan_ip @@ -153,6 +155,7 @@ Generic command layout: default=None) args = parser.parse_args() + args.macvlan_parent = LFUtils.name_to_eid(args.macvlan_parent) port_list = [] ip_list = [] if args.first_port is not None and args.use_ports is not None: @@ -168,12 +171,12 @@ Generic command layout: radio=args.radio) else: if (args.num_ports is not None) and args.macvlan_parent is not None and ( - int(args.num_ports) > 0) and args.macvlan_parent in args.first_port: + int(args.num_ports) > 0) and args.macvlan_parent[2] in args.first_port: start_num = int( args.first_port[args.first_port.index('#') + 1:]) num_ports = int(args.num_ports) port_list = LFUtils.port_name_series( - prefix=args.macvlan_parent + "#", + prefix=args.macvlan_parent[2] + "#", start_id=start_num, end_id=start_num + num_ports - 1, padding_number=100000, @@ -187,7 +190,7 @@ Generic command layout: if args.use_ports is None: num_ports = int(args.num_ports) port_list = LFUtils.port_name_series( - prefix=args.macvlan_parent + "#", + prefix=args.macvlan_parent[2] + "#", start_id=0, end_id=num_ports - 1, padding_number=100000, From cba16290549340de36e02f54616aa8b2879ba0b2 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 13 Dec 2021 08:49:08 -0800 Subject: [PATCH 02/40] wifi_monitor_profile: Use name_to_eid to parse the resource name Signed-off-by: Matthew Stidham --- py-json/wifi_monitor_profile.py | 35 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/py-json/wifi_monitor_profile.py b/py-json/wifi_monitor_profile.py index 7089c8b0..0ace016e 100644 --- a/py-json/wifi_monitor_profile.py +++ b/py-json/wifi_monitor_profile.py @@ -28,9 +28,13 @@ class WifiMonitor: self.flag_mask_names = [] self.flags_mask = add_monitor.default_flags_mask self.aid = "NA" # used when sniffing /ax radios - self.bsssid = "00:00:00:00:00:00" # used when sniffing on /ax radios + self.bssid = "00:00:00:00:00:00" # used when sniffing on /ax radios def create(self, resource_=1, channel=None, mode="AUTO", radio_="wiphy0", name_="moni0"): + radio_eid = self.local_realm.name_to_eid(radio_) + radio_shelf = radio_eid[0] + self.resource = radio_eid[1] + radio_ = radio_eid[2] print("Creating monitor " + name_) self.monitor_name = name_ computed_flags = 0 @@ -40,20 +44,19 @@ class WifiMonitor: # we want to query the existing country code of the radio # there's no reason to change it but we get hollering from server # if we don't provide a value for the parameter - jr = self.local_realm.json_get("/radiostatus/1/%s/%s?fields=channel,frequency,country" % (resource_, radio_), + jr = self.local_realm.json_get("/radiostatus/1/%s/%s?fields=channel,frequency,country" % (self.resource, radio_), debug_=self.debug) if jr is None: - raise ValueError("No radio %s.%s found" % (resource_, radio_)) + raise ValueError("No radio %s.%s found" % (self.resource, radio_)) - eid = "1.%s.%s" % (resource_, radio_) # frequency = 0 country = 0 - if eid in jr: - country = jr[eid]["country"] + if radio_ in jr: + country = jr[radio_]["country"] data = { - "shelf": 1, - "resource": resource_, + "shelf": radio_shelf, + "resource": self.resource, "radio": radio_, "mode": set_radio_mode[mode], # "NA", #0 for AUTO or "NA" "channel": channel, @@ -64,8 +67,8 @@ class WifiMonitor: self.local_realm.json_post("/cli-json/set_wifi_radio", _data=data) time.sleep(1) self.local_realm.json_post("/cli-json/add_monitor", { - "shelf": 1, - "resource": resource_, + "shelf": radio_shelf, + "resource": self.resource, "radio": radio_, "ap_name": self.monitor_name, "flags": computed_flags, @@ -81,31 +84,31 @@ class WifiMonitor: del self.flag_names[param_name] self.flags_mask |= add_monitor.flags[param_name] - def cleanup(self, resource_=1, desired_ports=None): + def cleanup(self, desired_ports=None): print("Cleaning up monitors") if (desired_ports is None) or (len(desired_ports) < 1): if (self.monitor_name is None) or (self.monitor_name == ""): print("No monitor name set to delete") return - LFUtils.removePort(resource=resource_, + LFUtils.removePort(resource=self.resource, port_name=self.monitor_name, baseurl=self.lfclient_url, debug=self.debug) else: names = ",".join(desired_ports) - existing_ports = self.local_realm.json_get("/port/1/%d/%s?fields=alias" % (resource_, names), debug_=False) + existing_ports = self.local_realm.json_get("/port/1/%d/%s?fields=alias" % (self.resource, names), debug_=False) if (existing_ports is None) or ("interfaces" not in existing_ports) or ("interface" not in existing_ports): print("No monitor names found to delete") return if "interfaces" in existing_ports: for eid, info in existing_ports["interfaces"].items(): - LFUtils.removePort(resource=resource_, + LFUtils.removePort(resource=self.resource, port_name=info["alias"], baseurl=self.lfclient_url, debug=self.debug) if "interface" in existing_ports: for eid, info in existing_ports["interface"].items(): - LFUtils.removePort(resource=resource_, + LFUtils.removePort(resource=self.resource, port_name=info["alias"], baseurl=self.lfclient_url, debug=self.debug) @@ -124,7 +127,7 @@ class WifiMonitor: raise ValueError("Need a capture file name") data = { "shelf": 1, - "resource": 1, + "resource": self.resource, "port": self.monitor_name, "display": "NA", "flags": 0x2, From 522e1a621677686e679d2ef6f14cb7a0c4982e53 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 13 Dec 2021 11:16:11 -0700 Subject: [PATCH 03/40] move py-script/README.md py-scripts/sandbox/README.md updating README.md to be one page. Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => sandbox}/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-scripts/{ => sandbox}/README.md (100%) diff --git a/py-scripts/README.md b/py-scripts/sandbox/README.md similarity index 100% rename from py-scripts/README.md rename to py-scripts/sandbox/README.md From 967f5f70b10c04304b3187f13543d33d1b933b39 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 13 Dec 2021 11:18:36 -0700 Subject: [PATCH 04/40] README.md short version: need to add simple script examples Signed-off-by: Chuck SmileyRekiere --- py-scripts/README.md | 63 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 py-scripts/README.md diff --git a/py-scripts/README.md b/py-scripts/README.md new file mode 100644 index 00000000..44ccdb3e --- /dev/null +++ b/py-scripts/README.md @@ -0,0 +1,63 @@ +# LANForge Python Scripts +This directory contains python scripts to intract with LANforge Wifi and Ethernet Traffic Generators for testing Access Points and other Wifi networks. + +## LANforge Python Scripts in py-scripts General Classifications + +* create_ - creates network element in LANforge wiphy radio +* lf_ or test_ - performs a test against an Access Point or Wifi network +* other files are various utilities + +## Still not sure what the script does ? +* LANforge scripts support --help , to provide a more detailed description of scripts functionality + +## LANforge Python Scripts Directory Structure +* py-scripts - configuration, unit test, module, and library scripts +* cv_examples - bash scripts for ochastrating Chamberview tests +* py-json - core libraries providing direct intraction with LANforge Traffic Generator +* py-json/LANforge - JSON intraction with LANforge Traffic Generator. +* lanforge_client/ - alpha version of JSON interface to LANforge Traffic Generator. + +## Where is the create_basic_argparse and create_bare_argsparse? +* py-json/LANforge/lfcli_base.py +## Updating scripts python library dependencies +* for F27 systems from lanforge-scripts run: `pip3 install --user -r python.3.6.requirements.txt --upgrade` +* from lanforge-scripts run: `pip3 install --user -r requirements.txt --upgrade` +## Scripts accessing Serial ports. +* to access serial ports add user to `dialout` and `tty` groups to gain access to serial ports without needing root access. +* Most scripts run in user space to use the installed python package and not affect the os python packages. + + + +## References +* https://www.candelatech.com/cookbook/cli/json-python +* http://www.candelatech.com/scripting_cookbook.php + + +# Getting Started + +The first step is to make sure all dependencies are installed in your system. + +## Example of running a chamber view test +### example from cv_examples/ferndale_ucentral.bash +* ./create_chamberview_dut.py : Replace arguments with your setup. Separate your ssid arguments with spaces and ensure the names are lowercase + * ./create_chamberview_dut.py --lfmgr `${MGR}` --port `${MGR_PORT}` --dut_name `${DUT}` \ + --ssid `"ssid_idx=0 ssid=Default-SSID-2g security=WPA2 password=12345678 bssid=c4:41:1e:f5:3f:24"` \ + --ssid `"ssid_idx=1 ssid=Default-SSID-5gl security=WPA2 password=12345678 bssid=c4:41:1e:f5:3f:25"` \ + --sw_version `"ucentral-01"` --hw_version `ea8450` --serial_num `1001` --model_num `8450` +* ./create_chamberview.py : change the lfmgr to your system, set the radio to a working radio on your LANforge system, same with the ethernet port. Create/update chamber view scenario and apply and build it. Easiest way to get these lines is to build it in the GUI and then copy/tweak what it shows in the 'Text Output' tab after saving and re-opening the scenario. + * ./create_chamberview.py --lfmgr `${MGR}` --port `${MGR_PORT}` --delete_scenario \ + --create_scenario `ucentral-scenario` \ + --raw_line `"profile_link 1.1 STA-AC 50 'DUT: $DUT Radio-1' NA wiphy0,AUTO -1 NA"` \ + --raw_line `"profile_link 1.1 STA-AC 50 'DUT: $DUT Radio-1' NA wiphy2,AUTO -1 NA"` \ + --raw_line `"profile_link 1.1 STA-AC 50 'DUT: $DUT Radio-2' NA wiphy1,AUTO -1 NA"` \ + --raw_line `"profile_link 1.1 STA-AC 46 'DUT: $DUT Radio-2' NA wiphy3,AUTO -1 NA"` \ + --raw_line `"profile_link 1.1 upstream-dhcp 1 NA NA $UPSTREAM,AUTO -1 NA" `\ + --raw_line `"profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 192.168.100.1/24' NA $LF_WAN_PORT,$UPSTREAM -1 NA"` \ + --raw_line `"profile_link 1.1 STA-AC 1 'DUT: $DUT Radio-2' NA ALL-AX,AUTO -1 NA"` +* ./lf_wifi_capacity_test.py : Run capacity test on the stations created by the chamber view scenario. + * ./lf_wifi_capacity_test.py --config_name Custom --pull_report --mgr `${MGR}` \ + --port `${MGR_PORT}` \ + --instance_name `testing` --upstream `1.1.$UPSTREAM` --test_rig `${TESTBED}` --graph_groups `${GROUP_FILE}` \ + --batch_size `"100"` --protocol `"TCP-IPv4"` --duration `20000` + + From 68568f5a421d9eec4d2ed7d05369d8576ec68e23 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 13 Dec 2021 11:50:56 -0800 Subject: [PATCH 05/40] sta_connect_example: Use name_to_eid to parse port name Signed-off-by: Matthew Stidham --- py-scripts/sta_connect_example.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/py-scripts/sta_connect_example.py b/py-scripts/sta_connect_example.py index 685d1961..4831fc4b 100755 --- a/py-scripts/sta_connect_example.py +++ b/py-scripts/sta_connect_example.py @@ -18,7 +18,7 @@ lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") LFCliBase = lfcli_base.LFCliBase sta_connect = importlib.import_module("py-scripts.sta_connect") StaConnect = sta_connect.StaConnect - +LFUtils = importlib.import_module("py-json.LANforge.LFUtils") def main(): parser = LFCliBase.create_basic_argparse( @@ -40,10 +40,11 @@ def main(): args.security = sta_connect.WPA2 if args.radio is None: args.radio = "wiphy0" + upstream_port = LFUtils.name_to_eid(args.upstream_port) staConnect = StaConnect(args.mgr, args.mgr_port, _debugOn=args.debug, _runtime_sec=monitor_interval) staConnect.sta_mode = 0 - staConnect.upstream_resource = 1 - staConnect.upstream_port = args.upstream_port + staConnect.upstream_resource = upstream_port[1] + staConnect.upstream_port = upstream_port[2] staConnect.radio = args.radio staConnect.resource = 1 staConnect.dut_security = args.security From 859e952ef9cf46d1431dabbfcc765adf3f0a8c66 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 13 Dec 2021 11:56:14 -0800 Subject: [PATCH 06/40] sta_connect: Wait until ports appear after adding new stations Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index a9fac8f4..6ed7a6be 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -177,6 +177,8 @@ class StaConnect(Realm): self.json_post("/cli-json/add_sta", add_sta_data, suppress_related_commands_=True) time.sleep(0.01) + LFUtils.wait_until_ports_appear(port_list=self.station_names) + set_port_data = { "shelf": 1, "resource": self.resource, From 75e1904f8a2589086e114d7bd82076c56f9eddc4 Mon Sep 17 00:00:00 2001 From: Scott Wedge Date: Mon, 13 Dec 2021 12:52:19 -0600 Subject: [PATCH 07/40] lf_ftp.py, modify --help output Signed-off-by: Scott Wedge --- py-scripts/lf_ftp.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/py-scripts/lf_ftp.py b/py-scripts/lf_ftp.py index 4de260eb..13a8face 100755 --- a/py-scripts/lf_ftp.py +++ b/py-scripts/lf_ftp.py @@ -712,24 +712,24 @@ def main(): FTP Test Script - lf_ftp.py --------------------------- CLI Example: -./lf_ftp.py --ssid --passwd --file_sizes 2MB --fiveg_duration 4 --mgr 192.168.1.101 --traffic_duration 2 --security wpa2 --bands 5G --fiveg_radio wiphy1 --directions Download Upload +./lf_ftp.py --ssid --passwd --file_sizes 2MB --fiveg_duration --mgr 192.168.1.101 --traffic_duration --security wpa2 --bands 5G --fiveg_radio wiphy1 --directions Download Upload --------------------------- ''') - parser.add_argument('--mgr', help='hostname for where LANforge GUI is running', default='localhost') - parser.add_argument('--mgr_port', help='port LANforge GUI HTTP service is running on', default=8080) - parser.add_argument('--upstream_port', help='non-station port that generates traffic: eg: eth1', default='eth1') + parser.add_argument('--mgr', help='hostname for where LANforge GUI is running [default = localhost]', default='localhost') + parser.add_argument('--mgr_port', help='port LANforge GUI HTTP service is running on [default = 8080]', default=8080) + parser.add_argument('--upstream_port', help='non-station port that generates traffic: eg: eth1 [default = eth1]', default='eth1') parser.add_argument('--ssid', type=str, help='--ssid') parser.add_argument('--passwd', type=str, help='--passwd') parser.add_argument('--security', type=str, help='--security') parser.add_argument('--ap_name', type=str, help='--ap_name') parser.add_argument('--ap_ip', type=str, help='--ap_ip') - parser.add_argument('--twog_radio', type=str, help='specify radio for 2.4G clients', default='wiphy1') - parser.add_argument('--fiveg_radio', type=str, help='specify radio for 5G client', default='wiphy0') + parser.add_argument('--twog_radio', type=str, help='specify radio for 2.4G clients [default = wiphy1]', default='wiphy1') + parser.add_argument('--fiveg_radio', type=str, help='specify radio for 5G client [default = wiphy0]', default='wiphy0') parser.add_argument('--twog_duration', nargs="+", help='Pass and Fail duration for 2.4G band in minutes') parser.add_argument('--fiveg_duration', nargs="+", help='Pass and Fail duration for 5G band in minutes') parser.add_argument('--both_duration', nargs="+", help='Pass and Fail duration for Both band in minutes') - parser.add_argument('--traffic_duration', type=int, help='duration for layer 4 traffic running') - parser.add_argument('--ssh_port', type=int, help="specify the shh port eg 22", default=22) + parser.add_argument('--traffic_duration', type=int, help='duration for layer 4 traffic running in minutes') + parser.add_argument('--ssh_port', type=int, help="specify the shh port: eg 22 [default = 22]", default=22) # Test variables parser.add_argument('--bands', nargs="+", help='--bands defaults ["5G","2.4G","Both"]', @@ -738,7 +738,7 @@ CLI Example: default=["Download", "Upload"]) parser.add_argument('--file_sizes', nargs="+", help='--File Size defaults ["2MB","500MB","1000MB"]', default=["2MB", "500MB", "1000MB"]) - parser.add_argument('--num_stations', type=int, help='--num_stations is number of stations', default=40) + parser.add_argument('--num_stations', type=int, help='--num_stations is number of stations [default = 40 stations]', default=40) args = parser.parse_args() From a8fcfd2762bfa773e898c62beda8a840ca08d78f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 13 Dec 2021 13:56:02 -0800 Subject: [PATCH 08/40] vap_profile.py: Use LFUtils.name_to_eid to parse radio names Signed-off-by: Matthew Stidham --- py-json/vap_profile.py | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/py-json/vap_profile.py b/py-json/vap_profile.py index 173610f2..9287e9ac 100644 --- a/py-json/vap_profile.py +++ b/py-json/vap_profile.py @@ -33,10 +33,12 @@ class VAPProfile(LFCliBase): self.COMMANDS = ["add_vap", "set_port"] self.desired_add_vap_flags = ["wpa2_enable", "80211u_enable", "create_admin_down"] self.desired_add_vap_flags_mask = ["wpa2_enable", "80211u_enable", "create_admin_down"] + self.shelf = 1 + self.resource = 1 self.add_vap_data = { - "shelf": 1, - "resource": 1, + "shelf": self.shelf, + "resource": self.resource, "radio": None, "ap_name": None, "flags": 0, @@ -51,16 +53,16 @@ class VAPProfile(LFCliBase): self.desired_set_port_current_flags = ["if_down"] self.desired_set_port_interest_flags = ["current_flags", "ifdown"] self.set_port_data = { - "shelf": 1, - "resource": 1, + "shelf": self.shelf, + "resource": self.resource, "port": None, "current_flags": 0, "interest": 0, # (0x2 + 0x4000 + 0x800000) # current, dhcp, down } self.wifi_extra_data_modified = False self.wifi_extra_data = { - "shelf": 1, - "resource": 1, + "shelf": self.shelf, + "resource": self.resource, "port": None, "key_mgmt": None, "eap": None, @@ -70,6 +72,7 @@ class VAPProfile(LFCliBase): "realm": None, "domain": None } + self.up = None def set_wifi_extra(self, key_mgmt="WPA-EAP", @@ -219,6 +222,14 @@ class VAPProfile(LFCliBase): def create(self, resource, radio, channel=None, up_=None, debug=False, use_ht40=True, use_ht80=True, use_ht160=False, suppress_related_commands_=True, use_radius=False, hs20_enable=False, bridge=True): + eid = LFUtils.name_to_eid(radio) + self.shelf = eid[0] + self.resource = eid[1] + radio = eid[2] + + if resource: + self.resource = resource + port_list = self.local_realm.json_get("port/1/1/list") if port_list is not None: port_list = port_list['interfaces'] @@ -248,19 +259,19 @@ class VAPProfile(LFCliBase): # print("MODE ========= ", self.mode) - jr = self.local_realm.json_get("/radiostatus/1/%s/%s?fields=channel,frequency,country" % (resource, radio), + jr = self.local_realm.json_get("/radiostatus/1/%s/%s?fields=channel,frequency,country" % (self.resource, radio), debug_=self.debug) if jr is None: - raise ValueError("No radio %s.%s found" % (resource, radio)) + raise ValueError("No radio %s.%s found" % (self.resource, radio)) - eid = "1.%s.%s" % (resource, radio) + eid_2 = "1.%s.%s" % (self.resource, radio) country = 0 - if eid in jr: - country = jr[eid]["country"] + if eid_2 in jr: + country = jr[eid_2]["country"] data = { - "shelf": 1, - "resource": resource, + "shelf": self.shelf, + "resource": self.resource, "radio": radio, "mode": self.mode, # "NA", #0 for AUTO or "NA" "channel": channel, @@ -355,7 +366,7 @@ class VAPProfile(LFCliBase): if self.up: self.admin_up(resource) - def cleanup(self, resource, delay=0.03): + def cleanup(self, resource): print("Cleaning up VAPs") desired_ports = ["1.%s.%s" % (resource, self.vap_name), "1.%s.br0" % resource] From 354ebaefebac9fe6f120ad3a5223972362a4d851 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 13 Dec 2021 15:48:40 -0700 Subject: [PATCH 09/40] Revert "sta_connect: Fix whitespace" This reverts commit 25f537a027bc266499cdc74de5121520d2f8bf1d. --- py-scripts/sta_connect.py | 50 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 6ed7a6be..94ac436f 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -13,6 +13,7 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) + sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -61,7 +62,7 @@ class StaConnect(Realm): self.station_names = [] self.cx_names = {} if _sta_name is not None: - self.station_names = [_sta_name] + self.station_names = [ _sta_name ] self.resulting_stations = {} self.resulting_endpoints = {} @@ -98,22 +99,23 @@ class StaConnect(Realm): def num_associated(self, bssid): counter = 0 # print("there are %d results" % len(self.station_results)) + fields = "_links,port,alias,ip,ap,port+type" if (self.station_results is None) or (len(self.station_results) < 1): self.get_failed_result_list() - for eid, record in self.station_results.items(): - # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - # pprint(eid) - # pprint(record) + for eid,record in self.station_results.items(): + #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + #pprint(eid) + #pprint(record) if record["ap"] == bssid: counter += 1 - # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") return counter def clear_test_results(self): self.resulting_stations = {} self.resulting_endpoints = {} super().clear_test_results() - # super(StaConnect, self).clear_test_results().test_results.clear() + #super(StaConnect, self).clear_test_results().test_results.clear() def run(self): if not self.setup(): @@ -231,7 +233,7 @@ class StaConnect(Realm): else: connected_stations[sta_name] = sta_url data = { - "shelf": 1, + "shelf":1, "resource": self.resource, "port": "ALL", "probe_flags": 1 @@ -242,7 +244,7 @@ class StaConnect(Realm): for sta_name in self.station_names: sta_url = self.get_station_url(sta_name) - station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") + station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") self.resulting_stations[sta_url] = station_info ap = station_info["interface"]["ap"] ip = station_info["interface"]["ip"] @@ -250,14 +252,13 @@ class StaConnect(Realm): print(" %s +AP %s, " % (sta_name, ap), end="") if self.dut_bssid != "": if self.dut_bssid.lower() == ap.lower(): - self._pass(sta_name + " connected to BSSID: " + ap) + self._pass(sta_name+" connected to BSSID: " + ap) # self.test_results.append("PASSED: ) # print("PASSED: Connected to BSSID: "+ap) else: - self._fail( - "%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap)) + self._fail("%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap)) else: - self._fail(sta_name + " did not connect to AP") + self._fail(sta_name+" did not connect to AP") return False if ip == "0.0.0.0": @@ -275,8 +276,8 @@ class StaConnect(Realm): # Create UDP endpoints for sta_name in self.station_names: - self.cx_names["testUDP-" + sta_name] = {"a": "testUDP-%s-A" % sta_name, - "b": "testUDP-%s-B" % sta_name} + self.cx_names["testUDP-"+sta_name] = { "a": "testUDP-%s-A" % sta_name, + "b": "testUDP-%s-B" % sta_name} data = { "alias": "testUDP-%s-A" % sta_name, "shelf": 1, @@ -289,9 +290,9 @@ class StaConnect(Realm): self.json_post("/cli-json/add_endp", data, suppress_related_commands_=True) data = { - "name": "testUDP-%s-A" % sta_name, - "flag": "UseAutoNAT", - "val": 1 + "name" : "testUDP-%s-A" % sta_name, + "flag" : "UseAutoNAT", + "val" : 1 } self.json_post("/cli-json/set_endp_flag", data, suppress_related_commands_=True) @@ -307,9 +308,9 @@ class StaConnect(Realm): self.json_post("/cli-json/add_endp", data, suppress_related_commands_=True) data = { - "name": "testUDP-%s-B" % sta_name, - "flag": "UseAutoNAT", - "val": 1 + "name" : "testUDP-%s-B" % sta_name, + "flag" : "UseAutoNAT", + "val" : 1 } self.json_post("/cli-json/set_endp_flag", data, suppress_related_commands_=True) @@ -330,8 +331,8 @@ class StaConnect(Realm): self.json_post("/cli-json/set_cx_report_timer", data, suppress_related_commands_=True) # Create TCP endpoints - self.cx_names["testTCP-" + sta_name] = {"a": "testTCP-%s-A" % sta_name, - "b": "testTCP-%s-B" % sta_name} + self.cx_names["testTCP-"+sta_name] = {"a": "testTCP-%s-A" % sta_name, + "b": "testTCP-%s-B" % sta_name} data = { "alias": "testTCP-%s-A" % sta_name, "shelf": 1, @@ -507,7 +508,7 @@ Example: staConnect.run() - staConnect.get_result_list() + run_results = staConnect.get_result_list() if not staConnect.passes(): print("FAIL: Some tests failed") @@ -523,7 +524,6 @@ Example: print(staConnect.get_all_message()) - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 2f198da3d111de6f994ce9cbb493164fa7c3a24e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 13 Dec 2021 15:49:05 -0700 Subject: [PATCH 10/40] Revert "sta_connect: sta_connect works now" This reverts commit 4d7451a287fcfc3a6ce87120a638215b32464856. --- py-scripts/sta_connect.py | 92 ++++++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 34 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 94ac436f..dea1c46f 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -19,6 +19,8 @@ sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") removeCX = LFUtils.removeCX removeEndps = LFUtils.removeEndps +lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") +LFCliBase = lfcli_base.LFCliBase realm = importlib.import_module("py-json.realm") Realm = realm.Realm @@ -29,20 +31,16 @@ WPA2 = "wpa2" MODE_AUTO = 0 -class StaConnect(Realm): +class StaConnect(LFCliBase): def __init__(self, host, port, _dut_ssid="MyAP", _dut_passwd="NA", _dut_bssid="", - _user="lanforge", _passwd="lanforge", _sta_mode="0", _radio="wiphy0", + _user="", _passwd="", _sta_mode="0", _radio="wiphy0", _resource=1, _upstream_resource=1, _upstream_port="eth2", _sta_name=None, _debugOn=False, _dut_security=OPEN, _exit_on_error=False, _cleanup_on_exit=True, _runtime_sec=60, _exit_on_fail=False): # do not use `super(LFCLiBase,self).__init__(self, host, port, _debugOn) # that is py2 era syntax and will force self into the host variable, making you # very confused. - super().__init__(lfclient_host=host, lfclient_port=port, debug_=_debugOn, _exit_on_fail=_exit_on_fail) - fields = "_links,port,alias,ip,ap,port+type" - self.station_results = self.find_ports_like("sta*", fields, debug_=False) - self.host = host - self.port = port + super().__init__(host, port, _debug=_debugOn, _exit_on_fail=_exit_on_fail) self.debugOn = _debugOn self.dut_security = "" self.dut_ssid = _dut_ssid @@ -63,12 +61,14 @@ class StaConnect(Realm): self.cx_names = {} if _sta_name is not None: self.station_names = [ _sta_name ] + # self.localrealm :Realm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 + self.localrealm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 self.resulting_stations = {} self.resulting_endpoints = {} - self.cx_profile = self.new_l3_cx_profile() - self.cx_profile.host = self.host - self.cx_profile.port = self.port + # def get_realm(self) -> Realm: # py > 3.6 + def get_realm(self): + return self.localrealm def get_station_url(self, sta_name_=None): if sta_name_ is None: @@ -100,6 +100,7 @@ class StaConnect(Realm): counter = 0 # print("there are %d results" % len(self.station_results)) fields = "_links,port,alias,ip,ap,port+type" + self.station_results = self.localrealm.find_ports_like("sta*", fields, debug_=False) if (self.station_results is None) or (len(self.station_results) < 1): self.get_failed_result_list() for eid,record in self.station_results.items(): @@ -151,7 +152,8 @@ class StaConnect(Realm): if response is not None: if response["interface"] is not None: print("removing old station") - LFUtils.removePort(self.resource, sta_name, self.lfclient_url, debug=False) + for sta_name in self.station_names: + LFUtils.removePort(self.resource, sta_name, self.lfclient_url) LFUtils.waitUntilPortsDisappear(self.resource, self.lfclient_url, self.station_names) # Create stations and turn dhcp on @@ -242,6 +244,7 @@ class StaConnect(Realm): # make a copy of the connected stations for test records + for sta_name in self.station_names: sta_url = self.get_station_url(sta_name) station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") @@ -274,6 +277,7 @@ class StaConnect(Realm): # create endpoints and cxs # Create UDP endpoints + self.cx_names = {} for sta_name in self.station_names: self.cx_names["testUDP-"+sta_name] = { "a": "testUDP-%s-A" % sta_name, @@ -331,8 +335,8 @@ class StaConnect(Realm): self.json_post("/cli-json/set_cx_report_timer", data, suppress_related_commands_=True) # Create TCP endpoints - self.cx_names["testTCP-"+sta_name] = {"a": "testTCP-%s-A" % sta_name, - "b": "testTCP-%s-B" % sta_name} + self.cx_names["testTCP-"+sta_name] = { "a": "testUDP-%s-A" % sta_name, + "b": "testUDP-%s-B" % sta_name} data = { "alias": "testTCP-%s-A" % sta_name, "shelf": 1, @@ -371,7 +375,6 @@ class StaConnect(Realm): } self.json_post("/cli-json/set_cx_report_timer", data, suppress_related_commands_=True) - self.wait_until_endps_appear(self.cx_names) return True def start(self): @@ -395,9 +398,19 @@ class StaConnect(Realm): } self.json_post("/cli-json/show_cxe", data) return True + def stop(self): - self.cx_profile.stop_cx() + # stop cx traffic + print("Stopping CX Traffic") + for cx_name in self.cx_names.keys(): + data = { + "test_mgr": "ALL", + "cx_name": cx_name, + "cx_state": "STOPPED" + } + self.json_post("/cli-json/set_cx_state", data) + return True def finish(self): # Refresh stats @@ -425,7 +438,7 @@ class StaConnect(Realm): ptest_a_tx = ptest['endpoint']['tx bytes'] ptest_a_rx = ptest['endpoint']['rx bytes'] - # ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % self.cx_names[cx_name]["b"]) + #ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % self.cx_names[cx_name]["b"]) endp_url = "/endp/%s" % self.cx_names[cx_name]["b"] ptest = self.json_get(endp_url) self.resulting_endpoints[endp_url] = ptest @@ -447,46 +460,59 @@ class StaConnect(Realm): # self.test_results.append("FAILED message will fail") # print("\n") + def cleanup(self): for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url, debug=False) + LFUtils.removePort(self.resource, sta_name, self.lfclient_url) endp_names = [] removeCX(self.lfclient_url, self.cx_names.keys()) for cx_name in self.cx_names: endp_names.append(self.cx_names[cx_name]["a"]) endp_names.append(self.cx_names[cx_name]["b"]) - if self.debug: - print("Removing endpoints %s" % self.cx_names.values()) - removeEndps(self.lfclient_url, endp_names, debug=False) + removeEndps(self.lfclient_url, endp_names) + +# ~class + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - def main(): lfjson_host = "localhost" lfjson_port = 8080 - parser = Realm.create_basic_argparse( + parser = argparse.ArgumentParser( prog="sta_connect.py", formatter_class=argparse.RawTextHelpFormatter, description="""LANforge Unit Test: Connect Station to AP Example: -./sta_connect.py --mgr 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C +./sta_connect.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C """) + parser.add_argument("-d", "--dest", type=str, help="address of the LANforge GUI machine (localhost is default)") parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") + parser.add_argument("-u", "--user", type=str, help="TBD: credential login/username") + parser.add_argument("-p", "--passwd", type=str, help="TBD: credential password") parser.add_argument("--resource", type=str, help="LANforge Station resource ID to use, default is 1") parser.add_argument("--upstream_resource", type=str, help="LANforge Ethernet port resource ID to use, default is 1") + parser.add_argument("--upstream_port", type=str, help="LANforge Ethernet port name, default is eth2") + parser.add_argument("--radio", type=str, help="LANforge radio to use, default is wiphy0") parser.add_argument("--sta_mode", type=str, help="LANforge station-mode setting (see add_sta LANforge CLI documentation, default is 0 (auto))") + parser.add_argument("--dut_ssid", type=str, help="DUT SSID") + parser.add_argument("--dut_passwd", type=str, help="DUT PSK password. Do not set for OPEN auth") parser.add_argument("--dut_bssid", type=str, help="DUT BSSID to which we expect to connect.") - parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m") args = parser.parse_args() - monitor_interval = Realm.parse_time(args.test_duration).total_seconds() - if args.mgr is not None: - lfjson_host = args.mgr + if args.dest is not None: + lfjson_host = args.dest if args.port is not None: lfjson_port = args.port - staConnect = StaConnect(lfjson_host, lfjson_port, _runtime_sec=monitor_interval) - staConnect.station_names = ["sta0000"] + staConnect = StaConnect(lfjson_host, lfjson_port) + staConnect.station_names = [ "sta0000" ] + if args.user is not None: + staConnect.user = args.user + if args.passwd is not None: + staConnect.passwd = args.passwd if args.sta_mode is not None: staConnect.sta_mode = args.sta_mode if args.upstream_resource is not None: @@ -497,14 +523,12 @@ Example: staConnect.radio = args.radio if args.resource is not None: staConnect.resource = args.resource - if args.passwd is not None: - staConnect.dut_passwd = args.passwd + if args.dut_passwd is not None: + staConnect.dut_passwd = args.dut_passwd if args.dut_bssid is not None: staConnect.dut_bssid = args.dut_bssid - if args.ssid is not None: - staConnect.dut_ssid = args.ssid - if args.security is not None: - staConnect.dut_security = args.security + if args.dut_ssid is not None: + staConnect.dut_ssid = args.dut_ssid staConnect.run() From f6e33994da98138a48d82707eb6f37dfa9d23f7a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 13 Dec 2021 17:13:09 -0700 Subject: [PATCH 11/40] sta_connect.py : added back in the older functionality for configuation. This script uses the json calles directly so will be helpful in working with the auto generated library : work in progress Signed-off-by: Chuck SmileyRekiere --- py-scripts/sta_connect.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index dea1c46f..186a1b4e 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -500,6 +500,7 @@ Example: parser.add_argument("--dut_ssid", type=str, help="DUT SSID") parser.add_argument("--dut_passwd", type=str, help="DUT PSK password. Do not set for OPEN auth") parser.add_argument("--dut_bssid", type=str, help="DUT BSSID to which we expect to connect.") + parser.add_argument("--dut_security", type=str, help="DUT Security mode") args = parser.parse_args() if args.dest is not None: @@ -529,6 +530,8 @@ Example: staConnect.dut_bssid = args.dut_bssid if args.dut_ssid is not None: staConnect.dut_ssid = args.dut_ssid + if args.dut_ssid is not None: + staConnect.dut_security = args.dut_security staConnect.run() From bb9735a9c9ae2858566d1dbef01be3c7b4b59ec1 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 13 Dec 2021 17:33:19 -0700 Subject: [PATCH 12/40] Revert "sta_connect.py : added back in the older functionality for configuation." This reverts commit f6e33994da98138a48d82707eb6f37dfa9d23f7a. --- py-scripts/sta_connect.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 186a1b4e..dea1c46f 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -500,7 +500,6 @@ Example: parser.add_argument("--dut_ssid", type=str, help="DUT SSID") parser.add_argument("--dut_passwd", type=str, help="DUT PSK password. Do not set for OPEN auth") parser.add_argument("--dut_bssid", type=str, help="DUT BSSID to which we expect to connect.") - parser.add_argument("--dut_security", type=str, help="DUT Security mode") args = parser.parse_args() if args.dest is not None: @@ -530,8 +529,6 @@ Example: staConnect.dut_bssid = args.dut_bssid if args.dut_ssid is not None: staConnect.dut_ssid = args.dut_ssid - if args.dut_ssid is not None: - staConnect.dut_security = args.dut_security staConnect.run() From 98e96523fcc64df163d299cadb0ec048c620fb45 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 13 Dec 2021 17:33:37 -0700 Subject: [PATCH 13/40] Revert "Revert "sta_connect: sta_connect works now"" This reverts commit 2f198da3d111de6f994ce9cbb493164fa7c3a24e. --- py-scripts/sta_connect.py | 92 +++++++++++++++------------------------ 1 file changed, 34 insertions(+), 58 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index dea1c46f..94ac436f 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -19,8 +19,6 @@ sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") removeCX = LFUtils.removeCX removeEndps = LFUtils.removeEndps -lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") -LFCliBase = lfcli_base.LFCliBase realm = importlib.import_module("py-json.realm") Realm = realm.Realm @@ -31,16 +29,20 @@ WPA2 = "wpa2" MODE_AUTO = 0 -class StaConnect(LFCliBase): +class StaConnect(Realm): def __init__(self, host, port, _dut_ssid="MyAP", _dut_passwd="NA", _dut_bssid="", - _user="", _passwd="", _sta_mode="0", _radio="wiphy0", + _user="lanforge", _passwd="lanforge", _sta_mode="0", _radio="wiphy0", _resource=1, _upstream_resource=1, _upstream_port="eth2", _sta_name=None, _debugOn=False, _dut_security=OPEN, _exit_on_error=False, _cleanup_on_exit=True, _runtime_sec=60, _exit_on_fail=False): # do not use `super(LFCLiBase,self).__init__(self, host, port, _debugOn) # that is py2 era syntax and will force self into the host variable, making you # very confused. - super().__init__(host, port, _debug=_debugOn, _exit_on_fail=_exit_on_fail) + super().__init__(lfclient_host=host, lfclient_port=port, debug_=_debugOn, _exit_on_fail=_exit_on_fail) + fields = "_links,port,alias,ip,ap,port+type" + self.station_results = self.find_ports_like("sta*", fields, debug_=False) + self.host = host + self.port = port self.debugOn = _debugOn self.dut_security = "" self.dut_ssid = _dut_ssid @@ -61,14 +63,12 @@ class StaConnect(LFCliBase): self.cx_names = {} if _sta_name is not None: self.station_names = [ _sta_name ] - # self.localrealm :Realm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 - self.localrealm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 self.resulting_stations = {} self.resulting_endpoints = {} - # def get_realm(self) -> Realm: # py > 3.6 - def get_realm(self): - return self.localrealm + self.cx_profile = self.new_l3_cx_profile() + self.cx_profile.host = self.host + self.cx_profile.port = self.port def get_station_url(self, sta_name_=None): if sta_name_ is None: @@ -100,7 +100,6 @@ class StaConnect(LFCliBase): counter = 0 # print("there are %d results" % len(self.station_results)) fields = "_links,port,alias,ip,ap,port+type" - self.station_results = self.localrealm.find_ports_like("sta*", fields, debug_=False) if (self.station_results is None) or (len(self.station_results) < 1): self.get_failed_result_list() for eid,record in self.station_results.items(): @@ -152,8 +151,7 @@ class StaConnect(LFCliBase): if response is not None: if response["interface"] is not None: print("removing old station") - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) + LFUtils.removePort(self.resource, sta_name, self.lfclient_url, debug=False) LFUtils.waitUntilPortsDisappear(self.resource, self.lfclient_url, self.station_names) # Create stations and turn dhcp on @@ -244,7 +242,6 @@ class StaConnect(LFCliBase): # make a copy of the connected stations for test records - for sta_name in self.station_names: sta_url = self.get_station_url(sta_name) station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") @@ -277,7 +274,6 @@ class StaConnect(LFCliBase): # create endpoints and cxs # Create UDP endpoints - self.cx_names = {} for sta_name in self.station_names: self.cx_names["testUDP-"+sta_name] = { "a": "testUDP-%s-A" % sta_name, @@ -335,8 +331,8 @@ class StaConnect(LFCliBase): self.json_post("/cli-json/set_cx_report_timer", data, suppress_related_commands_=True) # Create TCP endpoints - self.cx_names["testTCP-"+sta_name] = { "a": "testUDP-%s-A" % sta_name, - "b": "testUDP-%s-B" % sta_name} + self.cx_names["testTCP-"+sta_name] = {"a": "testTCP-%s-A" % sta_name, + "b": "testTCP-%s-B" % sta_name} data = { "alias": "testTCP-%s-A" % sta_name, "shelf": 1, @@ -375,6 +371,7 @@ class StaConnect(LFCliBase): } self.json_post("/cli-json/set_cx_report_timer", data, suppress_related_commands_=True) + self.wait_until_endps_appear(self.cx_names) return True def start(self): @@ -398,19 +395,9 @@ class StaConnect(LFCliBase): } self.json_post("/cli-json/show_cxe", data) return True - def stop(self): - # stop cx traffic - print("Stopping CX Traffic") - for cx_name in self.cx_names.keys(): - data = { - "test_mgr": "ALL", - "cx_name": cx_name, - "cx_state": "STOPPED" - } - self.json_post("/cli-json/set_cx_state", data) - return True + self.cx_profile.stop_cx() def finish(self): # Refresh stats @@ -438,7 +425,7 @@ class StaConnect(LFCliBase): ptest_a_tx = ptest['endpoint']['tx bytes'] ptest_a_rx = ptest['endpoint']['rx bytes'] - #ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % self.cx_names[cx_name]["b"]) + # ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % self.cx_names[cx_name]["b"]) endp_url = "/endp/%s" % self.cx_names[cx_name]["b"] ptest = self.json_get(endp_url) self.resulting_endpoints[endp_url] = ptest @@ -460,59 +447,46 @@ class StaConnect(LFCliBase): # self.test_results.append("FAILED message will fail") # print("\n") - def cleanup(self): for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) + LFUtils.removePort(self.resource, sta_name, self.lfclient_url, debug=False) endp_names = [] removeCX(self.lfclient_url, self.cx_names.keys()) for cx_name in self.cx_names: endp_names.append(self.cx_names[cx_name]["a"]) endp_names.append(self.cx_names[cx_name]["b"]) - removeEndps(self.lfclient_url, endp_names) - -# ~class - - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + if self.debug: + print("Removing endpoints %s" % self.cx_names.values()) + removeEndps(self.lfclient_url, endp_names, debug=False) def main(): lfjson_host = "localhost" lfjson_port = 8080 - parser = argparse.ArgumentParser( + parser = Realm.create_basic_argparse( prog="sta_connect.py", formatter_class=argparse.RawTextHelpFormatter, description="""LANforge Unit Test: Connect Station to AP Example: -./sta_connect.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C +./sta_connect.py --mgr 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C """) - parser.add_argument("-d", "--dest", type=str, help="address of the LANforge GUI machine (localhost is default)") parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") - parser.add_argument("-u", "--user", type=str, help="TBD: credential login/username") - parser.add_argument("-p", "--passwd", type=str, help="TBD: credential password") parser.add_argument("--resource", type=str, help="LANforge Station resource ID to use, default is 1") parser.add_argument("--upstream_resource", type=str, help="LANforge Ethernet port resource ID to use, default is 1") - parser.add_argument("--upstream_port", type=str, help="LANforge Ethernet port name, default is eth2") - parser.add_argument("--radio", type=str, help="LANforge radio to use, default is wiphy0") parser.add_argument("--sta_mode", type=str, help="LANforge station-mode setting (see add_sta LANforge CLI documentation, default is 0 (auto))") - parser.add_argument("--dut_ssid", type=str, help="DUT SSID") - parser.add_argument("--dut_passwd", type=str, help="DUT PSK password. Do not set for OPEN auth") parser.add_argument("--dut_bssid", type=str, help="DUT BSSID to which we expect to connect.") + parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m") args = parser.parse_args() - if args.dest is not None: - lfjson_host = args.dest + monitor_interval = Realm.parse_time(args.test_duration).total_seconds() + if args.mgr is not None: + lfjson_host = args.mgr if args.port is not None: lfjson_port = args.port - staConnect = StaConnect(lfjson_host, lfjson_port) - staConnect.station_names = [ "sta0000" ] - if args.user is not None: - staConnect.user = args.user - if args.passwd is not None: - staConnect.passwd = args.passwd + staConnect = StaConnect(lfjson_host, lfjson_port, _runtime_sec=monitor_interval) + staConnect.station_names = ["sta0000"] if args.sta_mode is not None: staConnect.sta_mode = args.sta_mode if args.upstream_resource is not None: @@ -523,12 +497,14 @@ Example: staConnect.radio = args.radio if args.resource is not None: staConnect.resource = args.resource - if args.dut_passwd is not None: - staConnect.dut_passwd = args.dut_passwd + if args.passwd is not None: + staConnect.dut_passwd = args.passwd if args.dut_bssid is not None: staConnect.dut_bssid = args.dut_bssid - if args.dut_ssid is not None: - staConnect.dut_ssid = args.dut_ssid + if args.ssid is not None: + staConnect.dut_ssid = args.ssid + if args.security is not None: + staConnect.dut_security = args.security staConnect.run() From 0687cc1b27183e3ca4704491021ae7829e93485b Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 13 Dec 2021 17:33:59 -0700 Subject: [PATCH 14/40] Revert "Revert "sta_connect: Fix whitespace"" This reverts commit 354ebaefebac9fe6f120ad3a5223972362a4d851. --- py-scripts/sta_connect.py | 50 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 94ac436f..6ed7a6be 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -13,7 +13,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -62,7 +61,7 @@ class StaConnect(Realm): self.station_names = [] self.cx_names = {} if _sta_name is not None: - self.station_names = [ _sta_name ] + self.station_names = [_sta_name] self.resulting_stations = {} self.resulting_endpoints = {} @@ -99,23 +98,22 @@ class StaConnect(Realm): def num_associated(self, bssid): counter = 0 # print("there are %d results" % len(self.station_results)) - fields = "_links,port,alias,ip,ap,port+type" if (self.station_results is None) or (len(self.station_results) < 1): self.get_failed_result_list() - for eid,record in self.station_results.items(): - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - #pprint(eid) - #pprint(record) + for eid, record in self.station_results.items(): + # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + # pprint(eid) + # pprint(record) if record["ap"] == bssid: counter += 1 - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") return counter def clear_test_results(self): self.resulting_stations = {} self.resulting_endpoints = {} super().clear_test_results() - #super(StaConnect, self).clear_test_results().test_results.clear() + # super(StaConnect, self).clear_test_results().test_results.clear() def run(self): if not self.setup(): @@ -233,7 +231,7 @@ class StaConnect(Realm): else: connected_stations[sta_name] = sta_url data = { - "shelf":1, + "shelf": 1, "resource": self.resource, "port": "ALL", "probe_flags": 1 @@ -244,7 +242,7 @@ class StaConnect(Realm): for sta_name in self.station_names: sta_url = self.get_station_url(sta_name) - station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") + station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") self.resulting_stations[sta_url] = station_info ap = station_info["interface"]["ap"] ip = station_info["interface"]["ip"] @@ -252,13 +250,14 @@ class StaConnect(Realm): print(" %s +AP %s, " % (sta_name, ap), end="") if self.dut_bssid != "": if self.dut_bssid.lower() == ap.lower(): - self._pass(sta_name+" connected to BSSID: " + ap) + self._pass(sta_name + " connected to BSSID: " + ap) # self.test_results.append("PASSED: ) # print("PASSED: Connected to BSSID: "+ap) else: - self._fail("%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap)) + self._fail( + "%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap)) else: - self._fail(sta_name+" did not connect to AP") + self._fail(sta_name + " did not connect to AP") return False if ip == "0.0.0.0": @@ -276,8 +275,8 @@ class StaConnect(Realm): # Create UDP endpoints for sta_name in self.station_names: - self.cx_names["testUDP-"+sta_name] = { "a": "testUDP-%s-A" % sta_name, - "b": "testUDP-%s-B" % sta_name} + self.cx_names["testUDP-" + sta_name] = {"a": "testUDP-%s-A" % sta_name, + "b": "testUDP-%s-B" % sta_name} data = { "alias": "testUDP-%s-A" % sta_name, "shelf": 1, @@ -290,9 +289,9 @@ class StaConnect(Realm): self.json_post("/cli-json/add_endp", data, suppress_related_commands_=True) data = { - "name" : "testUDP-%s-A" % sta_name, - "flag" : "UseAutoNAT", - "val" : 1 + "name": "testUDP-%s-A" % sta_name, + "flag": "UseAutoNAT", + "val": 1 } self.json_post("/cli-json/set_endp_flag", data, suppress_related_commands_=True) @@ -308,9 +307,9 @@ class StaConnect(Realm): self.json_post("/cli-json/add_endp", data, suppress_related_commands_=True) data = { - "name" : "testUDP-%s-B" % sta_name, - "flag" : "UseAutoNAT", - "val" : 1 + "name": "testUDP-%s-B" % sta_name, + "flag": "UseAutoNAT", + "val": 1 } self.json_post("/cli-json/set_endp_flag", data, suppress_related_commands_=True) @@ -331,8 +330,8 @@ class StaConnect(Realm): self.json_post("/cli-json/set_cx_report_timer", data, suppress_related_commands_=True) # Create TCP endpoints - self.cx_names["testTCP-"+sta_name] = {"a": "testTCP-%s-A" % sta_name, - "b": "testTCP-%s-B" % sta_name} + self.cx_names["testTCP-" + sta_name] = {"a": "testTCP-%s-A" % sta_name, + "b": "testTCP-%s-B" % sta_name} data = { "alias": "testTCP-%s-A" % sta_name, "shelf": 1, @@ -508,7 +507,7 @@ Example: staConnect.run() - run_results = staConnect.get_result_list() + staConnect.get_result_list() if not staConnect.passes(): print("FAIL: Some tests failed") @@ -524,6 +523,7 @@ Example: print(staConnect.get_all_message()) + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 4a871c95169e4a5081b583b998282ae66210fc6c Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 13 Dec 2021 17:05:23 -0800 Subject: [PATCH 15/40] sta_connect.py: Use name_to_eid to parse name of radio Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 6ed7a6be..37278afd 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -160,10 +160,12 @@ class StaConnect(Realm): elif self.dut_security == OPEN: pass + radio = LFUtils.name_to_eid(self.radio) + add_sta_data = { - "shelf": 1, - "resource": self.resource, - "radio": self.radio, + "shelf": radio[0], + "resource": radio[1], + "radio": radio[2], "ssid": self.dut_ssid, "key": self.dut_passwd, "mode": self.sta_mode, From 2982bf3e49bfc060c2b153ccf0ecfb215d492c12 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 13 Dec 2021 17:10:55 -0800 Subject: [PATCH 16/40] sta_connect: Use name_to_eid to parse name of upstream port Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 37278afd..81aef499 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -31,7 +31,7 @@ MODE_AUTO = 0 class StaConnect(Realm): def __init__(self, host, port, _dut_ssid="MyAP", _dut_passwd="NA", _dut_bssid="", _user="lanforge", _passwd="lanforge", _sta_mode="0", _radio="wiphy0", - _resource=1, _upstream_resource=1, _upstream_port="eth2", + _resource=1, _upstream_resource=None, _upstream_port="eth2", _sta_name=None, _debugOn=False, _dut_security=OPEN, _exit_on_error=False, _cleanup_on_exit=True, _runtime_sec=60, _exit_on_fail=False): # do not use `super(LFCLiBase,self).__init__(self, host, port, _debugOn) @@ -52,8 +52,12 @@ class StaConnect(Realm): self.sta_mode = _sta_mode # See add_sta LANforge CLI users guide entry self.radio = _radio self.resource = _resource - self.upstream_resource = _upstream_resource - self.upstream_port = _upstream_port + _upstream_port = LFUtils.to_eid(_upstream_port) + if _upstream_resource: + self.upstream_resource = _upstream_resource + else: + self.upstream_resource = _upstream_port[2] + self.upstream_port = _upstream_port[3] self.runtime_secs = _runtime_sec self.cleanup_on_exit = _cleanup_on_exit self.sta_url_map = None # defer construction From 5d89b48f8f2b2682bbceb8fcb7977a9a22c94292 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 13 Dec 2021 17:11:42 -0800 Subject: [PATCH 17/40] sta_connect: name_to_eid Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 81aef499..dd51f9f1 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -52,7 +52,7 @@ class StaConnect(Realm): self.sta_mode = _sta_mode # See add_sta LANforge CLI users guide entry self.radio = _radio self.resource = _resource - _upstream_port = LFUtils.to_eid(_upstream_port) + _upstream_port = LFUtils.name_to_eid(_upstream_port) if _upstream_resource: self.upstream_resource = _upstream_resource else: From 8c1bf88b05086e06f2fa88ba26d1d1f8900d6959 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 13 Dec 2021 17:22:03 -0800 Subject: [PATCH 18/40] sta_connect: Use name_to_eid for upstream port Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index dd51f9f1..6ae7a9c5 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -56,8 +56,8 @@ class StaConnect(Realm): if _upstream_resource: self.upstream_resource = _upstream_resource else: - self.upstream_resource = _upstream_port[2] - self.upstream_port = _upstream_port[3] + self.upstream_resource = _upstream_port[1] + self.upstream_port = _upstream_port[2] self.runtime_secs = _runtime_sec self.cleanup_on_exit = _cleanup_on_exit self.sta_url_map = None # defer construction @@ -72,6 +72,7 @@ class StaConnect(Realm): self.cx_profile = self.new_l3_cx_profile() self.cx_profile.host = self.host self.cx_profile.port = self.port + print(self.upstream_port) def get_station_url(self, sta_name_=None): if sta_name_ is None: @@ -490,14 +491,12 @@ Example: if args.port is not None: lfjson_port = args.port - staConnect = StaConnect(lfjson_host, lfjson_port, _runtime_sec=monitor_interval) + staConnect = StaConnect(lfjson_host, lfjson_port, _upstream_port=args.upstream_port, _runtime_sec=monitor_interval) staConnect.station_names = ["sta0000"] if args.sta_mode is not None: staConnect.sta_mode = args.sta_mode if args.upstream_resource is not None: staConnect.upstream_resource = args.upstream_resource - if args.upstream_port is not None: - staConnect.upstream_port = args.upstream_port if args.radio is not None: staConnect.radio = args.radio if args.resource is not None: From 254681a2050a6e5da2b5c5e0e46a2a6a77742f6e Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Fri, 10 Dec 2021 14:41:38 -0800 Subject: [PATCH 19/40] regression_test.sh: adds sorting to bottom, fixes missing tbody end tag Signed-off-by: Jed Reynolds --- py-scripts/regression_test.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 212041c2..9a597500 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -662,12 +662,12 @@ td.testname { " - tail="" + f="" fname="${HOMEPATH}/html-reports/regression_file-${NOW}.html" echo "$header" >> "$fname" echo "${results[@]}" >> "$fname" - echo " + echo "

System information

@@ -694,7 +694,9 @@ td.testname { ${PYTHON_ENVIRONMENT} - " >> "$fname" + + +" >> "$fname" echo "$tail" >> "$fname" if [ -f "${HOMEPATH}/html-reports/latest.html" ]; then rm -f "${HOMEPATH}/html-reports/latest.html" From 78bffdbbf05498d345d24fa256b41bd9448c4cbc Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 14 Dec 2021 04:32:05 -0700 Subject: [PATCH 20/40] ct_us_scripts.json : initial checkin - attempt to include more regression lf_cleanup.py : added the cleanup of moni with sta Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_cleanup.py | 11 + py-scripts/tools/ct_us_scripts.json | 629 ++++++++++++++++++++++++++++ 2 files changed, 640 insertions(+) create mode 100644 py-scripts/tools/ct_us_scripts.json diff --git a/py-scripts/lf_cleanup.py b/py-scripts/lf_cleanup.py index b1a1901f..629803d2 100755 --- a/py-scripts/lf_cleanup.py +++ b/py-scripts/lf_cleanup.py @@ -143,6 +143,17 @@ class lf_clean(Realm): # print(data) super().json_post(req_url, data) time.sleep(.5) + if 'moni' in alias: + info = self.name_to_eid(alias) + req_url = "cli-json/rm_vlan" + data = { + "shelf": info[0], + "resource": info[1], + "port": info[2] + } + # print(data) + super().json_post(req_url, data) + time.sleep(.5) if 'Unknown' in alias: info = self.name_to_eid(alias) req_url = "cli-json/rm_vlan" diff --git a/py-scripts/tools/ct_us_scripts.json b/py-scripts/tools/ct_us_scripts.json new file mode 100644 index 00000000..87426a69 --- /dev/null +++ b/py-scripts/tools/ct_us_scripts.json @@ -0,0 +1,629 @@ +{ + "ct_tests_001_scripts":{ + "Notes":[ + "The json is used to orchastrate the tests to be run on testbed ct_us_001", + "This json file is used as an input to the ./lf_check.py file", + "The variables that are all capitalized below are replaced with configuration", + "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", + "The replacement is loosely coupled so the upper and lower case convention is used", + "to identify replaced strings in the lf_check.py code.", + "When doing a create_chamberview.py --create_scenario ", + "has no correlation to the --instance_name , instance name is used ", + "as a unique identifier for tha chamber-view test run" + ] + }, + "test_suites":{ + "suite_smoke":{ + "clean_up_cxs_endp_sta":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_ip_variable_time0-ipv4":{ + "enabled":"TRUE", + "command":"test_ip_variable_time.py", + "timeout":"360", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP ", + " use_ssid_idx=1 --radio wiphy4 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 60s --output_format csv ", + " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", + " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", + " --port_mgr_cols 'alias','channel','activity','mode'", + " --num_stations 1"] + }, + "test_ip_variable_time1-ipv4":{ + "enabled":"FALSE", + "timeout":"360", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 60s --output_format csv ", + " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", + " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", + " --port_mgr_cols 'alias','channel','activity','mode'" + ]}, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + }, + "suite_verify":{ + "clean_up_cxs_endp_sta":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_ip_variable_time0-ipv4":{ + "enabled":"TRUE", + "command":"test_ip_variable_time.py", + "timeout":"360", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP ", + " use_ssid_idx=1 --radio wiphy4 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 60s --output_format csv ", + " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", + " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", + " --port_mgr_cols 'alias','channel','activity','mode'", + " --num_stations 1"] + }, + "test_ip_variable_time1-ipv4":{ + "enabled":"FALSE", + "timeout":"360", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 60s --output_format csv ", + " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", + " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", + " --port_mgr_cols 'alias','channel','activity','mode'" + ]}, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + }, + "suite_l3":{ + "clean_up_cxs_endp_sta_flags_5q_all":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_5g_all":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 30s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_2q_all":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_2g_all":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 30s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + }, + "suite_test":{ + "lf_cleanup":{ + "enabled":"FALSE", + "load_db":"NONE", + "command":"lf_cleanup.py", + "args":"", + "args_list":["--mgr LF_MGR_IP --cxs --sta" + ] + }, + "lf_report_test":{ + "enabled":"TRUE", + "load_db":"NONE", + "timeout":"60", + "command":"lf_report_test.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP " + ] + }, + "lf_graph":{ + "enabled":"TRUE", + "load_db":"NONE", + "timeout":"60", + "command":"lf_graph.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP " + ] + }, + "test_ip_variable_time0-ipv4":{ + "enabled":"TRUE", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"] + }, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + }, + "suite_scripts_r":{ + "lf_help_check":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"lf_help_check.bash", + "args":"", + "args_list":[ + " " + ] + }, + "lf_cleanup":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + "--mgr LF_MGR_IP --cxs --sta " + ] + }, + "create_chamberview_dut_ATH10K_9984__wc":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" + ] + }, + "create_chamberview_ATH10K_9984__wc":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ATH10K_9984__wc ", + " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: USE_DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" + ] + }, + "wifi_capacity_ATH10K_9984_":{ + "enabled":"TRUE", + "timeout":"600", + "iterations":"1", + "load_db":"skip", + "command":"lf_wifi_capacity_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__wc", + " --upstream 1.1.eth2 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_'", + " --test_rig TEST_RIG ", + " --set DUT_SET_NAME" + ] + }, + "create_chamberview_dut_ATH10K_9984__dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" + ] + }, + "create_chamberview_ATH10K_9984__dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ATH10K_9984__dp", + " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: USE_DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" + ] + }, + "dataplane_ATH10K_9984_":{ + "enabled":"TRUE", + "load_db":"skip", + "timeout":"600", + "iterations":"1", + "command":"lf_dataplane_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__dp", + " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan1", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", + " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", + " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_' ", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "test_l3_longevity":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_for_l3":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_enable_flags":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED wifi_mode==0 wifi_settings==wifi_settings enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_AX200_5g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_AX200_5g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 60s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_AX200_2g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_AX200_2g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 60s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=0 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_5q_all":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_5g_all":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 60s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_2q_all":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_2g_all":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 60s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "test_ip_connection-ipv4":{ + "enabled":"TRUE", + "command":"test_ip_connection.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --debug"]}, + "test_ip_variable_time_ipv4_udp":{ + "enabled":"FALSE", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", + " --traffic_type lf_udp", + " --debug"]}, + "test_ip_variable_time_ipv4_tcp":{ + "enabled":"FALSE", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", + " --traffic_type lf_tcp", + " --debug"]}, + "test_ip_connection_ipv6_udp":{ + "enabled":"FALSE", + "command":"test_ip_connection.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", + " --traffic_type lf_udp", + " --ipv6", + " --debug"]}, + "test_ip_variable_time_ipv6_tcp":{ + "enabled":"FALSE", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", + " --traffic_type lf_tcp", + " --ipv6", + " --debug"]}, + "test_ip_variable_time1-ipv6":{ + "enabled":"FALSE", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", + " --traffic_type lf_tcp", + " --ipv6", + " --debug"]}, + "create_bridge":{ + "enabled":"TRUE", + "command":"create_bridge.py", + "args":"", + "args_list":["--mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT --target_device sta0000 --debug" + ] + }, + "create_l3_stations":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"create_l3_stations.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + ] + }, + "lf_report_test":{ + "enabled":"TRUE", + "load_db":"NONE", + "timeout":"60", + "command":"lf_report_test.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP " + ] + }, + "test_l4":{ + "enabled":"TRUE", + "command":"test_l4.py", + "args":"", + "args_list":[ + "--mgr LF_MGR_IP --radio wiphy1 ", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED ", + " --test_duration 30s" + ] + }, + "test_l3_longevity_1":{ + "enabled":"TRUE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "test_l3_powersave_traffic":{ + "enabled":"FALSE", + "command":"test_l3_powersave_traffic.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --debug" + ] + }, + "create_l4":{ + "enabled":"TRUE", + "command":"create_l4.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --debug" + ] + }, + "test_status_msg":{ + "enabled":"TRUE", + "command":"test_status_msg.py", + "args":"", + "args_list":["--mgr LF_MGR_IP --action run_test" + ] + }, + "wlan_capacity_calculator1":{ + "enabled":"TRUE", + "command":"./wlan_capacity_calculator.py", + "args":"", + "args_list":["-sta 11abg -t Voice -p 48 -m 106 -e WEP -q Yes -b 1 2 5.5 11 -pre Long -s N/A -co G.711 -r Yes -c Yes" + ] + }, + "wlan_capacity_calculator2":{ + "enabled":"TRUE", + "command":"./wlan_capacity_calculator.py", + "args":"", + "args_list":["-sta 11n -t Voice -d 17 -ch 40 -gu 800 -high 9 -e WEP -q Yes -ip 5 -mc 42 -b 6 9 12 24 -m 1538 -co G.729 -pl Greenfield -cw 15 -r Yes -c Yes" + ] + }, + "wlan_capacity_calculator3":{ + "enabled":"TRUE", + "command":"./wlan_capacity_calculator.py", + "args":"", + "args_list":["-sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes" + ] + }, + "lf_graph":{ + "enabled":"TRUE", + "load_db":"NONE", + "timeout":"60", + "command":"lf_graph.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP " + ] + }, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + } + } +} + + + + \ No newline at end of file From de3683f220edc52b216ed7ab5a5594def8d8e03d Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 14 Dec 2021 05:05:53 -0700 Subject: [PATCH 21/40] lf_cleanup.py : pep8 cleanup Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_cleanup.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/py-scripts/lf_cleanup.py b/py-scripts/lf_cleanup.py index 629803d2..c9fb0616 100755 --- a/py-scripts/lf_cleanup.py +++ b/py-scripts/lf_cleanup.py @@ -63,12 +63,12 @@ class lf_clean(Realm): } super().json_post(req_url, data) time.sleep(.5) - time.sleep(1) + time.sleep(1) else: print("No cross connects found to cleanup") still_looking_cxs = False print("clean_cxs still_looking_cxs {cxs_looking}".format(cxs_looking=still_looking_cxs)) - if not still_looking_cxs: + if not still_looking_cxs: self.cxs_done = True return still_looking_cxs @@ -98,7 +98,7 @@ class lf_clean(Realm): print("No endpoints found to cleanup") still_looking_endp = False print("clean_endp still_looking_endp {ednp_looking}".format(ednp_looking=still_looking_endp)) - if not still_looking_endp: + if not still_looking_endp: self.endp_done = True return still_looking_endp @@ -167,29 +167,30 @@ class lf_clean(Realm): time.sleep(.5) if ('Unknown' not in alias) and ('wlan' not in alias) and ('sta' not in alias): still_looking_sta = False - time.sleep(1) + time.sleep(1) else: print("No stations found to cleanup") - still_looking_sta = False + still_looking_sta = False print("clean_sta still_looking_sta {sta_looking}".format(sta_looking=still_looking_sta)) - if not still_looking_sta: + if not still_looking_sta: self.sta_done = True return still_looking_sta - ''' 1: delete cx 2: delete endp 3: delete sta when deleting sta first, you will end up with phantom CX ''' + def cleanup(self): if self.clean_cxs: # also clean the endp when cleaning cxs still_looking_cxs = self.cxs_clean() still_looking_endp = self.endp_clean() - print("clean_cxs: still_looking_cxs {looking_cxs} still_looking_endp {looking_endp}".format(looking_cxs=still_looking_cxs,looking_endp=still_looking_endp)) + print("clean_cxs: still_looking_cxs {looking_cxs} still_looking_endp {looking_endp}".format( + looking_cxs=still_looking_cxs, looking_endp=still_looking_endp)) if self.clean_endp and not self.clean_cxs: still_looking_endp = self.endp_clean() print("clean_endp: still_looking_endp {looking_endp}".format(looking_endp=still_looking_endp)) @@ -198,6 +199,7 @@ class lf_clean(Realm): still_looking_sta = self.sta_clean() print("clean_sta: still_looking_sta {looking_sta}".format(looking_sta=still_looking_sta)) + def main(): parser = argparse.ArgumentParser( @@ -239,8 +241,8 @@ python3 ./lf_clean.py --mgr MGR args = parser.parse_args() if args.cxs or args.endp or args.sta: - clean = lf_clean(host=args.mgr,clean_cxs=args.cxs,clean_endp=args.endp,clean_sta=args.sta ) - print("cleaning cxs: {cxs} endpoints: {endp} stations: {sta} start".format(cxs=args.cxs,endp=args.endp,sta=args.sta)) + clean = lf_clean(host=args.mgr, clean_cxs=args.cxs, clean_endp=args.endp, clean_sta=args.sta) + print("cleaning cxs: {cxs} endpoints: {endp} stations: {sta} start".format(cxs=args.cxs, endp=args.endp, sta=args.sta)) if args.cxs: print("cleaning cxs will also clean endp") clean.cxs_clean() @@ -253,7 +255,8 @@ python3 ./lf_clean.py --mgr MGR # print("Clean cxs_done {cxs_done} endp_done {endp_done} sta_done {sta_done}" # .format(cxs_done=clean.cxs_done,endp_done=clean.endp_done,sta_done=clean.sta_done)) else: - print("please add option of --cxs ,--endp, or --sta to clean") + print("please add option of --cxs ,--endp, or --sta to clean") + if __name__ == "__main__": main() From 8a3dc2221ef9e10ddfc02de4fbe428ab7e11fabe Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 14 Dec 2021 05:17:34 -0700 Subject: [PATCH 22/40] ct_us_scripts.json: regression updates Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_scripts.json | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/py-scripts/tools/ct_us_scripts.json b/py-scripts/tools/ct_us_scripts.json index 87426a69..26653156 100644 --- a/py-scripts/tools/ct_us_scripts.json +++ b/py-scripts/tools/ct_us_scripts.json @@ -531,6 +531,15 @@ "args_list":[" --mgr LF_MGR_IP " ] }, + "test_l3_powersave_traffic":{ + "enabled":"TRUE", + "command":"test_l3_powersave_traffic.py", + "args":"", + "args_list":[ + "--mgr LF_MGR_IP --radio 1.1.wiphy0 ", + " use_ssid_idx=0 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + ] + }, "test_l4":{ "enabled":"TRUE", "command":"test_l4.py", @@ -553,16 +562,6 @@ " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" ] }, - "test_l3_powersave_traffic":{ - "enabled":"FALSE", - "command":"test_l3_powersave_traffic.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", - " --debug" - ] - }, "create_l4":{ "enabled":"TRUE", "command":"create_l4.py", From 66b33ce9feb7c4798d074075966e6f183df4eac3 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 14 Dec 2021 06:18:03 -0700 Subject: [PATCH 23/40] test_ipv4_ttls.py : pass up upstream_port configuraiton, ct_us_scripts.json updated test added cleanup. Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_ipv4_ttls.py | 4 +++- py-scripts/tools/ct_us_scripts.json | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/py-scripts/test_ipv4_ttls.py b/py-scripts/test_ipv4_ttls.py index 4057f77e..45a25aa6 100755 --- a/py-scripts/test_ipv4_ttls.py +++ b/py-scripts/test_ipv4_ttls.py @@ -26,6 +26,7 @@ class TTLSTest(Realm): security="wpa2", password="[BLANK]", radio="wiphy0", + upstream_port="eth2", key_mgmt="WPA-EAP", pairwise="NA", group="NA", @@ -112,7 +113,7 @@ class TTLSTest(Realm): self.debug = _debug_on self.station_profile = self.new_station_profile() self.vap = vap - self.upstream_port = "eth1" + self.upstream_port = upstream_port self.upstream_resource = 1 if self.vap: self.vap_profile = self.new_vap_profile() @@ -364,6 +365,7 @@ test_ipv4_ttls.py: ssid=args.ssid, password=args.passwd, security=args.security, + upstream_port=args.upstream_port, sta_list=station_list, radio=args.radio, key_mgmt=args.key_mgmt, diff --git a/py-scripts/tools/ct_us_scripts.json b/py-scripts/tools/ct_us_scripts.json index 26653156..39d65ead 100644 --- a/py-scripts/tools/ct_us_scripts.json +++ b/py-scripts/tools/ct_us_scripts.json @@ -531,6 +531,13 @@ "args_list":[" --mgr LF_MGR_IP " ] }, + "clean_up_cxs_endp_sta_l3_powersave":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, "test_l3_powersave_traffic":{ "enabled":"TRUE", "command":"test_l3_powersave_traffic.py", @@ -540,6 +547,13 @@ " use_ssid_idx=0 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " ] }, + "clean_up_cxs_endp_sta_l4":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, "test_l4":{ "enabled":"TRUE", "command":"test_l4.py", From aba356c1ad3e1e041fc565e69e65d67f76d7d6b0 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 14 Dec 2021 07:21:29 -0700 Subject: [PATCH 24/40] ct_us_scripts.json : added test_ipv4_ps , test_ipv4_ttls , tests turned off place holders when bridge is worked out. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_scripts.json | 67 ++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/ct_us_scripts.json b/py-scripts/tools/ct_us_scripts.json index 39d65ead..d405df09 100644 --- a/py-scripts/tools/ct_us_scripts.json +++ b/py-scripts/tools/ct_us_scripts.json @@ -444,6 +444,14 @@ " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" ] }, + "clean_up_cxs_endp_sta_0":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ] + }, "test_ip_connection-ipv4":{ "enabled":"TRUE", "command":"test_ip_connection.py", @@ -452,7 +460,44 @@ " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", " --debug"]}, - "test_ip_variable_time_ipv4_udp":{ + "clean_up_cxs_endp_sta":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ] + }, + "test_ip_variable_time_ipv4_24g":{ + "enabled":"TRUE", + "command":"test_ip_variable_time.py", + "timeout":"360", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP ", + " use_ssid_idx=0 --radio wiphy0 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 60s --output_format csv ", + " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", + " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", + " --port_mgr_cols 'alias','channel','activity','mode'", + " --num_stations 1" + ] + }, + "test_ip_variable_time_ipv4_5g":{ + "enabled":"TRUE", + "timeout":"360", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 60s --output_format csv ", + " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", + " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", + " --port_mgr_cols 'alias','channel','activity','mode'" + ] + }, + "test_ip_variable_time_ipv4_5g_udp":{ "enabled":"FALSE", "command":"test_ip_variable_time.py", "args":"", @@ -462,7 +507,7 @@ " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", " --traffic_type lf_udp", " --debug"]}, - "test_ip_variable_time_ipv4_tcp":{ + "test_ip_variable_time_ipv4_5g_tcp":{ "enabled":"FALSE", "command":"test_ip_variable_time.py", "args":"", @@ -531,6 +576,24 @@ "args_list":[" --mgr LF_MGR_IP " ] }, + "test_ipv4_ps":{ + "enabled":"FALSE", + "command":"test_ipv4_ps.py", + "args":"", + "args_list":[ + "--mgr LF_MGR_IP --radio 1.1.wiphy1 --upstream_port 1.1.eth2 --radio2 1.1.wiphy2", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + ] + }, + "test_ipv4_ttls":{ + "enabled":"FALSE", + "command":"test_ipv4_ttls.py", + "args":"", + "args_list":[ + "--mgr LF_MGR_IP --radio 1.1.wiphy0 --upstream_port 1.1.eth2 ", + " use_ssid_idx=0 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + ] + }, "clean_up_cxs_endp_sta_l3_powersave":{ "enabled":"TRUE", "command":"lf_cleanup.py", From 679f4bf6b53aaf516713c283790b8a95b284092e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 14 Dec 2021 09:01:43 -0800 Subject: [PATCH 25/40] sta_connect: Fix create function Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 68 ++++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 6ae7a9c5..931db0e0 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -20,7 +20,9 @@ removeCX = LFUtils.removeCX removeEndps = LFUtils.removeEndps realm = importlib.import_module("py-json.realm") Realm = realm.Realm - +set_port = importlib.import_module("py-json.LANforge.set_port") +add_sta = importlib.import_module("py-json.LANforge.add_sta") +LFRequest = importlib.import_module("py-json.LANforge.LFRequest") OPEN = "open" WEP = "wep" WPA = "wpa" @@ -74,6 +76,12 @@ class StaConnect(Realm): self.cx_profile.port = self.port print(self.upstream_port) + self.desired_set_port_current_flags = ["if_down", "use_dhcp"] + self.desired_set_port_interest_flags = ["current_flags", "ifdown", "dhcp"] + + self.desired_add_sta_flags = ["wpa2_enable", "80211u_enable", "create_admin_down"] + self.desired_add_sta_flags_mask = ["wpa2_enable", "80211u_enable", "create_admin_down"] + def get_station_url(self, sta_name_=None): if sta_name_ is None: raise ValueError("get_station_url wants a station name") @@ -137,6 +145,26 @@ class StaConnect(Realm): return False return True + @staticmethod + def add_named_flags(desired_list, command_ref): + if desired_list is None: + raise ValueError("addNamedFlags wants a list of desired flag names") + if len(desired_list) < 1: + print("addNamedFlags: empty desired list") + return 0 + if (command_ref is None) or (len(command_ref) < 1): + raise ValueError("addNamedFlags wants a maps of flag values") + + result = 0 + for name in desired_list: + if (name is None) or (name == ""): + continue + if name not in command_ref: + raise ValueError("flag %s not in map" % name) + result += command_ref[name] + + return result + def setup(self): self.clear_test_results() self.check_connect() @@ -159,12 +187,6 @@ class StaConnect(Realm): # Create stations and turn dhcp on - flags = 0x10000 - if self.dut_security == WPA2: - flags += 0x400 - elif self.dut_security == OPEN: - pass - radio = LFUtils.name_to_eid(self.radio) add_sta_data = { @@ -175,7 +197,8 @@ class StaConnect(Realm): "key": self.dut_passwd, "mode": self.sta_mode, "mac": "xx:xx:xx:xx:*:xx", - "flags": flags # verbose, wpa2 + "flags": self.add_named_flags(self.desired_add_sta_flags, add_sta.add_sta_flags), # verbose, wpa2 + "flags_mask": self.add_named_flags(self.desired_add_sta_flags_mask, add_sta.add_sta_flags) } print("Adding new stations ", end="") for sta_name in self.station_names: @@ -184,26 +207,26 @@ class StaConnect(Realm): self.json_post("/cli-json/add_sta", add_sta_data, suppress_related_commands_=True) time.sleep(0.01) - LFUtils.wait_until_ports_appear(port_list=self.station_names) + set_port_data = {"shelf": 1, "resource": self.resource, + "current_flags": self.add_named_flags(self.desired_set_port_current_flags, + set_port.set_port_current_flags), + "interest": self.add_named_flags(self.desired_set_port_interest_flags, + set_port.set_port_interest_flags), + 'report_timer': 1500, 'suppress_preexec_cli': 'yes', + 'suppress_preexec_method': 1} - set_port_data = { - "shelf": 1, - "resource": self.resource, - "current_flags": 0x80000000, # use DHCP, not down - "interest": 0x4002 # set dhcp, current flags - } print("\nConfiguring ") for sta_name in self.station_names: set_port_data["port"] = sta_name print(" %s," % sta_name, end="") - self.json_post("/cli-json/set_port", set_port_data, suppress_related_commands_=True) + set_port_r = LFRequest.LFRequest(self.lfclient_url + "/cli-json/set_port") + set_port_r.addPostData(set_port_data) + set_port_r.jsonPost() + time.sleep(0.01) print("\nBringing ports up...") - data = {"shelf": 1, - "resource": self.resource, - "port": "ALL", - "probe_flags": 1} - self.json_post("/cli-json/nc_show_ports", data, suppress_related_commands_=True) + for port in self.station_names: + self.admin_up(port) LFUtils.waitUntilPortsAdminUp(self.resource, self.lfclient_url, self.station_names) # station_info = self.jsonGet(self.mgr_url, "%s?fields=port,ip,ap" % (self.getStaUrl())) @@ -246,7 +269,6 @@ class StaConnect(Realm): self.json_post("/cli-json/nc_show_ports", data, suppress_related_commands_=True) # make a copy of the connected stations for test records - for sta_name in self.station_names: sta_url = self.get_station_url(sta_name) station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") @@ -377,7 +399,7 @@ class StaConnect(Realm): } self.json_post("/cli-json/set_cx_report_timer", data, suppress_related_commands_=True) - self.wait_until_endps_appear(self.cx_names) + self.wait_until_cxs_appear(self.cx_names) return True def start(self): From e724113a5f5e5625b0a8007374c9a0169a4af67a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 14 Dec 2021 09:02:00 -0800 Subject: [PATCH 26/40] regression_test: Test sta_connect2.py Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 9a597500..4beb2c21 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -350,6 +350,7 @@ else #./sta_connect_bssid_mac.py "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" "./sta_connect.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" + "./sta_connect2.py --dest $MGR --dut_ssid $SSID_USED --dut_passwd $PASSWD_USED --dut_security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM " "./sta_scan_test.py --ssid $SSID_USED --security $SECURITY --passwd $PASSWD_USED --radio $RADIO_USED" #station_layer3.py #stations_connected.py From 4bba61d9e92564fe451eefcf0d6891a4753cace7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 14 Dec 2021 10:26:26 -0800 Subject: [PATCH 27/40] regression_test: Print ERROR in status column if stations could not acquire IPs Signed-off-by: Matthew Stidham --- py-scripts/eth_check.py | 0 py-scripts/regression_test.sh | 4 ++++ 2 files changed, 4 insertions(+) create mode 100644 py-scripts/eth_check.py diff --git a/py-scripts/eth_check.py b/py-scripts/eth_check.py new file mode 100644 index 00000000..e69de29b diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 4beb2c21..16472d19 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -555,6 +555,10 @@ function test() { then TEXTCLASS="partial_failure" TDTEXT="Partial Failure" + elif [[ $TEXT =~ "FAILED" ]] + then + TEXTCLASS="partial_failure" + TDTEXT="ERROR" else TEXTCLASS="success" TDTEXT="Success" From c7ea081bd199e42fea138be1c3887513b9711d0b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 14 Dec 2021 10:28:36 -0800 Subject: [PATCH 28/40] regression_test: Better command line echoing Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 16472d19..95663a61 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -555,23 +555,23 @@ function test() { then TEXTCLASS="partial_failure" TDTEXT="Partial Failure" + echo "Partial Failure" elif [[ $TEXT =~ "FAILED" ]] then TEXTCLASS="partial_failure" TDTEXT="ERROR" + echo "ERROR" else TEXTCLASS="success" TDTEXT="Success" + echo "No errors detected" fi if (( FILESIZE > 0)) then - echo "Errors detected" TEXTCLASS="failure" TDTEXT="Failure" STDERR="STDERR" - else - echo "No errors detected" fi results+=("${CURR_TEST_NAME} ${testcommand} From 40a9a68981702a535a47edaaed2d59b1f70827da Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 14 Dec 2021 11:43:20 -0800 Subject: [PATCH 29/40] regression_test: more debug Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 95663a61..fc039a2b 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -348,10 +348,10 @@ else "./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test Dataplane --test_profile http --cv_scenario ct-us-001" #scenario.py #./sta_connect_bssid_mac.py - "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" - "./sta_connect.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" - "./sta_connect2.py --dest $MGR --dut_ssid $SSID_USED --dut_passwd $PASSWD_USED --dut_security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM " - "./sta_scan_test.py --ssid $SSID_USED --security $SECURITY --passwd $PASSWD_USED --radio $RADIO_USED" + "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s --debug" + "./sta_connect.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s --debug" + "./sta_connect2.py --dest $MGR --dut_ssid $SSID_USED --dut_passwd $PASSWD_USED --dut_security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM" + "./sta_scan_test.py --ssid $SSID_USED --security $SECURITY --passwd $PASSWD_USED --radio $RADIO_USED --debug" #station_layer3.py #stations_connected.py #"./test_1k_clients_jedtest.py From 289a41325ba1fbd55800ddebbf75a1f3b8163fbd Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Thu, 9 Dec 2021 13:19:15 -0800 Subject: [PATCH 30/40] lf_webpage.py: line length fixes for pep8 compliance --- py-scripts/lf_webpage.py | 74 +++++++++++++++------------------------- 1 file changed, 28 insertions(+), 46 deletions(-) diff --git a/py-scripts/lf_webpage.py b/py-scripts/lf_webpage.py index 32f80daf..49adce69 100755 --- a/py-scripts/lf_webpage.py +++ b/py-scripts/lf_webpage.py @@ -1,13 +1,11 @@ #!/usr/bin/env python3 -""" -This script will create 40 clients on 5Ghz , 2.4Ghz and Both and generate layer4 traffic on LANforge ,The Webpage Download Test is designed to test the performance of the Access Point.The goal is to check whether the -webpage loading time meets the expectation when clients connected on single radio as well as dual radio. +"""This script will create 40 clients on 5Ghz , 2.4Ghz and Both and generate layer4 traffic on LANforge ,The Webpage +Download Test is designed to test the performance of the Access Point.The goal is to check whether the webpage +loading time meets the expectation when clients connected on single radio as well as dual radio. -how to run - -python3 lf_webpage.py --mgr 192.168.200.29 --mgr_port 8080 --upstream_port eth1 --num_stations 10 --security open --ssid testap210 --passwd [BLANK] --target_per_ten 1 --bands 5G --file_size 10MB --fiveg_radio wiphy0 --twog_radio wiphy1 --duration 1 -Copyright 2021 Candela Technologies Inc -04 - April - 2021 -""" +how to run - python3 lf_webpage.py --mgr 192.168.200.29 --mgr_port 8080 --upstream_port eth1 --num_stations 10 +--security open --ssid testap210 --passwd [BLANK] --target_per_ten 1 --bands 5G --file_size 10MB --fiveg_radio +wiphy0 --twog_radio wiphy1 --duration 1 Copyright 2021 Candela Technologies Inc 04 - April - 2021 """ import sys import os import importlib @@ -53,7 +51,7 @@ class HttpDownload(Realm): self.station_profile = self.local_realm.new_station_profile() self.http_profile = self.local_realm.new_http_profile() self.http_profile.requests_per_ten = self.target_per_ten - #self.http_profile.url = self.url + # self.http_profile.url = self.url self.port_util = PortUtils(self.local_realm) self.http_profile.debug = _debug_on self.created_cx = {} @@ -490,47 +488,33 @@ class HttpDownload(Realm): # # report.test_setup_table(value="Device under test", test_setup_data=test_setup_info) # - # report.set_obj_html("Objective", - # "The Webpage Download Test is designed to test the performance of the Access Point.The goal is to check whether the webpage loading time of all the " + str( - # num_stations) + " clients which are downloading at the same time meets the expectation when clients connected on single radio as well as dual radio") - # report.build_objective() - # report.set_obj_html("Download Time Graph", - # "The below graph provides information about the download time taken by each client to download webpage for test duration of " + str( - # duration) + " min") - # report.build_objective() - # graph = self.generate_graph(dataset=dataset, lis=lis, bands=bands) - # report.set_graph_image(graph) - # report.set_csv_filename(graph) - # report.move_csv_file() - # report.move_graph_image() - # report.build_graph() - # report.set_obj_html("Download Rate Graph", - # "The below graph provides information about the download rate in Mbps of each client to download the webpage for test duration of " + str( - # duration) + " min") - # report.build_objective() - # graph2 = self.graph_2(dataset2, lis=lis, bands=bands) - # print("graph name {}".format(graph2)) - # report.set_graph_image(graph2) - # report.set_csv_filename(graph2) - # report.move_csv_file() - # report.move_graph_image() - # report.build_graph() - # report.set_obj_html("Summary Table Description", - # "This Table shows you the summary result of Webpage Download Test as PASS or FAIL criteria. If the average time taken by " + str( - # num_stations) + " clients to access the webpage is less than " + str( - # threshold_2g) + "s it's a PASS criteria for 2.4 ghz clients, If the average time taken by " + "" + str( - # num_stations) + " clients to access the webpage is less than " + str( - # threshold_5g) + "s it's a PASS criteria for 5 ghz clients and If the average time taken by " + str( - # num_stations) + " clients to access the webpage is less than " + str( - # threshold_both) + "s it's a PASS criteria for 2.4 ghz and 5ghz clients") + # report.set_obj_html("Objective", "The Webpage Download Test is designed to test the performance of the + # Access Point.The goal is to check whether the webpage loading time of all the " + str( num_stations) + " + # clients which are downloading at the same time meets the expectation when clients connected on single radio + # as well as dual radio") report.build_objective() report.set_obj_html("Download Time Graph", "The below + # graph provides information about the download time taken by each client to download webpage for test + # duration of " + str( duration) + " min") report.build_objective() graph = self.generate_graph( + # dataset=dataset, lis=lis, bands=bands) report.set_graph_image(graph) report.set_csv_filename(graph) + # report.move_csv_file() report.move_graph_image() report.build_graph() report.set_obj_html("Download Rate + # Graph", "The below graph provides information about the download rate in Mbps of each client to download + # the webpage for test duration of " + str( duration) + " min") report.build_objective() graph2 = + # self.graph_2(dataset2, lis=lis, bands=bands) print("graph name {}".format(graph2)) report.set_graph_image( + # graph2) report.set_csv_filename(graph2) report.move_csv_file() report.move_graph_image() + # report.build_graph() report.set_obj_html("Summary Table Description", "This Table shows you the summary + # result of Webpage Download Test as PASS or FAIL criteria. If the average time taken by " + str( + # num_stations) + " clients to access the webpage is less than " + str( threshold_2g) + "s it's a PASS + # criteria for 2.4 ghz clients, If the average time taken by " + "" + str( num_stations) + " clients to + # access the webpage is less than " + str( threshold_5g) + "s it's a PASS criteria for 5 ghz clients and If + # the average time taken by " + str( num_stations) + " clients to access the webpage is less than " + str( + # threshold_both) + "s it's a PASS criteria for 2.4 ghz and 5ghz clients") # # report.build_objective() # test_setup1 = pd.DataFrame(summary_table_value) # report.set_table_dataframe(test_setup1) # report.build_table() # - # report.set_obj_html("Download Time Table Description", - # "This Table will provide you information of the minimum, maximum and the average time taken by clients to download a webpage in seconds") + # report.set_obj_html("Download Time Table Description", "This Table will provide you information of the + # minimum, maximum and the average time taken by clients to download a webpage in seconds") # # report.build_objective() x = [] @@ -682,7 +666,6 @@ def main(): parser.add_argument("--test_id", default="lf_webpage", help="test-id for kpi.csv, script or test name") parser.add_argument('--csv_outfile', help="--csv_outfile ", default="") - args = parser.parse_args() test_time = datetime.now() test_time = test_time.strftime("%b %d %H:%M:%S") @@ -853,6 +836,5 @@ def main(): test_input_infor=test_input_infor, csv_outfile=args.csv_outfile) - if __name__ == '__main__': main() From 77c80f7cc757729f34a51c2c2023c1e5fe924ef3 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Tue, 14 Dec 2021 11:49:41 -0800 Subject: [PATCH 31/40] test_l3_powersave_traffic.py: Added command line arguments for choosing radios to use in station and monitor creation --- py-scripts/test_l3_powersave_traffic.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/py-scripts/test_l3_powersave_traffic.py b/py-scripts/test_l3_powersave_traffic.py index 88b87f27..4864b675 100755 --- a/py-scripts/test_l3_powersave_traffic.py +++ b/py-scripts/test_l3_powersave_traffic.py @@ -26,6 +26,7 @@ class L3PowersaveTraffic(LFCliBase): def __init__(self, host, port, ssid, security, password, station_list, side_a_min_rate=56, side_b_min_rate=56, side_a_max_rate=0, side_b_max_rate=0, pdu_size=1000, prefix="00000", test_duration="5m", + station_radio="wiphy0", monitor_radio="wiphy1", _debug_on=False, _exit_on_error=False, _exit_on_fail=False): super().__init__(host, port, _debug=_debug_on, _exit_on_fail=_exit_on_fail) self.host = host @@ -35,6 +36,8 @@ class L3PowersaveTraffic(LFCliBase): self.password = password self.sta_list = station_list self.prefix = prefix + self.station_radio = station_radio + self.monitor_radio = monitor_radio self.debug = _debug_on self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=False) # upload @@ -69,8 +72,8 @@ class L3PowersaveTraffic(LFCliBase): # channel = self.json_get("/port/1/%s/%s/"%(1,"wiphy0")) # rint("The channel name is...") - self.new_monitor.create(resource_=1, channel=149, radio_="wiphy1", name_="moni0") - self.station_profile.create(radio="wiphy0", sta_names_=self.sta_list, debug=False) + self.new_monitor.create(resource_=1, channel=149, radio_=self.monitor_radio, name_="moni0") + self.station_profile.create(radio=self.station_radio, sta_names_=self.sta_list, debug=False) # station_channel = self.json_get("/port/1/%s/%s") # pprint.pprint(station_channel) @@ -165,6 +168,8 @@ def main(): description='''\ Example of creating traffic on an l3 connection ''') + + parser.add_argument('--monitor_radio', help="--monitor_radio radio to be used in monitor creation", default="wiphy1") args = parser.parse_args() lfjson_host = args.mgr @@ -172,9 +177,9 @@ Example of creating traffic on an l3 connection station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=4, padding_number_=10000) ip_powersave_test = L3PowersaveTraffic(lfjson_host, lfjson_port, ssid=args.ssid, security=args.security, password=args.passwd, station_list=station_list, side_a_min_rate=2000, - side_b_min_rate=2000, side_a_max_rate=0, - side_b_max_rate=0, prefix="00000", test_duration="30s", - _debug_on=False, _exit_on_error=True, _exit_on_fail=True) + side_b_min_rate=2000, side_a_max_rate=0, station_radio=args.radio, + monitor_radio=args.monitor_radio, side_b_max_rate=0, prefix="00000", + test_duration="30s", _debug_on=False, _exit_on_error=True, _exit_on_fail=True) ip_powersave_test.cleanup() ip_powersave_test.build() ip_powersave_test.start() From 330eeabf8f94fa3c67e6da5c93812a14761dee4f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 14 Dec 2021 15:12:03 -0800 Subject: [PATCH 32/40] sta_connect and sta_connect_example: Improve port removal logic Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 9 +++++---- py-scripts/sta_connect_example.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 931db0e0..6f882de5 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -182,8 +182,8 @@ class StaConnect(Realm): if response is not None: if response["interface"] is not None: print("removing old station") - LFUtils.removePort(self.resource, sta_name, self.lfclient_url, debug=False) - LFUtils.waitUntilPortsDisappear(self.resource, self.lfclient_url, self.station_names) + self.rm_port(sta_name) + self.wait_until_ports_disappear(self.station_names) # Create stations and turn dhcp on @@ -477,9 +477,10 @@ class StaConnect(Realm): def cleanup(self): for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url, debug=False) + self.rm_port(sta_name) endp_names = [] - removeCX(self.lfclient_url, self.cx_names.keys()) + for cx in self.cx_names.keys(): + self.rm_cx(cx) for cx_name in self.cx_names: endp_names.append(self.cx_names[cx_name]["a"]) endp_names.append(self.cx_names[cx_name]["b"]) diff --git a/py-scripts/sta_connect_example.py b/py-scripts/sta_connect_example.py index 4831fc4b..68621f83 100755 --- a/py-scripts/sta_connect_example.py +++ b/py-scripts/sta_connect_example.py @@ -53,7 +53,7 @@ def main(): staConnect.station_names = ["sta000"] staConnect.setup() staConnect.start() - time.sleep(20) + staConnect.run() staConnect.stop() # staConnect.finish() staConnect.cleanup() From 638894a27736fd717001caa3c13971e4b7e3fd2b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 14 Dec 2021 16:18:05 -0800 Subject: [PATCH 33/40] sta_connect.py: Don't spout an error if trying to remove a station which doesn't exist Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 6f882de5..1cb18fa9 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -182,7 +182,8 @@ class StaConnect(Realm): if response is not None: if response["interface"] is not None: print("removing old station") - self.rm_port(sta_name) + if self.port_exists(sta_name): + self.rm_port(sta_name) self.wait_until_ports_disappear(self.station_names) # Create stations and turn dhcp on From ca2dfeeda18314dc3ea742af176cda1c9735b17a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 15 Dec 2021 07:29:09 -0700 Subject: [PATCH 34/40] test_l3_powersave_traffic.py : updated for single interface, ct_us_scripts.json updated scripts to test Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_powersave_traffic.py | 21 +++++++++++++++------ py-scripts/tools/ct_us_scripts.json | 6 ++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/py-scripts/test_l3_powersave_traffic.py b/py-scripts/test_l3_powersave_traffic.py index 4864b675..3ed3b337 100755 --- a/py-scripts/test_l3_powersave_traffic.py +++ b/py-scripts/test_l3_powersave_traffic.py @@ -130,11 +130,19 @@ class L3PowersaveTraffic(LFCliBase): temp.append(self.local_realm.name_to_eid(station)[2]) port_info = self.json_get("port/1/1/%s?fields=alias,ap,mac" % ','.join(temp)) if port_info is not None: - for item in port_info['interfaces']: - for k, v in item.items(): - print("sta_name %s" % v['alias']) - print("mac %s" % v['mac']) - print("ap %s\n" % v['ap']) + if 'interfaces' in port_info: + for item in port_info['interfaces']: + for k, v in item.items(): + print("sta_name %s" % v['alias']) + print("mac %s" % v['mac']) + print("ap %s\n" % v['ap']) + elif 'interface' in port_info: + print("sta_name %s" % port_info['interface']['alias']) + print("mac %s" % port_info['interface']['mac']) + print("ap %s\n" % port_info['interface']['ap']) + else: + print('interfaces and interface not in port_mgr_response') + exit(1) while cur_time < end_time: # DOUBLE CHECK @@ -158,6 +166,7 @@ class L3PowersaveTraffic(LFCliBase): def main(): + # Realm.create_basic_argparse defined in lanforge-scripts/py-json/LANforge/lfcli_base.py parser = Realm.create_basic_argparse( prog='test_l3_powersave_traffic.py', formatter_class=argparse.RawTextHelpFormatter, @@ -174,7 +183,7 @@ Example of creating traffic on an l3 connection lfjson_host = args.mgr lfjson_port = 8080 - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=4, padding_number_=10000) + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=0, padding_number_=10000) ip_powersave_test = L3PowersaveTraffic(lfjson_host, lfjson_port, ssid=args.ssid, security=args.security, password=args.passwd, station_list=station_list, side_a_min_rate=2000, side_b_min_rate=2000, side_a_max_rate=0, station_radio=args.radio, diff --git a/py-scripts/tools/ct_us_scripts.json b/py-scripts/tools/ct_us_scripts.json index d405df09..52625e9d 100644 --- a/py-scripts/tools/ct_us_scripts.json +++ b/py-scripts/tools/ct_us_scripts.json @@ -549,7 +549,9 @@ " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", " --traffic_type lf_tcp", " --ipv6", - " --debug"]}, + " --debug" + ] + }, "create_bridge":{ "enabled":"TRUE", "command":"create_bridge.py", @@ -606,7 +608,7 @@ "command":"test_l3_powersave_traffic.py", "args":"", "args_list":[ - "--mgr LF_MGR_IP --radio 1.1.wiphy0 ", + "--mgr LF_MGR_IP --radio 1.1.wiphy4 --monitor_radio 1.1.wiphy6 --upstream_port UPSTREAM_PORT", " use_ssid_idx=0 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " ] }, From 64774a4cd049125af06cf31e98b389bf2da834e6 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 15 Dec 2021 08:48:53 -0700 Subject: [PATCH 35/40] ct_us_XXX_rig.json added candela email. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_rig.json | 2 +- py-scripts/tools/ct_us_002_rig.json | 2 +- py-scripts/tools/ct_us_003_rig.json | 2 +- py-scripts/tools/ct_us_004_rig.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/tools/ct_us_001_rig.json b/py-scripts/tools/ct_us_001_rig.json index 125b8454..51e9bba9 100644 --- a/py-scripts/tools/ct_us_001_rig.json +++ b/py-scripts/tools/ct_us_001_rig.json @@ -15,7 +15,7 @@ "LF_MGR_PASS": "lanforge", "UPSTREAM_PORT":"1.1.eth2", "TEST_TIMEOUT": 600, - "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", + "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,scott.wedge@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-001", "EMAIL_TXT": "Lanforge QA Testing CT-US-001 " diff --git a/py-scripts/tools/ct_us_002_rig.json b/py-scripts/tools/ct_us_002_rig.json index 2f6b8651..7be43276 100644 --- a/py-scripts/tools/ct_us_002_rig.json +++ b/py-scripts/tools/ct_us_002_rig.json @@ -15,7 +15,7 @@ "LF_MGR_PASS": "lanforge", "UPSTREAM_PORT": "1.1.eth2", "TEST_TIMEOUT": 600, - "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", + "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,scott.wedge@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-002", "EMAIL_TXT": "Lanforge QA Testing CT-US-002" diff --git a/py-scripts/tools/ct_us_003_rig.json b/py-scripts/tools/ct_us_003_rig.json index e5683a1e..cc51dff9 100644 --- a/py-scripts/tools/ct_us_003_rig.json +++ b/py-scripts/tools/ct_us_003_rig.json @@ -15,7 +15,7 @@ "LF_MGR_PASS": "lanforge", "UPSTREAM_PORT":"1.1.eth1", "TEST_TIMEOUT": 600, - "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", + "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,jreynolds@candelatech.com,scott.wedge@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-003", "EMAIL_TXT": "Lanforge QA Testing CT-US-003" diff --git a/py-scripts/tools/ct_us_004_rig.json b/py-scripts/tools/ct_us_004_rig.json index 304427d7..97157d43 100644 --- a/py-scripts/tools/ct_us_004_rig.json +++ b/py-scripts/tools/ct_us_004_rig.json @@ -15,7 +15,7 @@ "LF_MGR_PASS": "lanforge", "UPSTREAM_PORT": "1.1.eth2", "TEST_TIMEOUT": 300, - "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", + "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,scott.wedge@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-004", "EMAIL_TXT": "Lanforge QA Testing CT-US-004 " From 7e0563ac2180370b0060baa9c03109a951aa1b05 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 15 Dec 2021 09:57:10 -0700 Subject: [PATCH 36/40] ct_us_scripts.json : changed suite_scipte_r to suite_scripts Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_scripts.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_scripts.json b/py-scripts/tools/ct_us_scripts.json index 52625e9d..3460dd24 100644 --- a/py-scripts/tools/ct_us_scripts.json +++ b/py-scripts/tools/ct_us_scripts.json @@ -213,7 +213,7 @@ ] } }, - "suite_scripts_r":{ + "suite_scripts":{ "lf_help_check":{ "enabled":"TRUE", "load_db":"skip", From 2852c5e5939721615c85fdcf8a934dcf87741efb Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 15 Dec 2021 09:48:44 -0800 Subject: [PATCH 37/40] test_ipv4_ttls: cleanup stations upon creation and at end of program Signed-off-by: Matthew Stidham --- py-scripts/test_ipv4_ttls.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/py-scripts/test_ipv4_ttls.py b/py-scripts/test_ipv4_ttls.py index 45a25aa6..cefa4ad4 100755 --- a/py-scripts/test_ipv4_ttls.py +++ b/py-scripts/test_ipv4_ttls.py @@ -277,6 +277,13 @@ class TTLSTest(Realm): LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=sta_list, debug=self.debug) + def pre_cleanup(self): + self.cx_profile.cleanup_prefix() + # do not clean up station if existed prior to test + if not self.use_existing_sta: + for sta in self.sta_list: + self.rm_port(sta, check_exists=True, debug_=False) + def collect_endp_stats(self, endp_map, traffic_type="TCP"): print("Collecting Data") fields = "?fields=name,tx+bytes,rx+bytes" @@ -382,6 +389,7 @@ test_ipv4_ttls.py: enable_pkc=args.enable_pkc, ) ttls_test.cleanup(station_list) + ttls_test.pre_cleanup() ttls_test.build() if not ttls_test.passes(): print(ttls_test.get_fail_message()) @@ -393,6 +401,7 @@ test_ipv4_ttls.py: exit(1) time.sleep(30) ttls_test.cleanup(station_list) + ttls_test.pre_cleanup() if ttls_test.passes(): print("Full test passed, all stations associated and got IP") From 0426c3b0a561eaf2db1519ab17745eedcb9d3ceb Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 15 Dec 2021 09:50:36 -0800 Subject: [PATCH 38/40] sta_connect2: Cleanup pre-existing stations when test starts Signed-off-by: Matthew Stidham --- py-scripts/sta_connect2.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index 08cb9836..935aaffb 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -390,6 +390,12 @@ class StaConnect2(LFCliBase): curr_endp_names.append(endp_names[1]) removeEndps(self.lfclient_url, curr_endp_names, debug=self.debug) + def pre_cleanup(self): + self.cx_profile.cleanup_prefix() + # do not clean up station if existed prior to test + if not self.use_existing_sta: + for sta in self.sta_list: + self.rm_port(sta, check_exists=True, debug_=False) # ~class @@ -475,7 +481,7 @@ Example: staConnect.station_names = ["%s0000" % args.prefix] staConnect.bringup_time_sec = args.bringup_time - # staConnect.cleanup() + staConnect.pre_cleanup() staConnect.setup() staConnect.start() print("napping %f sec" % staConnect.runtime_secs) @@ -490,7 +496,7 @@ Example: print("PASS: All tests pass") print(staConnect.get_all_message()) - staConnect.cleanup() + staConnect.pre_cleanup() # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 92bdf1c44f76762a7db64f65ac66b46e9ec2ba56 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 15 Dec 2021 10:00:38 -0800 Subject: [PATCH 39/40] sta_connect2: Update logic to be in line with the rest of the library Signed-off-by: Matthew Stidham --- py-scripts/eth_check.py | 0 py-scripts/sta_connect2.py | 36 ++++++++++++++++++++---------------- 2 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 py-scripts/eth_check.py diff --git a/py-scripts/eth_check.py b/py-scripts/eth_check.py deleted file mode 100644 index e69de29b..00000000 diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index 935aaffb..390c6e52 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -35,7 +35,7 @@ WPA3 = "wpa3" MODE_AUTO = 0 -class StaConnect2(LFCliBase): +class StaConnect2(Realm): def __init__(self, host, port, _dut_ssid="jedway-open-1", _dut_passwd="NA", _dut_bssid="", _user="", _passwd="", _sta_mode="0", _radio="wiphy0", _influx_host=None, _influx_db=None, _influx_user=None, @@ -47,7 +47,9 @@ class StaConnect2(LFCliBase): # do not use `super(LFCLiBase,self).__init__(self, host, port, _debugOn) # that is py2 era syntax and will force self into the host variable, making you # very confused. - super().__init__(host, port, _debug=debug_, _exit_on_fail=_exit_on_fail) + super().__init__(host, port, debug_=debug_, _exit_on_fail=_exit_on_fail) + self.host = host + self.port = port self.debug = debug_ self.dut_security = _dut_security self.dut_ssid = _dut_ssid @@ -70,8 +72,6 @@ class StaConnect2(LFCliBase): self.station_names = [_sta_name] self.sta_prefix = _sta_prefix self.bringup_time_sec = _bringup_time_sec - # self.localrealm :Realm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 - self.localrealm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 self.resulting_stations = {} self.resulting_endpoints = {} self.station_profile = None @@ -81,10 +81,14 @@ class StaConnect2(LFCliBase): self.influx_db = _influx_db self.influx_user = _influx_user self.influx_passwd = _influx_passwd + self.name_prefix = "tcp" + self.use_existing_sta = False + + self.cx_profile = self.new_l3_cx_profile() + self.cx_profile.host = self.host + self.cx_profile.port = self.port + self.cx_profile.name_prefix = self.name_prefix - # def get_realm(self) -> Realm: # py > 3.6 - def get_realm(self): - return self.localrealm def get_station_url(self, sta_name_=None): if sta_name_ is None: @@ -116,7 +120,7 @@ class StaConnect2(LFCliBase): counter = 0 # print("there are %d results" % len(self.station_results)) fields = "_links,port,alias,ip,ap,port+type" - self.station_results = self.localrealm.find_ports_like("%s*" % self.sta_prefix, fields, debug_=False) + self.station_results = self.find_ports_like("%s*" % self.sta_prefix, fields, debug_=False) if (self.station_results is None) or (len(self.station_results) < 1): self.get_failed_result_list() for eid, record in self.station_results.items(): @@ -154,7 +158,7 @@ class StaConnect2(LFCliBase): # remove old stations if self.clean_all_sta: print("Removing all stations on resource.") - self.localrealm.remove_all_stations(self.resource) + self.remove_all_stations(self.resource) else: print("Removing old stations to be created by this test.") for sta_name in self.station_names: @@ -166,7 +170,7 @@ class StaConnect2(LFCliBase): LFUtils.wait_until_ports_disappear(self.lfclient_url, self.station_names) # Create stations and turn dhcp on - self.station_profile = self.localrealm.new_station_profile() + self.station_profile = self.new_station_profile() if self.dut_security == WPA2: self.station_profile.use_security(security_type="wpa2", ssid=self.dut_ssid, passwd=self.dut_passwd) @@ -187,14 +191,14 @@ class StaConnect2(LFCliBase): LFUtils.wait_until_ports_appear(self.lfclient_url, self.station_names, debug=self.debug) # Create UDP endpoints - self.l3_udp_profile = self.localrealm.new_l3_cx_profile() + self.l3_udp_profile = self.new_l3_cx_profile() self.l3_udp_profile.side_a_min_bps = 128000 self.l3_udp_profile.side_b_min_bps = 128000 self.l3_udp_profile.side_a_min_pdu = 1200 self.l3_udp_profile.side_b_min_pdu = 1500 self.l3_udp_profile.report_timer = 1000 self.l3_udp_profile.name_prefix = "udp" - port_list = list(self.localrealm.find_ports_like("%s+" % self.sta_prefix)) + port_list = list(self.find_ports_like("%s+" % self.sta_prefix)) if (port_list is None) or (len(port_list) < 1): raise ValueError("Unable to find ports named '%s'+" % self.sta_prefix) self.l3_udp_profile.create(endp_type="lf_udp", @@ -203,13 +207,13 @@ class StaConnect2(LFCliBase): suppress_related_commands=True) # Create TCP endpoints - self.l3_tcp_profile = self.localrealm.new_l3_cx_profile() + self.l3_tcp_profile = self.new_l3_cx_profile() self.l3_tcp_profile.side_a_min_bps = 128000 self.l3_tcp_profile.side_b_min_bps = 56000 - self.l3_tcp_profile.name_prefix = "tcp" + self.l3_tcp_profile.name_prefix = self.name_prefix self.l3_tcp_profile.report_timer = 1000 self.l3_tcp_profile.create(endp_type="lf_tcp", - side_a=list(self.localrealm.find_ports_like("%s+" % self.sta_prefix)), + side_a=list(self.find_ports_like("%s+" % self.sta_prefix)), side_b="%d.%s" % (self.resource, self.upstream_port), suppress_related_commands=True) @@ -394,7 +398,7 @@ class StaConnect2(LFCliBase): self.cx_profile.cleanup_prefix() # do not clean up station if existed prior to test if not self.use_existing_sta: - for sta in self.sta_list: + for sta in self.station_names: self.rm_port(sta, check_exists=True, debug_=False) # ~class From 49840e0802522ba1ac761cbb9d8913c506b3c5b8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 15 Dec 2021 10:01:45 -0800 Subject: [PATCH 40/40] sta_connect2: Remove unused imports Signed-off-by: Matthew Stidham --- py-scripts/sta_connect2.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index 390c6e52..232b59a0 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -20,8 +20,6 @@ sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") removeCX = LFUtils.removeCX removeEndps = LFUtils.removeEndps -lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") -LFCliBase = lfcli_base.LFCliBase realm = importlib.import_module("py-json.realm") Realm = realm.Realm influx = importlib.import_module("py-scripts.influx_utils")