From a8fcc7b14b8b965323b2bddc6cd070f96b4157af Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 13 Apr 2021 13:01:26 -0600 Subject: [PATCH] README.md : description for py-json scripts Signed-off-by: Chuck SmileyRekiere --- README.md | 90 ++++++++++++++++++++++++++++--------- py-json/create_wanlink.py | 10 +++-- py-json/fio_endp_profile.py | 6 +++ py-json/realm.py | 12 +++++ py-scripts/test_fileio.py | 8 ++++ 5 files changed, 100 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 6f3ebd81..9411dd8f 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,73 @@ within a script. ### Examples and Documents ### Read more examples in the [scripting LANforge](http://www.candelatech.com/lfcli_api_cookbook.php) cookbook. -### Python Scripts ### +## Python Scripts ## When starting to use Python, please run the update_dependencies.py script located in py-scripts to install all necessary dependencies for this library. + +### Python Scripts py-json/LANforge ### + +Core communication files to LANforge + +| Name | Purpose | +|------|---------| +| `add_dut.py` | defined list of DUT keys, cli equivalent: https://www.candelatech.com/lfcli_ug.php#add_dut | +| `add_file_endp.py` | Add a File endpoint to the LANforge Manager. cli equivalent: add_file_endp https://www.candelatech.com/lfcli_ug.php#add_file_endp | +| `add_l4_endp.py` | Add a Layer 4-7 (HTTP, FTP, TELNET, ..) endpoint to the LANforge Manager. cli equivalent: add_l4_endp https://www.candelatech.com/lfcli_ug.php#add_l4_endp | +| `add_monitor.py` | Add a WIFI Monitor interface. These are useful for doing low-level wifi packet capturing. cli equivalent: add_monitor https://www.candelatech.com/lfcli_ug.php#add_monitor | +| `add_sta.py` | Add a WIFI Virtual Station (Virtual STA) interface. cli equivalent: add_sta https://www.candelatech.com/lfcli_ug.php#add_sta | +| `add_vap.py` | Add a WIFI Virtual Access Point (VAP) interface. cli equivalent: add_vap https://www.candelatech.com/lfcli_ug.php#add_vap | +| `set_port.py` | This command allows you to modify attributes on an Ethernet port. cli equivalent: set_port https://www.candelatech.com/lfcli_ug.php#set_port | +| `lfcli_base.py` | json communication to LANforge | +| `LFRequest.py` | Class holds default settings for json requests to LANforge, see: https://gist.github.com/aleiphoenix/4159510| +| `LFUtils.py` | Defines useful common methods | +| `set_port.py` | This command allows you to modify attributes on an Ethernet port. These options includes the IP address, netmask, gateway address, MAC, MTU, and TX Queue Length. cli equivalent: set_port https://www.candelatech.com/lfcli_ug.php#set_port | + + +# This program +# + +# Written by Candela Technologies Inc. +# Updated by: +# + + + +### Python Scripts py-json/ ### +| Name | Purpose | +|------|---------| +|`create_wanlink.py` | Create and modify WAN Links Using LANforge JSON AP : http://www.candelatech.com/cookbook.php?vol=cli&book=JSON:+Managing+WANlinks+using+JSON+and+Python | +|`cv_commands.py` | This is a library file used to create a chamber view scenario. import this file as showed in create_chamberview.py to create a scenario| +|`cv_test_manager.py` | This script is working as library for chamberview tests. It holds different commands to automate test.| +|`cv_test_reports.py` | Class: lanforge_reports Pulls reports from LANforge| +|`dut_profile.py` | Class: DUTProfile (new_dut_profile) Use example: py-scripts/update_dut.py used to updates a Device Under Test (DUT) entry in the LANforge test scenario A common reason to use this would be to update MAC addresses in a DUT when you switch between different items of the same make/model of a DUT| +|`fio_endp_profile.py` | Class: FIOEndpProfile (new_fio_endp_profile) Use example: py-scripts/test_fileio.py will create stations or macvlans with matching fileio endpoints to generate and verify fileio related traffic| +|`gen_cxprofile.py` | Class: GenCXProfile (new_generic_endp_profile) Use example: test_generic.py will create stations and endpoints to generate traffic based on a command-line specified command type | +|`http_profile.py` | Class: HTTPProfile (new_http_profile) Use example: test_ipv4_l4_wifi.py will create stations and endpoints to generate and verify layer-4 upload traffic| +|`influx2.py` | Class: RecordInflux version 2.0 influx DB client| +|`influx.py` | Class: RecordInflux influx DB client| +|`l3_cxprofile.py` | Class: L3CXProfile (new_l3_cx_profile) Use example: test_ipv4_variable_time.py will create stations and endpoints to generate and verify layer-3 traffic| +|`l4_cxprofile.py` | Class: L4CXProfile (new_l4_cx_profile) Use example: test_ipv4_l4.py will create stations and endpoints to generate and verify layer-4 traffic | +|`mac_vlan_profile.py` | Class: MACVLANProfile (new_mvlan_profile) Use example: test_fileio.py will create stations or macvlans with matching fileio endpoints to generate and verify fileio related traffic. | +|`multicast_profile.py` | Class: MULTICASTProfile (new_multicast_profile) Use example: test_l3_longevity.py multi cast profiles are created in this test | +|`port_utils.py` | Class: PortUtils used to set the ftp or http port| +|`qvlan_profile.py` | Class: QVLANProfile (new_qvlan_profile) Use example: create_qvlan.py (802.1Q VLAN)| +|`realm.py` | Class: The Realm Class is inherited by most python tests. Realm Class inherites from LFCliBase. The Realm Class contains the configurable components for LANforge, For example L3 / L4 cross connects, stations. http://www.candelatech.com/cookbook.php?vol=cli&book=Python_Create_Test_Scripts_With_the_Realm_Class| +|`station_profile.py` | Class: StationProfile (new_station_profile) Use example: most scripts create and use station profiles| +|`test_group_profile.py` | Class: TestGroupProfile (new_test_group_profile) Use example: test_fileio.py will create stations or macvlans with matching fileio endpoints to generate and verify fileio related traffic| +|`vap_profile.py` | Class: VAPProfile (new_vap_profile) profile for creating Virtual AP's Use example: create_vap.py | +|`wifi_monitor_profile.py` | Class: WifiMonitor (new_wifi_monitor_profile) Use example: tip_station_powersave.py This script uses filters from realm's PacketFilter class to filter pcap output for specific packets.| +|`wlan_theoretical_sta.py` | Class: abg11_calculator Standard Script for WLAN Capaity Calculator Use example: wlan_capacitycalculator.py| +|`ws_generic_monitor.py` | Class: WS_Listener web socket listener Use example: ws_generic_monitor_test.py, ws_generic_monitor to monitor events triggered by scripts, This script when running, will monitor the events triggered by test_ipv4_connection.py| +|`ws-sta-monitor.py` | Example of how to filter messages from the :8081 websocket | + + + +### Python Scripts py-scripts ### + +Test scripts and helper scripts + | Name | Purpose | |------|---------| | `lf_tos_test.py` | Generate traffic at different QoS and report performance in a spreadsheet | @@ -70,27 +133,7 @@ When starting to use Python, please run the update_dependencies.py script locate | `test_l3_unicast_traffic_gen.py` | Generate unicast traffic over a list of stations| | `tip_station_powersave.py` | Generate and test for powersave packets within traffic run over multiple stations | - -### Python Scripts py-json/LANforge ### - -Core communication files to LANforge - -| Name | Purpose | -|------|---------| -| `add_dut.py` | defined list of DUT keys, cli equivalent: https://www.candelatech.com/lfcli_ug.php#add_dut | -| `add_file_endp.py` | Add a File endpoint to the LANforge Manager. cli equivalent: add_file_endp https://www.candelatech.com/lfcli_ug.php#add_file_endp | -| `add_l4_endp.py` | Add a Layer 4-7 (HTTP, FTP, TELNET, ..) endpoint to the LANforge Manager. cli equivalent: add_l4_endp https://www.candelatech.com/lfcli_ug.php#add_l4_endp | -| `add_monitor.py` | Add a WIFI Monitor interface. These are useful for doing low-level wifi packet capturing. cli equivalent: add_monitor https://www.candelatech.com/lfcli_ug.php#add_monitor | -| `add_sta.py` | Add a WIFI Virtual Station (Virtual STA) interface. cli equivalent: add_sta https://www.candelatech.com/lfcli_ug.php#add_sta | -| `add_vap.py` | Add a WIFI Virtual Access Point (VAP) interface. cli equivalent: add_vap https://www.candelatech.com/lfcli_ug.php#add_vap | -| `set_port.py` | This command allows you to modify attributes on an Ethernet port. cli equivalent: set_port https://www.candelatech.com/lfcli_ug.php#set_port | -| `lfcli_base.py` | json communication to LANforge | -| `LFRequest.py` | Class holds default settings for json requests to LANforge, see: https://gist.github.com/aleiphoenix/4159510| -| `LFUtils.py` | Defines useful common methods | -| `set_port.py` | This command allows you to modify attributes on an Ethernet port. These options includes the IP address, netmask, gateway address, MAC, MTU, and TX Queue Length. cli equivalent: set_port https://www.candelatech.com/lfcli_ug.php#set_port | - - -### Perl and Shell Scripts ### +## Perl and Shell Scripts ## | Name | Purpose | |------|---------| @@ -144,6 +187,9 @@ Core communication files to LANforge | `wait_on_ports.pl` | waits on ports to have IP addresses, can up/down port to stimulate new DHCP lease | | `wifi-roaming-times.pl` | parses `wpa_supplicant_log.wiphyX` file to determine roaming times | +### LANForge Monitoring ### +From LANforge cli on port 4001 do a 'show_event' to see events from LANforge + ### Compatibility ### Scripts will be kept backwards and forwards compatible with LANforge releases as much as possible. diff --git a/py-json/create_wanlink.py b/py-json/create_wanlink.py index b35d25f6..94a16ef5 100755 --- a/py-json/create_wanlink.py +++ b/py-json/create_wanlink.py @@ -1,8 +1,10 @@ #!/usr/bin/python3 -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# example of how to create a WAN Link using JSON - -# - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Create and modify WAN Links Using LANforge JSON AP : http://www.candelatech.com/cookbook.php?vol=cli&book=JSON:+Managing+WANlinks+using+JSON+and+Python + +# Written by Candela Technologies Inc. +# Updated by: + import sys import urllib diff --git a/py-json/fio_endp_profile.py b/py-json/fio_endp_profile.py index e9495a78..9f5d3182 100644 --- a/py-json/fio_endp_profile.py +++ b/py-json/fio_endp_profile.py @@ -4,6 +4,12 @@ import pprint from pprint import pprint import time +# Class: FIOEndpProfile(LFCliBase) +# + +# Written by Candela Technologies Inc. +# Updated by: +# class FIOEndpProfile(LFCliBase): """ diff --git a/py-json/realm.py b/py-json/realm.py index 44d8c15c..01d3b323 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -1,4 +1,16 @@ #!/usr/bin/env python3 + +# The Realm Class is inherited by most python tests. Realm Class inherites from LFCliBase. +# The Realm Class contains the configurable components for LANforge, +# For example L3 / L4 cross connects, stations. Also contains helper methods +# http://www.candelatech.com/cookbook.php?vol=cli&book=Python_Create_Test_Scripts_With_the_Realm_Class +# + +# Written by Candela Technologies Inc. +# Updated by: +# + + # ---- ---- ---- ---- LANforge Base Imports ---- ---- ---- ---- from LANforge import LFRequest from LANforge import LFUtils diff --git a/py-scripts/test_fileio.py b/py-scripts/test_fileio.py index 80e6b21d..d20e4e93 100755 --- a/py-scripts/test_fileio.py +++ b/py-scripts/test_fileio.py @@ -11,6 +11,14 @@ 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: +./test_fileio.py --macvlan_parent --num_ports --use_macvlans + --first_mvlan_ip --netmask --gateway + +./test_fileio.py --macvlan_parent eth2 --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 + --netmask 255.255.255.0 --gateway 192.168.92.1 + + Use './test_fileio.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.