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:
Chuck SmileyRekiere
2021-04-22 18:17:47 -06:00
parent 6e7f4e1fb1
commit ea18c5f114

View File

@@ -140,6 +140,7 @@ INCLUDE_IN_README
''' '''
import sys import sys
import os import os
import itertools
from pprint import pprint 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_packet_type in controller_packet_types:
for controller_direction in controller_directions: for controller_direction in controller_directions:
for side_a_tx_min_bps_ul in controller_side_a_tx_min_bps: # looping though both A and B together, upload direction will select A, download direction will select B
for side_b_tx_min_bps_dl in controller_side_b_tx_min_bps: 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: for controller_pdu in controller_pdus:
logg.info("#####################################################") logg.info("###################################################################")
logg.info("# TEST RUNNING , TEST RUNNING ######################") logg.info("# TEST RUNNING direction:{} ul: {} , TEST RUNNING dl: {}"
logg.info("#####################################################") .format(controller_direction, side_a_tx_min_bps_ul, side_b_tx_min_bps_dl))
test_config = "AP=={} Band=={} chan_5ghz=={} chan_24ghz=={} wifi_mode=={} BW=={} encryption=={} ap_mode=={} clients=={} packet_type=={} direction=={} pdu=={}".format( logg.info("####################################################################")
controller_ap,controller_band,controller_chan_5ghz,controller_chan_24ghz,controller_wifimode,controller_chan_width,controller_data_encryption,controller_ap_mode,controller_client_density, test_config = "AP=={} Band=={} chan_5ghz=={} chan_24ghz=={} wifi_mode=={} BW=={} encryption=={} ap_mode=={} clients=={} packet_type=={} direction=={} pdu=={}".format(
controller_packet_type,controller_direction,controller_pdu) controller_ap,controller_band,controller_chan_5ghz,controller_chan_24ghz,controller_wifimode,controller_chan_width,controller_data_encryption,controller_ap_mode,controller_client_density,
test_keys = ['AP','Band','wifi_mode','chan_5ghz','chan_24ghz','BW','encryption','ap_mode','clients','packet_type','direction','pdu'] 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)) logg.info("# controller run settings: {}".format(test_config))
if(args.no_controller): if(args.no_controller):
logg.info("################################################") logg.info("################################################")
logg.info("# NO CONTROLLER SET , TEST MODE") logg.info("# NO CONTROLLER SET , TEST MODE")
logg.info("################################################") logg.info("################################################")
if( controller_ap != __ap_set or if( controller_ap != __ap_set or
controller_band != __band_set or controller_band != __band_set or
controller_chan_width != __chan_width_set or controller_chan_width != __chan_width_set or
controller_ap_mode != __ap_mode_set or controller_ap_mode != __ap_mode_set or
controller_tx_power != __tx_power_set or controller_tx_power != __tx_power_set or
controller_chan_5ghz != __chan_5ghz_set or controller_chan_5ghz != __chan_5ghz_set or
controller_chan_24ghz != __chan_24ghz_set controller_chan_24ghz != __chan_24ghz_set
): ):
logg.info("###############################################") logg.info("###############################################")
logg.info("# NEW CONTROLLER CONFIG") logg.info("# NEW CONTROLLER CONFIG")
logg.info("###############################################") logg.info("###############################################")
__ap_set = controller_ap __ap_set = controller_ap
__band_set = controller_band __band_set = controller_band
__chan_width_set = controller_chan_width __chan_width_set = controller_chan_width
__ap_mode_set = controller_ap_mode __ap_mode_set = controller_ap_mode
__tx_power_set = controller_tx_power __tx_power_set = controller_tx_power
__chan_5ghz_set = controller_chan_5ghz __chan_5ghz_set = controller_chan_5ghz
__chan_24ghz_set = controller_chan_24ghz __chan_24ghz_set = controller_chan_24ghz
__client_density = controller_client_density __client_density = controller_client_density
else: else:
if( controller_ap != __ap_set or if( controller_ap != __ap_set or
controller_band != __band_set or controller_band != __band_set or
controller_chan_width != __chan_width_set or controller_chan_width != __chan_width_set or
controller_ap_mode != __ap_mode_set or controller_ap_mode != __ap_mode_set or
controller_tx_power != __tx_power_set or controller_tx_power != __tx_power_set or
controller_chan_5ghz != __chan_5ghz_set or controller_chan_5ghz != __chan_5ghz_set or
controller_chan_24ghz != __chan_24ghz_set controller_chan_24ghz != __chan_24ghz_set
): ):
logg.info("###############################################") logg.info("###############################################")
logg.info("# NEW CONTROLLER CONFIG") logg.info("# NEW CONTROLLER CONFIG")
logg.info("###############################################") logg.info("###############################################")
__ap_set = controller_ap __ap_set = controller_ap
__band_set = controller_band __band_set = controller_band
__chan_width_set = controller_chan_width __chan_width_set = controller_chan_width
__ap_mode_set = controller_ap_mode __ap_mode_set = controller_ap_mode
__tx_power_set = controller_tx_power __tx_power_set = controller_tx_power
__chan_5ghz_set = controller_chan_5ghz __chan_5ghz_set = controller_chan_5ghz
__chan_24ghz_set = controller_chan_24ghz __chan_24ghz_set = controller_chan_24ghz
__client_density = controller_client_density __client_density = controller_client_density
controller = CreateCtlr(
controller = CreateCtlr( _scheme=__scheme,
_scheme=__scheme, _port=__port,
_port=__port, _series=__series,
_series=__series, _ctlr=__ctlr,
_ctlr=__ctlr, _prompt=__prompt,
_prompt=__prompt, _user=__user,
_user=__user, _passwd=__passwd,
_passwd=__passwd, _ap=__ap_set,
_ap=__ap_set, _band=__band_set,
_band=__band_set, _chan_5ghz=__chan_5ghz_set,
_chan_5ghz=__chan_5ghz_set, _chan_24ghz=__chan_24ghz_set,
_chan_24ghz=__chan_24ghz_set, _chan_width=__chan_width_set,
_chan_width=__chan_width_set, _ap_mode=__ap_mode_set,
_ap_mode=__ap_mode_set, _tx_power=__tx_power_set,
_tx_power=__tx_power_set, _cap_ctl_out=__cap_ctl_out
_cap_ctl_out=__cap_ctl_out )
) #Disable AP
#Disable AP #
# # Controller Configuration
# Controller Configuration #
# #if controller_args.controller_series == "9800":
#if controller_args.controller_series == "9800": # controller_controller_no_loggin_console()
# controller_controller_no_loggin_console() pss = controller.controller_show_ap_summary()
pss = controller.controller_show_ap_summary() logg.info("pss {}".format(pss))
logg.info("pss {}".format(pss)) controller.controller_disable_ap()
controller.controller_disable_ap() if controller_args.controller_series == "9800":
if controller_args.controller_series == "9800": controller.controller_disable_wlan()
controller.controller_disable_wlan() controller.controller_disable_network_5ghz()
controller.controller_disable_network_5ghz() controller.controller_disable_network_24ghz()
controller.controller_disable_network_24ghz() controller.controller_role_manual()
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
####################################
else: else:
logg.info("###############################################") controller.controller_disable_network_5ghz()
logg.info("# NO CHANGE TO CONTROLLER CONFIG") controller.controller_disable_network_24ghz()
logg.info("###############################################") controller.controller_set_tx_power()
logg.info("controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}" controller.controller_set_channel()
.format(controller_ap,controller_band, controller_chan_width, controller_ap_mode, controller_tx_power, controller_chan_5ghz, controller_chan_24ghz)) controller.controller_set_bandwidth()
logg.info("__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}" if controller_args.controller_series == "9800":
.format(__ap_set,__band_set, __chan_width_set, __ap_mode_set, __tx_power_set, __chan_5ghz_set, __chan_24ghz_set)) controller.controller_create_wlan()
logg.info("controller_wifi_mode {}".format(controller_wifimode)) controller.controller_set_wireless_tag_policy()
controller.controller_enable_wlan()
logg.info("radios {}".format(radios)) if controller_band == "a":
for radio_ in radios: controller.controller_enable_network_5ghz()
radio_keys = ['radio','stations','ssid','ssid_pw','security','wifimode'] else:
radio_info_dict = dict(map(lambda x: x.split('=='), str(radio_).replace('[','').replace(']','').replace("'","").split())) controller.controller_enable_network_24ghz()
logg.info("radio_dict {}".format(radio_info_dict)) controller.controller_enable_ap()
for key in radio_keys: # need to actually check the CAC timer
if key not in radio_info_dict: time.sleep(30)
logg.info("missing config, for the {}, all of the following need to be present {} ".format(key,radio_keys)) ####################################
exit(1) # end of controller controller code
radio_name_list.append(radio_info_dict['radio']) ####################################
ssid_list.append(radio_info_dict['ssid']) else:
ssid_password_list.append(radio_info_dict['ssid_pw']) logg.info("###############################################")
ssid_security_list.append(radio_info_dict['security']) logg.info("# NO CHANGE TO CONTROLLER CONFIG")
if args.radio: logg.info("###############################################")
number_of_stations_per_radio_list.append(radio_info_dict['stations']) logg.info("controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}"
wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) .format(controller_ap,controller_band, controller_chan_width, controller_ap_mode, controller_tx_power, controller_chan_5ghz, controller_chan_24ghz))
else: logg.info("__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}"
number_of_stations_per_radio_list.append(radio_info_dict['stations']) .format(__ap_set,__band_set, __chan_width_set, __ap_mode_set, __tx_power_set, __chan_5ghz_set, __chan_24ghz_set))
wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) logg.info("controller_wifi_mode {}".format(controller_wifimode))
optional_radio_reset_keys = ['reset_port_enable'] logg.info("radios {}".format(radios))
radio_reset_found = True for radio_ in radios:
for key in optional_radio_reset_keys: radio_keys = ['radio','stations','ssid','ssid_pw','security','wifimode']
if key not in radio_info_dict: radio_info_dict = dict(map(lambda x: x.split('=='), str(radio_).replace('[','').replace(']','').replace("'","").split()))
#logg.info("port reset test not enabled") logg.info("radio_dict {}".format(radio_info_dict))
radio_reset_found = False for key in radio_keys:
break 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))
if radio_reset_found: exit(1)
reset_port_enable_list.append(True) radio_name_list.append(radio_info_dict['radio'])
reset_port_time_min_list.append(radio_info_dict['reset_port_time_min']) ssid_list.append(radio_info_dict['ssid'])
reset_port_time_max_list.append(radio_info_dict['reset_port_time_max']) ssid_password_list.append(radio_info_dict['ssid_pw'])
else: ssid_security_list.append(radio_info_dict['security'])
reset_port_enable_list.append(False) if args.radio:
reset_port_time_min_list.append('0s') number_of_stations_per_radio_list.append(radio_info_dict['stations'])
reset_port_time_max_list.append('0s') 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 - # no stations for testing reconfiguration of the controller -
if(args.no_stations): if(args.no_stations):
logg.info("##################################") 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_min_list=reset_port_time_min_list,
reset_port_time_max_list=reset_port_time_max_list, reset_port_time_max_list=reset_port_time_max_list,
csv_started=__csv_started, 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_tx_max_bps =0,
side_a_min_pdu =controller_pdu, side_a_min_pdu =controller_pdu,
side_a_max_pdu =0, side_a_max_pdu =0,