From 43fa8db465dc7d433366ac289a8cd0924a3cf35a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 30 Nov 2021 12:33:57 -0500 Subject: [PATCH] lf_check.py : add test run, success, timeout, failure summary ct_us_001_scripts.json : fixed typo Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 2 +- py-scripts/tools/lf_check.py | 26 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 63fb63f3..9627d0b6 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -67,7 +67,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[" --mgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", - " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USEDD,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " 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 --local_lf_report_dir REPORT_PATH"]} }, "suite_test":{ diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 9d052caa..804494bf 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -156,6 +156,10 @@ class lf_check(): self.outfile = _outfile self.outfile_name = _outfile_name self.test_result = "Failure" + self.tests_run = 0 + self.tests_success = 0 + self.tests_failure = 0 + self.tests_timeout = 0 self.results_col_titles = [ "Test", "Command", "Result", "STDOUT", "STDERR"] self.html_results = "" @@ -250,7 +254,7 @@ class lf_check(): "get_scripts_get_sha exit_code: {exit_code}".format( exit_code=exit_code)) scripts_git_sha = commit_hash.decode('utf-8', 'ignore') - scripts_git_sha = scripts_git_sha.replace('\n','') + scripts_git_sha = scripts_git_sha.replace('\n', '') return scripts_git_sha ''' @@ -1056,6 +1060,16 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.test_result = "Time Out" background = self.background_purple + # Total up test, tests success, tests failure, tests + # timeouts + self.tests_run += 1 + if self.test_result == "Success": + self.tests_success += 1 + elif self.test_result == "Failure": + self.tests_failed += 1 + elif self.test_result == "TIMEOUT": + self.tests_timeout += 1 + if 'lf_qa' in command: line_list = open(stdout_log_txt).readlines() for line in line_list: @@ -1405,6 +1419,12 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # Successfully gathered LANforge information Run Tests check.run_script_test() + lf_test_summary = pd.DataFrame() + lf_test_summary['Tests Run'] = [check.tests_run] + lf_test_summary['Success'] = [check.tests_success] + lf_test_summary['Failure'] = [check.tests_failure] + lf_test_summary['Timeout'] = [check.tests_timeout] + # generate output reports test_rig = check.get_test_rig() report.set_title( @@ -1422,6 +1442,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_radio_df) report.build_table() + report.set_table_title("LF Check Test Summary") + report.build_table_title() + report.set_table_dataframe(lf_test_summary) + report.build_table() report.set_table_title("LF Check Test Results") report.build_table_title() html_results = check.get_html_results()