lf_check.py : updates to close files after appending (may not be necessary) and indicate scripts skipped

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-05-15 07:24:24 -06:00
parent fd64dd39ce
commit baa261a9b3

View File

@@ -169,7 +169,6 @@ class lf_check():
print("test: {} skipped".format(test))
# load the default database
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,12 +208,22 @@ class lf_check():
stderr_log = open(stderr_log_txt, 'a')
process = subprocess.Popen((command).split(' '), shell=False, stdout=stdout_log, stderr=stderr_log, universal_newlines=True)
# close the file
stdout_log.close()
stderr_log.close()
sleep(2)
#print(stdout_log_txt)
stdout_log_size = os.path.getsize(stdout_log_txt)
stdout_log_size = os.stat(stdout_log_txt).st_size
print("stdout_log_size {}".format(stdout_log_size))
print("stdout {}".format(os.stat(stdout_log_txt)))
#print(stderr_log_txt)
stderr_log_size = os.path.getsize(stderr_log_txt)
if stderr_log_size > 0 or stdout_log_size == 0:
if stderr_log_size > 0 :
print("File: {} is not empty: {}".format(stderr_log_txt,str(stderr_log_size)))
self.test_result = "Failure"
background = self.background_red
else:
@@ -235,6 +244,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))
print("test: {} executed".format(test))
else:
print("enable value {} invalid for test: {}, test skipped".format(self.test_dict[test]['enabled'],test))