continuation of file output edits/formatting

This commit is contained in:
Dipti
2021-01-22 02:22:17 -08:00
committed by Jed Reynolds
parent 96d445b496
commit ca5a673a4f
2 changed files with 10 additions and 11 deletions

View File

@@ -140,12 +140,14 @@ python3 ./test_ipv4_l4_urls_per_ten.py
"an" : "10", "an" : "10",
"bgnAC" : "11", "bgnAC" : "11",
"abgnAX" : "12", "abgnAX" : "12",
"bgnAX" : "13", "bgnAX" : "13"} \\
--num_tests 1 \\ --num_tests 1 \\
--url "dl http://10.40.0.1 /dev/null" \\ --url "dl http://10.40.0.1 /dev/null" \\
--ap "00:0e:8e:78:e1:76" --ap "00:0e:8e:78:e1:76"
--target_per_ten 600 \\ --target_per_ten 600 \\
--test_duration 2m --output_format csv \\
--report_file ~/Documents/results.csv \\
--test_duration 2m \\
--debug --debug
''') ''')
required = None required = None
@@ -168,7 +170,7 @@ python3 ./test_ipv4_l4_urls_per_ten.py
optional.add_argument('--mode',help='Used to force mode of stations') optional.add_argument('--mode',help='Used to force mode of stations')
optional.add_argument('--ap',help='Used to force a connection to a particular AP') optional.add_argument('--ap',help='Used to force a connection to a particular AP')
optional.add_argument('--report_file',help='where you want to store results') optional.add_argument('--report_file',help='where you want to store results')
optional.add_argument('--output_format', help='choose either csv or xlsx') optional.add_argument('--output_format', help='choose csv or xlsx') #update once other forms are completed
args = parser.parse_args() args = parser.parse_args()
@@ -177,8 +179,8 @@ python3 ./test_ipv4_l4_urls_per_ten.py
num_stations_converted = int(args.num_stations) num_stations_converted = int(args.num_stations)
num_sta = num_stations_converted num_sta = num_stations_converted
if args.report_file is None: if args.report_file is None:
if args.output_format in ['csv','json','html','hdf','stata','pickle','pdf','parquet','xlsx']: if args.output_format in ['csv','json','html','hdf','stata','pickle','pdf','parquet','png','df','xlsx']:
output_form=args.output_format output_form=args.output_format.lower()
print("Defaulting file output placement to /home/lanforge.") print("Defaulting file output placement to /home/lanforge.")
rpt_file='/home/lanforge/data.' + output_form rpt_file='/home/lanforge/data.' + output_form
else: else:
@@ -220,10 +222,7 @@ python3 ./test_ipv4_l4_urls_per_ten.py
except: except:
pass pass
ip_test.l4cxprofile.monitor(report_file=rpt_file, duration_sec=ip_test.local_realm.parse_time(args.test_duration).total_seconds(), ip_test.l4cxprofile.monitor(report_file=rpt_file, duration_sec=ip_test.local_realm.parse_time(args.test_duration).total_seconds(),
created_cx=layer4traffic, created_cx=layer4traffic, output_format=output_form, script_name='test_ipv4_l4_urls_per_ten', arguments=args)
output_format=output_form,
script_name='test_ipv4_l4_urls_per_ten',
arguments=args)
ip_test.stop() ip_test.stop()
if not ip_test.passes(): if not ip_test.passes():
print(ip_test.get_fail_message()) print(ip_test.get_fail_message())

View File

@@ -203,7 +203,7 @@ python3 ./test_ipv4_variable_time.py
homedir=str(datetime.datetime.now()).replace(':','-')+'test_ipv4_variable_time' homedir=str(datetime.datetime.now()).replace(':','-')+'test_ipv4_variable_time'
os.mkdir('/home/lanforge/report_data/'+homedir) os.mkdir('/home/lanforge/report_data/'+homedir)
if args.report_file is None: if args.report_file is None:
if args.output_format in ['csv','json','html','hdf','stata','pickle','pdf','parquet','xlsx']: if args.output_format in ['csv','json','html','hdf','stata','pickle','pdf','png','df','parquet','xlsx']:
report_f='/home/lanforge/report-data/'+homedir+'/data.' + args.output_format report_f='/home/lanforge/report-data/'+homedir+'/data.' + args.output_format
output=args.output_format output=args.output_format
else: else:
@@ -265,7 +265,7 @@ python3 ./test_ipv4_variable_time.py
if ip_var_test.passes(): if ip_var_test.passes():
ip_var_test.exit_success() ip_var_test.exit_success()
IPV4VariableTime.cx_profile.stop_cx() IPV4VariableTime.cx_profile.stop_cx() #is this needed?
if __name__ == "__main__": if __name__ == "__main__":
main() main()