mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 19:28:00 +00:00
Merge /home/greearb/btbits/x64_btbits/server/lf_scripts
This commit is contained in:
@@ -18,12 +18,13 @@ import pprint
|
||||
|
||||
|
||||
class IPv4Test(LFCliBase):
|
||||
def __init__(self, host, port, ssid, security, password, sta_list=None, number_template="00000", _debug_on=False,
|
||||
def __init__(self, host, port, ssid, security, password, sta_list=None, number_template="00000", radio = "wiphy0",_debug_on=False,
|
||||
_exit_on_error=False,
|
||||
_exit_on_fail=False):
|
||||
super().__init__(host, port, _debug=_debug_on, _halt_on_error=_exit_on_error, _exit_on_fail=_exit_on_fail)
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.radio = radio
|
||||
self.ssid = ssid
|
||||
self.security = security
|
||||
self.password = password
|
||||
@@ -49,7 +50,7 @@ class IPv4Test(LFCliBase):
|
||||
self.station_profile.set_command_flag("add_sta", "create_admin_down", 1)
|
||||
self.station_profile.set_command_param("set_port", "report_timer", 1500)
|
||||
self.station_profile.set_command_flag("set_port", "rpt_timer", 1)
|
||||
self.station_profile.create(radio="wiphy0", sta_names_=self.sta_list, debug=self.debug)
|
||||
self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug)
|
||||
self._pass("PASS: Station build finished")
|
||||
|
||||
def cleanup(self, sta_list):
|
||||
@@ -70,17 +71,17 @@ def main():
|
||||
''',
|
||||
|
||||
description='''\
|
||||
example_wpa_connection.py
|
||||
example_wep_connection.py
|
||||
--------------------
|
||||
|
||||
Generic command example:
|
||||
python3 ./example_wpa_connection.py \\
|
||||
python3 ./example_wep_connection.py \\
|
||||
--host localhost (optional) \\
|
||||
--port 8080 (optional) \\
|
||||
--num_stations 3 \\
|
||||
--security {open|wep|wpa|wpa2|wpa3} \\
|
||||
--ssid netgear-wep \\
|
||||
--passwd admin123-wep \\
|
||||
--ssid jedway-wep-48 \\
|
||||
--passwd jedway-wep-48 \\
|
||||
--debug
|
||||
|
||||
Note: multiple --radio switches may be entered up to the number of radios available:
|
||||
@@ -99,7 +100,7 @@ def main():
|
||||
end_id_=num_sta-1,
|
||||
padding_number_=10000)
|
||||
ip_test = IPv4Test(lfjson_host, lfjson_port, ssid=args.ssid, password=args.passwd,
|
||||
security=args.security, sta_list=station_list)
|
||||
security=args.security, radio=args.radio, sta_list=station_list)
|
||||
ip_test.cleanup(station_list)
|
||||
ip_test.timeout = 60
|
||||
ip_test.build()
|
||||
|
||||
@@ -75,7 +75,7 @@ def main():
|
||||
--------------------
|
||||
|
||||
Generic command example:
|
||||
python3 ./example_wpa_connection.py \\
|
||||
python3 ./example_wpa2_connection.py \\
|
||||
--host localhost (optional) \\
|
||||
--port 8080 (optional) \\
|
||||
--num_stations 3 \\
|
||||
|
||||
@@ -619,12 +619,15 @@ class cisco_():
|
||||
|
||||
class L3VariableTime(LFCliBase):
|
||||
def __init__(self, host, port, endp_types, args, tos, side_b, radio_name_list, number_of_stations_per_radio_list,
|
||||
ssid_list, ssid_password_list, ssid_security_list, wifimode_list,station_lists, name_prefix, debug_on, outfile,test_keys,test_config,
|
||||
ssid_list, ssid_password_list, ssid_security_list, wifimode_list,station_lists, name_prefix, debug_on, outfile,
|
||||
test_keys,test_config,
|
||||
reset_port_enable_list,
|
||||
reset_port_time_min_list,
|
||||
reset_port_time_max_list,
|
||||
side_a_min_rate=560000, side_a_max_rate=0,
|
||||
side_a_min_pdu=1518,side_a_max_pdu=0,
|
||||
side_b_min_rate=560000, side_b_max_rate=0,
|
||||
side_b_min_pdu=1518,side_b_max_pdu=0,
|
||||
number_template="00", test_duration="256s",
|
||||
polling_interval="60s",
|
||||
_exit_on_error=False,
|
||||
@@ -652,7 +655,7 @@ class L3VariableTime(LFCliBase):
|
||||
self.polling_interval_seconds = self.local_realm.duration_time_to_seconds(polling_interval)
|
||||
self.cx_profile = self.local_realm.new_l3_cx_profile()
|
||||
self.multicast_profile = self.local_realm.new_multicast_profile()
|
||||
self.multicast_profile.name_prefix = "MLT-";
|
||||
self.multicast_profile.name_prefix = "MLT-"
|
||||
self.station_profiles = []
|
||||
self.args = args
|
||||
self.outfile = outfile
|
||||
@@ -702,8 +705,12 @@ class L3VariableTime(LFCliBase):
|
||||
self.cx_profile.name_prefix = self.name_prefix
|
||||
self.cx_profile.side_a_min_bps = side_a_min_rate
|
||||
self.cx_profile.side_a_max_bps = side_a_max_rate
|
||||
self.cx_profile.side_a_min_pdu = side_a_min_pdu
|
||||
self.cx_profile.side_a_max_pdu = side_a_max_pdu
|
||||
self.cx_profile.side_b_min_bps = side_b_min_rate
|
||||
self.cx_profile.side_b_max_bps = side_b_max_rate
|
||||
self.cx_profile.side_b_min_pdu = side_b_min_pdu
|
||||
self.cx_profile.side_b_max_pdu = side_b_max_pdu
|
||||
|
||||
def __get_rx_values(self):
|
||||
endp_list = self.json_get("endp?fields=name,rx+bytes,rx+drop+%25", debug_=False)
|
||||
@@ -711,9 +718,9 @@ class L3VariableTime(LFCliBase):
|
||||
endp_rx_map = {}
|
||||
our_endps = {}
|
||||
for e in self.multicast_profile.get_mc_names():
|
||||
our_endps[e] = e;
|
||||
our_endps[e] = e
|
||||
for e in self.cx_profile.created_endp.keys():
|
||||
our_endps[e] = e;
|
||||
our_endps[e] = e
|
||||
for endp_name in endp_list['endpoint']:
|
||||
if endp_name != 'uri' and endp_name != 'handler':
|
||||
for item, value in endp_name.items():
|
||||
@@ -1056,7 +1063,7 @@ class L3VariableTime(LFCliBase):
|
||||
for station_profile in self.station_profiles:
|
||||
temp_stations_list.extend(station_profile.station_names.copy())
|
||||
# need algorithm for setting time default
|
||||
if self.local_realm.wait_for_ip(temp_stations_list, timeout_sec=600, debug=self.debug):
|
||||
if self.local_realm.wait_for_ip(temp_stations_list, timeout_sec=120, debug=self.debug):
|
||||
logg.info("ip's acquired")
|
||||
else:
|
||||
logg.info("print failed to get IP's")
|
||||
@@ -1451,8 +1458,10 @@ TODO: Radio descriptions in realm , the 1. refers to the chassi hopefully corres
|
||||
parser.add_argument('-r','--radio', action='append', nargs=1, help='--radio \
|
||||
\"radio==<number_of_wiphy stations=<=number of stations> ssid==<ssid> ssid_pw==<ssid password> security==<security> wifimode==<wifimode>\" '\
|
||||
, required=False)
|
||||
parser.add_argument('-amr','--side_a_min_rate', help='--side_a_min_rate, station transfer rate default 256000', default=256000)
|
||||
parser.add_argument('-amr','--side_a_min_rate', help='--side_a_min_rate, station min tx rate default 256000', default=256000)
|
||||
#parser.add_argument('-bmr','--side_a_min_pdu', help='--side_a_min_pdu , station ipdu size default 1518', default=1518)
|
||||
parser.add_argument('-bmr','--side_b_min_rate', help='--side_b_min_rate , upstream min tx rate default 256000', default=256000)
|
||||
#parser.add_argument('-bmr','--side_b_min_pdu', help='--side_b_min_pdu , upstream pdu size default 1518', default=1518)
|
||||
|
||||
# Parameters that allow for testing
|
||||
parser.add_argument('-noc','--no_controller', help='--no_controller no configuration of the controller', action='store_true')
|
||||
@@ -1518,6 +1527,36 @@ TODO: Radio descriptions in realm , the 1. refers to the chassi hopefully corres
|
||||
logging.basicConfig(format=FORMAT, handlers=[console_handler])
|
||||
|
||||
|
||||
####################################################
|
||||
#
|
||||
# Static Configuration Cisco Realm one lanforge
|
||||
#
|
||||
####################################################
|
||||
radio_AX200_abgn_ax_list_001_one = [['radio==1.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']]
|
||||
|
||||
radio_AX200_abgn_ax_list_010_one = [['radio==1.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'],
|
||||
['radio==1.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'],
|
||||
['radio==1.wiphy2 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'],
|
||||
['radio==1.wiphy3 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'],
|
||||
['radio==1.wiphy4 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'],
|
||||
['radio==1.wiphy5 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'],
|
||||
['radio==1.wiphy6 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'],
|
||||
['radio==1.wiphy7 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']]
|
||||
|
||||
|
||||
|
||||
radio_AX200_abgn_ax_dict_one = {'1' : radio_AX200_abgn_ax_list_001_one,
|
||||
'8' : radio_AX200_abgn_ax_list_010_one}
|
||||
|
||||
|
||||
radio_ath10K_9984_an_AC_list_001_one = [['radio==1.wiphy8 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']]
|
||||
radio_ath10K_9984_an_AC_list_010_one = [['radio==1.wiphy8 stations==10 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']]
|
||||
radio_ath10K_9984_an_AC_list_020_one = [['radio==1.wiphy8 stations==20 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']]
|
||||
|
||||
radio_ath10K_9984_an_AC_dict_one = {'1' : radio_ath10K_9984_an_AC_list_001_one,
|
||||
'10' : radio_ath10K_9984_an_AC_list_010_one,
|
||||
'20' : radio_ath10K_9984_an_AC_list_020_one}
|
||||
|
||||
|
||||
####################################################
|
||||
#
|
||||
@@ -1676,18 +1715,25 @@ TODO: Radio descriptions in realm , the 1. refers to the chassi hopefully corres
|
||||
|
||||
if args.cisco_all:
|
||||
cisco_aps = "APA453.0E7B.CF9C".split()
|
||||
cisco_bands = "a b".split()
|
||||
cisco_wifimodes = "an anAX anAC abgn bg".split()
|
||||
# cisco_bands = "a b".split()
|
||||
cisco_bands = "a ".split()
|
||||
# cisco_wifimodes = "an anAX anAC abgn bg".split()
|
||||
cisco_wifimodes = "an".split()
|
||||
cisco_tx_power = "3"
|
||||
cisco_chan_5ghz = "36".split()
|
||||
cisco_chan_24ghz = "1".split()
|
||||
cisco_chan_widths = "20".split()
|
||||
cisco_ap_modes = "local flex".split()
|
||||
# cisco_ap_modes = "local flex".split()
|
||||
cisco_ap_modes = "local".split()
|
||||
cisco_data_encryptions = "disable".split()
|
||||
endp_types = "lf_udp lf_tcp"
|
||||
cisco_packet_sizes = "1518".split()
|
||||
cisco_client_densities = "1".split()
|
||||
cisco_data_encryptions = "disable".split()
|
||||
|
||||
radio_AX200_abgn_ax_dict = radio_AX200_abgn_ax_dict_one
|
||||
radio_ath10K_9984_an_AC_dict = radio_ath10K_9984_an_AC_dict_one
|
||||
|
||||
elif args.cisco_test:
|
||||
cisco_aps = "APA453.0E7B.CF9C".split()
|
||||
cisco_bands = "a".split()
|
||||
@@ -1700,8 +1746,8 @@ TODO: Radio descriptions in realm , the 1. refers to the chassi hopefully corres
|
||||
cisco_ap_modes = "local".split()
|
||||
cisco_data_encryptions = "disable".split()
|
||||
endp_types = "lf_udp lf_tcp"
|
||||
cisco_packet_sizes = "1518".split()
|
||||
cisco_client_densities = "1 10 50".split()
|
||||
cisco_packet_sizes = "88 512 1370 1518".split()
|
||||
cisco_client_densities = "1".split()
|
||||
cisco_data_encryptions = "disable".split()
|
||||
|
||||
radio_AX200_abgn_ax_dict = radio_AX200_abgn_ax_dict_test
|
||||
@@ -1892,7 +1938,9 @@ TODO: Radio descriptions in realm , the 1. refers to the chassi hopefully corres
|
||||
reset_port_time_min_list=reset_port_time_min_list,
|
||||
reset_port_time_max_list=reset_port_time_max_list,
|
||||
side_a_min_rate=args.side_a_min_rate,
|
||||
side_a_min_pdu =args.cisco_packet_size,
|
||||
side_b_min_rate=args.side_b_min_rate,
|
||||
side_b_min_pdu =args.cisco_packet_size,
|
||||
debug_on=debug_on,
|
||||
outfile=csv_outfile,
|
||||
test_keys=test_keys,
|
||||
|
||||
@@ -22,13 +22,13 @@ parser = LFCliBase.create_bare_argparse(
|
||||
description='''scenario.py
|
||||
--------------------
|
||||
Generic command example:
|
||||
python3 scenario.py --load db1 --action overwrite --clean_dut --clean_chambers
|
||||
scenario.py --load db1 --action overwrite --clean_dut --clean_chambers
|
||||
|
||||
python3 scenario.py --start test_group1
|
||||
scenario.py --start test_group1
|
||||
|
||||
python3 scenario.py --quiesce test_group1
|
||||
scenario.py --quiesce test_group1
|
||||
|
||||
python3 scenario.py --stop test_group1
|
||||
scenario.py --stop test_group1
|
||||
''')
|
||||
|
||||
group = parser.add_mutually_exclusive_group()
|
||||
|
||||
79
py-scripts/test_all_scripts.sh
Executable file
79
py-scripts/test_all_scripts.sh
Executable file
@@ -0,0 +1,79 @@
|
||||
#!/bin/bash
|
||||
#Security connection examples#########################################
|
||||
echo "Beginning example_wpa_connection.py test..."
|
||||
chmod +x example_wpa2_connection.py
|
||||
./example_wpa2_connection.py --num_stations 3 --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio wiphy0
|
||||
chmod +x scenario.py
|
||||
./scenario.py --load BLANK
|
||||
chmod +x example_wep_connection.py
|
||||
./example_wep_connection.py --ssid jedway-wep-48 --passwd jedway-wep-48 --radio wiphy1
|
||||
./scenario.py --load BLANK
|
||||
chmod +x example_wpa3_connection.py
|
||||
./example_wpa3_connection.py
|
||||
./scenario.py --load BLANK
|
||||
chmod +x example_wpa_connection.py
|
||||
./example_wpa_connection.py --radio wiphy1
|
||||
./scenario.py --load BLANK
|
||||
#test generic and test fileio######################################################
|
||||
#chmod +x test_fileio.py
|
||||
#./test_fileio.py
|
||||
chmod +x test_generic.py
|
||||
#lfping
|
||||
./test_generic.py --num_stations 3 --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio wiphy0
|
||||
#lfcurl
|
||||
./test_generic.py --num_stations 3 --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio wiphy0
|
||||
#generic
|
||||
./test_generic.py --num_stations 3 --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio wiphy0
|
||||
#speedtest
|
||||
./test_generic.py --num_stations 3 --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio wiphy0
|
||||
#iperf3
|
||||
./test_generic.py --num_stations 3 --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio wiphy0
|
||||
#Ipv4 connection tests##########################################
|
||||
chmod +x test_ipv4_connection.py
|
||||
./test_ipv4_connection.py
|
||||
chmod +x test_ipv4_l4_ftp_upload.py
|
||||
./test_ipv4_l4_ftp_upload.py
|
||||
chmod +x test_ipv4_l4_ftp_urls_per_ten.py
|
||||
./test_ipv4_l4_ftp_urls_per_ten.py
|
||||
chmod +x test_ipv4_l4_ftp_wifi.py
|
||||
./test_ipv4_l4_ftp_wifi.py
|
||||
chmod +x test_ipv4_l4_urls_per_ten.py
|
||||
./test_ipv4_l4_urls_per_ten.py
|
||||
chmod +x test_ipv4_l4_wifi.py
|
||||
./test_ipv4_l4_wifi.py
|
||||
chmod +x test_ipv4_l4
|
||||
./test_ipv4_l4.py
|
||||
chmod +x test_ipv4_ps.py
|
||||
./test_ipv4_l4_ps.py
|
||||
chmod +x test_ipv4_ttls.py
|
||||
./test_ipv4_l4_ttls.py
|
||||
chmod +x test_ipv4_variable_time.py
|
||||
./test_ipv4_variable_time.py
|
||||
#Layer 3 tests################################################
|
||||
chmod +x test_l3_longevity.py
|
||||
./test_l3_longevity.py
|
||||
chmod +x test_l3_powersave_traffic
|
||||
./test_l3_powersave_traffic.py
|
||||
chmod +x test_l3_scenario_traffic.py
|
||||
./test_l3_scenario_traffic.py
|
||||
chmod +x test_l3_unicast_traffic_gen.py
|
||||
./test_l3_unicast_traffic_gen.py
|
||||
chmod +x test_l3_WAN_LAN.py
|
||||
./test_l3_WAN_LAN.py
|
||||
#WANlink######################################################
|
||||
chmod +x test_wanlink.py
|
||||
./test_wanlink.py
|
||||
#IPv6 connection tests########################################
|
||||
chmod +x test_ipv6_connection.py
|
||||
./test_ipv6_variable_connection.py
|
||||
chmod +x test_ipv6_variable_time.py
|
||||
./test_ipv6_variable_time.py
|
||||
#STA Connect examples#########################################
|
||||
chmod +x sta_connect_example.py
|
||||
./sta_connect_example.py
|
||||
chmod +x sta_connect_multi_example.py
|
||||
./sta_connect_multi_example.py
|
||||
chmod +x sta_connect.py
|
||||
./sta_connect.py
|
||||
chmod +x sta_connect2.py
|
||||
./sta_connect2.py
|
||||
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
# import re
|
||||
if sys.version_info[0] != 3:
|
||||
print("This script requires Python 3")
|
||||
exit(1)
|
||||
|
||||
@@ -123,7 +123,7 @@ def main():
|
||||
test_ipv4_connection.py
|
||||
--------------------
|
||||
Generic command example:
|
||||
python3 ./test_ipv4_connection.py --upstream_port eth1 \\
|
||||
./test_ipv4_connection.py --upstream_port eth1 \\
|
||||
--radio wiphy0 \\
|
||||
--num_stations 3 \\
|
||||
--security {open|wep|wpa|wpa2|wpa3} \\
|
||||
@@ -142,6 +142,8 @@ python3 ./test_ipv4_connection.py --upstream_port eth1 \\
|
||||
num_stations_converted = int(args.num_stations)
|
||||
num_sta = num_stations_converted
|
||||
|
||||
ws_event = LFCliBase("192.168.200.15", 8080)
|
||||
|
||||
station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta-1, padding_number_=10000)
|
||||
ip_test = IPv4Test(lfjson_host, lfjson_port, ssid=args.ssid, password=args.passwd,
|
||||
security=args.security, sta_list=station_list, radio=args.radio)
|
||||
@@ -150,17 +152,19 @@ python3 ./test_ipv4_connection.py --upstream_port eth1 \\
|
||||
ip_test.build()
|
||||
if not ip_test.passes():
|
||||
print(ip_test.get_fail_message())
|
||||
ws_event.add_event(name="test_ipv4_connection.py", message=ip_test.get_fail_message())
|
||||
exit(1)
|
||||
ip_test.start(station_list, False, False)
|
||||
ip_test.stop()
|
||||
if not ip_test.passes():
|
||||
print(ip_test.get_fail_message())
|
||||
ws_event.add_event(name="test_ipv4_connection.py", message=ip_test.get_fail_message())
|
||||
exit(1)
|
||||
time.sleep(30)
|
||||
ip_test.cleanup(station_list)
|
||||
if ip_test.passes():
|
||||
print("Full test passed, all stations associated and got IP")
|
||||
|
||||
ws_event.add_event(name="test_ipv4_connection.py", message="Full test passed, all stations associated and got IP")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
28
py-scripts/ws_generic_monitor_test.py
Normal file
28
py-scripts/ws_generic_monitor_test.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
This example is to demonstrate ws_generic_monitor to monitor events triggered by scripts,
|
||||
This script when running, will monitor the events triggered by test_ipv4_connection.py
|
||||
|
||||
"""
|
||||
|
||||
|
||||
import sys
|
||||
import json
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-json')
|
||||
from ws_generic_monitor import WS_Listener
|
||||
|
||||
reference = "test_ipv4_connection.py"
|
||||
def main():
|
||||
WS_Listener(lfclient_host="localhost", _scriptname=reference, _callback=TestRun)
|
||||
|
||||
|
||||
def TestRun(ws, message):
|
||||
if (str(message).__contains__(reference)):
|
||||
#print(message)
|
||||
temp = json.loads(message)
|
||||
event_message = str(temp['name']) + "/" + str(temp['details']) + "/" + str(temp['timestamp'])
|
||||
print(event_message)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user