From 9475269b7b227efe75cce92eb41f258c5026c5da Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 15 Dec 2021 10:12:18 -0800 Subject: [PATCH 01/29] test_fileio: Import from realm, don't use local_realm, it just adds unnecessary imports Signed-off-by: Matthew Stidham --- py-scripts/test_fileio.py | 40 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/py-scripts/test_fileio.py b/py-scripts/test_fileio.py index df754a8b..392f8893 100755 --- a/py-scripts/test_fileio.py +++ b/py-scripts/test_fileio.py @@ -39,8 +39,6 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) -lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") -LFCliBase = lfcli_base.LFCliBase LFUtils = importlib.import_module("py-json.LANforge.LFUtils") add_file_endp = importlib.import_module("py-json.LANforge.add_file_endp") fe_fstype = add_file_endp.fe_fstype @@ -48,7 +46,7 @@ realm = importlib.import_module("py-json.realm") Realm = realm.Realm -class FileIOTest(LFCliBase): +class FileIOTest(Realm): def __init__(self, host, port, ssid, security, password, number_template="00000", radio="wiphy0", @@ -83,7 +81,7 @@ class FileIOTest(LFCliBase): _debug_on=False, _exit_on_error=False, _exit_on_fail=False): - super().__init__(host, port, _debug=_debug_on, _exit_on_fail=_exit_on_fail) + super().__init__(host, port, debug_=_debug_on, _exit_on_fail=_exit_on_fail) if port_list is None: port_list = [] if update_group_args is None: @@ -140,12 +138,11 @@ class FileIOTest(LFCliBase): # self.min_write_rate_bps = self.parse_size_bps(min_write_rate_bps) # self.max_write_rate_bps = self.parse_size_bps(max_write_rate_bps) - self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port) - self.wo_profile = self.local_realm.new_fio_endp_profile() - self.mvlan_profile = self.local_realm.new_mvlan_profile() + self.wo_profile = self.new_fio_endp_profile() + self.mvlan_profile = self.new_mvlan_profile() if not self.use_macvlans and len(self.port_list) > 0: - self.station_profile = self.local_realm.new_station_profile() + self.station_profile = self.new_station_profile() self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = self.ssid self.station_profile.ssid_pass = self.password @@ -181,14 +178,14 @@ class FileIOTest(LFCliBase): if self.use_test_groups: if self.mode is not None: if self.mode == "write": - self.wo_tg_profile = self.local_realm.new_test_group_profile() + self.wo_tg_profile = self.new_test_group_profile() self.wo_tg_profile.group_name = self.write_only_test_group elif self.mode == "read": - self.ro_tg_profile = self.local_realm.new_test_group_profile() + self.ro_tg_profile = self.new_test_group_profile() self.ro_tg_profile.group_name = self.read_only_test_group elif self.mode == "both": - self.wo_tg_profile = self.local_realm.new_test_group_profile() - self.ro_tg_profile = self.local_realm.new_test_group_profile() + self.wo_tg_profile = self.new_test_group_profile() + self.ro_tg_profile = self.new_test_group_profile() self.wo_tg_profile.group_name = self.write_only_test_group self.ro_tg_profile.group_name = self.read_only_test_group else: @@ -197,7 +194,7 @@ class FileIOTest(LFCliBase): raise ValueError("Mode ( read, write, or both ) must be specified") if update_group_args is not None and update_group_args['name'] is not None: - temp_tg = self.local_realm.new_test_group_profile() + temp_tg = self.new_test_group_profile() temp_cxs = update_group_args['cxs'].split(',') if update_group_args['action'] == "add": temp_tg.group_name = update_group_args['name'] @@ -291,7 +288,7 @@ class FileIOTest(LFCliBase): for i in cx_list: for item, value in i.items(): # print(item, value) - cx_map[self.local_realm.name_to_eid(item)[2]] = {"read-bps": value['read-bps'], + cx_map[self.name_to_eid(item)[2]] = {"read-bps": value['read-bps'], "write-bps": value['write-bps']} # print(cx_map) return cx_map @@ -319,9 +316,9 @@ class FileIOTest(LFCliBase): for num_port in range(len(self.port_list)): if self.ip_list[num_port] != 0: if self.gateway is not None and self.netmask is not None: - shelf = self.local_realm.name_to_eid(self.port_list[num_port])[0] - resource = self.local_realm.name_to_eid(self.port_list[num_port])[1] - port = self.local_realm.name_to_eid(self.port_list[num_port])[2] + shelf = self.name_to_eid(self.port_list[num_port])[0] + resource = self.name_to_eid(self.port_list[num_port])[1] + port = self.name_to_eid(self.port_list[num_port])[2] req_url = "/cli-json/set_port" data = { "shelf": shelf, @@ -331,7 +328,7 @@ class FileIOTest(LFCliBase): "netmask": self.netmask, "gateway": self.gateway } - self.local_realm.json_post(req_url, data) + self.json_post(req_url, data) self.created_ports.append("%s.%s.%s" % (shelf, resource, port)) else: raise ValueError("Netmask and gateway must be specified") @@ -462,18 +459,17 @@ class FileIOTest(LFCliBase): def start(self, print_pass=False, print_fail=False): temp_ports = self.created_ports.copy() - # temp_stas.append(self.local_realm.name_to_eid(self.upstream_port)[2]) if not self.use_macvlans: self.station_profile.admin_up() else: self.mvlan_profile.admin_up() - if self.local_realm.wait_for_ip(temp_ports, debug=self.debug): + if self.wait_for_ip(temp_ports, debug=self.debug): self._pass("All ports got IPs", print_pass) else: self._fail("Ports failed to get IPs", print_fail) cur_time = datetime.datetime.now() # print("Got Values") - end_time = self.local_realm.parse_time(self.test_duration) + cur_time + end_time = self.parse_time(self.test_duration) + cur_time if self.use_test_groups: if self.mode == "write": self.wo_tg_profile.start_group() @@ -590,7 +586,7 @@ class FileIOTest(LFCliBase): def main(): - parser = LFCliBase.create_bare_argparse( + parser = Realm.create_bare_argparse( prog='test_fileio.py', # formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawTextHelpFormatter, From 9d85bd8b8abcca073ceb3c7e77be135b7a0400c3 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 15 Dec 2021 10:14:01 -0800 Subject: [PATCH 02/29] test_fileio: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/test_fileio.py | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/py-scripts/test_fileio.py b/py-scripts/test_fileio.py index 392f8893..7810de17 100755 --- a/py-scripts/test_fileio.py +++ b/py-scripts/test_fileio.py @@ -129,15 +129,6 @@ class FileIOTest(Realm): raise ValueError("--write_only_test_group and --read_only_test_group " "must be used to set test group names") - # self.min_rw_size = self.parse_size(min_rw_size) - # self.max_rw_size = self.parse_size(max_rw_size) - # self.min_file_size = self.parse_size(min_file_size) - # self.min_file_size = self.parse_size(min_file_size) - # self.min_read_rate_bps = self.parse_size_bps(min_read_rate_bps) - # self.max_read_rate_bps = self.sisize_bps(max_read_rate_bps) - # self.min_write_rate_bps = self.parse_size_bps(min_write_rate_bps) - # self.max_write_rate_bps = self.parse_size_bps(max_write_rate_bps) - self.wo_profile = self.new_fio_endp_profile() self.mvlan_profile = self.new_mvlan_profile() @@ -245,18 +236,10 @@ class FileIOTest(Realm): expected_passes += 1 # print(item) if item[0] == 'r': - # print("TEST", item, - # val_list[item]['read-bps'], - # self.ro_profile.min_read_rate_bps, - # val_list[item]['read-bps'] > self.ro_profile.min_read_rate_bps) if val_list[item]['read-bps'] > self.wo_profile.min_read_rate_bps: passes += 1 else: - # print("TEST", item, - # val_list[item]['write-bps'], - # self.wo_profile.min_write_rate_bps, - # val_list[item]['write-bps'] > self.wo_profile.min_write_rate_bps) if val_list[item]['write-bps'] > self.wo_profile.min_write_rate_bps: passes += 1 @@ -279,18 +262,13 @@ class FileIOTest(Realm): cx_list = self.json_get("fileio/%s,%s?fields=write-bps,read-bps" % ( ','.join(self.wo_profile.created_cx.keys()), ','.join(self.ro_profile.created_cx.keys())), debug_=self.debug) - # print(cx_list) - # print("==============\n", cx_list, "\n==============") cx_map = {} - # pprint.pprint(cx_list) if cx_list is not None: cx_list = cx_list['endpoint'] for i in cx_list: for item, value in i.items(): - # print(item, value) cx_map[self.name_to_eid(item)[2]] = {"read-bps": value['read-bps'], - "write-bps": value['write-bps']} - # print(cx_map) + "write-bps": value['write-bps']} return cx_map def build(self): @@ -658,7 +636,9 @@ Generic command layout: tg_group = parser.add_mutually_exclusive_group() tg_group.add_argument('--add_to_group', help='name of test group to add cxs to', default=None) tg_group.add_argument('--del_from_group', help='name of test group to delete cxs from', default=None) - parser.add_argument('--cxs', help='list of cxs to add/remove depending on use of --add_to_group or --del_from_group', default=None) + parser.add_argument('--cxs', + help='list of cxs to add/remove depending on use of --add_to_group or --del_from_group', + default=None) args = parser.parse_args() update_group_args = { From f2c7fd3f8281e54c71b1e07e08d362e787eac053 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 15 Dec 2021 10:43:40 -0800 Subject: [PATCH 03/29] mac_vlan_profile: cleanup whitespace and bad logic Signed-off-by: Matthew Stidham --- py-json/mac_vlan_profile.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/py-json/mac_vlan_profile.py b/py-json/mac_vlan_profile.py index 1382cc27..6ebd1412 100644 --- a/py-json/mac_vlan_profile.py +++ b/py-json/mac_vlan_profile.py @@ -5,7 +5,6 @@ import importlib from pprint import pprint import time - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -20,7 +19,6 @@ class MACVLANProfile(LFCliBase): local_realm, macvlan_parent="eth1", num_macvlans=1, - admin_down=False, dhcp=False, debug_=False): super().__init__(lfclient_host, lfclient_port, debug_) @@ -123,7 +121,7 @@ class MACVLANProfile(LFCliBase): print("Creating MACVLANs...") req_url = "/cli-json/add_mvlan" - if not self.dhcp and self.first_ip_addr is not None and self.netmask is not None and self.gateway is not None: + if not self.dhcp and self.first_ip_addr and self.netmask and self.gateway: self.desired_set_port_interest_flags.append("ip_address") self.desired_set_port_interest_flags.append("ip_Mask") self.desired_set_port_interest_flags.append("ip_gateway") @@ -148,7 +146,7 @@ class MACVLANProfile(LFCliBase): "mac": "xx:xx:xx:*:*:xx", "port": self.local_realm.name_to_eid(self.macvlan_parent)[2], "index": int(self.desired_macvlans[i][self.desired_macvlans[i].index('#') + 1:]), - #"dhcp": self.dhcp, + # "dhcp": self.dhcp, "flags": None } if admin_down: @@ -156,8 +154,9 @@ class MACVLANProfile(LFCliBase): else: data["flags"] = 0 self.created_macvlans.append("%s.%s.%s#%d" % (self.shelf, self.resource, - self.macvlan_parent, int( - self.desired_macvlans[i][self.desired_macvlans[i].index('#') + 1:]))) + self.macvlan_parent, + int(self.desired_macvlans[i][ + self.desired_macvlans[i].index('#') + 1:]))) self.local_realm.json_post(req_url, data) time.sleep(sleep_time) @@ -170,13 +169,12 @@ class MACVLANProfile(LFCliBase): eid = self.local_realm.name_to_eid(self.created_macvlans[i]) name = eid[2] self.set_port_data["port"] = name # for set_port calls. - if not self.dhcp and self.first_ip_addr is not None and self.netmask is not None \ - and self.gateway is not None: + if not self.dhcp and self.first_ip_addr and self.netmask and self.gateway: self.set_port_data["ip_addr"] = self.ip_list[i] self.set_port_data["netmask"] = self.netmask self.set_port_data["gateway"] = self.gateway set_port_r.addPostData(self.set_port_data) - json_response = set_port_r.jsonPost(debug) + set_port_r.jsonPost(debug) time.sleep(sleep_time) def cleanup(self): From f3fc3c850c64cc186c8cc6dd92be54d76cea4a7b Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 15 Dec 2021 11:09:02 -0700 Subject: [PATCH 04/29] ct_us_scripts.json : additional test scripts added Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_scripts.json | 463 ++++++++++++++++------------ 1 file changed, 259 insertions(+), 204 deletions(-) diff --git a/py-scripts/tools/ct_us_scripts.json b/py-scripts/tools/ct_us_scripts.json index 3460dd24..afdcbd87 100644 --- a/py-scripts/tools/ct_us_scripts.json +++ b/py-scripts/tools/ct_us_scripts.json @@ -9,210 +9,11 @@ "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" + "as a unique identifier for tha chamber-view test run", + "Simpler runs after the suite_scripts" ] }, "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":{ "lf_help_check":{ "enabled":"TRUE", @@ -498,7 +299,7 @@ ] }, "test_ip_variable_time_ipv4_5g_udp":{ - "enabled":"FALSE", + "enabled":"TRUE", "command":"test_ip_variable_time.py", "args":"", "args_list":[ @@ -508,7 +309,7 @@ " --traffic_type lf_udp", " --debug"]}, "test_ip_variable_time_ipv4_5g_tcp":{ - "enabled":"FALSE", + "enabled":"TRUE", "command":"test_ip_variable_time.py", "args":"", "args_list":[ @@ -578,12 +379,66 @@ "args_list":[" --mgr LF_MGR_IP " ] }, + "lf_report":{ + "enabled":"TRUE", + "load_db":"NONE", + "timeout":"60", + "command":"lf_report.py", + "args":"", + "args_list":[" " + ] + }, + "lf_snp_test":{ + "enabled":"TRUE", + "load_db":"NONE", + "timeout":"60", + "command":"lf_snp_test.py", + "args":"", + "args_list":[" --help" + ] + }, + "testgroup":{ + "enabled":"TRUE", + "load_db":"NONE", + "timeout":"60", + "command":"testgroup.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP --group_name group1 --add_group --list_groups --debug" + ] + }, + "testgroup2":{ + "enabled":"TRUE", + "load_db":"NONE", + "timeout":"60", + "command":"testgroup2.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP --group_name group0 --add_group --num_stations 1 --radio 1.1.wiphy1", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED ", + ] + }, + "clean_up_cxs_endp_sta_from_test_group":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ] + }, + "test_generic":{ + "enabled":"TRUE", + "command":"test_generic.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --radio 1.1.wiphy1 --upstream_port UPSTREAM_PORT --num_stations 1 --type lfping --dest LF_MGR_IP --debug", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + ] + }, "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", + " --mgr LF_MGR_IP --radio 1.1.wiphy1 --upstream_port UPSTREAM_PORT --radio2 1.1.wiphy2", " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " ] }, @@ -698,6 +553,206 @@ " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } + }, + "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" + ] + } } } } From 40986001ce0e45999a39a35685dc27b21525a34f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 15 Dec 2021 12:09:53 -0700 Subject: [PATCH 05/29] ct_us_scripts.json : syntax fix 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 afdcbd87..b22c8a58 100644 --- a/py-scripts/tools/ct_us_scripts.json +++ b/py-scripts/tools/ct_us_scripts.json @@ -413,7 +413,7 @@ "command":"testgroup2.py", "args":"", "args_list":[" --mgr LF_MGR_IP --group_name group0 --add_group --num_stations 1 --radio 1.1.wiphy1", - " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED ", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " ] }, "clean_up_cxs_endp_sta_from_test_group":{ From aae9a34cea4337ee6e593e3886fefc2b55468ca7 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Wed, 15 Dec 2021 13:07:32 -0800 Subject: [PATCH 06/29] lf_webpage.py: Added separate arguments for 2.4G and 5G wifi configurations, graphing fixes(WIP) --- py-scripts/lf_webpage.py | 190 ++++++++++++++++++++++++--------------- 1 file changed, 117 insertions(+), 73 deletions(-) diff --git a/py-scripts/lf_webpage.py b/py-scripts/lf_webpage.py index 49adce69..439e324d 100755 --- a/py-scripts/lf_webpage.py +++ b/py-scripts/lf_webpage.py @@ -55,27 +55,43 @@ class HttpDownload(Realm): self.port_util = PortUtils(self.local_realm) self.http_profile.debug = _debug_on self.created_cx = {} + self.station_list = [] + self.radio = [] def set_values(self): # This method will set values according user input if self.bands == "5G": self.radio = [self.fiveg_radio] + self.station_list = [LFUtils.portNameSeries(prefix_="fiveg_sta", start_id_=self.sta_start_id, + end_id_=self.num_sta - 1, padding_number_=10000, + radio=self.fiveg_radio)] elif self.bands == "2.4G": self.radio = [self.twog_radio] + self.station_list = [LFUtils.portNameSeries(prefix_="twog_sta", start_id_=self.sta_start_id, + end_id_=self.num_sta - 1, padding_number_=10000, + radio=self.twog_radio)] elif self.bands == "Both": self.radio = [self.fiveg_radio, self.twog_radio] print(self.radio) - self.num_sta = self.num_sta // 2 + # self.num_sta = self.num_sta // 2 + self.station_list = [ + LFUtils.portNameSeries(prefix_="fiveg_sta", start_id_=self.sta_start_id, + end_id_=self.num_sta - 1, padding_number_=10000, + radio=self.fiveg_radio), + LFUtils.portNameSeries(prefix_="twog_sta", start_id_=self.sta_start_id, + end_id_=self.num_sta - 1, padding_number_=10000, + radio=self.twog_radio) + ] def precleanup(self): self.count = 0 - for rad in self.radio: - print("radio", rad) - if rad == self.fiveg_radio: + for rad in range(len(self.radio)): + print("radio", self.radio[rad]) + if self.radio[rad] == self.fiveg_radio: # select an mode self.station_profile.mode = 10 self.count = self.count + 1 - elif rad == self.twog_radio: + elif self.radio[rad] == self.twog_radio: # select an mode self.station_profile.mode = 6 self.count = self.count + 1 @@ -85,24 +101,19 @@ class HttpDownload(Realm): self.num_sta = 2 * (self.num_sta) self.station_profile.mode = 10 self.http_profile.cleanup() - self.station_list1 = LFUtils.portNameSeries(prefix_="sta", start_id_=self.sta_start_id, - end_id_=self.num_sta - 1, padding_number_=10000, - radio=rad) # cleanup station list which started sta_id 20 - self.station_profile.cleanup(self.station_list1, debug_=self.local_realm.debug) + self.station_profile.cleanup(self.station_list[rad], debug_=self.local_realm.debug) LFUtils.wait_until_ports_disappear(base_url=self.local_realm.lfclient_url, - port_list=self.station_list, + port_list=self.station_list[rad], debug=self.local_realm.debug) return # clean dlayer4 ftp traffic self.http_profile.cleanup() - self.station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=self.sta_start_id, - end_id_=self.num_sta - 1, padding_number_=10000, - radio=rad) + # cleans stations - self.station_profile.cleanup(self.station_list, delay=1, debug_=self.local_realm.debug) + self.station_profile.cleanup(self.station_list[rad], delay=1, debug_=self.local_realm.debug) LFUtils.wait_until_ports_disappear(base_url=self.local_realm.lfclient_url, - port_list=self.station_list, + port_list=self.station_list[rad], debug=self.local_realm.debug) time.sleep(1) print("precleanup done") @@ -110,15 +121,16 @@ class HttpDownload(Realm): def build(self): # enable http on ethernet self.port_util.set_http(port_name=self.local_realm.name_to_eid(self.upstream)[2], resource=1, on=True) - for rad in self.radio: - self.station_profile.use_security(self.security, self.ssid, self.password) + for rad in range(len(self.radio)): + print(self.station_list[rad]) + self.station_profile.use_security(self.security[rad], self.ssid[rad], self.password[rad]) self.station_profile.set_command_flag("add_sta", "create_admin_down", 1) self.station_profile.set_command_param("set_port", "report_timer", 1500) self.station_profile.set_command_flag("set_port", "rpt_timer", 1) - self.station_profile.create(radio=rad, sta_names_=self.station_list, debug=self.local_realm.debug) - self.local_realm.wait_until_ports_appear(sta_list=self.station_list) + self.station_profile.create(radio=self.radio[rad], sta_names_=self.station_list[rad], debug=self.local_realm.debug) + self.local_realm.wait_until_ports_appear(sta_list=self.station_list[rad]) self.station_profile.admin_up() - if self.local_realm.wait_for_ip(self.station_list, timeout_sec=60): + if self.local_realm.wait_for_ip(self.station_list[rad], timeout_sec=60): self.local_realm._pass("All stations got IPs") else: self.local_realm._fail("Stations failed to get IPs") @@ -138,7 +150,6 @@ class HttpDownload(Realm): suppress_related_commands_=None, http=True, http_ip=ip_upstream + "/webpage.html") if self.count == 2: - self.station_list = self.station_list1 self.station_profile.mode = 6 print("Test Build done") @@ -479,44 +490,60 @@ class HttpDownload(Realm): # Section commented because graphing breaks two band report generation # TODO: Fix graphing bug with multiple bands being recorded - # - # report.set_title("WEBPAGE DOWNLOAD TEST") - # report.set_date(date) - # report.build_banner() - # report.set_table_title("Test Setup Information") - # report.build_table_title() - # - # 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.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.build_objective() + if bands == "Both": + num_stations = num_stations * 2 + report.set_title("WEBPAGE DOWNLOAD TEST") + report.set_date(date) + report.build_banner() + report.set_table_title("Test Setup Information") + report.build_table_title() + + 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.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.build_objective() x = [] for fcc in list(result_data.keys()): fcc_type = result_data[fcc]["min"] @@ -612,8 +639,6 @@ class HttpDownload(Realm): csv_outfile = report.file_add_path(csv_outfile) print("csv output file : {}".format(csv_outfile)) - exit() - test_setup = pd.DataFrame(download_table_value) report.set_table_dataframe(test_setup) report.build_table() @@ -638,9 +663,12 @@ def main(): parser.add_argument('--num_stations', type=int, help='number of stations to create', default=1) parser.add_argument('--twog_radio', help='specify radio for 2.4G clients', default='wiphy3') parser.add_argument('--fiveg_radio', help='specify radio for 5 GHz client', default='wiphy0') - parser.add_argument('--security', help='WiFi Security protocol: {open|wep|wpa2|wpa3') - parser.add_argument('--ssid', help='WiFi SSID for script object to associate to') - parser.add_argument('--passwd', help='WiFi passphrase/password/key') + parser.add_argument('--twog_security', help='WiFi Security protocol: {open|wep|wpa2|wpa3} for 2.4G clients') + parser.add_argument('--twog_ssid', help='WiFi SSID for script object to associate for 2.4G clients') + parser.add_argument('--twog_passwd', help='WiFi passphrase/password/key for 2.4G clients') + parser.add_argument('--fiveg_security', help='WiFi Security protocol: {open|wep|wpa2|wpa3} for 5G clients') + parser.add_argument('--fiveg_ssid', help='WiFi SSID for script object to associate for 5G clients') + parser.add_argument('--fiveg_passwd', help='WiFi passphrase/password/key for 5G clients') parser.add_argument('--target_per_ten', help='number of request per 10 minutes', default=100) parser.add_argument('--file_size', type=str, help='specify the size of file you want to download', default='5MB') parser.add_argument('--bands', nargs="+", help='specify which band testing you want to run eg 5G OR 2.4G OR Both', @@ -699,10 +727,22 @@ def main(): avg_both = [] for bands in args.bands: + if bands == "2.4G": + security = [args.twog_security] + ssid = [args.twog_ssid] + passwd = [args.twog_passwd] + elif bands == "5G": + security = [args.fiveg_security] + ssid = [args.fiveg_ssid] + passwd = [args.fiveg_passwd] + elif bands == "Both": + security = [args.fiveg_security, args.twog_security] + ssid = [args.fiveg_ssid, args.twog_ssid] + passwd = [args.fiveg_passwd, args.twog_passwd] http = HttpDownload(lfclient_host=args.mgr, lfclient_port=args.mgr_port, upstream=args.upstream_port, num_sta=args.num_stations, - security=args.security, - ssid=args.ssid, password=args.passwd, + security=security, + ssid=ssid, password=passwd, target_per_ten=args.target_per_ten, file_size=args.file_size, bands=bands, twog_radio=args.twog_radio, @@ -786,7 +826,7 @@ def main(): date = str(datetime.now()).split(",")[0].replace(" ", "-").split(".")[0] test_setup_info = { "DUT Name": args.ap_name, - "SSID": args.ssid, + "SSID": ','.join(ssid), "Test Duration": test_duration, } test_input_infor = { @@ -795,23 +835,27 @@ def main(): "Bands": args.bands, "Upstream": args.upstream_port, "Stations": args.num_stations, - "SSID": args.ssid, - "Security": args.security, + "SSID": ','.join(ssid), + "Security": ','.join(security), "Duration": args.duration, "Contact": "support@candelatech.com" } http1 = HttpDownload(lfclient_host=args.mgr, lfclient_port=args.mgr_port, upstream=args.upstream_port, num_sta=args.num_stations, - security=args.security, - ssid=args.ssid, password=args.passwd, + security=security, + ssid=ssid, password=passwd, target_per_ten=args.target_per_ten, file_size=args.file_size, bands=args.bands, twog_radio=args.twog_radio, fiveg_radio=args.fiveg_radio) dataset = http1.download_time_in_sec(result_data=result_data) lis = [] - for i in range(1, args.num_stations + 1): - lis.append(i) + if bands == "Both": + for i in range(1, args.num_stations*2 + 1): + lis.append(i) + else: + for i in range(1, args.num_stations + 1): + lis.append(i) dataset2 = http1.speed_in_Mbps(result_data=result_data) data = http1.summary_calculation( From af19c13649ac729f530ca0fe25020b1333eed799 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 15 Dec 2021 14:47:07 -0800 Subject: [PATCH 07/29] mine_regression_results: add badger to regression results csv Signed-off-by: Matthew Stidham --- py-scripts/tools/mine_regression_results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/mine_regression_results.py b/py-scripts/tools/mine_regression_results.py index f5e200bb..29453448 100755 --- a/py-scripts/tools/mine_regression_results.py +++ b/py-scripts/tools/mine_regression_results.py @@ -56,7 +56,7 @@ def main(): args = parser.parse_args() if args.ip is None: - args.ip = ['192.168.92.18', '192.168.92.12', '192.168.93.51', '192.168.92.15'] + args.ip = ['192.168.92.18', '192.168.92.12', '192.168.93.51', '192.168.92.15', '192.168.100.184'] #args.ip = ['192.168.93.51'] Miner = MineRegression(system_information=args.system_info, save_csv=args.save_csv, From 1e942b30faf2dbc1dcc839b403c3a4cc5890c8c2 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 15 Dec 2021 15:39:56 -0800 Subject: [PATCH 08/29] test_fileio: if BLANK is not None is not desirable. if BLANK is better. Signed-off-by: Matthew Stidham --- py-scripts/test_fileio.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/py-scripts/test_fileio.py b/py-scripts/test_fileio.py index 7810de17..a17a4135 100755 --- a/py-scripts/test_fileio.py +++ b/py-scripts/test_fileio.py @@ -103,7 +103,7 @@ class FileIOTest(Realm): self.netmask = netmask self.gateway = gateway if self.use_macvlans: - if macvlan_parent is not None: + if macvlan_parent: self.macvlan_parent = macvlan_parent self.port_list = port_list else: @@ -112,17 +112,17 @@ class FileIOTest(Realm): self.use_test_groups = use_test_groups if self.use_test_groups: if self.mode == "write": - if write_only_test_group is not None: + if write_only_test_group: self.write_only_test_group = write_only_test_group else: raise ValueError("--write_only_test_group must be used to set test group name") if self.mode == "read": - if read_only_test_group is not None: + if read_only_test_group: self.read_only_test_group = read_only_test_group else: raise ValueError("--read_only_test_group must be used to set test group name") if self.mode == "both": - if write_only_test_group is not None and read_only_test_group is not None: + if write_only_test_group and read_only_test_group: self.write_only_test_group = write_only_test_group self.read_only_test_group = read_only_test_group else: @@ -167,7 +167,7 @@ class FileIOTest(Realm): self.created_ports = [] if self.use_test_groups: - if self.mode is not None: + if self.mode: if self.mode == "write": self.wo_tg_profile = self.new_test_group_profile() self.wo_tg_profile.group_name = self.write_only_test_group @@ -184,7 +184,7 @@ class FileIOTest(Realm): else: raise ValueError("Mode ( read, write, or both ) must be specified") - if update_group_args is not None and update_group_args['name'] is not None: + if update_group_args and update_group_args['name']: temp_tg = self.new_test_group_profile() temp_cxs = update_group_args['cxs'].split(',') if update_group_args['action'] == "add": @@ -263,7 +263,7 @@ class FileIOTest(Realm): ','.join(self.wo_profile.created_cx.keys()), ','.join(self.ro_profile.created_cx.keys())), debug_=self.debug) cx_map = {} - if cx_list is not None: + if cx_list: cx_list = cx_list['endpoint'] for i in cx_list: for item, value in i.items(): @@ -293,7 +293,7 @@ class FileIOTest(Realm): # print("++++++++++++++++\n", self.ip_list, "++++++++++++++++\n") for num_port in range(len(self.port_list)): if self.ip_list[num_port] != 0: - if self.gateway is not None and self.netmask is not None: + if self.gateway and self.netmask: shelf = self.name_to_eid(self.port_list[num_port])[0] resource = self.name_to_eid(self.port_list[num_port])[1] port = self.name_to_eid(self.port_list[num_port])[2] @@ -315,7 +315,7 @@ class FileIOTest(Realm): # if use test groups and test group exists and no cxs, create cxs, assign to test group # if use test groups and test group exist and cxs exist, do nothing # if not use test groups, create cxs - if self.mode is not None: + if self.mode: if self.use_test_groups: if self.mode == "write": if self.wo_tg_exists: @@ -646,27 +646,27 @@ Generic command layout: "action": None, "cxs": None } - if args.add_to_group is not None and args.cxs is not None: + if args.add_to_group and args.cxs: update_group_args['name'] = args.add_to_group update_group_args['action'] = "add" update_group_args['cxs'] = args.cxs - elif args.del_from_group is not None and args.cxs is not None: + elif args.del_from_group and args.cxs: update_group_args['name'] = args.del_from_group update_group_args['action'] = "del" update_group_args['cxs'] = args.cxs port_list = [] ip_list = [] - if args.first_port is not None and args.use_ports is not None: + if args.first_port and args.use_ports: if args.first_port.startswith("sta"): - if (args.num_ports is not None) and (int(args.num_ports) > 0): + if args.num_ports and (int(args.num_ports) > 0): start_num = int(args.first_port[3:]) num_ports = int(args.num_ports) port_list = LFUtils.port_name_series(prefix="sta", start_id=start_num, end_id=start_num + num_ports - 1, padding_number=10000, radio=args.radio) else: - if (args.num_ports is not None) and args.macvlan_parent is not None and (int(args.num_ports) > 0) \ + if args.num_ports and args.macvlan_parent and (int(args.num_ports) > 0) \ and args.macvlan_parent in args.first_port: start_num = int(args.first_port[args.first_port.index('#') + 1:]) num_ports = int(args.num_ports) @@ -700,7 +700,7 @@ Generic command layout: if len(port_list) != len(ip_list): raise ValueError(temp_list, " ports must have matching ip addresses!") - if args.first_mvlan_ip is not None: + if args.first_mvlan_ip: if args.first_mvlan_ip.lower() == "dhcp": dhcp = True else: From 94d15d18007c5132ffec7501e2af7ad38a8ba139 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 15 Dec 2021 15:43:50 -0800 Subject: [PATCH 09/29] Use name_to_eid to parser parent name if it includes resource and shelf information Signed-off-by: Matthew Stidham --- py-scripts/test_fileio.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/py-scripts/test_fileio.py b/py-scripts/test_fileio.py index a17a4135..d622a5e9 100755 --- a/py-scripts/test_fileio.py +++ b/py-scripts/test_fileio.py @@ -641,6 +641,8 @@ Generic command layout: default=None) args = parser.parse_args() + parent = LFUtils.name_to_eid(args.macvlan_parent) + macvlan_parent = parent[2] update_group_args = { "name": None, "action": None, @@ -666,17 +668,17 @@ Generic command layout: padding_number=10000, radio=args.radio) else: - if args.num_ports and args.macvlan_parent and (int(args.num_ports) > 0) \ - and args.macvlan_parent in args.first_port: + if args.num_ports and macvlan_parent and (int(args.num_ports) > 0) \ + and macvlan_parent 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 + "#", start_id=start_num, + port_list = LFUtils.port_name_series(prefix=macvlan_parent + "#", start_id=start_num, end_id=start_num + num_ports - 1, padding_number=100000, radio=args.radio) else: raise ValueError("Invalid values for num_ports [%s], macvlan_parent [%s], and/or first_port [%s].\n" "first_port must contain parent port and num_ports must be greater than 0" - % (args.num_ports, args.macvlan_parent, args.first_port)) + % (args.num_ports, macvlan_parent, args.first_port)) else: if args.use_ports is None: num_ports = int(args.num_ports) @@ -685,7 +687,7 @@ Generic command layout: padding_number=10000, radio=args.radio) else: - port_list = LFUtils.port_name_series(prefix=args.macvlan_parent + "#", start_id=0, + port_list = LFUtils.port_name_series(prefix=macvlan_parent + "#", start_id=0, end_id=num_ports - 1, padding_number=100000, radio=args.radio) else: @@ -725,7 +727,7 @@ Generic command layout: test_duration=args.test_duration, upstream_port=args.upstream_port, _debug_on=args.debug, - macvlan_parent=args.macvlan_parent, + macvlan_parent=macvlan_parent, use_macvlans=args.use_macvlans, first_mvlan_ip=args.first_mvlan_ip, netmask=args.netmask, From a82db47ee946b9a4fd66e3bb1cf77b06edfabfd4 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 15 Dec 2021 15:48:25 -0800 Subject: [PATCH 10/29] check_large_files.bash: cleans up dangling etc/grub.d/50_candela_X files; rebuilds grub menu Signed-off-by: Jed Reynolds --- check_large_files.bash | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/check_large_files.bash b/check_large_files.bash index bdf83b60..8a7e6bed 100755 --- a/check_large_files.bash +++ b/check_large_files.bash @@ -339,6 +339,21 @@ clean_old_kernels() { echo "/lib/modules/$f" done | xargs rm -rf fi + # check to see if there are 50_candela-x files that + # lack a /lib/modules directory + local fifty_files=(`ls /etc/grub.d/50_candela_*`) + local k_v + for file in "${fifty_files[@]}"; do + k_v=${file#/etc/grub.d/50_candela_} + #echo "K_V[$k_v]" + if [ ! -d /lib/modules/$k_v ]; then + echo "/lib/modules/$k_v not found, removing /etc/grub.d/50_candela_$k_v" + rm -f "/etc/grub.d/50_candela_${k_v}" + fi + done + + grub2-mkconfig -o /boot/grub2/grub.cfg + if [ -d "/boot2" ]; then rm -rf /boot2/* rsync -a /boot/. /boot2/ From 1f0b3e7ff1115174eddb0ca4170583a096fa60fc Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 15 Dec 2021 15:51:35 -0800 Subject: [PATCH 11/29] mac_vlan_profile and test_fileio: Allow user to specify resource and shelf for eth ports Signed-off-by: Matthew Stidham --- py-json/mac_vlan_profile.py | 6 ++++-- py-scripts/test_fileio.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/py-json/mac_vlan_profile.py b/py-json/mac_vlan_profile.py index 6ebd1412..0151e420 100644 --- a/py-json/mac_vlan_profile.py +++ b/py-json/mac_vlan_profile.py @@ -19,14 +19,16 @@ class MACVLANProfile(LFCliBase): local_realm, macvlan_parent="eth1", num_macvlans=1, + shelf=1, + resource=1, dhcp=False, debug_=False): super().__init__(lfclient_host, lfclient_port, debug_) self.local_realm = local_realm self.num_macvlans = num_macvlans self.macvlan_parent = macvlan_parent - self.resource = 1 - self.shelf = 1 + self.resource = resource + self.shelf = shelf self.desired_macvlans = [] self.created_macvlans = [] self.dhcp = dhcp diff --git a/py-scripts/test_fileio.py b/py-scripts/test_fileio.py index d622a5e9..4e3b2293 100755 --- a/py-scripts/test_fileio.py +++ b/py-scripts/test_fileio.py @@ -68,6 +68,8 @@ class FileIOTest(Realm): first_mvlan_ip=None, netmask=None, gateway=None, + shelf=1, + resource=1, dhcp=True, use_macvlans=False, use_test_groups=False, @@ -164,6 +166,8 @@ class FileIOTest(Realm): self.mvlan_profile.netmask = netmask self.mvlan_profile.first_ip_addr = first_mvlan_ip self.mvlan_profile.gateway = gateway + self.mvlan_profile.shelf = shelf + self.mvlan_profile.resource = resource self.created_ports = [] if self.use_test_groups: @@ -231,10 +235,8 @@ class FileIOTest(Realm): def __compare_vals(self, val_list): passes = 0 expected_passes = 0 - # print(val_list) for item in val_list: expected_passes += 1 - # print(item) if item[0] == 'r': if val_list[item]['read-bps'] > self.wo_profile.min_read_rate_bps: @@ -274,7 +276,6 @@ class FileIOTest(Realm): def build(self): # Build stations if self.use_macvlans: - print("Creating MACVLANs") self.mvlan_profile.create(admin_down=False, sleep_time=.5, debug=self.debug) self._pass("PASS: MACVLAN build finished") self.created_ports += self.mvlan_profile.created_macvlans @@ -290,7 +291,6 @@ class FileIOTest(Realm): self.created_ports += self.station_profile.station_names if len(self.ip_list) > 0: - # print("++++++++++++++++\n", self.ip_list, "++++++++++++++++\n") for num_port in range(len(self.port_list)): if self.ip_list[num_port] != 0: if self.gateway and self.netmask: @@ -642,6 +642,8 @@ Generic command layout: args = parser.parse_args() parent = LFUtils.name_to_eid(args.macvlan_parent) + shelf = parent[0] + resource = parent[1] macvlan_parent = parent[2] update_group_args = { "name": None, @@ -732,6 +734,8 @@ Generic command layout: first_mvlan_ip=args.first_mvlan_ip, netmask=args.netmask, gateway=args.gateway, + shelf=shelf, + resource=resource, dhcp=dhcp, fs_type=args.fs_type, min_rw_size=args.min_rw_size, From 25b2fdbfb8651ec17a84f8ad66be12f5c9fecf25 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 15 Dec 2021 18:15:25 -0700 Subject: [PATCH 12/29] lf_check.py : add Server Host name, Server ip , Python3 Version Python3 Executable Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index d1bfc8a2..0ebc631d 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1475,6 +1475,16 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # Add the qa_report_html qa_report_html = check.qa_report_html + # add the python3 version information + lf_server = pd.DataFrame() + hostname = socket.getfqdn() + ip = socket.gethostbyname(hostname) + + lf_server['Server Host Name'] = [hostname] + lf_server['Server ip'] = [ip] + lf_server['Python3 Version'] = [sys.version] + lf_server['Python3 Executable'] = [sys.executable] + lf_suite_time = pd.DataFrame() lf_suite_time['Suite Start'] = [check.suite_start_time] lf_suite_time['Suite End'] = [check.suite_end_time] @@ -1501,6 +1511,10 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a report.build_table_title() report.set_table_dataframe(lf_test_setup) report.build_table() + report.set_table_title("LANForge CICD Server") + report.build_table_title() + report.set_table_dataframe(lf_server) + report.build_table() report.set_table_title("LANForge Radios") report.build_table_title() report.set_table_dataframe(lf_radio_df) From 8a93649b0a25a2f1113f5ace43a5c5730e909270 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 08:24:56 -0800 Subject: [PATCH 13/29] sta_scan_test: Use a more robust cleanup method at the beginning of the test so we avoid false negatives Signed-off-by: Matthew Stidham --- py-scripts/sta_scan_test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/py-scripts/sta_scan_test.py b/py-scripts/sta_scan_test.py index 13f3b468..49d15de2 100755 --- a/py-scripts/sta_scan_test.py +++ b/py-scripts/sta_scan_test.py @@ -126,8 +126,7 @@ class StaScan(Realm): print("%s\t%s\t%s" % (info['bss'], info['signal'], info['ssid'])) def pre_cleanup(self): - for sta in self.sta_list: - self.rm_port(sta, check_exists=True) + self.station_profile.cleanup(self.sta_list) def cleanup(self): self.station_profile.cleanup() From 8303d2b4677d756a346433fc174e11750d45e6e6 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 08:27:37 -0800 Subject: [PATCH 14/29] test_ipv4_ttls: Fix incorrect call for cx_profile Signed-off-by: Matthew Stidham --- py-scripts/test_ipv4_ttls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/test_ipv4_ttls.py b/py-scripts/test_ipv4_ttls.py index cefa4ad4..2eebd1a9 100755 --- a/py-scripts/test_ipv4_ttls.py +++ b/py-scripts/test_ipv4_ttls.py @@ -278,7 +278,7 @@ class TTLSTest(Realm): debug=self.debug) def pre_cleanup(self): - self.cx_profile.cleanup_prefix() + self.l3_cx_obj_udp.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: From 114e56160510f8804c34ecc8d6cb9ca4d3222f19 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 08:29:19 -0800 Subject: [PATCH 15/29] test_ipv4_ttls: Fix incorrect call for self.use_existing_sta Signed-off-by: Matthew Stidham --- py-scripts/test_ipv4_ttls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/test_ipv4_ttls.py b/py-scripts/test_ipv4_ttls.py index 2eebd1a9..a325fe5d 100755 --- a/py-scripts/test_ipv4_ttls.py +++ b/py-scripts/test_ipv4_ttls.py @@ -280,7 +280,7 @@ class TTLSTest(Realm): def pre_cleanup(self): self.l3_cx_obj_udp.cx_profile.cleanup_prefix() # do not clean up station if existed prior to test - if not self.use_existing_sta: + if not self.l3_cx_obj_udp.use_existing_sta: for sta in self.sta_list: self.rm_port(sta, check_exists=True, debug_=False) From 849deb89c2a3dc683e88a677983c2fcdfec90744 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 08:36:06 -0800 Subject: [PATCH 16/29] sta_connect: Make logic more verbose Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 43 ++++++++++----------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 1cb18fa9..b643a55b 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -64,10 +64,8 @@ class StaConnect(Realm): self.cleanup_on_exit = _cleanup_on_exit self.sta_url_map = None # defer construction self.upstream_url = None # defer construction - self.station_names = [] + self.station_names = _sta_name self.cx_names = {} - if _sta_name is not None: - self.station_names = [_sta_name] self.resulting_stations = {} self.resulting_endpoints = {} @@ -169,7 +167,7 @@ class StaConnect(Realm): self.clear_test_results() self.check_connect() eth1IP = self.json_get(self.get_upstream_url()) - if eth1IP is None: + if not eth1IP: self._fail("Unable to query %s, bye" % self.upstream_port, True) return False if eth1IP['interface']['ip'] == "0.0.0.0": @@ -179,8 +177,8 @@ class StaConnect(Realm): for sta_name in self.station_names: sta_url = self.get_station_url(sta_name) response = self.json_get(sta_url) - if response is not None: - if response["interface"] is not None: + if response: + if response["interface"]: print("removing old station") if self.port_exists(sta_name): self.rm_port(sta_name) @@ -246,7 +244,7 @@ class StaConnect(Realm): station_info = self.json_get(sta_url + "?fields=port,ip,ap") # LFUtils.debug_printer.pprint(station_info) - if (station_info is not None) and ("interface" in station_info): + if station_info and "interface" in station_info: if "ip" in station_info["interface"]: ip = station_info["interface"]["ip"] if "ap" in station_info["interface"]: @@ -491,8 +489,6 @@ class StaConnect(Realm): def main(): - lfjson_host = "localhost" - lfjson_port = 8080 parser = Realm.create_basic_argparse( prog="sta_connect.py", formatter_class=argparse.RawTextHelpFormatter, @@ -500,7 +496,7 @@ def main(): Example: ./sta_connect.py --mgr 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C """) - parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") + parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)", default=8080) 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("--sta_mode", type=str, @@ -510,29 +506,12 @@ Example: 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.port is not None: - lfjson_port = args.port - 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.radio is not None: - 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_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 + staConnect = StaConnect(args.mgr, args.port, _upstream_port=args.upstream_port, _runtime_sec=monitor_interval, + _sta_mode=args.sta_mode, _upstream_resource=args.upstream_resource, + _radio=args.radio, _resource=args.resource, _passwd=args.passwd, _dut_passwd=args.passwd, + _dut_bssid=args.dut_bssid, _dut_ssid=args.ssid, _dut_security=args.security, + _sta_name=["sta0000"]) staConnect.run() From 1cf362be8ac4d2dadbf703cb492df4d299f48930 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 08:38:43 -0800 Subject: [PATCH 17/29] sta_connect: Improve logic Replace if XXX is None with if not XXX because we want to fail if the variable is blank or 0 Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index b643a55b..4eca6884 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -81,16 +81,16 @@ class StaConnect(Realm): 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: + if not sta_name_: raise ValueError("get_station_url wants a station name") - if self.sta_url_map is None: + if not self.sta_url_map: self.sta_url_map = {} for sta_name in self.station_names: self.sta_url_map[sta_name] = "port/1/%s/%s" % (self.resource, sta_name) return self.sta_url_map[sta_name_] def get_upstream_url(self): - if self.upstream_url is None: + if not self.upstream_url: self.upstream_url = "port/1/%s/%s" % (self.upstream_resource, self.upstream_port) return self.upstream_url @@ -109,7 +109,7 @@ class StaConnect(Realm): def num_associated(self, bssid): counter = 0 # print("there are %d results" % len(self.station_results)) - if (self.station_results is None) or (len(self.station_results) < 1): + if not self.station_results or (len(self.station_results) < 1): self.get_failed_result_list() for eid, record in self.station_results.items(): # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") @@ -145,17 +145,16 @@ class StaConnect(Realm): @staticmethod def add_named_flags(desired_list, command_ref): - if desired_list is None: + if not desired_list: 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: empty desired list") + if not command_ref 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 == ""): + if not name: continue if name not in command_ref: raise ValueError("flag %s not in map" % name) From 865ea25964cdef7d1576a19072a37b53302447ba Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 08:50:20 -0800 Subject: [PATCH 18/29] sta_connect: Use explicit defaults in the argparser Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 4eca6884..9fae931d 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -496,11 +496,11 @@ Example: ./sta_connect.py --mgr 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C """) parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)", default=8080) - 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("--resource", type=str, help="LANforge Station resource ID to use, default is 1", default=1) + parser.add_argument("--upstream_resource", type=str, help="LANforge Ethernet port resource ID to use, default is 1", default=1) 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_bssid", type=str, help="DUT BSSID to which we expect to connect.") + help="LANforge station-mode setting (see add_sta LANforge CLI documentation, default is 0 (auto))", default=0) + parser.add_argument("--dut_bssid", type=str, help="DUT BSSID to which we expect to connect.", default="MyAP") parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m") args = parser.parse_args() From 6f86f2aa0573514dda91ee3bacb1da94ef8f6205 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 09:46:19 -0800 Subject: [PATCH 19/29] regression_test: test_fileio macvlan IP will be on 10.40 network instead Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index fc039a2b..e908ec11 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -365,7 +365,7 @@ else # --b_max 0 # --debug" #test_client_admission.py - "./test_fileio.py --macvlan_parent $UPSTREAM --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 --netmask 255.255.255.0 --gateway 192.168.92.1 --test_duration 30s --mgr $MGR" # Better tested on Kelly, where VRF is turned off + "./test_fileio.py --macvlan_parent $UPSTREAM --num_ports 3 --use_macvlans --first_mvlan_ip 10.40.92.13 --netmask 255.255.255.0 --gateway 192.168.92.1 --test_duration 30s --mgr $MGR" # Better tested on Kelly, where VRF is turned off "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug --mgr $MGR" "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security $SECURITY --debug --mgr $MGR" "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type iperf3 --debug --mgr $MGR" From d796415dd419a0ba0c5b19ac2d1ac211886f7fb4 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 12:01:01 -0800 Subject: [PATCH 20/29] sta_connect: sta_connect.setup needs to not throw an error if the port does not exist. It needs to quietly remove the old station and move on. Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index 9fae931d..dc48ab9e 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -174,13 +174,8 @@ class StaConnect(Realm): return False for sta_name in self.station_names: - sta_url = self.get_station_url(sta_name) - response = self.json_get(sta_url) - if response: - if response["interface"]: - print("removing old station") - if self.port_exists(sta_name): - self.rm_port(sta_name) + if self.port_exists(sta_name, debug=False): + self.rm_port(sta_name, debug_=False) self.wait_until_ports_disappear(self.station_names) # Create stations and turn dhcp on From 2f793741d3823cb06dfdf6c47c21ccb78bbf83b5 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 13:19:30 -0800 Subject: [PATCH 21/29] station_profile.modify: parse radio name using name_to_eid, and use the parsed name to set radio data Signed-off-by: Matthew Stidham --- py-json/station_profile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-json/station_profile.py b/py-json/station_profile.py index 62409eac..a1cd5a88 100644 --- a/py-json/station_profile.py +++ b/py-json/station_profile.py @@ -557,7 +557,8 @@ class StationProfile: station_shelf = station_eid[0] station_resource = station_eid[1] station_port = station_eid[2] - self.add_sta_data["radio"] = radio + radio_eid = self.local_realm.name_to_eid(radio) + self.add_sta_data["radio"] = radio_eid[2] self.add_sta_data["shelf"] = station_shelf self.add_sta_data["resource"] = station_resource self.add_sta_data["sta_name"] = station_port From d170bfe4dd089a12f1832e230f039f02f6c3b462 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 14:32:31 -0800 Subject: [PATCH 22/29] sta_connect2: We don't want to use is not None, because then if the value is an empty string by accident we will produce errors, so I've fixed this Signed-off-by: Matthew Stidham --- py-scripts/sta_connect2.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index 232b59a0..5f6a6e95 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -66,7 +66,7 @@ class StaConnect2(Realm): self.sta_url_map = None # defer construction self.upstream_url = None # defer construction self.station_names = [] - if _sta_name is not None: + if _sta_name: self.station_names = [_sta_name] self.sta_prefix = _sta_prefix self.bringup_time_sec = _bringup_time_sec @@ -162,7 +162,7 @@ class StaConnect2(Realm): for sta_name in self.station_names: sta_url = self.get_station_url(sta_name) response = self.json_get(sta_url) - if (response is not None) and (response["interface"] is not None): + if (response) and (response["interface"]): for station in self.station_names: LFUtils.removePort(self.resource, station, self.lfclient_url) LFUtils.wait_until_ports_disappear(self.lfclient_url, self.station_names) @@ -257,7 +257,7 @@ class StaConnect2(Realm): station_info = self.json_get(sta_url + "?fields=port,ip,ap") # LFUtils.debug_printer.pprint(station_info) - if (station_info is not None) and ("interface" in station_info): + if (station_info) and ("interface" in station_info): if "ip" in station_info["interface"]: ip = station_info["interface"]["ip"] if "ap" in station_info["interface"]: @@ -442,9 +442,9 @@ Example: parser.add_argument('--monitor_interval', help='How frequently you want to append to your database', default='5s') args = parser.parse_args() - if args.dest is not None: + if args.dest: lfjson_host = args.dest - if args.port is not None: + if args.port: lfjson_port = args.port staConnect = StaConnect2(lfjson_host, lfjson_port, @@ -456,29 +456,29 @@ Example: _exit_on_fail=True, _exit_on_error=False) - if args.user is not None: + if args.user: staConnect.user = args.user - if args.passwd is not None: + if args.passwd: staConnect.passwd = args.passwd - if args.sta_mode is not None: + if args.sta_mode: staConnect.sta_mode = args.sta_mode - if args.upstream_resource is not None: + if args.upstream_resource: staConnect.upstream_resource = args.upstream_resource - if args.upstream_port is not None: + if args.upstream_port: staConnect.upstream_port = args.upstream_port - if args.radio is not None: + if args.radio: staConnect.radio = args.radio - if args.resource is not None: + if args.resource: staConnect.resource = args.resource - if args.dut_ssid is not None: + if args.dut_ssid: staConnect.dut_ssid = args.dut_ssid - if args.dut_passwd is not None: + if args.dut_passwd: staConnect.dut_passwd = args.dut_passwd - if args.dut_bssid is not None: + if args.dut_bssid: staConnect.dut_bssid = args.dut_bssid - if args.dut_security is not None: + if args.dut_security: staConnect.dut_security = args.dut_security - if (args.prefix is not None) or (args.prefix != "sta"): + if args.prefix or (args.prefix != "sta"): staConnect.sta_prefix = args.prefix staConnect.station_names = ["%s0000" % args.prefix] staConnect.bringup_time_sec = args.bringup_time From e1c33e033e6fe465b07bf96ec90dfe66dbbfe3af Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 14:45:19 -0800 Subject: [PATCH 23/29] sta_connect2: Use the default attribute in argparser, it is more robust Explicitly declare the arguments in the intial call of StaConnect2 when possible, avoid if XXX: when possible Signed-off-by: Matthew Stidham --- py-scripts/sta_connect2.py | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index 5f6a6e95..7f57d1cc 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -415,16 +415,16 @@ def main(): Example: ./sta_connect2.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("-d", "--dest", type=str, help="address of the LANforge GUI machine (localhost is default)", default='localhost') + parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)", default=8080) 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("--resource", type=str, help="LANforge Station resource ID to use, default is 1", default=1) + parser.add_argument("--upstream_resource", type=str, help="LANforge Ethernet port resource ID to use, default is 1", default=1) + parser.add_argument("--upstream_port", type=str, help="LANforge Ethernet port name, default is eth2", default='eth2') + parser.add_argument("--radio", type=str, help="LANforge radio to use, default is wiphy0", default='wiphy0') parser.add_argument("--sta_mode", type=str, - help="LANforge station-mode setting (see add_sta LANforge CLI documentation, default is 0 (auto))") + help="LANforge station-mode setting (see add_sta LANforge CLI documentation, default is 0 (auto))", default=0) parser.add_argument("--dut_ssid", type=str, help="DUT SSID") parser.add_argument("--dut_security", type=str, help="DUT security: openLF, wpa, wpa2, wpa3") parser.add_argument("--dut_passwd", type=str, help="DUT PSK password. Do not set for OPEN auth") @@ -442,12 +442,13 @@ Example: parser.add_argument('--monitor_interval', help='How frequently you want to append to your database', default='5s') args = parser.parse_args() - if args.dest: - lfjson_host = args.dest - if args.port: - lfjson_port = args.port - staConnect = StaConnect2(lfjson_host, lfjson_port, + staConnect = StaConnect2(args.dest, args.port, + _resource=args.resource, + _upstream_resource=args.upstream_resource, + _upstream_port=args.upstream_port, + _radio=args.radio, + _sta_mode=args.sta_mode, debug_=True, _influx_db=args.influx_db, _influx_passwd=args.influx_passwd, @@ -460,16 +461,6 @@ Example: staConnect.user = args.user if args.passwd: staConnect.passwd = args.passwd - if args.sta_mode: - staConnect.sta_mode = args.sta_mode - if args.upstream_resource: - staConnect.upstream_resource = args.upstream_resource - if args.upstream_port: - staConnect.upstream_port = args.upstream_port - if args.radio: - staConnect.radio = args.radio - if args.resource: - staConnect.resource = args.resource if args.dut_ssid: staConnect.dut_ssid = args.dut_ssid if args.dut_passwd: From 776c0955bc4f472e162f7372d487369764d6acb8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 14:48:52 -0800 Subject: [PATCH 24/29] sta_connect2: Use name_to_eid to parse the upstream resource and upstream port Signed-off-by: Matthew Stidham --- py-scripts/sta_connect2.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index 7f57d1cc..35060ac3 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -420,8 +420,8 @@ Example: 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", default=1) - parser.add_argument("--upstream_resource", type=str, help="LANforge Ethernet port resource ID to use, default is 1", default=1) - parser.add_argument("--upstream_port", type=str, help="LANforge Ethernet port name, default is eth2", default='eth2') + parser.add_argument("--upstream_resource", type=str, help="LANforge Ethernet port resource ID to use, default is 1", default=None) + parser.add_argument("--upstream_port", type=str, help="LANforge Ethernet port name, default is eth2", default='1.1.eth2') parser.add_argument("--radio", type=str, help="LANforge radio to use, default is wiphy0", default='wiphy0') parser.add_argument("--sta_mode", type=str, help="LANforge station-mode setting (see add_sta LANforge CLI documentation, default is 0 (auto))", default=0) @@ -442,11 +442,16 @@ Example: parser.add_argument('--monitor_interval', help='How frequently you want to append to your database', default='5s') args = parser.parse_args() + upstream_port = LFUtils.name_to_eid(args.upstream_port) + if args.upstream_resource: + upstream_resource = args.upstream_resource + else: + upstream_resource = args.upstream_port[1] staConnect = StaConnect2(args.dest, args.port, _resource=args.resource, - _upstream_resource=args.upstream_resource, - _upstream_port=args.upstream_port, + _upstream_resource=upstream_resource, + _upstream_port=upstream_port[2], _radio=args.radio, _sta_mode=args.sta_mode, debug_=True, From d6024b41988d3ea4bb1c3f3b05689f5c44ea4b88 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 14:55:45 -0800 Subject: [PATCH 25/29] sta_connect2: Fix logic on line 449, it needs to be upstream_resource = upstream_port[1], not args.upstream_port[1] Signed-off-by: Matthew Stidham --- py-scripts/sta_connect2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index 35060ac3..4d68bbe9 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -446,7 +446,7 @@ Example: if args.upstream_resource: upstream_resource = args.upstream_resource else: - upstream_resource = args.upstream_port[1] + upstream_resource = upstream_port[1] staConnect = StaConnect2(args.dest, args.port, _resource=args.resource, From d73df6d5c9d7845474e9920f1674d47ae2a6085b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 15:35:34 -0800 Subject: [PATCH 26/29] mine_regression_results: mine data from dingo Signed-off-by: Matthew Stidham --- py-scripts/tools/mine_regression_results.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/py-scripts/tools/mine_regression_results.py b/py-scripts/tools/mine_regression_results.py index 29453448..3de5d588 100755 --- a/py-scripts/tools/mine_regression_results.py +++ b/py-scripts/tools/mine_regression_results.py @@ -56,8 +56,7 @@ def main(): args = parser.parse_args() if args.ip is None: - args.ip = ['192.168.92.18', '192.168.92.12', '192.168.93.51', '192.168.92.15', '192.168.100.184'] - #args.ip = ['192.168.93.51'] + args.ip = ['192.168.92.18', '192.168.92.12', '192.168.93.51', '192.168.92.15', '192.168.100.184', '192.168.100.30'] Miner = MineRegression(system_information=args.system_info, save_csv=args.save_csv, ips=args.ip) From b7838416c6c4053127677b4ca7739589d686c18f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 15:43:18 -0800 Subject: [PATCH 27/29] mine_regression_results: Improve output table so it has columns tallying the number of successes, errors, partial errors, partial failures specifically Signed-off-by: Matthew Stidham --- py-scripts/tools/mine_regression_results.py | 24 +++++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/py-scripts/tools/mine_regression_results.py b/py-scripts/tools/mine_regression_results.py index 3de5d588..aa3a2532 100755 --- a/py-scripts/tools/mine_regression_results.py +++ b/py-scripts/tools/mine_regression_results.py @@ -30,22 +30,32 @@ class MineRegression: ['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname', 'Python Environment']).reset_index(drop=True) errors = list() lanforge_errors = list() + partial_failures = list() + major_errors = list() + successes = list() for index in system_variations.index: variation = system_variations.iloc[index] - result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict( - variation).values()).all(axis=1), :].dropna(subset=['STDERR']).shape[0] + system = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict( + variation).values()).all(axis=1), :] + result = system.dropna(subset=['STDERR']).shape[0] errors.append(result) - lanforge_result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict( - variation).values()).all(axis=1), :].dropna(subset=['LANforge Error']).shape[0] + lanforge_result = system.dropna(subset=['LANforge Error']).shape[0] + partial_failures.append(system[system['Status'] == 'Partial Failure'].shape[0]) + major_errors.append(system[system['Status'] == 'ERROR'].shape[0]) lanforge_errors.append(lanforge_result) - system_variations['errors'] = errors + successes.append(system[system['Status'] == 'Success'].shape[0]) + system_variations['Successes'] = successes + system_variations['Errors'] = errors system_variations['LANforge errors'] = lanforge_errors - system_variations['Python errors'] = system_variations['errors'] - system_variations['LANforge errors'] + system_variations['Python errors'] = system_variations['Errors'] - system_variations['LANforge errors'] + system_variations['Partial Failures'] = partial_failures + system_variations['Major Errors'] = major_errors + system_variations if self.save_csv: system_variations.to_csv('regression_suite_results.csv') else: - print(system_variations.sort_values('errors')) + print(system_variations.sort_values('Successes')) def main(): From a72233f504b5a13e9f46d1ce6627c46bb7bc09e0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 16 Dec 2021 16:42:37 -0800 Subject: [PATCH 28/29] regression_test: Add run_cv_scenario.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 e908ec11..aebfcf02 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -345,6 +345,7 @@ else --disable_flag ht160_enable \ --debug" #recordinflux.py + "./run_cv_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test 'WiFi Capacity' --test_profile 'test-20' --cv_scenario ct-us-001" "./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 From 7d9c9fadaf43d96b6316126b93fb78d46ee8e05d Mon Sep 17 00:00:00 2001 From: shivamcandela Date: Fri, 17 Dec 2021 07:16:37 +0530 Subject: [PATCH 29/29] Added layer3 cleanup logic which will run after test Signed-off-by: shivamcandela --- py-scripts/test_ipv4_ttls.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py-scripts/test_ipv4_ttls.py b/py-scripts/test_ipv4_ttls.py index a325fe5d..8c4cf40d 100755 --- a/py-scripts/test_ipv4_ttls.py +++ b/py-scripts/test_ipv4_ttls.py @@ -271,6 +271,8 @@ class TTLSTest(Realm): self.collect_endp_stats(self.l3_cx_obj_udp.cx_profile.created_cx, traffic_type="UDP") def cleanup(self, sta_list): + self.l3_cx_obj_udp.cx_profile.cleanup_prefix() + self.l3_cx_obj_tcp.cx_profile.cleanup_prefix() self.station_profile.cleanup(sta_list) if self.vap: self.vap_profile.cleanup(1)