diff --git a/cisco_wifi_ctl.py b/cisco_wifi_ctl.py index 935d27ce..6af883b6 100755 --- a/cisco_wifi_ctl.py +++ b/cisco_wifi_ctl.py @@ -279,7 +279,7 @@ def main(): raise Exception("channel requires ap and value") if (args.action == "channel"): if args.series == "9800": - command = "ap name %s dot11 5ghz channel width %s"%(args.ap, args.value) + command = "ap name %s dot11 5ghz channel %s"%(args.ap, args.value) else: command = "config 802.11%s channel ap %s %s"%(band, args.ap, args.value) @@ -311,7 +311,6 @@ def main(): if (args.action == "wlan_qos"): command = "config wlan qos %s %s"%(args.wlanID, args.value) - if (command is None): logg.info("No command specified, going to log out.") else: diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index a423cbf6..721095bf 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -337,11 +337,11 @@ class L3VariableTimeLongevity(LFCliBase): def lf_hackrf_enable(self): # hard coded for now - - if os.path.isfile(self.args.hackrf): - print("hack rf file found {}".format(self.args.hackrf)) - else: - print("WARNING: hack rf file not found at {}".format(self.args.hackrf)) + # need json and update to realm + #if os.path.isfile(self.args.hackrf): + # print("hack rf file found {}".format(self.args.hackrf)) + #else: + # print("WARNING: hack rf file not found at {}".format(self.args.hackrf)) # look for lf_hackrf.py in local directory the look for in pass @@ -586,52 +586,102 @@ def main(): description='''\ test_l3_longevity.py: -------------------- -Basic Idea: create stations, create traffic between upstream port and stations, run traffic. - The traffic on the stations will be checked once per minute to verify that traffic is transmitted - and recieved. - Test will exit on failure of not recieving traffice for one minute on any station. - - Scripts are executed from: ./lanforge/py-scripts - - Stations start counting from zero, thus stations count from zero - number of las +Summary : +---------- +create stations, create traffic between upstream port and stations, run traffic. +The traffic on the stations will be checked once per minute to verify that traffic is transmitted +and recieved. Generic command layout: -python .\\test_l3_longevity.py --test_duration --endp_type --upstream_port --radio --debug +----------------------- +python .\\test_l3_longevity.py --test_duration --endp_type --upstream_port + --radio "radio== stations== ssid== ssid_pw== security==" --debug +Multiple radios may be entered with individual --radio switches + +generiic command with controller setting channel and channel width test duration 5 min +python3 test_l3_longevity.py --cisco_ctlr --cisco_dfs True/False --mgr + --cisco_channel --cisco_chan_width <20,40,80,120> --endp_type 'lf_udp lf_tcp mc_udp' --upstream_port <1.ethX> + --radio "radio== stations== ssid== ssid_pw== security==" + --radio "radio== stations== ssid== ssid_pw== security==" + --duration 5m -Note: multiple --station switches may be entered up to the number of radios available: - example: - --station "radio==wiphy0 stations==4 ssid==jedway-wpa2-x2048-4-1 ssid_pw==jedway-wpa2-x2048-4-1 security==wpa2","--radio","radio==wiphy1 stations==3 ssid==jedway-wpa2-x2048-5-3, ssid_pw==jedway-wpa2-x2048-5-3 security==wpa2" : number followed by one of the following - d - days - h - hours - m - minutes - s - seconds +d - days +h - hours +m - minutes +s - seconds : - lf_udp : IPv4 UDP traffic - lf_tcp : IPv4 TCP traffic - lf_udp6 : IPv6 UDP traffic - lf_tcp6 : IPv6 TCP traffic - - mc_udp : IPv4 multi cast UDP traffic - mc_udp6 : IPv6 multi cast UDP traffic +lf_udp : IPv4 UDP traffic +lf_tcp : IPv4 TCP traffic +lf_udp6 : IPv6 UDP traffic +lf_tcp6 : IPv6 TCP traffic +mc_udp : IPv4 multi cast UDP traffic +mc_udp6 : IPv6 multi cast UDP traffic : - BK, BE, VI, VO: Optional wifi related Tos Settings. Or, use your preferred numeric values. - +BK, BE, VI, VO: Optional wifi related Tos Settings. Or, use your preferred numeric values. - Example: - 1. Test duration 4 minutes - 2. Traffic IPv4 TCP - 3. Upstream-port eth1 - 4. Radio #1 wiphy0 has 32 stations, ssid = candelaTech-wpa2-x2048-4-1, ssid password = candelaTech-wpa2-x2048-4-1 - 5. Radio #2 wiphy1 has 64 stations, ssid = candelaTech-wpa2-x2048-5-3, ssid password = candelaTech-wpa2-x2048-5-3 - 6. Create connections with TOS of BK and VI +################################# +#Command switches +################################# +--cisco_ctlr ',default=None +--cisco_user ',default="admin" +--cisco_passwd ',default="Cisco123 +--cisco_prompt ',default="(Cisco Controller) > +--cisco_ap ',default="APA453.0E7B.CF9C" + +--cisco_dfs ',default=False +--cisco_channel ',default=None , no change +--cisco_chan_width <20 40 80 160>',default="20",choices=["20","40","80","160"] +--cisco_band ',default="a",choices=["a", "b", "abgn"] + +--mgr ',default='localhost' +-d / --test_duration example --time 5d (5 days) default: 3m options: number followed by d, h, m or s',default='3m' +--tos: Support different ToS settings: BK | BE | VI | VO | numeric',default="BE" +--debug: Enable debugging',default=False +-t / --endp_type 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', + default='lf_udp', type=valid_endp_types +-u / --upstream_port example: --upstream_port eth1',default='eth1') +-o / --outfile ", default='longevity_results' + +######################################### +# Examples +# ####################################### +Example #1 running traffic with two radios +1. Test duration 4 minutes +2. Traffic IPv4 TCP +3. Upstream-port eth1 +4. Radio #0 wiphy0 has 32 stations, ssid = candelaTech-wpa2-x2048-4-1, ssid password = candelaTech-wpa2-x2048-4-1 +5. Radio #1 wiphy1 has 64 stations, ssid = candelaTech-wpa2-x2048-5-3, ssid password = candelaTech-wpa2-x2048-5-3 +6. Create connections with TOS of BK and VI + +Command: (remove carriage returns) +python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp mc_udp\" --tos \"BK VI\" --upstream_port eth1 +--radio "radio==wiphy0 stations==32 ssid==candelaTech-wpa2-x2048-4-1 ssid_pw==candelaTech-wpa2-x2048-4-1 security==wpa2" +--radio "radio==wiphy1 stations==64 ssid==candelaTech-wpa2-x2048-5-3 ssid_pw==candelaTech-wpa2-x2048-5-3 security==wpa2" + +Example #2 using cisco controller +1. cisco controller at 192.168.100.112 +2. cisco dfs True +3. cisco channel 52 +4. cisco channel width 20 +5. traffic 'lf_udp lf_tcp mc_udp' +6. upstream port eth3 +7. radio #0 wiphy0 stations 3 ssid test_candela ssid_pw [BLANK] secruity Open +8. radio #1 wiphy1 stations 16 ssid test_candela ssid_pw [BLANK] security Open +9. lanforge manager at 192.168.100.178 +10. duration 5m + +Command: +python3 test_l3_longevity.py --cisco_ctlr 192.168.100.112 --cisco_dfs True --mgr 192.168.100.178 + --cisco_channel 52 --cisco_chan_width 20 --endp_type 'lf_udp lf_tcp mc_udp' --upstream_port 1.eth3 + --radio "radio==1.wiphy0 stations==3 ssid==test_candela ssid_pw==[BLANK] security==open" + --radio "radio==1.wiphy1 stations==16 ssid==test_candela ssid_pw==[BLANK] security==open" + --test_duration 5m - Command: - python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp mc_udp\" --tos \"BK VI\" --upstream_port eth1 --radio "radio==wiphy0 stations==4 ssid==jedway-wpa2-x2048-4-1 ssid_pw==jedway-wpa2-x2048-4-1 security==wpa2" ''') @@ -643,7 +693,6 @@ Note: multiple --station switches may be entered up to the number of radios av parser.add_argument('--cisco_ap', help='--cisco_ap ',default="APA453.0E7B.CF9C") parser.add_argument('--cisco_dfs', help='--cisco_dfs ',default=False) - parser.add_argument('--hackrf', help='--hackrf ',default="/home/lanforge/lf_hackrf.py") parser.add_argument('--cisco_channel', help='--cisco_channel ',default=None) parser.add_argument('--cisco_chan_width', help='--cisco_chan_width <20 40 80 160>',default="20",choices=["20","40","80","160"]) @@ -659,7 +708,7 @@ Note: multiple --station switches may be entered up to the number of radios av parser.add_argument('-t', '--endp_type', help='--endp_type 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', default='lf_udp', type=valid_endp_types) parser.add_argument('-u', '--upstream_port', help='--upstream_port example: --upstream_port eth1',default='eth1') - parser.add_argument('-o','--outfile', help="Output file for csv data", default='longevity_results') + parser.add_argument('-o','--outfile', help="--outfile ", default='longevity_results') #parser.add_argument('-c','--csv_output', help="Generate csv output", default=False) requiredNamed = parser.add_argument_group('required arguments')