mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 18:58:01 +00:00 
			
		
		
		
	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:
		| @@ -169,7 +169,6 @@ class lf_check(): | |||||||
|                 print("test: {}  skipped".format(test)) |                 print("test: {}  skipped".format(test)) | ||||||
|             # load the default database  |             # load the default database  | ||||||
|             elif self.test_dict[test]['enabled'] == "TRUE": |             elif self.test_dict[test]['enabled'] == "TRUE": | ||||||
|                 print("test: {} executed".format(test)) |  | ||||||
|                 # loop through radios |                 # loop through radios | ||||||
|                 for radio in self.radio_dict: |                 for radio in self.radio_dict: | ||||||
|                     # Replace RADIO, SSID, PASSWD, SECURITY with actual config values (e.g. RADIO_0_CFG to values) |                     # 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') |                     stderr_log = open(stderr_log_txt, 'a') | ||||||
|                 process = subprocess.Popen((command).split(' '), shell=False, stdout=stdout_log, stderr=stderr_log, universal_newlines=True) |                 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) |                 #print(stdout_log_txt) | ||||||
|                 stdout_log_size = os.path.getsize(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) |                 #print(stderr_log_txt) | ||||||
|                 stderr_log_size = os.path.getsize(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))) |                     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 |                     background = self.background_red | ||||||
|                 else: |                 else: | ||||||
| @@ -235,6 +244,8 @@ class lf_check(): | |||||||
|                 # CMR need to generate the CSV.. should be pretty straight forward |                 # CMR need to generate the CSV.. should be pretty straight forward | ||||||
|                 row = [test,command,self.test_result,stdout_log_txt,stderr_log_txt] |                 row = [test,command,self.test_result,stdout_log_txt,stderr_log_txt] | ||||||
|                 #print("row: {}".format(row)) |                 #print("row: {}".format(row)) | ||||||
|  |                 print("test: {} executed".format(test)) | ||||||
|  |  | ||||||
|             else: |             else: | ||||||
|                 print("enable value {} invalid for test: {}, test skipped".format(self.test_dict[test]['enabled'],test)) |                 print("enable value {} invalid for test: {}, test skipped".format(self.test_dict[test]['enabled'],test)) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Chuck SmileyRekiere
					Chuck SmileyRekiere