From cabed1cea7841751551fcc246fdc6ed67fa6e6ec Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 29 Mar 2022 16:31:32 -0600 Subject: [PATCH] lf_check.py : added check for IndexError. Comment where to check the script output. ct_us_001_tests.json : updated for test_l3.py Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 74 +++++++++++++++++++++++++++ py-scripts/tools/lf_check.py | 8 ++- 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index bdf4a3f5..dfbd247d 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -18,6 +18,29 @@ " " ] }, + "clean_up_cxs_5g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_5g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==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 'test_l3'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, "clean_up_cxs_endp_sta_flags_AX200_5g":{ "enabled":"TRUE", "command":"lf_cleanup.py", @@ -64,6 +87,30 @@ " --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_2g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_2g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=0 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'", + " use_ssid_idx=0 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'", + " use_ssid_idx=0 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'", + " use_ssid_idx=0 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'test_l3'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_5q_all":{ "enabled":"TRUE", "command":"lf_cleanup.py", @@ -807,6 +854,33 @@ ] } }, + "suite_test_l3":{ + "test_l3":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"test_l3.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'test_l3'", + " --ap_read --ap_test_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_ap":{ "test_l3_longevity":{ "enabled":"TRUE", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 7e306ae2..caa69a93 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -965,7 +965,7 @@ QA Report Dashboard: lf_qa.py was not run as last script of test suite""" try: summary = subprocess.Popen(command_to_run, shell=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) - + # TODO the looks one directory higher, there needs to be a way to execute from higher directory. except FileNotFoundError: # TODO tx_power is one directory up from py-scripts self.logger.info("FileNotFoundError will try to execute from lanforge Top directory") @@ -980,6 +980,7 @@ QA Report Dashboard: lf_qa.py was not run as last script of test suite""" except IsADirectoryError: self.logger.info("IsADirectoryError on execution of {command}".format(command=command_to_run)) + # This code will read the output as the script is running and log for line in iter(summary.stdout.readline, ''): self.logger.info(line) summary_output += line @@ -996,6 +997,8 @@ QA Report Dashboard: lf_qa.py was not run as last script of test suite""" os.chdir(self.scripts_wd) self.logger.info("Current Working Directory {}".format(os.getcwd())) + # Since using "wait" above the return code will be set. + self.logger.info(summary_output) stdout_log.write(summary_output) stdout_log.close() @@ -1114,6 +1117,9 @@ QA Report Dashboard: lf_qa.py was not run as last script of test suite""" else: self.test_result = "Some Tests Failed" background = self.background_orange + elif 'IndexError: list index out of range' in text: + self.test_result = "Test Errors" + background = self.background_red elif 'ERROR: FAILED ' in text: self.test_result = "Some Tests Failed" background = self.background_orange