lf_check.py : formatting lf_check_config.ini reduced length of l3_longevity test

This commit is contained in:
Chuck SmileyRekiere
2021-05-14 08:49:03 -06:00
parent e9aa330189
commit 9657b90389
2 changed files with 13 additions and 4 deletions

View File

@@ -67,6 +67,9 @@ class lf_check():
self.test_result = "Failure" self.test_result = "Failure"
self.results_col_titles = ["Test","Command","Result","STDOUT","STDERR"] self.results_col_titles = ["Test","Command","Result","STDOUT","STDERR"]
self.html_results = "" self.html_results = ""
self.background_green = "background-color:green"
self.background_red = "background-color:red"
self.background_purple = "background-color:purple"
def get_html_results(self): def get_html_results(self):
return self.html_results return self.html_results
@@ -75,7 +78,7 @@ class lf_check():
self.html_results += """ self.html_results += """
<table border="1" class="dataframe"> <table border="1" class="dataframe">
<thead> <thead>
<tr style="text-align: right;"> <tr style="text-align: left;">
<th>Test</th> <th>Test</th>
<th>Command</th> <th>Command</th>
<th>Result</th> <th>Result</th>
@@ -90,6 +93,9 @@ class lf_check():
self.html_results += """ self.html_results += """
</tbody> </tbody>
</table> </table>
<br>
<br>
<br>
""" """
# Functions in this section are/can be overridden by descendants # Functions in this section are/can be overridden by descendants
@@ -201,13 +207,16 @@ class lf_check():
if stderr_log_size > 0: if stderr_log_size > 0:
print("File: {} is not empty: {}".format(stderr_log_txt,str(stderr_log_size))) print("File: {} is not empty: {}".format(stderr_log_txt,str(stderr_log_size)))
self.test_result = "Failure" self.test_result = "Failure"
background = self.background_red
else: else:
print("File: {} is empty: {}".format(stderr_log_txt,str(stderr_log_size))) print("File: {} is empty: {}".format(stderr_log_txt,str(stderr_log_size)))
self.test_result = "Success" self.test_result = "Success"
background = self.background_green
self.html_results += """ self.html_results += """
<tr><td>""" + str(test) + """</td><td class='scriptdetails'>""" + str(command) + """</td> <tr><td>""" + str(test) + """</td><td class='scriptdetails'>""" + str(command) + """</td>
<td style="balckground-color:green">""" + str(self.test_result) + """ <td style="""+ str(background) + """>""" + str(self.test_result) + """
<td><a href=""" + str(stdout_log_txt) + """ target=\"_blank\">STDOUT</a></td> <td><a href=""" + str(stdout_log_txt) + """ target=\"_blank\">STDOUT</a></td>
<td><a href=""" + str(stderr_log_txt) + """ target=\"_blank\">STDERR</a></td></tr>""" <td><a href=""" + str(stderr_log_txt) + """ target=\"_blank\">STDERR</a></td></tr>"""
@@ -273,7 +282,7 @@ for running scripts listed in lf_check_config.ini
report.build_table_title() report.build_table_title()
# custom html (maybe try different) # custom html (maybe try different)
html_results = check.get_html_results() html_results = check.get_html_results()
print("html_results {}".format(html_results)) #print("html_results {}".format(html_results))
report.set_custom_html(html_results) report.set_custom_html(html_results)
report.build_custom() report.build_custom()
report.write_html() report.write_html()

View File

@@ -45,7 +45,7 @@ TEST_DICT: {
"testgroup":{"enabled":"FALSE","command":"testgroup.py","args":""}, "testgroup":{"enabled":"FALSE","command":"testgroup.py","args":""},
"test_ipv6_connection":{"enabled":"FALSE","command":"test_ipv6_connection.py","args":""}, "test_ipv6_connection":{"enabled":"FALSE","command":"test_ipv6_connection.py","args":""},
"test_ipv6_variable_time":{"enabled":"FALSE","command":"test_ipv6_variable_time.py","args":""}, "test_ipv6_variable_time":{"enabled":"FALSE","command":"test_ipv6_variable_time.py","args":""},
"test_l3_longevity":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"--test_duration 30s --polling_interval 10s --upstream_port eth1 "test_l3_longevity":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"--test_duration 20s --polling_interval 5s --upstream_port eth1
--radio 'radio==wiphy0,stations==1,ssid==jedway-wpa2-x2048-5-3,ssid_pw==jedway-wpa2-x2048-5-3,security==wpa2' --radio 'radio==wiphy0,stations==1,ssid==jedway-wpa2-x2048-5-3,ssid_pw==jedway-wpa2-x2048-5-3,security==wpa2'
--radio 'radio==wiphy1,stations==1,ssid==jedway-wpa2-x2048-4-1,ssid_pw==jedway-wpa2-x2048-4-1,security==wpa2' --radio 'radio==wiphy1,stations==1,ssid==jedway-wpa2-x2048-4-1,ssid_pw==jedway-wpa2-x2048-4-1,security==wpa2'
--endp_type lf_udp --ap_read --ap_test_mode --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"}, --endp_type lf_udp --ap_read --ap_test_mode --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"},