mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 20:27:54 +00:00
:Merge branch 'master' of github.com:greearb/lanforge-scripts
This commit is contained in:
@@ -37,6 +37,7 @@ class lf_report():
|
|||||||
#_path the report directory under which the report directories will be created.
|
#_path the report directory under which the report directories will be created.
|
||||||
_path = "/home/lanforge/report-data",
|
_path = "/home/lanforge/report-data",
|
||||||
_alt_path = "",
|
_alt_path = "",
|
||||||
|
_results_dir_name = "LANforge_Test_Results",
|
||||||
_output_format = 'html', # pass in on the write functionality, current not used
|
_output_format = 'html', # pass in on the write functionality, current not used
|
||||||
_dataframe="",
|
_dataframe="",
|
||||||
_title="LANForge Test Run Heading",
|
_title="LANForge Test Run Heading",
|
||||||
@@ -87,7 +88,7 @@ class lf_report():
|
|||||||
self.current_path = os.path.dirname(os.path.abspath(__file__))
|
self.current_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
# pass in _date to allow to change after construction
|
# 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()
|
self.build_date_time_directory()
|
||||||
|
|
||||||
# move the banners and candela images to report path
|
# move the banners and candela images to report path
|
||||||
@@ -119,12 +120,13 @@ class lf_report():
|
|||||||
def set_path(self,_path):
|
def set_path(self,_path):
|
||||||
self.path = _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.date = _date
|
||||||
|
self.results_dir_name = _results_dir_name
|
||||||
if self.date != "":
|
if self.date != "":
|
||||||
self.date_time_directory = self.date
|
self.date_time_directory = str(self.date) + str("_") + str(self.results_dir_name)
|
||||||
else:
|
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):
|
#def set_date_time_directory(self,date_time_directory):
|
||||||
# self.date_time_directory = date_time_directory
|
# self.date_time_directory = date_time_directory
|
||||||
@@ -133,7 +135,6 @@ class lf_report():
|
|||||||
def build_date_time_directory(self):
|
def build_date_time_directory(self):
|
||||||
if self.date_time_directory == "":
|
if self.date_time_directory == "":
|
||||||
self.set_date_time_directory()
|
self.set_date_time_directory()
|
||||||
#try:
|
|
||||||
self.path_date_time = os.path.join(self.path, self.date_time_directory)
|
self.path_date_time = os.path.join(self.path, self.date_time_directory)
|
||||||
print("path_date_time {}".format(self.path_date_time))
|
print("path_date_time {}".format(self.path_date_time))
|
||||||
try:
|
try:
|
||||||
@@ -179,6 +180,11 @@ class lf_report():
|
|||||||
def get_report_path(self):
|
def get_report_path(self):
|
||||||
return self.path_date_time
|
return self.path_date_time
|
||||||
|
|
||||||
|
def file_add_path(self, file):
|
||||||
|
output_file = str(self.path_date_time)+'/'+ str(file)
|
||||||
|
print("output file {}".format(output_file))
|
||||||
|
return output_file
|
||||||
|
|
||||||
def write_html(self):
|
def write_html(self):
|
||||||
self.write_output_html = str(self.path_date_time)+'/'+ str(self.output_html)
|
self.write_output_html = str(self.path_date_time)+'/'+ str(self.output_html)
|
||||||
print("write_output_html: {}".format(self.write_output_html))
|
print("write_output_html: {}".format(self.write_output_html))
|
||||||
|
|||||||
@@ -31,6 +31,13 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
#report = lf_report(_dataframe=dataframe)
|
#report = lf_report(_dataframe=dataframe)
|
||||||
report = lf_report()
|
report = lf_report()
|
||||||
|
|
||||||
|
report_path = report.get_path()
|
||||||
|
report_path_date_time = report.get_path_date_time()
|
||||||
|
|
||||||
|
print("path: {}".format(report_path))
|
||||||
|
print("path_date_time: {}".format(report_path_date_time))
|
||||||
|
|
||||||
report.set_title("Banner Title One")
|
report.set_title("Banner Title One")
|
||||||
report.build_banner()
|
report.build_banner()
|
||||||
#report.set_title("Banner Title Two")
|
#report.set_title("Banner Title Two")
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ import re
|
|||||||
import csv
|
import csv
|
||||||
import random
|
import random
|
||||||
import logging
|
import logging
|
||||||
|
from lf_report import lf_report
|
||||||
|
from lf_graph import lf_bar_graph
|
||||||
|
|
||||||
|
|
||||||
FORMAT = '%(asctime)s %(name)s %(levelname)s: %(message)s'
|
FORMAT = '%(asctime)s %(name)s %(levelname)s: %(message)s'
|
||||||
|
|
||||||
@@ -1594,18 +1597,6 @@ LANforge GUI what is displayed in the Column and how to access the value with cl
|
|||||||
if args.radio:
|
if args.radio:
|
||||||
radios = args.radio
|
radios = args.radio
|
||||||
|
|
||||||
if args.csv_outfile != None:
|
|
||||||
current_time = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime())
|
|
||||||
csv_outfile = "{}_{}.csv".format(args.csv_outfile,current_time)
|
|
||||||
csv_results = "results_{}_{}.csv".format(args.csv_outfile,current_time)
|
|
||||||
print("csv output file : {}".format(csv_outfile))
|
|
||||||
|
|
||||||
if args.log:
|
|
||||||
outfile_log = "{}_{}_output_log.log".format(args.outfile,current_time)
|
|
||||||
print("output file log: {}".format(outfile_log))
|
|
||||||
else:
|
|
||||||
outfile_log = "stdout"
|
|
||||||
print("output file log: {}".format(outfile_log))
|
|
||||||
|
|
||||||
if args.wait_timeout:
|
if args.wait_timeout:
|
||||||
wait_timeout = int(args.wait_timeout)
|
wait_timeout = int(args.wait_timeout)
|
||||||
@@ -1652,6 +1643,28 @@ LANforge GUI what is displayed in the Column and how to access the value with cl
|
|||||||
exit(1)
|
exit(1)
|
||||||
print("ap_dict: {}".format(ap_dict))
|
print("ap_dict: {}".format(ap_dict))
|
||||||
|
|
||||||
|
# Logging information
|
||||||
|
report = lf_report()
|
||||||
|
|
||||||
|
if args.csv_outfile != None:
|
||||||
|
current_time = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime())
|
||||||
|
csv_outfile = "{}_{}.csv".format(args.csv_outfile,current_time)
|
||||||
|
csv_outfile = report.file_add_path(csv_outfile)
|
||||||
|
|
||||||
|
csv_results = "results_{}_{}.csv".format(args.csv_outfile,current_time)
|
||||||
|
csv_results = report.file_add_path(csv_results)
|
||||||
|
print("csv output file : {}".format(csv_outfile))
|
||||||
|
print("csv results file : {}".format(csv_results))
|
||||||
|
|
||||||
|
if args.log:
|
||||||
|
outfile_log = "{}_{}_output_log.log".format(args.outfile,current_time)
|
||||||
|
outfile_log = report.file_add_path(outfile_log)
|
||||||
|
print("output file log: {}".format(outfile_log))
|
||||||
|
else:
|
||||||
|
outfile_log = "stdout"
|
||||||
|
print("output file log: {}".format(outfile_log))
|
||||||
|
|
||||||
|
# Set up the log file
|
||||||
console_handler = logging.StreamHandler()
|
console_handler = logging.StreamHandler()
|
||||||
formatter = logging.Formatter(FORMAT)
|
formatter = logging.Formatter(FORMAT)
|
||||||
logg = logging.getLogger(__name__)
|
logg = logging.getLogger(__name__)
|
||||||
@@ -2419,6 +2432,17 @@ LANforge GUI what is displayed in the Column and how to access the value with cl
|
|||||||
else:
|
else:
|
||||||
ip_var_test.passes()
|
ip_var_test.passes()
|
||||||
logg.info("Full test passed, all connections increased rx rate")
|
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__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user