mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-03 20:27:54 +00:00 
			
		
		
		
	arg additions
This commit is contained in:
		@@ -1168,24 +1168,6 @@ class L3CXProfile(BaseProfile):
 | 
				
			|||||||
            output_format = report_file.split('.')[-1]
 | 
					            output_format = report_file.split('.')[-1]
 | 
				
			||||||
        #retrieve compared report if specified - turn into dataframe
 | 
					        #retrieve compared report if specified - turn into dataframe
 | 
				
			||||||
        if compared_report is not None:
 | 
					        if compared_report is not None:
 | 
				
			||||||
            compared_format = compared_report.split('.')[-1]
 | 
					 | 
				
			||||||
            #initial dataframe
 | 
					 | 
				
			||||||
            previous_data_df = pd.DataFrame()
 | 
					 | 
				
			||||||
            if compared_format == 'hdf':
 | 
					 | 
				
			||||||
                #df.to_hdf(report_file, 'table', append=True)
 | 
					 | 
				
			||||||
                continue
 | 
					 | 
				
			||||||
            if compared_format == 'parquet':
 | 
					 | 
				
			||||||
                #df.to_parquet(report_file, engine='pyarrow')
 | 
					 | 
				
			||||||
                continue
 | 
					 | 
				
			||||||
            if compared_format == 'png':
 | 
					 | 
				
			||||||
                #fig = df.plot().get_figure()
 | 
					 | 
				
			||||||
                #fig.savefig(report_file)
 | 
					 | 
				
			||||||
                continue
 | 
					 | 
				
			||||||
            if compared_format.lower() in ['excel', 'xlsx'] or report_file.split('.')[-1] == 'xlsx':
 | 
					 | 
				
			||||||
                continue
 | 
					 | 
				
			||||||
            if compared_format == 'df':
 | 
					 | 
				
			||||||
                #return df
 | 
					 | 
				
			||||||
                continue
 | 
					 | 
				
			||||||
            supported_formats = ['csv', 'json', 'stata', 'pickle','html']
 | 
					            supported_formats = ['csv', 'json', 'stata', 'pickle','html']
 | 
				
			||||||
            for format in supported_formats:
 | 
					            for format in supported_formats:
 | 
				
			||||||
                if compared_format.lower() == format:
 | 
					                if compared_format.lower() == format:
 | 
				
			||||||
@@ -1237,6 +1219,7 @@ class L3CXProfile(BaseProfile):
 | 
				
			|||||||
                self._fail("FAIL: Not all stations increased traffic")
 | 
					                self._fail("FAIL: Not all stations increased traffic")
 | 
				
			||||||
                self.exit_fail()
 | 
					                self.exit_fail()
 | 
				
			||||||
            old_cx_rx_values = new_cx_rx_values
 | 
					            old_cx_rx_values = new_cx_rx_values
 | 
				
			||||||
 | 
					            #write csv file here - open, write,  and close file
 | 
				
			||||||
            time.sleep(monitor_interval)
 | 
					            time.sleep(monitor_interval)
 | 
				
			||||||
        print(value_map)
 | 
					        print(value_map)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1266,7 +1249,6 @@ class L3CXProfile(BaseProfile):
 | 
				
			|||||||
        df=df[["Timestamp","Timestamp milliseconds", *header_row[:-2]]]
 | 
					        df=df[["Timestamp","Timestamp milliseconds", *header_row[:-2]]]
 | 
				
			||||||
        #compare previous data to current data
 | 
					        #compare previous data to current data
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            systeminfo = ast.literal_eval(requests.get('http://'+str(self.lfclient_host)+':'+str(self.lfclient_port)).text)
 | 
					            systeminfo = ast.literal_eval(requests.get('http://'+str(self.lfclient_host)+':'+str(self.lfclient_port)).text)
 | 
				
			||||||
        except:
 | 
					        except:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -193,9 +193,10 @@ python3 ./test_ipv4_variable_time.py
 | 
				
			|||||||
        optional_args.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000)
 | 
					        optional_args.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000)
 | 
				
			||||||
        optional_args.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000)
 | 
					        optional_args.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000)
 | 
				
			||||||
        optional_args.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m")
 | 
					        optional_args.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m")
 | 
				
			||||||
        optional_args.add_argument('--col_names', help='Columns wished to be monitor', default=['name','tx bytes', 'rx bytes','dropped'])
 | 
					        optional_args.add_argument('--col_names', help='Columns wished to be monitor',default=['name','tx bytes', 'rx bytes','dropped'])
 | 
				
			||||||
        optional_args.add_argument('--compared_report',help='report path and file which is wished to be compared with new report', default=None)
 | 
					        optional_args.add_argument('--compared_report',help='report path and file which is wished to be compared with new report', default=None)
 | 
				
			||||||
    args = parser.parse_args()
 | 
					    args = parser.parse_args()
 | 
				
			||||||
 | 
					    #['name','tx bytes', 'rx bytes','dropped']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    num_sta = 2
 | 
					    num_sta = 2
 | 
				
			||||||
    if (args.num_stations is not None) and (int(args.num_stations) > 0):
 | 
					    if (args.num_stations is not None) and (int(args.num_stations) > 0):
 | 
				
			||||||
@@ -223,7 +224,9 @@ python3 ./test_ipv4_variable_time.py
 | 
				
			|||||||
            output=str(args.report_file).split('.')[-1]
 | 
					            output=str(args.report_file).split('.')[-1]
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            output=args.output_format
 | 
					            output=args.output_format
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    #Retrieve last data file
 | 
					    #Retrieve last data file
 | 
				
			||||||
 | 
					    compared_rept=None
 | 
				
			||||||
    if args.compared_report:
 | 
					    if args.compared_report:
 | 
				
			||||||
        #check if last report format is same as current rpt format
 | 
					        #check if last report format is same as current rpt format
 | 
				
			||||||
        last_report_format = args.compared_report.split('.')[-1]
 | 
					        last_report_format = args.compared_report.split('.')[-1]
 | 
				
			||||||
@@ -267,7 +270,8 @@ python3 ./test_ipv4_variable_time.py
 | 
				
			|||||||
        col_names=None
 | 
					        col_names=None
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        col_names = args.col_names
 | 
					        col_names = args.col_names
 | 
				
			||||||
    print(col_names)
 | 
					    if args.debug:
 | 
				
			||||||
 | 
					        print(col_names)
 | 
				
			||||||
    ip_var_test.l3cxprofile.monitor(col_names=col_names,
 | 
					    ip_var_test.l3cxprofile.monitor(col_names=col_names,
 | 
				
			||||||
                                    report_file=report_f,
 | 
					                                    report_file=report_f,
 | 
				
			||||||
                                    duration_sec=ip_var_test.local_realm.parse_time(args.test_duration).total_seconds(),
 | 
					                                    duration_sec=ip_var_test.local_realm.parse_time(args.test_duration).total_seconds(),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user