From e085bea4a46ea1bf8ebc899948af6ca433568038 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Mon, 17 May 2021 15:54:24 -0700 Subject: [PATCH] Added NAME, PURPOSE, and EXAMPLE sections to docstrings --- py-scripts/test_fileio.py | 8 ++++++-- py-scripts/test_generic.py | 19 ++++++++++++++++++- py-scripts/test_ipv4_connection.py | 9 ++++++++- py-scripts/test_ipv4_l4.py | 12 +++++++++++- py-scripts/test_ipv4_l4_ftp_upload.py | 11 ++++++++++- py-scripts/test_ipv4_l4_ftp_urls_per_ten.py | 11 ++++++++++- py-scripts/test_ipv4_l4_ftp_wifi.py | 12 +++++++++++- py-scripts/test_ipv4_l4_urls_per_ten.py | 13 ++++++++++++- py-scripts/test_ipv4_l4_wifi.py | 11 ++++++++++- py-scripts/test_ipv4_variable_time.py | 8 ++++++-- py-scripts/test_ipv6_connection.py | 12 ++++++++++-- py-scripts/test_ipv6_variable_time.py | 11 ++++++++++- 12 files changed, 122 insertions(+), 15 deletions(-) diff --git a/py-scripts/test_fileio.py b/py-scripts/test_fileio.py index d20e4e93..8cf8e6c7 100755 --- a/py-scripts/test_fileio.py +++ b/py-scripts/test_fileio.py @@ -1,6 +1,10 @@ #!/usr/bin/env python3 -"""test_fileio.py will create stations or macvlans with matching fileio endpoints to generate and verify fileio related traffic. +""" +NAME: test_fileio.py + +PURPOSE: +test_fileio.py will create stations or macvlans with matching fileio endpoints to generate and verify fileio related traffic. This script will create a variable number of stations or macvlans to test fileio traffic. Pre-existing stations and macvlans can be used as well. Command line options are available to update cross-connects as well as using a list of @@ -11,7 +15,7 @@ this script will depend on the mode used, a read-only test will check the read-b and both will check both attributes. If the relevant attributes increase over the duration of the test it will pass, otherwise it will fail. -Example: +EXAMPLE: ./test_fileio.py --macvlan_parent --num_ports --use_macvlans --first_mvlan_ip --netmask --gateway diff --git a/py-scripts/test_generic.py b/py-scripts/test_generic.py index 73896d76..b108f8b3 100755 --- a/py-scripts/test_generic.py +++ b/py-scripts/test_generic.py @@ -1,12 +1,29 @@ #!/usr/bin/env python3 -"""test_generic.py will create stations and endpoints to generate traffic based on a command-line specified command type. +""" +NAME: test_generic.py + +PURPOSE: +test_generic.py will create stations and endpoints to generate traffic based on a command-line specified command type. This script will create a variable number of stations to test generic endpoints. Multiple command types can be tested including ping, speedtest, generic types. The test will check the last-result attribute for different things depending on what test is being run. Ping will test for successful pings, speedtest will test for download speed, upload speed, and ping time, generic will test for successful generic commands +EXAMPLE: + LFPING: + ./test_generic.py --mgr localhost --mgr_port 4122 --radio wiphy0 --num_stations 7 --ssid jedway-wpa2-x2048-4-1 --passwd jedway-wpa2-x2048-4-1 --type lfping --dest 10.40.0.1 --security wpa2 + LFCURL (under construction): + ./test_generic.py --mgr localhost --mgr_port 4122 --radio wiphy1 --num_stations 26 --ssid jedway-wpa2-x2048-4-1 --passwd jedway-wpa2-x2048-4-1 --security wpa2 --type lfcurl --dest 10.40.0.1 + GENERIC: + ./test_generic.py --mgr localhost--mgr_port 4122 --radio wiphy1 --num_stations 2 --ssid jedway-wpa2-x2048-4-1 --passwd jedway-wpa2-x2048-4-1 --security wpa2 --type generic + SPEEDTEST: + ./test_generic.py --mgr localhost --mgr_port 4122 --radio wiphy2 --num_stations 13 --ssid jedway-wpa2-x2048-4-1 --passwd jedway-wpa2-x2048-4-1 --type speedtest --speedtest_min_up 20 + --speedtest_min_dl 20 --speedtest_max_ping 150 --security wpa2 + IPERF3 (under construction): + ./test_generic.py --mgr localhost --mgr_port 4122 --radio wiphy1 --num_stations 3 --ssid jedway-wpa2-x2048-4-1 --passwd jedway-wpa2-x2048-4-1 --security wpa2 --type iperf3 + Use './test_generic.py --help' to see command line usage and options Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. diff --git a/py-scripts/test_ipv4_connection.py b/py-scripts/test_ipv4_connection.py index 2fcc7e89..2bf2e9a8 100755 --- a/py-scripts/test_ipv4_connection.py +++ b/py-scripts/test_ipv4_connection.py @@ -1,11 +1,18 @@ #!/usr/bin/env python3 -"""test_ipv4_connection.py will create stations and attempt to connect to an SSID. WPA, WPA2, WPA3, WEP, and Open connection types are supported +""" +NAME: test_ipv4_connection.py + +PURPOSE: +test_ipv4_connection.py will create stations and attempt to connect to an SSID. WPA, WPA2, WPA3, WEP, and Open connection types are supported Script for creating a variable number of stations and attempting to connect them to an SSID. A test will run to verify stations are associated and get an IP, if these conditions are both true, the test will pass, otherwise, the test will fail. +EXAMPLE: +./test_ipv4_connection.py --upstream_port eth1 --radio wiphy0 --num_stations 3 --security open --ssid netgear --passwd BLANK --debug + Use './test_ipv4_connection.py' --help to see command line usage and options Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. diff --git a/py-scripts/test_ipv4_l4.py b/py-scripts/test_ipv4_l4.py index 5c7d8c7f..5cea2831 100755 --- a/py-scripts/test_ipv4_l4.py +++ b/py-scripts/test_ipv4_l4.py @@ -1,9 +1,19 @@ #!/usr/bin/env python3 -"""test_ipv4_l4.py will create stations and endpoints to generate and verify layer-4 traffic +""" +NAME: test_ipv4_l4.py + +PURPOSE: +test_ipv4_l4.py will create stations and endpoints to generate and verify layer-4 traffic This script will monitor the bytes-rd attribute of the endpoints. If the the monitored value does not continually increase, this test will not pass. +EXAMPLE: +./test_ipv4_l4.py --upstream_port eth1 (optional) --radio wiphy0 (required) --num_stations 3 (optional) + --security {open|wep|wpa|wpa2|wpa3} (required) --ssid netgear (required) + --url "dl http://10.40.0.1 /dev/null" (required) --password admin123 (required) + --test_duration 2m (optional) --debug (optional) + Use './test_ipv4_l4.py --help' to see command line usage and options Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. diff --git a/py-scripts/test_ipv4_l4_ftp_upload.py b/py-scripts/test_ipv4_l4_ftp_upload.py index d237d5e0..d437007b 100755 --- a/py-scripts/test_ipv4_l4_ftp_upload.py +++ b/py-scripts/test_ipv4_l4_ftp_upload.py @@ -1,9 +1,18 @@ #!/usr/bin/env python3 -"""test_ipv4_l4_ftp_upload.py will create stations and endpoints to generate and verify layer-4 upload traffic over an ftp connection +""" +NAME: test_ipv4_l4_ftp_upload.py + +PURPOSE: +test_ipv4_l4_ftp_upload.py will create stations and endpoints to generate and verify layer-4 upload traffic over an ftp connection This script will monitor the bytes-wr attribute of the endpoints. If the the monitored value does not continually increase, this test will not pass. +EXAMPLE: + ./test_ipv4_l4_ftp_upload.py --upstream_port eth1 --radio wiphy0 --num_stations 3 --security {open|wep|wpa|wpa2|wpa3} + --ssid netgear --passwd admin123 --test_duration 2m --url "ul ftp://10.40.0.1 /dev/null" --requests_per_ten 600 + --debug + Use './test_ipv4_l4_ftp_upload.py --help' to see command line usage and options Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. diff --git a/py-scripts/test_ipv4_l4_ftp_urls_per_ten.py b/py-scripts/test_ipv4_l4_ftp_urls_per_ten.py index 352822d0..893cf00a 100755 --- a/py-scripts/test_ipv4_l4_ftp_urls_per_ten.py +++ b/py-scripts/test_ipv4_l4_ftp_urls_per_ten.py @@ -1,9 +1,18 @@ #!/usr/bin/env python3 -"""test_ipv4_l4_ftp_urls_per_ten.py will create stations and endpoints to generate and verify layer-4 traffic over an ftp connection +""" +NAME: test_ipv4_l4_ftp_urls_per_ten.py + +PURPOSE: +test_ipv4_l4_ftp_urls_per_ten.py will create stations and endpoints to generate and verify layer-4 traffic over an ftp connection This script will monitor the urls/s attribute of the endpoints. If the the monitored value does not continually increase, this test will not pass. +EXAMPLE: + ./test_ipv4_l4_ftp_urls_per_ten.py --upstream_port eth1 --radio wiphy0 --num_stations 3 --security {open|wep|wpa|wpa2|wpa3} + --ssid netgear --passwd admin123 --test_duration 2m --interval 1s --mode 1 --ap "00:0e:8e:78:e1:76" --requests_per_ten 600 + --num_tests 1 --url "ul ftp://lanforge:lanforge@10.40.0.1/example.txt /home/lanforge/example.txt" --debug + Use './test_ipv4_l4_ftp_urls_per_ten.py --help' to see command line usage and options Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. diff --git a/py-scripts/test_ipv4_l4_ftp_wifi.py b/py-scripts/test_ipv4_l4_ftp_wifi.py index 3ab45041..bb94ac0c 100755 --- a/py-scripts/test_ipv4_l4_ftp_wifi.py +++ b/py-scripts/test_ipv4_l4_ftp_wifi.py @@ -1,9 +1,19 @@ #!/usr/bin/env python3 -"""test_ipv4_l4_ftp_wifi.py will create stations and endpoints to generate and verify layer-4 traffic over an ftp connection +""" +NAME: test_ipv4_l4_ftp_wifi.py + +PURPOSE: +test_ipv4_l4_ftp_wifi.py will create stations and endpoints to generate and verify layer-4 traffic over an ftp connection This script will monitor the bytes-wr attribute of the endpoints. If the the monitored value does not continually increase, this test will not pass. +EXAMPLE: +./test_ipv4_l4_ftp_wifi.py --upstream_port eth1 --radio wiphy0 --num_stations 3 --security {open|wep|wpa|wpa2|wpa3} + --ssid netgear --passwd admin123 --dest 10.40.0.1 --test_duration 2m --interval 1s --requests_per_ten 600 + --dest /var/www/html/data_slug_4K.bin --source /tmp/data_slug_4K.bin --ftp_user lanforge --ftp_passwd lanforge + --debug + Use './test_ipv4_l4_ftp_wifi.py --help' to see command line usage and options Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. diff --git a/py-scripts/test_ipv4_l4_urls_per_ten.py b/py-scripts/test_ipv4_l4_urls_per_ten.py index ea595470..8c2bc089 100755 --- a/py-scripts/test_ipv4_l4_urls_per_ten.py +++ b/py-scripts/test_ipv4_l4_urls_per_ten.py @@ -1,9 +1,20 @@ #!/usr/bin/env python3 -"""test_ipv4_l4_urls_per_ten.py will create stations and endpoints to generate and verify layer-4 traffic +""" +NAME: test_ipv4_l4_urls_per_ten.py + +PURPOSE: +test_ipv4_l4_urls_per_ten.py will create stations and endpoints to generate and verify layer-4 traffic This script will monitor the urls/s attribute of the endpoints. If the the monitored value does not continually increase, this test will not pass. +EXAMPLE: +./test_ipv4_l4_urls_per_ten.py --upstream_port eth1 --radio wiphy0 --num_stations 3 --security {open|wep|wpa|wpa2|wpa3} + --ssid netgear --passwd admin123 --requests_per_ten 600 --mode 1 --num_tests 1 --url "dl http://10.40.0.1 /dev/null" + --ap "00:0e:8e:78:e1:76" --target_per_ten 600 --output_format csv --report_file ~/Documents/results.csv --test_duration 2m + --debug + + Use './test_ipv4_l4_urls_per_ten.py --help' to see command line usage and options Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. diff --git a/py-scripts/test_ipv4_l4_wifi.py b/py-scripts/test_ipv4_l4_wifi.py index 099ae811..b4e342f0 100755 --- a/py-scripts/test_ipv4_l4_wifi.py +++ b/py-scripts/test_ipv4_l4_wifi.py @@ -1,9 +1,18 @@ #!/usr/bin/env python3 -"""test_ipv4_l4_wifi.py will create stations and endpoints to generate and verify layer-4 upload traffic +""" +NAME: test_ipv4_l4_wifi.py + +PURPOSE: +test_ipv4_l4_wifi.py will create stations and endpoints to generate and verify layer-4 upload traffic This script will monitor the bytes-rd attribute of the endpoints. If the the monitored value does not continually increase, this test will not pass. +EXAMPLE: +./test_ipv4_l4_wifi.py --upstream_port eth1 --radio wiphy0 --num_stations 3 --security open --ssid netgear + --passwd admin123 --test_duration 2m --requests_per_ten 600 --direction {ul | dl} + --dest /dev/null (or 10.40.0.1) --debug + Use './test_ipv4_l4_wifi.py --help' to see command line usage and options Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. diff --git a/py-scripts/test_ipv4_variable_time.py b/py-scripts/test_ipv4_variable_time.py index ef304dd4..bfe991d8 100755 --- a/py-scripts/test_ipv4_variable_time.py +++ b/py-scripts/test_ipv4_variable_time.py @@ -1,7 +1,11 @@ #!/usr/bin/env python3 -"""test_ipv4_variable_time.py will create stations and endpoints to generate and verify layer-3 traffic. -This Sdript has two working modes: +""" +NAME: test_ipv4_variable_time.py + +PURPOSE: +test_ipv4_variable_time.py will create stations and endpoints to generate and verify layer-3 traffic. +This Script has two working modes: Mode 1: When station is not available, diff --git a/py-scripts/test_ipv6_connection.py b/py-scripts/test_ipv6_connection.py index 81facd8a..f5fc18c1 100755 --- a/py-scripts/test_ipv6_connection.py +++ b/py-scripts/test_ipv6_connection.py @@ -1,11 +1,19 @@ #!/usr/bin/env python3 -"""test_ipv6_connection.py will create stations and attempt to connect to an SSID using IPv6. WPA, WPA2, WPA3, WEP, and Open connection types are supported +""" +NAME: test_ipv6_connection.py + +PURPOSE: +test_ipv6_connection.py will create stations and attempt to connect to an SSID using IPv6. WPA, WPA2, WPA3, WEP, and Open connection types are supported Script for creating a variable number of stations and attempting to connect them to an SSID using IPv6. A test will run to verify stations are associated and get an IP, if these conditions are both true, the test will pass, otherwise, the test will fail. +EXAMPLE: + ./test_ipv6_connection.py --upstream_port eth1 --radio wiphy0 --num_stations 3 --proxy --security {open|wep|wpa|wpa2|wpa3} + --ssid netgear --passwd admin123 --mode 1 --ap "00:0e:8e:78:e1:76" --test_id --timeout 120 --debug + Use './test_ipv6_connection.py --help' to see command line usage and options Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. @@ -153,7 +161,7 @@ python3 ./test_ipv6_connection.py --mode 1 --ap "00:0e:8e:78:e1:76" --test_id - -- timeout 120 + --timeout 120 --debug ''') diff --git a/py-scripts/test_ipv6_variable_time.py b/py-scripts/test_ipv6_variable_time.py index dcdd1763..6812c46a 100755 --- a/py-scripts/test_ipv6_variable_time.py +++ b/py-scripts/test_ipv6_variable_time.py @@ -1,11 +1,20 @@ #!/usr/bin/env python3 -"""test_ipv6_variable_time.py will create stations and endpoints to generate and verify layer-3 traffic over IPv6. +""" +NAME: test_ipv6_variable_time.py + +PURPOSE: +test_ipv6_variable_time.py will create stations and endpoints to generate and verify layer-3 traffic over IPv6. This script will create a variable number of stations, using IPv6, each with their own set of cross-connects and endpoints. It will then create layer 3 traffic over a specified amount of time, testing for increased traffic at regular intervals. This test will pass if all stations increase traffic over the full test duration. +EXAMPLE: + ./test_ipv6_connection.py --upstream_port eth1 --radio wiphy0 --num_stations 3 --security {open|wep|wpa|wpa2|wpa3} + --ssid netgear --passwd admin123 --upstream 10.40.0.1 --test_duration 2m --interval 1s --a_min 256000 --b_min 256000 + --debug + Use './test_ipv6_variable_time.py --help' to see command line usage and options Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed.