From f642e98ea8e550fc0145f4c860f0470869077359 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 19 Apr 2021 14:11:34 -0600 Subject: [PATCH] lf_report.py , lf_snp_test.py : add name to results directory Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_report.py | 13 +++++++------ py-scripts/lf_snp_test.py | 11 +++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/py-scripts/lf_report.py b/py-scripts/lf_report.py index 5f80fc20..310c54c0 100755 --- a/py-scripts/lf_report.py +++ b/py-scripts/lf_report.py @@ -37,6 +37,7 @@ class lf_report(): #_path the report directory under which the report directories will be created. _path = "/home/lanforge/report-data", _alt_path = "", + _results_dir_name = "LANforge_Test_Results", _output_format = 'html', # pass in on the write functionality, current not used _dataframe="", _title="LANForge Test Run Heading", @@ -87,7 +88,7 @@ class lf_report(): self.current_path = os.path.dirname(os.path.abspath(__file__)) # pass in _date to allow to change after construction - self.set_date_time_directory(_date) + self.set_date_time_directory(_date,_results_dir_name) self.build_date_time_directory() # move the banners and candela images to report path @@ -118,13 +119,14 @@ class lf_report(): def set_path(self,_path): self.path = _path - - def set_date_time_directory(self,_date): + + def set_date_time_directory(self,_date,_results_dir_name): self.date = _date + self.results_dir_name = _results_dir_name if self.date != "": - self.date_time_directory = self.date + self.date_time_directory = str(self.date) + str("_") + str(self.results_dir_name) else: - self.date_time_directory = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':','-') + self.date_time_directory = str(datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S_")).replace(':','-') + str(self.results_dir_name) #def set_date_time_directory(self,date_time_directory): # self.date_time_directory = date_time_directory @@ -133,7 +135,6 @@ class lf_report(): def build_date_time_directory(self): if self.date_time_directory == "": self.set_date_time_directory() - #try: self.path_date_time = os.path.join(self.path, self.date_time_directory) print("path_date_time {}".format(self.path_date_time)) try: diff --git a/py-scripts/lf_snp_test.py b/py-scripts/lf_snp_test.py index d4f02883..e4c5384d 100755 --- a/py-scripts/lf_snp_test.py +++ b/py-scripts/lf_snp_test.py @@ -2432,6 +2432,17 @@ LANforge GUI what is displayed in the Column and how to access the value with cl else: ip_var_test.passes() logg.info("Full test passed, all connections increased rx rate") + ########################################## + # + # Print out location of results + # + ########################################## + if args.csv_outfile != None: + logg.info("Report CSV: {}".format(csv_outfile)) + logg.info("Report CSV Results: {}".format(csv_results)) + + if args.log: + logg.info("output_log: {}".format(outfile_log)) if __name__ == "__main__": main()