lf_check.py : checking for invalid enable flags , lf_check_config.ini : fixed RADIO defines

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-05-14 17:40:26 -06:00
parent 67ddb9dde1
commit fd64dd39ce
2 changed files with 18 additions and 4 deletions

View File

@@ -125,6 +125,7 @@ class lf_check():
if 'RADIO_DICTIONARY' in config_file.sections():
section = config_file['RADIO_DICTIONARY']
self.radio_dict = json.loads(section.get('RADIO_DICT', self.radio_dict))
print("self.radio_dict {}".format(self.radio_dict))
if 'TEST_DICTIONARY' in config_file.sections():
section = config_file['TEST_DICTIONARY']
@@ -164,8 +165,11 @@ class lf_check():
def run_script_test(self):
self.start_html_results()
for test in self.test_dict:
if self.test_dict[test]['enabled'] == "FALSE":
print("test: {} skipped".format(test))
# load the default database
if self.test_dict[test]['enabled'] == "TRUE":
elif self.test_dict[test]['enabled'] == "TRUE":
print("test: {} executed".format(test))
# loop through radios
for radio in self.radio_dict:
# Replace RADIO, SSID, PASSWD, SECURITY with actual config values (e.g. RADIO_0_CFG to values)
@@ -209,7 +213,7 @@ class lf_check():
stdout_log_size = os.path.getsize(stdout_log_txt)
#print(stderr_log_txt)
stderr_log_size = os.path.getsize(stderr_log_txt)
if stderr_log_size > 0:
if stderr_log_size > 0 or stdout_log_size == 0:
print("File: {} is not empty: {}".format(stderr_log_txt,str(stderr_log_size)))
self.test_result = "Failure"
background = self.background_red
@@ -231,6 +235,8 @@ class lf_check():
# CMR need to generate the CSV.. should be pretty straight forward
row = [test,command,self.test_result,stdout_log_txt,stderr_log_txt]
#print("row: {}".format(row))
else:
print("enable value {} invalid for test: {}, test skipped".format(self.test_dict[test]['enabled'],test))
self.finish_html_results()

View File

@@ -5,10 +5,14 @@
#
# radio configuraiton used below for test arguments
# NOTE: KEY must match ELEMENT of the DICTIONARY (RADIO_0_CFG == "KEY":"RADIO_0_CFG")
[RADIO_DICTIONARY]
RADIO_DICT: {
"RADIO_0_CFG":{"KEY":"RADIO_0_CFG","RADIO":"wiphy0","STATIONS":"4","SSID":"jedway-wpa2-x2048-5-3","PASSWD":"jedway-wpa2-x2048-5-3","SECURITY":"wpa2"},
"RADIO_1_CFG":{"KEY":"RADIO_1_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"jedway-wpa2-x2048-4-1","PASSWD":"jedway-wpa2-x2048-4-1","SECURITY":"wpa2"}
"RADIO_1_CFG":{"KEY":"RADIO_1_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"jedway-wpa2-x2048-4-1","PASSWD":"jedway-wpa2-x2048-4-1","SECURITY":"wpa2"},
"RADIO_2_CFG":{"KEY":"RADIO_2_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"jedway-wpa-1","PASSWD":"jedway-wpa-1","SECURITY":"wpa"},
"RADIO_3_CFG":{"KEY":"RADIO_3_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"jedway-wep-48","PASSWD":"jedway-wep-48","SECURITY":"wep"},
"RADIO_4_CFG":{"KEY":"RADIO_4_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"jedway-wpa3-1","PASSWD":"jedway-wpa3-1","SECURITY":"wpa3"}
}
@@ -24,9 +28,13 @@ LF_MGR_PORT=8080
REPORT_DIR="/home/lanforge/html-reports"
REPORT_DATA="/home/lanforge/report-data"
# NOTE: the
[TEST_DICTIONARY]
TEST_DICT: {
"example_security_connection":{"enabled":"FALSE","command":"example_security_connection.py","args":"RADIO_0_CFG --debug"},
"example_security_connection0":{"enabled":"TRUE","command":"example_security_connection.py","args":"RADIO_0_CFG --debug"},
"example_security_connection1":{"enabled":"TRUE","command":"example_security_connection.py","args":"RADIO_2_CFG --debug"},
"example_security_connection2":{"enabled":"TRUE","command":"example_security_connection.py","args":"RADIO_3_CFG --debug"},
"example_security_connection3":{"enabled":"TRUE","command":"example_security_connection.py","args":"RADIO_4_CFG --debug"},
"sta_connect2":{"enabled":"TRUE","command":"sta_connect2.py","args":"--dut_ssid jedway-wpa2-x2048-5-3 --dut_passwd jedway-wpa2-x2048-5-3 --dut_security wpa2"},
"test_generic":{"enabled":"FALSE","command":"test_generic.py","args":"RADIO_0_CFG --type lfping --dest 10.40.0.1 --debug"},
"test_ipv4_connection":{"enabled":"FALSE","command":"test_ipv4_connection.py","args":"RADIO_0_CFG --debug"},