mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-20 12:04:52 +00:00
lf_cisco_snp.py : updates for additional configurations
This commit is contained in:
@@ -1377,7 +1377,7 @@ TODO: Radio descriptions in realm , the 1. refers to the chassi hopefully corres
|
|||||||
parser.add_argument('-cps','--cisco_packet_size', help='--cisco_packet_size List of packet sizes default \"88 512 1370 1518\"',default="88 512 1370 1518" )
|
parser.add_argument('-cps','--cisco_packet_size', help='--cisco_packet_size List of packet sizes default \"88 512 1370 1518\"',default="88 512 1370 1518" )
|
||||||
parser.add_argument('-ccd','--cisco_client_density', help='--cisco_client_density List of client densities defaults 1 10 20 50 100 200 ',
|
parser.add_argument('-ccd','--cisco_client_density', help='--cisco_client_density List of client densities defaults 1 10 20 50 100 200 ',
|
||||||
default="1 10 20 50 100 200" )
|
default="1 10 20 50 100 200" )
|
||||||
|
parser.add_argument('-cde','--cisco_data_encryption', help='--cisco_data_encryption \"enable disable\"',default="disable" )
|
||||||
|
|
||||||
parser.add_argument('-cs','--cisco_series', help='--cisco_series <9800 | 3504>',default="3504",choices=["9800","3504"])
|
parser.add_argument('-cs','--cisco_series', help='--cisco_series <9800 | 3504>',default="3504",choices=["9800","3504"])
|
||||||
parser.add_argument('-cc','--cisco_ctlr', help='--cisco_ctlr <IP of Cisco Controller> default 192.168.100.178',default="192.168.100.178")
|
parser.add_argument('-cc','--cisco_ctlr', help='--cisco_ctlr <IP of Cisco Controller> default 192.168.100.178',default="192.168.100.178")
|
||||||
@@ -1398,11 +1398,11 @@ TODO: Radio descriptions in realm , the 1. refers to the chassi hopefully corres
|
|||||||
parser.add_argument('-prs','--port_reset_seconds', help='--ports_reset_seconds \"<min seconds> <max seconds>\" ', default="10 30")
|
parser.add_argument('-prs','--port_reset_seconds', help='--ports_reset_seconds \"<min seconds> <max seconds>\" ', default="10 30")
|
||||||
|
|
||||||
parser.add_argument('-lm','--mgr', help='--mgr <hostname for where LANforge GUI is running>',default='localhost')
|
parser.add_argument('-lm','--mgr', help='--mgr <hostname for where LANforge GUI is running>',default='localhost')
|
||||||
parser.add_argument('-d','--test_duration', help='--test_duration <how long to run> example --time 5d (5 days) default: 3m options: number followed by d, h, m or s',default='2m')
|
parser.add_argument('-d','--test_duration', help='--test_duration <how long to run> example --time 5d (5 days) default: 3m options: number followed by d, h, m or s',default='30s')
|
||||||
parser.add_argument('--tos', help='--tos: Support different ToS settings: BK | BE | VI | VO | numeric',default="BE")
|
parser.add_argument('--tos', help='--tos: Support different ToS settings: BK | BE | VI | VO | numeric',default="BE")
|
||||||
parser.add_argument('-db','--debug', help='--debug: Enable debugging',action='store_true')
|
parser.add_argument('-db','--debug', help='--debug: Enable debugging',action='store_true')
|
||||||
parser.add_argument('-t', '--endp_type', help='--endp_type <types of traffic> example --endp_type \"lf_udp lf_tcp mc_udp\" Default: lf_udp , options: lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6',
|
parser.add_argument('-t', '--endp_type', help='--endp_type <types of traffic> example --endp_type \"lf_udp lf_tcp mc_udp\" Default: lf_udp lf_tcp, options: lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6',
|
||||||
default='lf_udp', type=valid_endp_types)
|
default='lf_udp lf_tcp', type=valid_endp_types)
|
||||||
parser.add_argument('-u', '--upstream_port', help='--upstream_port <cross connect upstream_port> example: --upstream_port eth1',default='eth1')
|
parser.add_argument('-u', '--upstream_port', help='--upstream_port <cross connect upstream_port> example: --upstream_port eth1',default='eth1')
|
||||||
parser.add_argument('-o','--csv_outfile', help="--csv_outfile <Output file for csv data>", default='snp')
|
parser.add_argument('-o','--csv_outfile', help="--csv_outfile <Output file for csv data>", default='snp')
|
||||||
parser.add_argument('-pi','--polling_interval', help="--polling_interval <seconds>", default='30s')
|
parser.add_argument('-pi','--polling_interval', help="--polling_interval <seconds>", default='30s')
|
||||||
@@ -1521,154 +1521,161 @@ TODO: Radio descriptions in realm , the 1. refers to the chassi hopefully corres
|
|||||||
print(cisco_packet_types)
|
print(cisco_packet_types)
|
||||||
cisco_packet_sizes = args.cisco_packet_size.split()
|
cisco_packet_sizes = args.cisco_packet_size.split()
|
||||||
print(cisco_packet_sizes)
|
print(cisco_packet_sizes)
|
||||||
|
cisco_client_densities = args.cisco_client_density.split()
|
||||||
|
print(cisco_client_densities)
|
||||||
|
cisco_data_encryptions = args.cisco_data_encryption.split()
|
||||||
|
print(cisco_data_encryptions)
|
||||||
|
|
||||||
for cisco_ap in cisco_aps:
|
for cisco_ap in cisco_aps:
|
||||||
for cisco_band in cisco_bands: # change to 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: #change to band width
|
for cisco_chan_width in cisco_chan_widths: #bandwidth
|
||||||
for cisco_ap_mode in cisco_ap_modes:
|
for cisco_data_encryption in cisco_data_encryptions:
|
||||||
for cisco_packet_size in cisco_packet_sizes:
|
for cisco_ap_mode in cisco_ap_modes:
|
||||||
print("Cisco run: AP {} band: {} wifimode {} chan_width {} cisco_ap_mode {} cisco_packet_size {}".format(cisco_ap,
|
for cisco_client_density in cisco_client_densities:
|
||||||
cisco_band, cisco_wifimode, cisco_chan_width, cisco_ap_mode, cisco_packet_size))
|
for endp_type in endp_types:
|
||||||
# over write the configurations of args for controller
|
for cisco_packet_size in cisco_packet_sizes:
|
||||||
'''cisco_args.cisco_ap = cisco_ap
|
print("Cisco run: AP {} band: {} wifimode {} chan_width {} cisco_ap_mode {} cisco_packet_size {}".format(cisco_ap,
|
||||||
cisco_args.cisco_band = cisco_band
|
cisco_band, cisco_wifimode, cisco_chan_width, cisco_ap_mode, cisco_packet_size))
|
||||||
cisco_args.cisco_chan_width = cisco_chan_width
|
# over write the configurations of args for controller
|
||||||
cisco_args.cisco_ap_mode = cisco_ap_mode
|
'''cisco_args.cisco_ap = cisco_ap
|
||||||
print(cisco_args)
|
cisco_args.cisco_band = cisco_band
|
||||||
|
cisco_args.cisco_chan_width = cisco_chan_width
|
||||||
|
cisco_args.cisco_ap_mode = cisco_ap_mode
|
||||||
|
print(cisco_args)
|
||||||
|
|
||||||
cisco = cisco_(cisco_args)
|
cisco = cisco_(cisco_args)
|
||||||
#Disable AP
|
#Disable AP
|
||||||
cisco.controller_disable_ap()
|
cisco.controller_disable_ap()
|
||||||
if cisco_args.cisco_series == "9800":
|
if cisco_args.cisco_series == "9800":
|
||||||
cisco.controller_disable_wlan()
|
cisco.controller_disable_wlan()
|
||||||
cisco.controller_disable_network_5ghz()
|
cisco.controller_disable_network_5ghz()
|
||||||
cisco.controller_disable_network_24ghz()
|
cisco.controller_disable_network_24ghz()
|
||||||
cisco.controller_role_manual()
|
cisco.controller_role_manual()
|
||||||
else:
|
else:
|
||||||
cisco.controller_disable_network_5ghz()
|
cisco.controller_disable_network_5ghz()
|
||||||
cisco.controller_disable_network_24ghz()
|
cisco.controller_disable_network_24ghz()
|
||||||
|
|
||||||
cisco.controller_set_bandwidth()
|
cisco.controller_set_bandwidth()
|
||||||
|
|
||||||
if cisco_args.cisco_series == "9800":
|
if cisco_args.cisco_series == "9800":
|
||||||
cisco.controller_create_wlan()
|
cisco.controller_create_wlan()
|
||||||
cisco.controller_set_wireless_tag_policy()
|
cisco.controller_set_wireless_tag_policy()
|
||||||
cisco.controller_enable_wlan()
|
cisco.controller_enable_wlan()
|
||||||
|
|
||||||
cisco.controller_enable_network_5ghz()
|
cisco.controller_enable_network_5ghz()
|
||||||
cisco.controller_enable_network_24ghz()
|
cisco.controller_enable_network_24ghz()
|
||||||
cisco.controller_enable_ap()
|
cisco.controller_enable_ap()
|
||||||
|
|
||||||
# need to actually check the CAC timer
|
# need to actually check the CAC timer
|
||||||
time.sleep(30)'''
|
time.sleep(30)'''
|
||||||
|
|
||||||
# TODO may need a static list of radios read for scaling and performance
|
# TODO may need a static list of radios read for scaling and performance
|
||||||
print("cisco_wifi_mode {}".format(cisco_wifimode))
|
print("cisco_wifi_mode {}".format(cisco_wifimode))
|
||||||
if args.radio:
|
if args.radio:
|
||||||
radios = args.radio
|
radios = args.radio
|
||||||
elif cisco_wifimode == "anAX" or cisco_wifimode == "abgn" or cisco_wifimode == "bg":
|
elif cisco_wifimode == "anAX" or cisco_wifimode == "abgn" or cisco_wifimode == "bg":
|
||||||
radios = radio_AX200_abgn_ax_dict
|
radios = radio_AX200_abgn_ax_dict
|
||||||
elif cisco_wifimode == "an" or cisco_wifimode == "anAC":
|
elif cisco_wifimode == "an" or cisco_wifimode == "anAC":
|
||||||
radios = radio_ath10K_9984_an_AC_dict
|
radios = radio_ath10K_9984_an_AC_dict
|
||||||
|
|
||||||
print("radios {}".format(radios))
|
print("radios {}".format(radios))
|
||||||
for radio_ in radios:
|
for radio_ in radios:
|
||||||
radio_keys = ['radio','stations','ssid','ssid_pw','security','wifimode']
|
radio_keys = ['radio','stations','ssid','ssid_pw','security','wifimode']
|
||||||
radio_info_dict = dict(map(lambda x: x.split('=='), str(radio_).replace('[','').replace(']','').replace("'","").split()))
|
radio_info_dict = dict(map(lambda x: x.split('=='), str(radio_).replace('[','').replace(']','').replace("'","").split()))
|
||||||
print("radio_dict {}".format(radio_info_dict))
|
print("radio_dict {}".format(radio_info_dict))
|
||||||
|
|
||||||
for key in radio_keys:
|
for key in radio_keys:
|
||||||
if key not in radio_info_dict:
|
if key not in radio_info_dict:
|
||||||
print("missing config, for the {}, all of the following need to be present {} ".format(key,radio_keys))
|
print("missing config, for the {}, all of the following need to be present {} ".format(key,radio_keys))
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
radio_name_list.append(radio_info_dict['radio'])
|
radio_name_list.append(radio_info_dict['radio'])
|
||||||
ssid_list.append(radio_info_dict['ssid'])
|
ssid_list.append(radio_info_dict['ssid'])
|
||||||
ssid_password_list.append(radio_info_dict['ssid_pw'])
|
ssid_password_list.append(radio_info_dict['ssid_pw'])
|
||||||
ssid_security_list.append(radio_info_dict['security'])
|
ssid_security_list.append(radio_info_dict['security'])
|
||||||
if args.radio:
|
if args.radio:
|
||||||
number_of_stations_per_radio_list.append(radio_info_dict['stations'])
|
number_of_stations_per_radio_list.append(radio_info_dict['stations'])
|
||||||
wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']]))
|
wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']]))
|
||||||
else:
|
else:
|
||||||
number_of_stations_per_radio_list.append(radio_info_dict['stations'])
|
number_of_stations_per_radio_list.append(radio_info_dict['stations'])
|
||||||
wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']]))
|
wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']]))
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# temp removal of loop
|
# temp removal of loop
|
||||||
######################
|
######################
|
||||||
'''optional_radio_reset_keys = ['reset_port_enable']
|
'''optional_radio_reset_keys = ['reset_port_enable']
|
||||||
radio_reset_found = True
|
radio_reset_found = True
|
||||||
for key in optional_radio_reset_keys:
|
for key in optional_radio_reset_keys:
|
||||||
if key not in radio_info_dict:
|
if key not in radio_info_dict:
|
||||||
#print("port reset test not enabled")
|
#print("port reset test not enabled")
|
||||||
radio_reset_found = False
|
radio_reset_found = False
|
||||||
break
|
break
|
||||||
|
|
||||||
if radio_reset_found:
|
if radio_reset_found:
|
||||||
reset_port_enable_list.append(True)
|
reset_port_enable_list.append(True)
|
||||||
reset_port_time_min_list.append(radio_info_dict['reset_port_time_min'])
|
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'])
|
reset_port_time_max_list.append(radio_info_dict['reset_port_time_max'])
|
||||||
else:
|
else:
|
||||||
reset_port_enable_list.append(False)
|
reset_port_enable_list.append(False)
|
||||||
reset_port_time_min_list.append('0s')
|
reset_port_time_min_list.append('0s')
|
||||||
reset_port_time_max_list.append('0s')
|
reset_port_time_max_list.append('0s')
|
||||||
index = 0
|
index = 0
|
||||||
station_lists = []
|
station_lists = []
|
||||||
for (radio_name_, number_of_stations_per_radio_) in zip(radio_name_list,number_of_stations_per_radio_list):
|
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_)
|
number_of_stations = int(number_of_stations_per_radio_)
|
||||||
if number_of_stations > MAX_NUMBER_OF_STATIONS:
|
if number_of_stations > MAX_NUMBER_OF_STATIONS:
|
||||||
print("number of stations per radio exceeded max of : {}".format(MAX_NUMBER_OF_STATIONS))
|
print("number of stations per radio exceeded max of : {}".format(MAX_NUMBER_OF_STATIONS))
|
||||||
quit(1)
|
quit(1)
|
||||||
station_list = LFUtils.portNameSeries(prefix_="sta", start_id_= 1 + index*1000, end_id_= number_of_stations + index*1000,
|
station_list = LFUtils.portNameSeries(prefix_="sta", start_id_= 1 + index*1000, end_id_= number_of_stations + index*1000,
|
||||||
padding_number_=10000, radio=radio_name_)
|
padding_number_=10000, radio=radio_name_)
|
||||||
station_lists.append(station_list)
|
station_lists.append(station_list)
|
||||||
index += 1
|
index += 1
|
||||||
|
|
||||||
#print("endp-types: %s"%(endp_types))
|
#print("endp-types: %s"%(endp_types))
|
||||||
|
|
||||||
#enstanciate the
|
#enstanciate the
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ip_var_test = L3VariableTime(
|
ip_var_test = L3VariableTime(
|
||||||
lfjson_host,
|
lfjson_host,
|
||||||
lfjson_port,
|
lfjson_port,
|
||||||
args=args,
|
args=args,
|
||||||
number_template="00",
|
number_template="00",
|
||||||
station_lists= station_lists,
|
station_lists= station_lists,
|
||||||
name_prefix="LT-",
|
name_prefix="LT-",
|
||||||
endp_types=endp_types,
|
endp_types=endp_types,
|
||||||
tos=args.tos,
|
tos=args.tos,
|
||||||
side_b=side_b,
|
side_b=side_b,
|
||||||
radio_name_list=radio_name_list,
|
radio_name_list=radio_name_list,
|
||||||
number_of_stations_per_radio_list=number_of_stations_per_radio_list,
|
number_of_stations_per_radio_list=number_of_stations_per_radio_list,
|
||||||
ssid_list=ssid_list,
|
ssid_list=ssid_list,
|
||||||
ssid_password_list=ssid_password_list,
|
ssid_password_list=ssid_password_list,
|
||||||
ssid_security_list=ssid_security_list,
|
ssid_security_list=ssid_security_list,
|
||||||
wifimode_list=wifimode_list,
|
wifimode_list=wifimode_list,
|
||||||
test_duration=test_duration,
|
test_duration=test_duration,
|
||||||
polling_interval= polling_interval,
|
polling_interval= polling_interval,
|
||||||
reset_port_enable_list=reset_port_enable_list,
|
reset_port_enable_list=reset_port_enable_list,
|
||||||
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,
|
||||||
side_a_min_rate=args.side_a_min_rate,
|
side_a_min_rate=args.side_a_min_rate,
|
||||||
side_b_min_rate=args.side_b_min_rate,
|
side_b_min_rate=args.side_b_min_rate,
|
||||||
debug_on=debug_on,
|
debug_on=debug_on,
|
||||||
outfile=csv_outfile)
|
outfile=csv_outfile)
|
||||||
|
|
||||||
|
|
||||||
ip_var_test.pre_cleanup()
|
ip_var_test.pre_cleanup()
|
||||||
ip_var_test.build()
|
ip_var_test.build()
|
||||||
if not ip_var_test.passes():
|
if not ip_var_test.passes():
|
||||||
print("build step failed.")
|
print("build step failed.")
|
||||||
print(ip_var_test.get_fail_message())
|
print(ip_var_test.get_fail_message())
|
||||||
exit(1)
|
exit(1)
|
||||||
ip_var_test.start(False, False)
|
ip_var_test.start(False, False)
|
||||||
ip_var_test.stop()
|
ip_var_test.stop()
|
||||||
if not ip_var_test.passes():
|
if not ip_var_test.passes():
|
||||||
print("stop test failed")
|
print("stop test failed")
|
||||||
print(ip_var_test.get_fail_message())
|
print(ip_var_test.get_fail_message())
|
||||||
|
|
||||||
|
|
||||||
#print("Pausing 30 seconds after run for manual inspection before we clean up.")
|
#print("Pausing 30 seconds after run for manual inspection before we clean up.")
|
||||||
|
|||||||
Reference in New Issue
Block a user