mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
lf_check.py : exit if suite is not present in .ini
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
@@ -263,6 +263,10 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path.
|
|||||||
self.logger.info("{}: {}".format(self.test_suite,self.test_dict))
|
self.logger.info("{}: {}".format(self.test_suite,self.test_dict))
|
||||||
except:
|
except:
|
||||||
self.logger.info("Excpetion loading {}, is there comma after the last entry? Check syntax".format(self.test_suite))
|
self.logger.info("Excpetion loading {}, is there comma after the last entry? Check syntax".format(self.test_suite))
|
||||||
|
else:
|
||||||
|
self.logger.info("EXITING... NOT FOUND Test Suite with name : {}".format(self.test_suite))
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
|
||||||
def load_factory_default_db(self):
|
def load_factory_default_db(self):
|
||||||
#self.logger.info("file_wd {}".format(self.scripts_wd))
|
#self.logger.info("file_wd {}".format(self.scripts_wd))
|
||||||
@@ -466,7 +470,8 @@ for running scripts listed in lf_check_config.ini
|
|||||||
parser.add_argument('--logfile', help="--logfile <logfile Name> logging for output of lf_check.py script", default="lf_check.log")
|
parser.add_argument('--logfile', help="--logfile <logfile Name> logging for output of lf_check.py script", default="lf_check.log")
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
# load the test config information
|
|
||||||
|
# Load test config file information
|
||||||
config_ini = os.getcwd() + '/' + args.ini
|
config_ini = os.getcwd() + '/' + args.ini
|
||||||
if os.path.exists(config_ini):
|
if os.path.exists(config_ini):
|
||||||
print("TEST CONFIG : {}".format(config_ini))
|
print("TEST CONFIG : {}".format(config_ini))
|
||||||
@@ -474,9 +479,10 @@ for running scripts listed in lf_check_config.ini
|
|||||||
print("EXITING: NOTFOUND TEST CONFIG : {} ".format(config_ini))
|
print("EXITING: NOTFOUND TEST CONFIG : {} ".format(config_ini))
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
# Select test suite
|
||||||
test_suite = args.suite
|
test_suite = args.suite
|
||||||
|
|
||||||
# output report.
|
# Create Report Class for reporting
|
||||||
report = lf_report(_results_dir_name="lf_check",
|
report = lf_report(_results_dir_name="lf_check",
|
||||||
_output_html="lf_check.html",
|
_output_html="lf_check.html",
|
||||||
_output_pdf="lf-check.pdf")
|
_output_pdf="lf-check.pdf")
|
||||||
@@ -493,13 +499,13 @@ for running scripts listed in lf_check_config.ini
|
|||||||
_csv_results = csv_results,
|
_csv_results = csv_results,
|
||||||
_outfile = outfile_path)
|
_outfile = outfile_path)
|
||||||
|
|
||||||
# get the git sha
|
# Get git sha
|
||||||
process = subprocess.Popen(["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE)
|
process = subprocess.Popen(["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE)
|
||||||
(commit_hash, err) = process.communicate()
|
(commit_hash, err) = process.communicate()
|
||||||
exit_code = process.wait()
|
exit_code = process.wait()
|
||||||
git_sha = commit_hash.decode('utf-8','ignore')
|
git_sha = commit_hash.decode('utf-8','ignore')
|
||||||
|
|
||||||
# set up logging
|
# Set Up logging
|
||||||
logfile = args.logfile[:-4]
|
logfile = args.logfile[:-4]
|
||||||
print("logfile: {}".format(logfile))
|
print("logfile: {}".format(logfile))
|
||||||
logfile = "{}-{}.log".format(logfile,current_time)
|
logfile = "{}-{}.log".format(logfile,current_time)
|
||||||
|
|||||||
Reference in New Issue
Block a user