mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 10:48:02 +00:00 
			
		
		
		
	lf_snp_test.py : bug fix for different number of upload and download rates to be tested.
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
		| @@ -140,6 +140,7 @@ INCLUDE_IN_README | ||||
| ''' | ||||
| import sys | ||||
| import os | ||||
| import itertools | ||||
| from pprint import pprint | ||||
|  | ||||
|  | ||||
| @@ -2350,158 +2351,156 @@ LANforge GUI what is displayed in the Column and how to access the value with cl | ||||
|  | ||||
|                                                 for controller_packet_type in controller_packet_types: | ||||
|                                                     for controller_direction in controller_directions: | ||||
|                                                         for side_a_tx_min_bps_ul in controller_side_a_tx_min_bps: | ||||
|                                                             for side_b_tx_min_bps_dl in controller_side_b_tx_min_bps: | ||||
|                                                                 for controller_pdu in controller_pdus: | ||||
|                                                                     logg.info("#####################################################") | ||||
|                                                                     logg.info("# TEST RUNNING ,  TEST RUNNING ######################") | ||||
|                                                                     logg.info("#####################################################") | ||||
|                                                                     test_config = "AP=={} Band=={} chan_5ghz=={} chan_24ghz=={} wifi_mode=={} BW=={} encryption=={} ap_mode=={} clients=={} packet_type=={} direction=={} pdu=={}".format( | ||||
|                                                                         controller_ap,controller_band,controller_chan_5ghz,controller_chan_24ghz,controller_wifimode,controller_chan_width,controller_data_encryption,controller_ap_mode,controller_client_density, | ||||
|                                                                         controller_packet_type,controller_direction,controller_pdu) | ||||
|                                                                     test_keys = ['AP','Band','wifi_mode','chan_5ghz','chan_24ghz','BW','encryption','ap_mode','clients','packet_type','direction','pdu']  | ||||
|  | ||||
|                                                                     logg.info("# controller run settings: {}".format(test_config)) | ||||
|                                                                     if(args.no_controller): | ||||
|                                                                         logg.info("################################################") | ||||
|                                                                         logg.info("# NO CONTROLLER SET , TEST MODE") | ||||
|                                                                         logg.info("################################################") | ||||
|                                                                         if( controller_ap            != __ap_set or  | ||||
|                                                                             controller_band          != __band_set or | ||||
|                                                                             controller_chan_width    != __chan_width_set or | ||||
|                                                                             controller_ap_mode       != __ap_mode_set or | ||||
|                                                                             controller_tx_power      != __tx_power_set or | ||||
|                                                                             controller_chan_5ghz     != __chan_5ghz_set or | ||||
|                                                                             controller_chan_24ghz    != __chan_24ghz_set | ||||
|                                                                             ): | ||||
|                                                                             logg.info("###############################################") | ||||
|                                                                             logg.info("# NEW CONTROLLER CONFIG") | ||||
|                                                                             logg.info("###############################################") | ||||
|                                                                             __ap_set          = controller_ap | ||||
|                                                                             __band_set        = controller_band | ||||
|                                                                             __chan_width_set  = controller_chan_width | ||||
|                                                                             __ap_mode_set     = controller_ap_mode | ||||
|                                                                             __tx_power_set    = controller_tx_power | ||||
|                                                                             __chan_5ghz_set   = controller_chan_5ghz | ||||
|                                                                             __chan_24ghz_set  = controller_chan_24ghz | ||||
|                                                                             __client_density  = controller_client_density | ||||
|                                                                     else: | ||||
|                                                                         if( controller_ap            != __ap_set or  | ||||
|                                                                             controller_band          != __band_set or | ||||
|                                                                             controller_chan_width    != __chan_width_set or | ||||
|                                                                             controller_ap_mode       != __ap_mode_set or | ||||
|                                                                             controller_tx_power      != __tx_power_set or | ||||
|                                                                             controller_chan_5ghz     != __chan_5ghz_set or | ||||
|                                                                             controller_chan_24ghz    != __chan_24ghz_set | ||||
|                                                                             ): | ||||
|                                                                             logg.info("###############################################") | ||||
|                                                                             logg.info("# NEW CONTROLLER CONFIG") | ||||
|                                                                             logg.info("###############################################") | ||||
|                                                                             __ap_set          = controller_ap | ||||
|                                                                             __band_set        = controller_band | ||||
|                                                                             __chan_width_set  = controller_chan_width | ||||
|                                                                             __ap_mode_set     = controller_ap_mode | ||||
|                                                                             __tx_power_set    = controller_tx_power | ||||
|                                                                             __chan_5ghz_set   = controller_chan_5ghz | ||||
|                                                                             __chan_24ghz_set  = controller_chan_24ghz | ||||
|                                                                             __client_density  = controller_client_density | ||||
|  | ||||
|                                                                             controller = CreateCtlr( | ||||
|                                                                                             _scheme=__scheme, | ||||
|                                                                                             _port=__port, | ||||
|                                                                                             _series=__series, | ||||
|                                                                                             _ctlr=__ctlr, | ||||
|                                                                                             _prompt=__prompt, | ||||
|                                                                                             _user=__user, | ||||
|                                                                                             _passwd=__passwd, | ||||
|                                                                                             _ap=__ap_set, | ||||
|                                                                                             _band=__band_set, | ||||
|                                                                                             _chan_5ghz=__chan_5ghz_set, | ||||
|                                                                                             _chan_24ghz=__chan_24ghz_set, | ||||
|                                                                                             _chan_width=__chan_width_set, | ||||
|                                                                                             _ap_mode=__ap_mode_set, | ||||
|                                                                                             _tx_power=__tx_power_set, | ||||
|                                                                                             _cap_ctl_out=__cap_ctl_out | ||||
|                                                                                             ) | ||||
|                                                                             #Disable AP | ||||
|                                                                             # | ||||
|                                                                             # Controller Configuration | ||||
|                                                                             # | ||||
|                                                                             #if controller_args.controller_series == "9800": | ||||
|                                                                             #    controller_controller_no_loggin_console() | ||||
|                                                                             pss = controller.controller_show_ap_summary() | ||||
|                                                                             logg.info("pss {}".format(pss)) | ||||
|                                                                             controller.controller_disable_ap() | ||||
|                                                                             if controller_args.controller_series == "9800": | ||||
|                                                                                 controller.controller_disable_wlan() | ||||
|                                                                                 controller.controller_disable_network_5ghz() | ||||
|                                                                                 controller.controller_disable_network_24ghz() | ||||
|                                                                                 controller.controller_role_manual() | ||||
|                                                                             else: | ||||
|                                                                                 controller.controller_disable_network_5ghz() | ||||
|                                                                                 controller.controller_disable_network_24ghz() | ||||
|                                                                             controller.controller_set_tx_power() | ||||
|                                                                             controller.controller_set_channel() | ||||
|                                                                             controller.controller_set_bandwidth() | ||||
|                                                                             if controller_args.controller_series == "9800": | ||||
|                                                                                 controller.controller_create_wlan() | ||||
|                                                                                 controller.controller_set_wireless_tag_policy() | ||||
|                                                                                 controller.controller_enable_wlan() | ||||
|                                                                             if controller_band == "a":     | ||||
|                                                                                 controller.controller_enable_network_5ghz() | ||||
|                                                                             else:     | ||||
|                                                                                 controller.controller_enable_network_24ghz() | ||||
|                                                                             controller.controller_enable_ap() | ||||
|                                                                             # need to actually check the CAC timer | ||||
|                                                                             time.sleep(30) | ||||
|                                                                             #################################### | ||||
|                                                                             # end of controller controller code | ||||
|                                                                             #################################### | ||||
|                                                         # looping though both A and B together,  upload direction will select A, download direction will select B | ||||
|                                                         for side_a_tx_min_bps_ul, side_b_tx_min_bps_dl in itertools.zip_longest(controller_side_a_tx_min_bps, controller_side_b_tx_min_bps, fillvalue = 256000): | ||||
|                                                             for controller_pdu in controller_pdus: | ||||
|                                                                 logg.info("###################################################################") | ||||
|                                                                 logg.info("# TEST RUNNING direction:{} ul: {} ,  TEST RUNNING dl: {}" | ||||
|                                                                     .format(controller_direction, side_a_tx_min_bps_ul, side_b_tx_min_bps_dl)) | ||||
|                                                                 logg.info("####################################################################") | ||||
|                                                                 test_config = "AP=={} Band=={} chan_5ghz=={} chan_24ghz=={} wifi_mode=={} BW=={} encryption=={} ap_mode=={} clients=={} packet_type=={} direction=={} pdu=={}".format( | ||||
|                                                                     controller_ap,controller_band,controller_chan_5ghz,controller_chan_24ghz,controller_wifimode,controller_chan_width,controller_data_encryption,controller_ap_mode,controller_client_density, | ||||
|                                                                     controller_packet_type,controller_direction,controller_pdu) | ||||
|                                                                 test_keys = ['AP','Band','wifi_mode','chan_5ghz','chan_24ghz','BW','encryption','ap_mode','clients','packet_type','direction','pdu']  | ||||
|                                                                 logg.info("# controller run settings: {}".format(test_config)) | ||||
|                                                                 if(args.no_controller): | ||||
|                                                                     logg.info("################################################") | ||||
|                                                                     logg.info("# NO CONTROLLER SET , TEST MODE") | ||||
|                                                                     logg.info("################################################") | ||||
|                                                                     if( controller_ap            != __ap_set or  | ||||
|                                                                         controller_band          != __band_set or | ||||
|                                                                         controller_chan_width    != __chan_width_set or | ||||
|                                                                         controller_ap_mode       != __ap_mode_set or | ||||
|                                                                         controller_tx_power      != __tx_power_set or | ||||
|                                                                         controller_chan_5ghz     != __chan_5ghz_set or | ||||
|                                                                         controller_chan_24ghz    != __chan_24ghz_set | ||||
|                                                                         ): | ||||
|                                                                         logg.info("###############################################") | ||||
|                                                                         logg.info("# NEW CONTROLLER CONFIG") | ||||
|                                                                         logg.info("###############################################") | ||||
|                                                                         __ap_set          = controller_ap | ||||
|                                                                         __band_set        = controller_band | ||||
|                                                                         __chan_width_set  = controller_chan_width | ||||
|                                                                         __ap_mode_set     = controller_ap_mode | ||||
|                                                                         __tx_power_set    = controller_tx_power | ||||
|                                                                         __chan_5ghz_set   = controller_chan_5ghz | ||||
|                                                                         __chan_24ghz_set  = controller_chan_24ghz | ||||
|                                                                         __client_density  = controller_client_density | ||||
|                                                                 else: | ||||
|                                                                     if( controller_ap            != __ap_set or  | ||||
|                                                                         controller_band          != __band_set or | ||||
|                                                                         controller_chan_width    != __chan_width_set or | ||||
|                                                                         controller_ap_mode       != __ap_mode_set or | ||||
|                                                                         controller_tx_power      != __tx_power_set or | ||||
|                                                                         controller_chan_5ghz     != __chan_5ghz_set or | ||||
|                                                                         controller_chan_24ghz    != __chan_24ghz_set | ||||
|                                                                         ): | ||||
|                                                                         logg.info("###############################################") | ||||
|                                                                         logg.info("# NEW CONTROLLER CONFIG") | ||||
|                                                                         logg.info("###############################################") | ||||
|                                                                         __ap_set          = controller_ap | ||||
|                                                                         __band_set        = controller_band | ||||
|                                                                         __chan_width_set  = controller_chan_width | ||||
|                                                                         __ap_mode_set     = controller_ap_mode | ||||
|                                                                         __tx_power_set    = controller_tx_power | ||||
|                                                                         __chan_5ghz_set   = controller_chan_5ghz | ||||
|                                                                         __chan_24ghz_set  = controller_chan_24ghz | ||||
|                                                                         __client_density  = controller_client_density | ||||
|                                                                         controller = CreateCtlr( | ||||
|                                                                                         _scheme=__scheme, | ||||
|                                                                                         _port=__port, | ||||
|                                                                                         _series=__series, | ||||
|                                                                                         _ctlr=__ctlr, | ||||
|                                                                                         _prompt=__prompt, | ||||
|                                                                                         _user=__user, | ||||
|                                                                                         _passwd=__passwd, | ||||
|                                                                                         _ap=__ap_set, | ||||
|                                                                                         _band=__band_set, | ||||
|                                                                                         _chan_5ghz=__chan_5ghz_set, | ||||
|                                                                                         _chan_24ghz=__chan_24ghz_set, | ||||
|                                                                                         _chan_width=__chan_width_set, | ||||
|                                                                                         _ap_mode=__ap_mode_set, | ||||
|                                                                                         _tx_power=__tx_power_set, | ||||
|                                                                                         _cap_ctl_out=__cap_ctl_out | ||||
|                                                                                         ) | ||||
|                                                                         #Disable AP | ||||
|                                                                         # | ||||
|                                                                         # Controller Configuration | ||||
|                                                                         # | ||||
|                                                                         #if controller_args.controller_series == "9800": | ||||
|                                                                         #    controller_controller_no_loggin_console() | ||||
|                                                                         pss = controller.controller_show_ap_summary() | ||||
|                                                                         logg.info("pss {}".format(pss)) | ||||
|                                                                         controller.controller_disable_ap() | ||||
|                                                                         if controller_args.controller_series == "9800": | ||||
|                                                                             controller.controller_disable_wlan() | ||||
|                                                                             controller.controller_disable_network_5ghz() | ||||
|                                                                             controller.controller_disable_network_24ghz() | ||||
|                                                                             controller.controller_role_manual() | ||||
|                                                                         else: | ||||
|                                                                             logg.info("###############################################") | ||||
|                                                                             logg.info("# NO CHANGE TO CONTROLLER CONFIG") | ||||
|                                                                             logg.info("###############################################") | ||||
|                                                                             logg.info("controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}" | ||||
|                                                                                 .format(controller_ap,controller_band, controller_chan_width, controller_ap_mode, controller_tx_power, controller_chan_5ghz, controller_chan_24ghz)) | ||||
|                                                                             logg.info("__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}" | ||||
|                                                                                 .format(__ap_set,__band_set, __chan_width_set, __ap_mode_set, __tx_power_set, __chan_5ghz_set, __chan_24ghz_set)) | ||||
|                                                                         logg.info("controller_wifi_mode {}".format(controller_wifimode)) | ||||
|  | ||||
|                                                                         logg.info("radios {}".format(radios)) | ||||
|                                                                         for radio_ in radios: | ||||
|                                                                             radio_keys = ['radio','stations','ssid','ssid_pw','security','wifimode'] | ||||
|                                                                             radio_info_dict = dict(map(lambda x: x.split('=='), str(radio_).replace('[','').replace(']','').replace("'","").split())) | ||||
|                                                                             logg.info("radio_dict {}".format(radio_info_dict)) | ||||
|                                                                             for key in radio_keys: | ||||
|                                                                                 if key not in radio_info_dict: | ||||
|                                                                                     logg.info("missing config, for the {}, all of the following need to be present {} ".format(key,radio_keys)) | ||||
|                                                                                     exit(1) | ||||
|                                                                             radio_name_list.append(radio_info_dict['radio']) | ||||
|                                                                             ssid_list.append(radio_info_dict['ssid']) | ||||
|                                                                             ssid_password_list.append(radio_info_dict['ssid_pw']) | ||||
|                                                                             ssid_security_list.append(radio_info_dict['security']) | ||||
|                                                                             if args.radio: | ||||
|                                                                                 number_of_stations_per_radio_list.append(radio_info_dict['stations']) | ||||
|                                                                                 wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) | ||||
|                                                                             else:  | ||||
|                                                                                 number_of_stations_per_radio_list.append(radio_info_dict['stations']) | ||||
|                                                                                 wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) | ||||
|                                                                             optional_radio_reset_keys = ['reset_port_enable'] | ||||
|                                                                             radio_reset_found = True | ||||
|                                                                             for key in optional_radio_reset_keys: | ||||
|                                                                                 if key not in radio_info_dict: | ||||
|                                                                                     #logg.info("port reset test not enabled") | ||||
|                                                                                     radio_reset_found = False | ||||
|                                                                                     break | ||||
|                                                                                  | ||||
|                                                                             if radio_reset_found: | ||||
|                                                                                 reset_port_enable_list.append(True) | ||||
|                                                                                 reset_port_time_min_list.append(radio_info_dict['reset_port_time_min']) | ||||
|                                                                                 reset_port_time_max_list.append(radio_info_dict['reset_port_time_max']) | ||||
|                                                                             else: | ||||
|                                                                                 reset_port_enable_list.append(False) | ||||
|                                                                                 reset_port_time_min_list.append('0s') | ||||
|                                                                                 reset_port_time_max_list.append('0s') | ||||
|                                                                             controller.controller_disable_network_5ghz() | ||||
|                                                                             controller.controller_disable_network_24ghz() | ||||
|                                                                         controller.controller_set_tx_power() | ||||
|                                                                         controller.controller_set_channel() | ||||
|                                                                         controller.controller_set_bandwidth() | ||||
|                                                                         if controller_args.controller_series == "9800": | ||||
|                                                                             controller.controller_create_wlan() | ||||
|                                                                             controller.controller_set_wireless_tag_policy() | ||||
|                                                                             controller.controller_enable_wlan() | ||||
|                                                                         if controller_band == "a":     | ||||
|                                                                             controller.controller_enable_network_5ghz() | ||||
|                                                                         else:     | ||||
|                                                                             controller.controller_enable_network_24ghz() | ||||
|                                                                         controller.controller_enable_ap() | ||||
|                                                                         # need to actually check the CAC timer | ||||
|                                                                         time.sleep(30) | ||||
|                                                                         #################################### | ||||
|                                                                         # end of controller controller code | ||||
|                                                                         #################################### | ||||
|                                                                     else: | ||||
|                                                                         logg.info("###############################################") | ||||
|                                                                         logg.info("# NO CHANGE TO CONTROLLER CONFIG") | ||||
|                                                                         logg.info("###############################################") | ||||
|                                                                         logg.info("controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}" | ||||
|                                                                             .format(controller_ap,controller_band, controller_chan_width, controller_ap_mode, controller_tx_power, controller_chan_5ghz, controller_chan_24ghz)) | ||||
|                                                                         logg.info("__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}" | ||||
|                                                                             .format(__ap_set,__band_set, __chan_width_set, __ap_mode_set, __tx_power_set, __chan_5ghz_set, __chan_24ghz_set)) | ||||
|                                                                     logg.info("controller_wifi_mode {}".format(controller_wifimode)) | ||||
|                                                                     logg.info("radios {}".format(radios)) | ||||
|                                                                     for radio_ in radios: | ||||
|                                                                         radio_keys = ['radio','stations','ssid','ssid_pw','security','wifimode'] | ||||
|                                                                         radio_info_dict = dict(map(lambda x: x.split('=='), str(radio_).replace('[','').replace(']','').replace("'","").split())) | ||||
|                                                                         logg.info("radio_dict {}".format(radio_info_dict)) | ||||
|                                                                         for key in radio_keys: | ||||
|                                                                             if key not in radio_info_dict: | ||||
|                                                                                 logg.info("missing config, for the {}, all of the following need to be present {} ".format(key,radio_keys)) | ||||
|                                                                                 exit(1) | ||||
|                                                                         radio_name_list.append(radio_info_dict['radio']) | ||||
|                                                                         ssid_list.append(radio_info_dict['ssid']) | ||||
|                                                                         ssid_password_list.append(radio_info_dict['ssid_pw']) | ||||
|                                                                         ssid_security_list.append(radio_info_dict['security']) | ||||
|                                                                         if args.radio: | ||||
|                                                                             number_of_stations_per_radio_list.append(radio_info_dict['stations']) | ||||
|                                                                             wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) | ||||
|                                                                         else:  | ||||
|                                                                             number_of_stations_per_radio_list.append(radio_info_dict['stations']) | ||||
|                                                                             wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) | ||||
|                                                                         optional_radio_reset_keys = ['reset_port_enable'] | ||||
|                                                                         radio_reset_found = True | ||||
|                                                                         for key in optional_radio_reset_keys: | ||||
|                                                                             if key not in radio_info_dict: | ||||
|                                                                                 #logg.info("port reset test not enabled") | ||||
|                                                                                 radio_reset_found = False | ||||
|                                                                                 break | ||||
|                                                                              | ||||
|                                                                         if radio_reset_found: | ||||
|                                                                             reset_port_enable_list.append(True) | ||||
|                                                                             reset_port_time_min_list.append(radio_info_dict['reset_port_time_min']) | ||||
|                                                                             reset_port_time_max_list.append(radio_info_dict['reset_port_time_max']) | ||||
|                                                                         else: | ||||
|                                                                             reset_port_enable_list.append(False) | ||||
|                                                                             reset_port_time_min_list.append('0s') | ||||
|                                                                             reset_port_time_max_list.append('0s') | ||||
|                                                             # no stations for testing reconfiguration of the controller -  | ||||
|                                                             if(args.no_stations): | ||||
|                                                                 logg.info("##################################") | ||||
| @@ -2569,7 +2568,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl | ||||
|                                                                                                 reset_port_time_min_list=reset_port_time_min_list, | ||||
|                                                                                                 reset_port_time_max_list=reset_port_time_max_list, | ||||
|                                                                                                 csv_started=__csv_started, | ||||
|                                                                                                 side_a_tx_min_bps =side_a_tx_min_bps,  | ||||
|                                                                                                 side_a_tx_min_bps = side_a_tx_min_bps,  | ||||
|                                                                                                 side_a_tx_max_bps =0, | ||||
|                                                                                                 side_a_min_pdu =controller_pdu,  | ||||
|                                                                                                 side_a_max_pdu =0, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Chuck SmileyRekiere
					Chuck SmileyRekiere