mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 03:07:56 +00:00
lf_check.py : bug fixe for missing test to not crash on missing test
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
@@ -381,21 +381,22 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path.
|
|||||||
#self.logger.info("stderr_log_txt: {}".format(stderr_log_txt))
|
#self.logger.info("stderr_log_txt: {}".format(stderr_log_txt))
|
||||||
stderr_log = open(stderr_log_txt, 'a')
|
stderr_log = open(stderr_log_txt, 'a')
|
||||||
|
|
||||||
|
# HERE is thwere the test is run
|
||||||
print("running {}".format(command))
|
print("running {}".format(command))
|
||||||
process = subprocess.Popen((command).split(' '), shell=False, stdout=stdout_log, stderr=stderr_log, universal_newlines=True)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
#out, err = process.communicate()
|
process = subprocess.Popen((command).split(' '), shell=False, stdout=stdout_log, stderr=stderr_log, universal_newlines=True)
|
||||||
process.wait(timeout=int(self.test_timeout))
|
# If there is a better solution please propose, the TIMEOUT Result is different then FAIL
|
||||||
except subprocess.TimeoutExpired:
|
try:
|
||||||
process.terminate()
|
#out, err = process.communicate()
|
||||||
self.test_result = "TIMEOUT"
|
process.wait(timeout=int(self.test_timeout))
|
||||||
|
except subprocess.TimeoutExpired:
|
||||||
|
process.terminate()
|
||||||
|
self.test_result = "TIMEOUT"
|
||||||
|
|
||||||
#if err:
|
except:
|
||||||
# self.logger.info("command Test timed out: {}".format(command))
|
print("No such file or directory with command: {}".format(command))
|
||||||
|
self.logger.info("No such file or directory with command: {}".format(command))
|
||||||
|
|
||||||
#self.logger.info(stderr_log_txt)
|
|
||||||
if(self.test_result != "TIMEOUT"):
|
if(self.test_result != "TIMEOUT"):
|
||||||
stderr_log_size = os.path.getsize(stderr_log_txt)
|
stderr_log_size = os.path.getsize(stderr_log_txt)
|
||||||
if stderr_log_size > 0 :
|
if stderr_log_size > 0 :
|
||||||
@@ -496,7 +497,8 @@ for running scripts listed in lf_check_config.ini
|
|||||||
logger.info("commit_hash: {}".format(commit_hash))
|
logger.info("commit_hash: {}".format(commit_hash))
|
||||||
logger.info("commit_hash2: {}".format(commit_hash.decode('utf-8','ignore')))
|
logger.info("commit_hash2: {}".format(commit_hash.decode('utf-8','ignore')))
|
||||||
|
|
||||||
check.read_config_contents() # CMR need mode to just print out the test config and not run
|
# READ Config and RUN Tests
|
||||||
|
check.read_config_contents()
|
||||||
check.run_script_test()
|
check.run_script_test()
|
||||||
|
|
||||||
# Generate Ouptput reports
|
# Generate Ouptput reports
|
||||||
|
|||||||
Reference in New Issue
Block a user