Package: lanforge-scripts
LANforge Perl, Python, and Shell ScriptsThis is a collection of scripts and scripting libraries designed to work
with LANforge systems. On your LANforge system, these scripts are
typically installed into/home/lanforge/scripts. TheLANforge/sub directory holds
the perl modules (.pmfiles) that are common to the perl scripts.LANforge CLI Users Guide:https://www.candelatech.com/lfcli_ug.phpThe LANforge CLI Users Guide is a good place to start for understanding scriptsLANforge on system cli help and cli command composerThe LANforge has an on system help / system query, when on LANforge browse to
http://local_host:8080The LANforge has an on system cli help and cli command composer
http://local_host:8080/helpCommonly UsedThelf_*.plscripts are typically more complete and general purpose
scripts, though some are ancient and very specific.  In particular,
these scripts are more modern and may be a good place to start:NamePurpoself_associate_ap.plLANforge server script for associating virtual stations to an arbitrary SSIDlf_attenmod.plQuery and update CT70X programmable attenuatorslf_firemod.plQuery and update connections (Layer 3)lf_icemod.plQuery and update WAN links and impairmentslf_portmod.plQuery and update physical and virtual portslf_tos_test.pyGenerate traffic at different QoS and report in spreadsheetlf_sniff.pyCreate packet capture files, especially OFDMA /AX capturesThelf_wifi_rest_example.plscript shows how one might call the other scripts from
within a script.Examples and DocumentsRead more examples in thescripting LANforgecookbook.Python ScriptsWhen 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/LANforgeCore communication files to LANforgeNamePurposeadd_dut.pydefined list of DUT keys, cli equivalent:https://www.candelatech.com/lfcli_ug.php#add_dutadd_file_endp.pyAdd a File endpoint to the LANforge Manager.  cli equivalent: add_file_endphttps://www.candelatech.com/lfcli_ug.php#add_file_endpadd_l4_endp.pyAdd a Layer 4-7 (HTTP, FTP, TELNET, ..) endpoint to the LANforge Manager. cli equivalent: add_l4_endphttps://www.candelatech.com/lfcli_ug.php#add_l4_endpadd_monitor.pyAdd a WIFI Monitor interface. These are useful for doing low-level wifi packet capturing.  cli equivalent: add_monitorhttps://www.candelatech.com/lfcli_ug.php#add_monitoradd_sta.pyAdd a WIFI Virtual Station (Virtual STA) interface. cli equivalent: add_stahttps://www.candelatech.com/lfcli_ug.php#add_staadd_vap.pyAdd a WIFI Virtual Access Point (VAP) interface.  cli equivalent: add_vaphttps://www.candelatech.com/lfcli_ug.php#add_vapset_port.pyThis command allows you to modify attributes on an Ethernet port.  cli equivalent: set_porthttps://www.candelatech.com/lfcli_ug.php#set_portlfcli_base.pyjson communication to LANforgeLFRequest.pyClass holds default settings for json requests to LANforge, see:https://gist.github.com/aleiphoenix/4159510LFUtils.pyDefines useful common methodsset_port.pyThis 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_porthttps://www.candelatech.com/lfcli_ug.php#set_portPython Scripts py-json/NamePurposebase_profile.pyClass: BaseProfile  Use example: py-json/l3_cxprofile2.py used to define generic utility methods to be inherited by other classescreate_wanlink.pyCreate and modify WAN Links Using LANforge JSON AP :http://www.candelatech.com/cookbook.php?vol=cli&book=JSON:+Managing+WANlinks+using+JSON+and+Pythoncv_commands.pyThis is a library file used to create a chamber view scenario.  import this file as showed in create_chamberview.py to create a scenariocv_test_manager.pyThis script is working as library for chamberview tests.  It holds different commands to automate test.cv_test_reports.pyClass: lanforge_reports  Pulls reports from LANforgedataplane_test_profile.pyLibrary to Run Dataplane Test: Using lf_cv_base classdut_profile.pyClass: 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 DUTfio_endp_profile.pyClass: 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 trafficgen_cxprofile.pyClass: 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 typehttp_profile.pyClass: HTTPProfile (new_http_profile) Use example: test_ipv4_l4_wifi.py  will create stations and endpoints to generate and verify layer-4 upload trafficl3_cxprofile.pyClass: L3CXProfile (new_l3_cx_profile)  Use example: test_ipv4_variable_time.py will create stations and endpoints to generate and verify layer-3 trafficl3_cxprofile2.pyClass: L3CXProfile2 (new_l3_cx_profile, ver=2) No current use example, inherits utility functions from BaseProfile, maintains functionality of L3CXProfilel4_cxprofile.pyClass: L4CXProfile (new_l4_cx_profile) Use example: test_ipv4_l4.py will create stations and endpoints to generate and verify layer-4 trafficlf_cv_base.pyClass: ChamberViewBase, Base Class to be used for Chamber View Tests, inherited by DataPlaneTest in dataplane_test_profile.pylfdata.pyClass: LFDataCollection, class used for data collection utility methodsmac_vlan_profile.pyClass: 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.pyClass: MULTICASTProfile (new_multicast_profile) Use example: test_l3_longevity.py multi cast profiles are created in this testport_utils.pyClass: PortUtils used to set the ftp or http portqvlan_profile.pyClass: QVLANProfile (new_qvlan_profile) Use example: create_qvlan.py (802.1Q VLAN)realm.pyClass: 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_Classrealm_test.pyPython script meant to test functionality of realm methodsshow_ports.pyPython script example of how to check a LANforge json urlstation_profile.pyClass: StationProfile (new_station_profile) Use example: most scripts create and use station profilestest_base.pyClass: TestBase, basic class for creating tests, uses basic functions for cleanup, starting/stopping, and passing of teststest_group_profile.pyClass: 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 traffictest_utility.pyStandard Script for Webconsole Test Utilityvap_profile.pyClass: VAPProfile (new_vap_profile) profile for creating Virtual AP's Use example: create_vap.pyvr_profile2.pyClass: VRProfile (new_vap_profile, ver=2) No current use example, inherits utility functions from BaseProfilewifi_monitor_profile.pyClass: 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.pyClass: abg11_calculator Standard Script for WLAN Capaity Calculator  Use example: wlan_capacitycalculator.pyws-sta-monitor.pyExample of how to filter messages from the :8081 websocketws_generic_monitor.pyClass: 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.pyPython Scripts py-scriptsTest scripts and helper scriptsNamePurposecicd_TipIntegration.pyFacebook TIP infrastructurecicd_testrail.pyTestRail API binding for Python 3cicd_testrailAndInfraSetup.pyFacebook TIP infrastructureconnection_test.pyStandard Script for Connection Testing -  Creates HTML and pdf report as a result (Used for web-console)create_bond.pyThis script can be used to create a bondcreate_bridge.pyScript for creating a variable number of bridgescreate_chamberview.pyScript for creating a chamberview scenariocreate_l3.pyThis script will create a variable number of layer3 stations each with their own set of cross-connects and endpointscreate_l4.pyThis script will create a variable number of layer4 stations each with their own set of cross-connects and endpointscreate_macvlan.pyScript for creating a variable number of macvlanscreate_qvlan.pyScript for creating a variable number of qvlanscreate_station.pyScript for creating a variable number of stationscreate_station_from_df.pyScript for creating a variable number of stations from a filecreate_vap.pyScript for creating a variable number of VAPscreate_vr.pyScript for creating a variable number of bridgescsv_convert.pyPython script to read in a LANforge Dataplane CSV file and output a csv file that works with a customer's RvRvO visualization tool.csv_processor.pyPython script to assist processing csv filescsv_to_influx.pyPython script to copy the data from a CSV file from the KPI file generated from a Wifi Capacity test to an Influx databasedownload_test.pydownload_test.py will do lf_report::add_kpi(tags, 'throughput-download-bps', $my_value);event_breaker.pyThis file is intended to expose concurrency problems in the /events/ URL handler by querying events rapidly. Please use concurrently with event_flood.py.event_flood.pyThis file is intended to expose concurrency problems in the /events/ URL handler by inserting events rapidly. Please concurrently use with event_breaker.py.example_security_connection.pyThis python script creates a variable number of stations using user-input  securityftp_html.pyThis FTP Test is used to "Verify that N clients connected on Specified band and can simultaneously download some amount of file from FTP server and measures the time taken by client to Download/Upload the filegrafana_profile.pyClass for creating and managing a grafana dashboardhtml_template.pyThis script is used for DFS Test Report generationinflux.pyClass for communicating with influxinflux2.pyClass for communicating with influxlayer3_test.pyPython script to test and monitor layer 3 connectionslayer4_test.pyPython script to test and monitor layer 4 connectionslf_ap_auto_test.pyThis script is used to automate running AP-Auto testslf_dataplane_test.pyThis script is used to automate running Dataplane testslf_dfs_test.pyTest testing dynamic frequency selection (dfs) between an AP connected to a controller and Lanforgelf_dut_sta_vap_test.pyLoad an existing scenario, start some layer 3 traffic, and test the Linux based DUT that has SSH serverlf_ftp_test.pyPython script will create stations and endpoints to generate and verify layer-4 traffic over an ftp connectionlf_graph.pyClasses for creating images from graphs using data setslf_mesh_test.pyThis script is used to automate running Mesh testslf_report.pyThis program is a helper  class for reporting results for a lanforge python scriptlf_report_test.pyPython script to test reportinglf_rvr_test.pyThis script is used to automate running Rate-vs-Range testslf_snp_test.pyTest scaling and performance (snp) run various configurations and measures data rateslf_tr398_test.pyThis script is used to automate running TR398 testslf_wifi_capacity_test.pyThis is a test file which will run a wifi capacity testrecordinflux.pyrecordinflux will record data from existing lanforge endpoints to record to an already existing influx databaserun_cv_scenario.pySet the LANforge to a BLANK database then it will load the specified database and start a graphical reportrvr_scenario.pyThis script will set the LANforge to a BLANK database then it will load the specified database and start a graphical reportscenario.pyPython script to load a database file and control test groupssta_connect.pyCreate a station, run TCP and UDP traffic then verify traffic was received. Stations are cleaned up afterwardssta_connect2.pyCreate a station, run TCP and UDP traffic then verify traffic was received. Stations are cleaned up afterwardssta_connect_example.pyExample of how to instantiate StaConnect and run the teststa_connect_multi_example.pyExample of how to instantiate StaConnect and run the teststation_layer3.pythis script creates one station with given argumentsstations_connected.pyContains examples of using realm to query stations and get specific information from themtest_1k_clients_jedtest.pyPython script to test 1k client connectionstest_client_admission.pyThis script will create one station at a time and generate downstream traffictest_fileio.pyTest FileIO traffictest_generic.pyTest generic traffic using generic cross-connect and endpoint typetest_ipv4_connection.pyTest connections to a VAP of varying security types (WEP, WPA, WPA2, WPA3, Open)test_ipv4_l4.pyTest layer 4 traffic using layer 4 cross-connect and endpoint typetest_ipv4_l4_ftp_upload.pyTest ftp upload traffictest_ipv4_l4_ftp_urls_per_ten.pyTest the number of urls per ten minutes in ftp traffictest_ipv4_l4_ftp_wifi.pyTest ftp upload traffic wifi-wifitest_ipv4_l4_urls_per_ten.pyTest urls per ten minutes in layer 4 traffictest_ipv4_l4_wifi.pyTest layer 4 upload traffic wifi-wifitest_ipv4_ttls.pyTest connection to ttls systemtest_ipv4_variable_time.pyTest connection and traffic on VAPs of varying security types (WEP, WPA, WPA2, WPA3, Open)test_ipv6_connection.pyTest IPV6 connection to VAPs of varying security types (WEP, WPA, WPA2, WPA3, Open)test_ipv6_variable_time.pyTest IPV6 connection and traffic on VAPs of varying security types (WEP, WPA, WPA2, WPA3, Open)test_l3_WAN_LAN.pyTest traffic over a bridged NAT connectiontest_l3_longevity.pyCreate variable stations on multiple radios, configurable rates, PDU, ToS, TCP and/or UDP traffic, upload and download, attenuationtest_l3_powersave_traffic.pyPython script to test for layer 3 powersave traffictest_l3_scenario_throughput.pyLoad an existing scenario and run the simultaneous throughput over time and generate report and P=plot the G=graphtest_l3_unicast_traffic_gen.pyGenerate unicast traffic over a list of stationstest_status_msg.pyTest the status message passing functions of /status-msgtest_wanlink.pyPython script to test wanlink creationtest_wpa_passphrases.pyPython script to test challenging wpa psk passphrasestestgroup.pyPython script to test creation and control of test groupstestgroup2.pyPython script to test creation and control of test groupstip_station_powersave.pyGenerate and test for powersave packets within traffic run over multiple stationsupdate_dependencies.pyPython script to update dependencies for various Candelatech python scriptsupdate_dut.pyThis script updates a Device Under Test (DUT) entry in the LANforge test scenariowlan_capacity_calculator.pyStandard Script for WLAN Capacity Calculatorws_generic_monitor_test.pyThis 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.pyPerl and Shell ScriptsNamePurposeassociate_loop.shUse this script to associate stations between SSIDs A and Battenuator_series_example.csvExample of CSV input for a series of attenuator settingsattenuator_series.plReads a CSV of attenuator settings and replays them to CT70X programmble attenuatorftp-upload.plUse this script to collect and upload station data to FTP siteimix.plpacket loss survey toollf_associate_ap.plLANforge server script for associating virtual stations to an chosen SSIDlf_attenmod.plThis program is used to modify the LANforge attenuator through the LANforgelf_auto_wifi_cap.plThis program is used to automatically run LANforge-GUI WiFi Capacity testslf_cmc_macvlan.plStress test sets up traffic types of udp , tcp , continuously starts and stops the connectionslf_create_bcast.plcreates a L3 broadcast connectionlf_cycle_wanlinks.plexample of how to call lf_icemod.pl from a scriptlf_endp_script.plcreate a hunt script on a L3 connection endpointlf_firemod.plqueries and modifies L3 connectionslf_generic_ping.plGenerate a batch of Generic lfping endpointslf_gui_cmd.plInitiate a stress testlf_icemod.plqueries and modified WANLink connectionslf_ice.pladds and configures wanlinkslf_l4_auth.plexample of scripting L4 http script with basic authlf_l4_reset.shreset any layer 4 connection that reaches 0 Mbps over last minutelf_log_parse.plConvert the timestamp in LANforge logs (it is in unix-time, miliseconds) to readable datelf_loop_traffic.shRepeatedly start and stop a L3 connectionlf_macvlan_l4.plSet up connection types: lf_udp, lf_tcp across 1 real port and many macvlan ports on 2 machines. Then continously starts and stops the connections.lf_mcast.bashCreate a multicast L3 connection endpointlf_monitor.plMonitor L4 connectionslf_nfs_io.plCreates and runs NFS connectionslf_parse_tshark_log.plBasic parsing of tshark logslf_portmod.plQueries and changes LANforge physical and virtual portslf_port_walk.plCreates a series of connections, useful for basic firewall testinglf_show_events.plDisplays and clears LANforge event loglf_staggered_dl.shhis script starts a series of Layer-3 connections across a series of stations each station will wait $nap seconds, download $quantity KB and then remove its old CX.lf_sta_name.plUse this script to alter a virtual station nameslf_verify.plCreates a basic L3 connection to verify that two ethernet ports are physically connectedlf_voip.plCreates series of VOIP connections between two LANforge machineslf_voip_test.plCreates series of VOIP connections and runs themlf_vue_mod.shBash script that wraps common operations for Virtual User Endpoint operations done bylf_associate_aplf_wifi_rest_example.plExample script that queries a LF GUI for JSON data and displays a slice of itlf_zlt_binary.plConfigures a Zero Loss Throughput testlist_phy_sta.shLists virtual stations backed by specified physical radiomin_max_ave_station.plThis script looks for min-max-average bps for rx-rate in a station csv data filemulti_routers.plRouting cleanup script that can be used with virtual routersprint_udev.shPrints out Linux Udev rules describing how to name ports by MAC addresssensorz.plDisplays temperature readings for CPU and ATH10K radiosshow-port-from-json.plExample script showing how to display a slice from a JSON GUI responsestation-toggle.shUse this script to toggle a set of stations on or offsysmon.shgrabs netdev stats and timestamp every second or so, saves to logfile.test_refcnt.plcreates MAC-VLANs and curl requests for eachtopmon.shLANforge system monitor that can be used from cronwait_on_ports.plwaits on ports to have IP addresses, can up/down port to stimulate new DHCP leasewifi-roaming-times.plparseswpa_supplicant_log.wiphyXfile to determine roaming timesLANForge MonitoringFrom LANforge cli on port 4001 do a 'show_event' to see events from LANforgeCompatibilityScripts will be kept backwards and forwards compatible with LANforge
releases as much as possible.InstallationThese scripts call each other and rely on the structure of this directory. To use these scripts in other locations,
such as your laptop, either copy the entire scripts directory or do agit cloneof this repository. Just copying
one script to a separate directory is going to break its requirements.RequirementsThe perl scripts require the following perl packages to be installed. Most of these
perl packages are available through your repository as.debor.rpmpackages.Perl PackageRPMRequiredNet::Telnetperl-Net-TelnetYesJSONperl-JSONYes, for JSON parsingJSON::PrettyPrintperl-JSON-PPNo, useful for debuggingPython3 PackageRPMRequiredPexpectpython3-pexpectyesXlsxWriterpython3-xlsxwriteryes, Xlsx outputPip v Pip3Please use pip3, we are targeting Python 3 with our scripts. If your pip/pip3 repositories have a difficult time connecting,
it's likely that you are trying to download frompypi.python.org. This is a deprecated location. Please update
using thepypi.orgservers. Consider updating your~/.pypircfile:[distutils]
index-servers =  
    pypi  

[pypi]  
repository: https://upload.pypi.org/legacy/Asdescribed on Python.org.LicenseCode in this repository is released under the BSD license (see license.txt).SupportPlease contactsupport@candelatech.comif you have any questions.Thanks,
Ben