lf_cisco_snp.py : modified logic to take into account wifi frequencies,

and radio modes
This commit is contained in:
Chuck SmileyRekiere
2020-12-03 14:00:41 -07:00
parent a51993e6d2
commit cb2297fb38

View File

@@ -1245,7 +1245,7 @@ Script logic loops:
AP {Axel, Vanc} Dynamic AP {Axel, Vanc} Dynamic
frequency {24ghz, 5ghz} Common (band) : 24ghz == b , 5ghz == a frequency {24ghz, 5ghz} Common (band) : 24ghz == b , 5ghz == a
wifimode{11ax, 11ac, 11n, 11bg} Common (an anAX anAC abgn bg) wifimode{11ax (2.4 ghz or 5 ghz), 11ac (5 ghz only), 11n (2.4 ghz or 5ghz), 11bg(2.4 ghz)} Common (an anAX anAC abgn bg)
Bandwidth {20, 40, 80, 160} Bandwidth {20, 40, 80, 160}
data-encryption {enable/disable} Common data-encryption {enable/disable} Common
AP-mode {local/flexconnect} Common AP-mode {local/flexconnect} Common
@@ -1273,7 +1273,7 @@ Note: wave-2 radios can act as ac, an, (802.11an-AC) or legacy a/b/g (802.11bgn-
############################################# #############################################
wifimodes needed to support wifimodes needed to support
############################################# #############################################
11ax, 11ac, 11n, 11bg (Cisco) 11ax (2.4 ghz or 5 ghz), 11ac (5 ghz only), 11n (2.4ghz or 5 ghz), 11bg (2.4 ghz) (Cisco)
############################################# #############################################
5 Ghz 5 Ghz
@@ -1282,10 +1282,10 @@ Wifi mode: 11ax - 5ghz
Radios : ax200 : 802.11 /a/n/ac/AX Radios : ax200 : 802.11 /a/n/ac/AX
Wifi mode: 11ac - 5ghz Wifi mode: 11ac - 5ghz
Radios : ath10K(9984) 802.11an-AC Radios : ath10K(9984) 802.11an-AC (9984 are single band)
Wifi mode: 11n - 5ghz Wifi mode: 11n - 5ghz
Radios : ath10K(9984) 802.11an-AC Radios : ath10K(9984) 802.11an-AC (9984 are single band)
############################################# #############################################
24 Ghz 24 Ghz
@@ -1294,7 +1294,7 @@ Wifi mode: 11ax - 24ghz
Radios : ax200 - 802.11 /b/g/n/AX Radios : ax200 - 802.11 /b/g/n/AX
Wifi mode: 11ac - 24ghz Wifi mode: 11ac - 24ghz
Radios : ax200 802.11 /b/g/n/AX (2.4Ghz doesn't officially support /AC, but often chips will do /AC there anyway) Radios : ax200 802.11 /b/g/n/AX (2.4Ghz doesn't officially support /AC, but often chips will do /AC there anyway) (invalid)
Wifi mode: 11n - 24ghz Wifi mode: 11n - 24ghz
Radios : ax200 802.11 /b/g/n/AX Radios : ax200 802.11 /b/g/n/AX
@@ -1746,213 +1746,233 @@ Eventual Realm at Cisco
for cisco_ap in cisco_aps: for cisco_ap in cisco_aps:
for cisco_band in cisco_bands: # frequency for cisco_band in cisco_bands: # frequency
for cisco_wifimode in cisco_wifimodes: for cisco_wifimode in cisco_wifimodes:
for cisco_chan_width in cisco_chan_widths: #bandwidth # check for valid frequency and wifi_mode combination put here to simplify logic since all radios do not support all modes
for cisco_data_encryption in cisco_data_encryptions: # "an anAX anAC abgn bg"
for cisco_ap_mode in cisco_ap_modes: if((cisco_band == "a" and cisco_wifimode == "bg") or (cisco_band == "b" and cisco_wifimode == "anAC")):
for cisco_client_density in cisco_client_densities: pass # invalid combination continue
for cisco_packet_type in cisco_packet_types: else:
for cisco_direction in cisco_directions: for cisco_chan_width in cisco_chan_widths: #bandwidth
for cisco_packet_size in cisco_packet_sizes: for cisco_data_encryption in cisco_data_encryptions:
logg.info("#####################################################") for cisco_ap_mode in cisco_ap_modes:
logg.info("# TEST RUNNING , TEST RUNNING ######################") for cisco_client_density in cisco_client_densities:
logg.info("#####################################################") for cisco_packet_type in cisco_packet_types:
test_config = "AP=={} Band=={} wifi_mode=={} BW=={} encryption=={} ap_mode=={} clients=={} packet_type=={} direction=={} packet_size=={}".format(cisco_ap, for cisco_direction in cisco_directions:
cisco_band,cisco_wifimode,cisco_chan_width,cisco_data_encryption,cisco_ap_mode,cisco_client_density, for cisco_packet_size in cisco_packet_sizes:
cisco_packet_type,cisco_direction,cisco_packet_size) logg.info("#####################################################")
test_keys = ['AP','Band','wifi_mode','BW','encryption','ap_mode','clients','packet_type','direction','packet_size'] logg.info("# TEST RUNNING , TEST RUNNING ######################")
logg.info("# Cisco run settings: {}".format(test_config)) logg.info("#####################################################")
if(args.no_controller): test_config = "AP=={} Band=={} wifi_mode=={} BW=={} encryption=={} ap_mode=={} clients=={} packet_type=={} direction=={} packet_size=={}".format(cisco_ap,
logg.info("################################################") cisco_band,cisco_wifimode,cisco_chan_width,cisco_data_encryption,cisco_ap_mode,cisco_client_density,
logg.info("# NO CONTROLLER SET , TEST MODE") cisco_packet_type,cisco_direction,cisco_packet_size)
logg.info("################################################") test_keys = ['AP','Band','wifi_mode','BW','encryption','ap_mode','clients','packet_type','direction','packet_size']
else: logg.info("# Cisco run settings: {}".format(test_config))
if( cisco_ap != ap_set or if(args.no_controller):
cisco_band != band_set or logg.info("################################################")
cisco_chan_width != chan_width_set or logg.info("# NO CONTROLLER SET , TEST MODE")
cisco_ap_mode != ap_mode_set or logg.info("################################################")
cisco_tx_power != tx_power_set
):
logg.info("###############################################")
logg.info("# NEW CONTROLLER CONFIG")
logg.info("###############################################")
ap_set = cisco_ap
band_set = cisco_band
chan_width_set = cisco_chan_width
ap_mode_set = cisco_ap_mode
tx_power_set = cisco_tx_power
#############################################
# configure cisco controller
#############################################
cisco_args.cisco_ap = cisco_ap
cisco_args.cisco_band = cisco_band
if cisco_band == "a":
cisco_args.cisco_chan = cisco_chan_5ghz
else: else:
cisco_args.cisco_chan = cisco_chan_24ghz if( cisco_ap != ap_set or
cisco_args.cisco_chan_width = cisco_chan_width cisco_band != band_set or
cisco_args.cisco_ap_mode = cisco_ap_mode cisco_chan_width != chan_width_set or
cisco_args.cisco_tx_power = cisco_tx_power cisco_ap_mode != ap_mode_set or
logg.info(cisco_args) cisco_tx_power != tx_power_set
cisco = cisco_(cisco_args) ):
#Disable AP logg.info("###############################################")
cisco.controller_disable_ap() logg.info("# NEW CONTROLLER CONFIG")
if cisco_args.cisco_series == "9800": logg.info("###############################################")
cisco.controller_disable_wlan() ap_set = cisco_ap
cisco.controller_disable_network_5ghz() band_set = cisco_band
cisco.controller_disable_network_24ghz() chan_width_set = cisco_chan_width
cisco.controller_role_manual() ap_mode_set = cisco_ap_mode
tx_power_set = cisco_tx_power
#############################################
# configure cisco controller
#############################################
cisco_args.cisco_ap = cisco_ap
cisco_args.cisco_band = cisco_band
if cisco_band == "a":
cisco_args.cisco_chan = cisco_chan_5ghz
else:
cisco_args.cisco_chan = cisco_chan_24ghz
cisco_args.cisco_chan_width = cisco_chan_width
cisco_args.cisco_ap_mode = cisco_ap_mode
cisco_args.cisco_tx_power = cisco_tx_power
logg.info(cisco_args)
cisco = cisco_(cisco_args)
#Disable AP
cisco.controller_disable_ap()
if cisco_args.cisco_series == "9800":
cisco.controller_disable_wlan()
cisco.controller_disable_network_5ghz()
cisco.controller_disable_network_24ghz()
cisco.controller_role_manual()
else:
cisco.controller_disable_network_5ghz()
cisco.controller_disable_network_24ghz()
cisco.controller_set_tx_power()
cisco.controller_set_channel()
cisco.controller_set_bandwidth()
if cisco_args.cisco_series == "9800":
cisco.controller_create_wlan()
cisco.controller_set_wireless_tag_policy()
cisco.controller_enable_wlan()
if cisco_band == "a":
cisco.controller_enable_network_5ghz()
else:
cisco.controller_enable_network_24ghz()
cisco.controller_enable_ap()
# need to actually check the CAC timer
time.sleep(30)
####################################
# end of cisco controller code
####################################
else:
logg.info("###############################################")
logg.info("# NO CHANGE TO CONTROLLER CONFIG")
logg.info("###############################################")
logg.info("cisco_wifi_mode {}".format(cisco_wifimode))
if args.radio:
radios = args.radio
elif cisco_band == "a":
#elif cisco_wifimode == "anAX" or cisco_wifimode == "abgn" or cisco_wifimode == "bg":
if cisco_wifimode == "anAX" or cisco_wifimode == "abgn":
#AX200 dual band
radios = radio_AX200_abgn_ax_dict[cisco_client_density]
elif cisco_wifimode == "an" or cisco_wifimode == "anAC" or cisco_wifimode =="auto":
#ath10K only supports 5Ghz
radios = radio_ath10K_9984_an_AC_dict[cisco_client_density]
else:
logg.info("##################################")
logg.info("# INVALID COMBINATION 5ghz")
logg.info("# Cisco run settings: {}".format(test_config))
logg.info("##################################")
exit(1)
else: # cisco_band == "b"
if cisco_wifimode == "anAX" or cisco_wifimode == "abgn" or cisco_wifimode == "bg" or cisco_wifimode == "auto":
#AX200 dual band
radios = radio_AX200_abgn_ax_dict[cisco_client_density]
else:
logg.info("##################################")
logg.info("# INVALID COMBINATION 24 ghz")
logg.info("# Cisco run settings: {}".format(test_config))
logg.info("##################################")
exit(1)
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("##################################")
logg.info("# NO STATIONS")
logg.info("##################################")
else: else:
cisco.controller_disable_network_5ghz() index = 0
cisco.controller_disable_network_24ghz() station_lists = []
cisco.controller_set_tx_power() for (radio_name_, number_of_stations_per_radio_) in zip(radio_name_list,number_of_stations_per_radio_list):
cisco.controller_set_channel() number_of_stations = int(number_of_stations_per_radio_)
cisco.controller_set_bandwidth() if number_of_stations > MAX_NUMBER_OF_STATIONS:
if cisco_args.cisco_series == "9800": logg.info("number of stations per radio exceeded max of : {}".format(MAX_NUMBER_OF_STATIONS))
cisco.controller_create_wlan() quit(1)
cisco.controller_set_wireless_tag_policy() station_list = LFUtils.portNameSeries(prefix_="sta", start_id_= 1 + index*1000, end_id_= number_of_stations + index*1000,
cisco.controller_enable_wlan() padding_number_=10000, radio=radio_name_)
cisco.controller_enable_network_5ghz() station_lists.append(station_list)
cisco.controller_enable_network_24ghz() index += 1
cisco.controller_enable_ap() # Run Traffic Upstream (STA to AP)
# need to actually check the CAC timer if(cisco_direction == "upstream"):
time.sleep(30) side_a_min_bps = cisco_side_a_min_bps
side_b_min_bps = 0
#################################### # Run Traffic Downstream (AP to STA)
# end of cisco controller code else:
#################################### side_a_min_bps = 0
else: side_b_min_bps = cisco_side_b_min_bps
logg.info("###############################################") # current default is to have a values
logg.info("# NO CHANGE TO CONTROLLER CONFIG") ip_var_test = L3VariableTime(
logg.info("###############################################") lfjson_host,
lfjson_port,
args=args,
logg.info("cisco_wifi_mode {}".format(cisco_wifimode)) number_template="00",
if args.radio: station_lists= station_lists,
radios = args.radio name_prefix="LT-",
elif cisco_wifimode == "anAX" or cisco_wifimode == "abgn" or cisco_wifimode == "bg": endp_type=cisco_packet_type,
radios = radio_AX200_abgn_ax_dict[cisco_client_density] tos=args.tos,
elif cisco_wifimode == "an" or cisco_wifimode == "anAC": side_b=side_b,
radios = radio_ath10K_9984_an_AC_dict[cisco_client_density] radio_name_list=radio_name_list,
logg.info("radios {}".format(radios)) number_of_stations_per_radio_list=number_of_stations_per_radio_list,
for radio_ in radios: ssid_list=ssid_list,
radio_keys = ['radio','stations','ssid','ssid_pw','security','wifimode'] ssid_password_list=ssid_password_list,
radio_info_dict = dict(map(lambda x: x.split('=='), str(radio_).replace('[','').replace(']','').replace("'","").split())) ssid_security_list=ssid_security_list,
logg.info("radio_dict {}".format(radio_info_dict)) wifimode_list=wifimode_list,
for key in radio_keys: test_duration=test_duration,
if key not in radio_info_dict: polling_interval= polling_interval,
logg.info("missing config, for the {}, all of the following need to be present {} ".format(key,radio_keys)) reset_port_enable_list=reset_port_enable_list,
exit(1) reset_port_time_min_list=reset_port_time_min_list,
radio_name_list.append(radio_info_dict['radio']) reset_port_time_max_list=reset_port_time_max_list,
ssid_list.append(radio_info_dict['ssid']) side_a_min_bps=side_a_min_bps,
ssid_password_list.append(radio_info_dict['ssid_pw']) side_a_min_pdu =cisco_packet_size,
ssid_security_list.append(radio_info_dict['security']) side_b_min_bps=side_b_min_bps,
if args.radio: side_b_min_pdu =cisco_packet_size,
number_of_stations_per_radio_list.append(radio_info_dict['stations']) debug_on=debug_on,
wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) outfile=csv_outfile,
else: test_keys=test_keys,
number_of_stations_per_radio_list.append(radio_info_dict['stations']) test_config=test_config)
wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) ip_var_test.pre_cleanup()
ip_var_test.build()
optional_radio_reset_keys = ['reset_port_enable'] if not ip_var_test.passes():
radio_reset_found = True logg.info("build step failed.")
for key in optional_radio_reset_keys: logg.info(ip_var_test.get_fail_message())
if key not in radio_info_dict: exit(1)
#logg.info("port reset test not enabled") ip_var_test.start(False, False)
radio_reset_found = False ip_var_test.stop()
break if not ip_var_test.passes():
logg.info("stop test failed")
if radio_reset_found: logg.info(ip_var_test.get_fail_message())
reset_port_enable_list.append(True) # clean up
reset_port_time_min_list.append(radio_info_dict['reset_port_time_min']) radio_name_list = []
reset_port_time_max_list.append(radio_info_dict['reset_port_time_max']) number_of_stations_per_radio_list = []
else: ssid_list = []
reset_port_enable_list.append(False) ssid_password_list = []
reset_port_time_min_list.append('0s') ssid_security_list = []
reset_port_time_max_list.append('0s') wifimode_list = []
ip_var_test.cleanup()
# no stations for testing reconfiguration of the controller - if ( args.no_stations):
if(args.no_stations): pass
logg.info("##################################") else:
logg.info("# NO STATIONS") ip_var_test.passes()
logg.info("##################################") logg.info("Full test passed, all connections increased rx bytes")
else:
index = 0
station_lists = []
for (radio_name_, number_of_stations_per_radio_) in zip(radio_name_list,number_of_stations_per_radio_list):
number_of_stations = int(number_of_stations_per_radio_)
if number_of_stations > MAX_NUMBER_OF_STATIONS:
logg.info("number of stations per radio exceeded max of : {}".format(MAX_NUMBER_OF_STATIONS))
quit(1)
station_list = LFUtils.portNameSeries(prefix_="sta", start_id_= 1 + index*1000, end_id_= number_of_stations + index*1000,
padding_number_=10000, radio=radio_name_)
station_lists.append(station_list)
index += 1
# Run Traffic Upstream (STA to AP)
if(cisco_direction == "upstream"):
side_a_min_bps = cisco_side_a_min_bps
side_b_min_bps = 0
# Run Traffic Downstream (AP to STA)
else:
side_a_min_bps = 0
side_b_min_bps = cisco_side_b_min_bps
# current default is to have a values
ip_var_test = L3VariableTime(
lfjson_host,
lfjson_port,
args=args,
number_template="00",
station_lists= station_lists,
name_prefix="LT-",
endp_type=cisco_packet_type,
tos=args.tos,
side_b=side_b,
radio_name_list=radio_name_list,
number_of_stations_per_radio_list=number_of_stations_per_radio_list,
ssid_list=ssid_list,
ssid_password_list=ssid_password_list,
ssid_security_list=ssid_security_list,
wifimode_list=wifimode_list,
test_duration=test_duration,
polling_interval= polling_interval,
reset_port_enable_list=reset_port_enable_list,
reset_port_time_min_list=reset_port_time_min_list,
reset_port_time_max_list=reset_port_time_max_list,
side_a_min_bps=side_a_min_bps,
side_a_min_pdu =cisco_packet_size,
side_b_min_bps=side_b_min_bps,
side_b_min_pdu =cisco_packet_size,
debug_on=debug_on,
outfile=csv_outfile,
test_keys=test_keys,
test_config=test_config)
ip_var_test.pre_cleanup()
ip_var_test.build()
if not ip_var_test.passes():
logg.info("build step failed.")
logg.info(ip_var_test.get_fail_message())
exit(1)
ip_var_test.start(False, False)
ip_var_test.stop()
if not ip_var_test.passes():
logg.info("stop test failed")
logg.info(ip_var_test.get_fail_message())
# clean up
radio_name_list = []
number_of_stations_per_radio_list = []
ssid_list = []
ssid_password_list = []
ssid_security_list = []
wifimode_list = []
ip_var_test.cleanup()
if ( args.no_stations):
pass
else:
ip_var_test.passes()
logg.info("Full test passed, all connections increased rx bytes")
if __name__ == "__main__": if __name__ == "__main__":
main() main()