From 1dde46c7bd7c5eddd73f93352553ba3f21cbb17b Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 22 Sep 2021 06:20:31 -0600 Subject: [PATCH 001/731] lf_check.py : LANforge server version in the output Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 6a56bd9e..bfcf9e33 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -143,8 +143,8 @@ class lf_check(): # LANforge information self.lanforge_system_node_version = "" self.lanforge_kernel_version = "" - self.lanforge_gui_version_full = "" - self.lanforge_gui_version = "" + self.lanforge_server_version_full = "" + self.lanforge_server_version = "" # meta.txt self.meta_data_path = "" @@ -279,21 +279,21 @@ class lf_check(): time.sleep(1) return self.lanforge_kernel_version - def get_lanforge_gui_version(self): + def get_lanforge_server_version(self): ssh = paramiko.SSHClient() # creating shh client object we use this object to connect to router ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # automatically adds the missing host key ssh.connect(hostname=self.lf_mgr_ip, port=22, username=self.lf_mgr_user, password=self.lf_mgr_pass, allow_agent=False, look_for_keys=False, banner_timeout=600) stdin, stdout, stderr = ssh.exec_command('./btserver --version | grep Version') - self.lanforge_gui_version_full = stdout.readlines() - self.lanforge_gui_version_full = [line.replace('\n', '') for line in self.lanforge_gui_version_full] - print("lanforge_gui_version_full: {lanforge_gui_version_full}".format(lanforge_gui_version_full=self.lanforge_gui_version_full)) - self.lanforge_gui_version = self.lanforge_gui_version_full[0].split('Version:',maxsplit=1)[-1].split(maxsplit=1)[0] - self.lanforge_gui_version = self.lanforge_gui_version.strip() - print("lanforge_gui_version: {lanforge_gui_version}".format(lanforge_gui_version=self.lanforge_gui_version)) + self.lanforge_server_version_full = stdout.readlines() + self.lanforge_server_version_full = [line.replace('\n', '') for line in self.lanforge_server_version_full] + print("lanforge_server_version_full: {lanforge_server_version_full}".format(lanforge_server_version_full=self.lanforge_server_version_full)) + self.lanforge_server_version = self.lanforge_server_version_full[0].split('Version:',maxsplit=1)[-1].split(maxsplit=1)[0] + self.lanforge_server_version = self.lanforge_server_version.strip() + print("lanforge_server_version: {lanforge_server_version}".format(lanforge_server_version=self.lanforge_server_version)) ssh.close() time.sleep(1) - return self.lanforge_gui_version_full + return self.lanforge_server_version_full def get_radio_status(self): radio_status = self.json_get("/radiostatus/all") @@ -932,8 +932,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) meta_data_fd.write('$ Generated by Candela Technologies LANforge network testing tool\n') meta_data_fd.write('$ meta.txt file location\n') meta_data_fd.write("file {path}\n".format(path=meta_data_path)) - meta_data_fd.write('$ LANforge GUI\n') - meta_data_fd.write('gui_version: {gui_version} \n'.format(gui_version=self.lanforge_gui_version)) + meta_data_fd.write('$ LANforge SERVER\n') + meta_data_fd.write('server_version: {server_version} \n'.format(server_version=self.lanforge_server_version)) meta_data_fd.write('$ LANforge command\n') meta_data_fd.write("command {command}\n".format(command=command)) # split command at test-tag , at rest of string once at the actual test-tag value @@ -945,7 +945,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) meta_data_fd.write('$ LANforge Information\n') meta_data_fd.write("lanforge_system_node {lanforge_system_node}\n".format(lanforge_system_node=self.lanforge_system_node_version[0])) meta_data_fd.write("lanforge_kernel_version {lanforge_kernel_version}\n".format(lanforge_kernel_version=self.lanforge_kernel_version[0])) - meta_data_fd.write("lanforge_gui_version_full {lanforge_gui_version_full}\n".format(lanforge_gui_version_full=self.lanforge_gui_version_full[0])) + meta_data_fd.write("lanforge_server_version_full {lanforge_server_version_full}\n".format(lanforge_server_version_full=self.lanforge_server_version_full[0])) meta_data_fd.close() if self.test_result != "TIMEOUT": @@ -1113,7 +1113,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a lanforge_system_node_version = 'NO_LF_NODE_VER' scripts_git_sha = 'NO_GIT_SHA' lanforge_kernel_version = 'NO_KERNEL_VER' - lanforge_gui_version_full = 'NO_LF_GUI_VER' + lanforge_server_version_full = 'NO_LF_SERVER_VER' # select test suite test_suite = args.suite @@ -1194,10 +1194,10 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a exit(1) try: - lanforge_gui_version_full = check.get_lanforge_gui_version() - print("lanforge_gui_version_full {lanforge_gui_version_full}".format(lanforge_gui_version_full=lanforge_gui_version_full)) + lanforge_server_version_full = check.get_lanforge_server_version() + print("lanforge_server_version_full {lanforge_server_version_full}".format(lanforge_server_version_full=lanforge_server_version_full)) except: - print("lanforge_gui_version exception, tests aborted check lanforge ip") + print("lanforge_server_version exception, tests aborted check lanforge ip") exit(1) try: @@ -1239,7 +1239,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a lf_test_setup = pd.DataFrame() lf_test_setup['LANforge'] = lanforge_system_node_version lf_test_setup['kernel version'] = lanforge_kernel_version - lf_test_setup['GUI version'] = lanforge_gui_version_full + lf_test_setup['Server version'] = lanforge_server_version_full lf_test_setup['scripts git sha'] = scripts_git_sha # Successfully gathered LANforge information Run Tests From de62fbd041d892f37c783d4722cf42d3f57d8422 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 22 Sep 2021 11:54:02 -0600 Subject: [PATCH 002/731] lf_check.py added the lanforge GUI version Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 62 +++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index bfcf9e33..60ce1aed 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -35,6 +35,20 @@ NOTES: getting radio information: 4. if the connection to 8080 is rejected check : pgrep -af java , to see the number of GUI instances running +5. getting the lanforge GUI version +curl -H 'Accept: application/json' http://localhost:8080/ | json_pp +{ + "VersionInfo" : { + "BuildDate" : "Sun 19 Sep 2021 02:36:51 PM PDT", + "BuildMachine" : "v-f30-64", + "BuildVersion" : "5.4.4", + "Builder" : "greearb", + "GitVersion" : "a98d7fbb8ca4e5c4f736a70e5cc3759e44aba636", + "JsonVersion" : "1.0.25931" + }, + +curl -u 'user:pass' -H 'Accept: application/json' http://:8080 | json_pp | grep -A 7 "VersionInfo" + GENERIC NOTES: Starting LANforge: On local or remote system: /home/lanforge/LANforgeGUI/lfclient.bash -cli-socket 3990 -s LF_MGR @@ -145,6 +159,10 @@ class lf_check(): self.lanforge_kernel_version = "" self.lanforge_server_version_full = "" self.lanforge_server_version = "" + self.lanforge_gui_version_full = "" + self.lanforge_gui_version = "" + self.lanforge_gui_build_date = "" + self.lanforge_gui_git_sha = "" # meta.txt self.meta_data_path = "" @@ -295,11 +313,35 @@ class lf_check(): time.sleep(1) return self.lanforge_server_version_full - def get_radio_status(self): - radio_status = self.json_get("/radiostatus/all") - print("radio status {radio_status}".format(radio_status=radio_status)) + def get_lanforge_gui_version(self): + ssh = paramiko.SSHClient() # creating shh client object we use this object to connect to router + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # automatically adds the missing host key + ssh.connect(hostname=self.lf_mgr_ip, port=22, username=self.lf_mgr_user, password=self.lf_mgr_pass, + allow_agent=False, look_for_keys=False, banner_timeout=600) + stdin, stdout, stderr = ssh.exec_command('curl -H "Accept: application/json" http://{lanforge_ip}:8080 | json_pp | grep -A 7 "VersionInfo"'.format(lanforge_ip=self.lf_mgr_ip)) + self.lanforge_gui_version_full = stdout.readlines() + #print("lanforge_gui_version_full pre: {lanforge_gui_version_full}".format(lanforge_gui_version_full=self.lanforge_gui_version_full)) + self.lanforge_gui_version_full = [line.replace('\n', '') for line in self.lanforge_gui_version_full] + #print("lanforge_gui_version_full: {lanforge_gui_version_full}".format(lanforge_gui_version_full=self.lanforge_gui_version_full)) + for element in self.lanforge_gui_version_full: + if "BuildVersion" in element: + ver_str = str(element) + self.lanforge_gui_version = ver_str.split(':',maxsplit=1)[-1].replace(',','') + print("BuildVersion {}".format(self.lanforge_gui_version)) + if "BuildDate" in element: + gui_str = str(element) + self.lanforge_gui_build_date = gui_str.split(':',maxsplit=1)[-1].replace(',','') + print("BuildDate {}".format(self.lanforge_gui_build_date)) + if "GitVersion" in element: + git_sha_str = str(element) + self.lanforge_gui_git_sha = git_sha_str.split(':',maxsplit=1)[-1].replace(',','') + print("GitVersion {}".format(self.lanforge_gui_git_sha)) + + ssh.close() + time.sleep(1) + return self.lanforge_gui_version_full, self.lanforge_gui_version, self.lanforge_gui_build_date, self.lanforge_gui_git_sha + - # NOT complete : will send the email results def send_results_email(self, report_file=None): if (report_file is None): print("No report file, not sending email.") @@ -1200,6 +1242,13 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a print("lanforge_server_version exception, tests aborted check lanforge ip") exit(1) + try: + lanforge_gui_version_full, lanforge_gui_version, lanforge_gui_build_date, lanforge_gui_git_sha = check.get_lanforge_gui_version() + print("lanforge_gui_version_full {lanforge_gui_version_full}".format(lanforge_gui_version_full=lanforge_gui_version_full)) + except: + print("lanforge_gui_version exception, tests aborted check lanforge ip") + exit(1) + try: lanforge_radio_json, lanforge_radio_text = check.get_lanforge_radio_information() lanforge_radio_formatted_str = json.dumps(lanforge_radio_json, indent = 2) @@ -1239,7 +1288,10 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a lf_test_setup = pd.DataFrame() lf_test_setup['LANforge'] = lanforge_system_node_version lf_test_setup['kernel version'] = lanforge_kernel_version - lf_test_setup['Server version'] = lanforge_server_version_full + lf_test_setup['server version'] = lanforge_server_version_full + lf_test_setup['gui version'] = lanforge_gui_version + lf_test_setup['gui build date'] = lanforge_gui_build_date + lf_test_setup['gui git sha'] = lanforge_gui_git_sha lf_test_setup['scripts git sha'] = scripts_git_sha # Successfully gathered LANforge information Run Tests From 65808d21fa887ee39e0d9c9d3aa92beb4585f918 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 23 Sep 2021 14:36:49 -0700 Subject: [PATCH 003/731] 1. Fix circular import error in LFRequest 2. add import re to lfcli_base 3. add debug output to l3_cxprofile, so it is how it used to be 4. add help options to regression_test so we can test how the help flags are working 5. Make test_ip_variable_time work better when it is imported directly by moving most of the logic to a function under IPVariableTime 6. Add init.py file to the LANforge directory and fix archiving in the to_pip.py script Signed-off-by: Matthew Stidham --- py-json/LANforge/LFRequest.py | 15 +- py-json/LANforge/lfcli_base.py | 1 + py-scripts/regression_test.sh | 125 ++++++- .../vap_stations_example.py | 0 py-scripts/test_ip_variable_time.py | 326 ++++++++++-------- to_pip.sh | 30 +- 6 files changed, 319 insertions(+), 178 deletions(-) rename py-scripts/{ => scripts_deprecated}/vap_stations_example.py (100%) diff --git a/py-json/LANforge/LFRequest.py b/py-json/LANforge/LFRequest.py index 7ea796c5..d64b2547 100644 --- a/py-json/LANforge/LFRequest.py +++ b/py-json/LANforge/LFRequest.py @@ -5,7 +5,7 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - import sys import os -import importlib +import pprint import urllib from urllib import request import json @@ -17,8 +17,7 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) -LFUtils = importlib.import_module("py-json.LANforge.LFUtils") - +debug_printer = pprint.PrettyPrinter(indent=2) class LFRequest: Default_Base_URL = "http://localhost:8080" @@ -180,7 +179,7 @@ class LFRequest: print("----- LFRequest::json_post:128 debug: --------------------------------------------") print("URL: %s :%d "% (self.requested_url, resp.status)) if resp.status != 200: - LFUtils.debug_printer.pprint(resp.getheaders()) + debug_printer.pprint(resp.getheaders()) print("----- resp_data:128 -------------------------------------------------") print(resp_data) print("-------------------------------------------------") @@ -191,7 +190,7 @@ class LFRequest: j = json.loads(resp_data) if debug: print("----- LFRequest::json_post:140 debug: --------------------------------------------") - LFUtils.debug_printer.pprint(j) + debug_printer.pprint(j) print("-------------------------------------------------") response_json_list_.append(j) return responses[0] @@ -348,7 +347,7 @@ def plain_get(url_=None, debug_=False, die_on_error_=False, proxies_=None): def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, error_list_=None, debug_=False): if debug_: print("LFRequest::print_diagnostics: error_.__class__: %s"%error_.__class__) - LFUtils.debug_printer.pprint(error_) + debug_printer.pprint(error_) if url_ is None: print("WARNING LFRequest::print_diagnostics: url_ is None") @@ -402,7 +401,7 @@ def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, er if hasattr(request_, "data") and (request_.data is not None): print(" Data:") - LFUtils.debug_printer.pprint(request_.data) + debug_printer.pprint(request_.data) elif debug_: print(" ") @@ -414,7 +413,7 @@ def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, er if len(responses_) > 0: print("----- Response: --------------------------------------------------------") - LFUtils.debug_printer.pprint(responses_[0].reason) + debug_printer.pprint(responses_[0].reason) if debug_: print("------------------------------------------------------------------------") return diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index d7120ab9..6f250046 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -10,6 +10,7 @@ import random import string import datetime import argparse +import re if sys.version_info[0] != 3: print("This script requires Python 3") diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 6e25430c..a37a099c 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -14,10 +14,12 @@ Help() echo "MGR is the IP address of the device which has LANforge installed, if different from the system you are using." echo "A is used to call to test a specific command based on" echo "F is used to pass in an RC file which can store the credentials for running regression multiple times on your system" + echo "H is used to test the help feature of each script, to make sure it renders properly." echo "Example command: ./regression_test.sh -s SSID -p PASSWD -w SECURITY -m MGR" + echo "If using the help flag, put the H flag at the end of the command after other flags." } -while getopts ":h:s:p:w:m:A:r:F:B:U:" option; do +while getopts ":h:s:p:w:m:A:r:F:B:U:H:" option; do case "${option}" in h) # display Help Help @@ -48,7 +50,10 @@ while getopts ":h:s:p:w:m:A:r:F:B:U:" option; do BSSID=${OPTARG} ;; U) - UPSTREAM=$OPTARG + UPSTREAM=${OPTARG} + ;; + H) + HELP=1 ;; *) @@ -129,13 +134,107 @@ function testgroup_delete_group() { ./testgroup.py --group_name group1 --add_group --add_cx cx0000,cx0001,cx0002 --remove_cx cx0003 ./testgroup.py --group_name group1--del_group --debug --mgr "$MGR" } -if [[ $MGRLEN -gt 0 ]]; then +if [[ $HELP -eq 1 ]]; then + testCommands=( + "./create_bond.py --help --mgr $MGR" + "./create_bridge.py --help --mgr $MGR" + "./create_chamberview.py --help -m $MGR" + "./create_chamberview_dut.py --help --lfmgr $MGR" + "./create_l3.py --help --mgr $MGR" + "./create_l4.py --help --mgr $MGR" + "./create_macvlan.py --help --mgr $MGR" + "./create_qvlan.py --help --mgr $MGR" + "./create_station.py --help --mgr $MGR" + "./create_vap.py --help --mgr $MGR" + "./create_vr.py --help --mgr $MGR" + "./create_wanlink.py --help --mgr $MGR" + "./csv_convert.py --help --mgr $MGR" + "./csv_processor.py --help --mgr $MGR" + "./csv_to_grafana.py --help --mgr $MGR" + "./csv_to_influx.py --help --mgr $MGR" + "./cv_manager.py --help --mgr $MGR" + "./cv_to_grafana.py --help --mgr $MGR" + "./docstrings.py --help --mgr $MGR" + "./event_breaker --help --mgr $MGR" + "./event_flood --help --mgr $MGR" + "./example_security_connection.py --help --mgr $MGR" + "./ftp_html.py --help --mgr $MGR" + "./ghost_profile.py --help --mgr $MGR" + "./grafana_profile.py --help --mgr $MGR" + "./html_template.py --help --mgr $MGR" + "./influx.py --help --mgr $MGR" + "./layer3_test.py --help --mgr $MGR" + "./layer4_test.py --help --mgr $MGR" + "./lf_ap_auto_test.py --help --mgr $MGR" + "./lf_atten_mod_test.py --help --mgr $MGR" + "./lf_csv.py --help --mgr $MGR" + "./lf_dataplane_config.py --help --mgr $MGR" + "./lf_dataplane_test.py --help --mgr $MGR" + "./lf_dfs_test.py --help --mgr $MGR" + "./lf_dut_sta_vap_test.py --help --mgr $MGR" + "./lf_ftp.py --help --mgr $MGR" + "./lf_ftp_test.py --help --mgr $MGR" + "./lf_graph.py --help --mgr $MGR" + "./lf_mesh_test.py --help --mgr $MGR" + "./lf_multipsk.py --help --mgr $MGR" + "./lf_report.py --help --mgr $MGR" + "./lf_report_test.py --help --mgr $MGR" + "./lf_rvr_test.py --help --mgr $MGR" + "./lf_rx_sensitivity_test.py --help --mgr $MGR" + "./lf_sniff_radio.py --help --mgr $MGR" + "./lf_snp_test.py -0-help --mgr $MGR" + "./lf_tr398_test.py --help --mgr $MGR" + "./lf_webpage.py --help --mgr $MGR" + "./lf_wifi_capacity_test.py --help --mgr $MGR" + "./measure_station_time_up.py --help --mgr $MGR" + "./modify_station.py --help --mgr $MGR" + "./modify_vap.py --help --mgr $MGR" + "./recordinflux.py --help --mgr $MGR" + "./run_cv_scenario.py --help --mgr $MGR" + "./rvr_scenario.py --help --mgr $MGR" + "./scenario.py --help --mgr $MGR" + "./sta_connect.py --help --mgr $MGR" + "./sta_connect2.py --help --mgr $MGR" + "./sta_connect_bssid_mac.py --help --mgr $MGR" + "./sta_connect_example.py --help --mgr $MGR" + "./sta_connect_multi_example.py --help --mgr $MGR" + "./sta_scan_test.py --help --mgr $MGR" + "./station_layer3.py --help --mgr $MGR" + "./stations_connected.py --help --mgr $MGR" + "./test_1k_clients_jedtest.py --help --mgr $MGR" + "./test_client_admission.py --help --mgr $MGR" + "./test_fileio.py --help --mgr $MGR" + "./test_generic.py --help --mgr $MGR" + "./test_ip_connection.py --help --mgr $MGR" + "./test_ip_variable_time.py --help --mgr $MGR" + "./test_ipv4_ps.py --help --mgr $MGR" + "./test_ipv4_ttls.py --help --mgr $MGR" + "./test_l3_WAN_LAN.py --help --mgr $MGR" + "./test_l3_longevity.py --help --mgr $MGR" + "./test_l3_scenario_throughput.py -h -m $MGR" + "./test_l3_unicast_traffic_gen.py --help --mgr $MGR" + "./test_l4.py --help --mgr $MGR" + "./test_status_msg.py --help --mgr $MGR" + "./test_wanlink.py --help --mgr $MGR" + "./test_wpa_passphrases.py --help --mgr $MGR" + "./testgroup.py --help --mgr $MGR" + "./testgroup2.py --help --mgr $MGR" + "./testgroup_delete_group --mgr $MGR" + "./testgroup_list_connections --help --mgr $MGR" + "./testgroup_list_groups.py --help --mgr $MGR" + "./tip_station_powersave.py --help --mgr $MGR" + "./video_rates.py --help --mgr $MGR" + "./wlan_capacity_calculator.py -h --mgr $MGR" + "./ws_generic_monitor_test.py --help --mgr $MGR" + ) +elif [[ $MGRLEN -gt 0 ]]; then testCommands=( #"./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" #"./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug --mgr $MGR" "./create_chamberview.py -m $MGR -cs \"regression_test\" --line \"Resource=1.1 Profile=STA-AC Amount=1 Uses-1 $RADIO_USED Freq=-1 DUT=TEST DUT_RADIO=$RADIO_USED Traffic=http\" --line \"Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=Test DUT_RADIO=$RADIO_USED Traffic=http\"" - "./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut --ssid \"ssid_idx=0 ssid=$SSID_USED security=$SECURITY password=$PASSWD_USED bssid=04:f0:21:2c:41:84\"" - #"./create_l3.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR" + "./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ + --ssid \"ssid_idx=0 ssid=\"$SSID_USED\" security=\"$SECURITY\" password=\"$PASSWD_USED\" bssid=04:f0:21:2c:41:84\"" + "./create_l3.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR" #"./create_l4.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR" #"./create_macvlan.py --radio 1.$RADIO_USED --macvlan_parent eth1 --debug --mgr $MGR" #"./create_qvlan.py --first_qvlan_ip 192.168.1.50 --mgr $MGR" @@ -152,7 +251,8 @@ if [[ $MGRLEN -gt 0 ]]; then #"./docstrings.py --mgr $MGR" #"./event_breaker --mgr $MGR" #"./event_flood --mgr $MGR" - "./example_security_connection.py --num_stations $NUM_STA --ssid $SSID_USED --passwd $PASSWD_USED --radio $RADIO_USED --security wpa2 --debug --mgr $MGR" + "./example_security_connection.py --num_stations $NUM_STA --ssid $SSID_USED \ + --passwd $PASSWD_USED --radio 1.1.$RADIO_USED --security wpa2 --debug --mgr $MGR" #./ftp_html.py #./ghost_profile #./grafana_profile @@ -182,10 +282,6 @@ if [[ $MGRLEN -gt 0 ]]; then --instance_name dataplane-instance --config_name test_con --upstream 1.1.$UPSTREAM \ --dut linksys-8450 --duration 15s --station 1.1.sta01500 \ --download_speed 85% --upload_speed 0 \ - --raw_line \"pkts: Custom;60;142;256;512;1024;MTU\" \ - --raw_line \"cust_pkt_sz: 88 1200\" \ - --raw_line \"directions: DUT Transmit;DUT Receive\" \ - --raw_line \"traffic_types: UDP;TCP\" \ --test_rig Testbed-01 --pull_report \ --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ @@ -195,7 +291,7 @@ if [[ $MGRLEN -gt 0 ]]; then #./lf_dut_sta_vap_test #"./lf_ftp.py --mgr $MGR --mgr_port 8080 --upstream_port $UPSTREAM --ssid $SSID --security $SECURITY --passwd $PASSWD_USED \ # --ap_name WAC505 --ap_ip 192.168.213.90 --bands Both --directions Download --twog_radio wiphy1 --fiveg_radio wiphy0 --file_size 2MB --num_stations 40 --Both_duration 1 --traffic_duration 2 --ssh_port 22_" - "./lf_ftp_test.py --mgr $MGR --ssid $SSID --passwd $PASSWD_USED --security $SECURITY --bands 5G --direction Download \ + "./lf_ftp_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --bands 5G --direction Download \ --file_size 2MB --num_stations 2" "./lf_graph.py --mgr $MGR" #"./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line 'selected_dut2 RootAP wactest $BSSID'" @@ -210,8 +306,8 @@ if [[ $MGRLEN -gt 0 ]]; then #./lf_webpage "./lf_wifi_capacity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ --instance_name this_inst --config_name test_con --upstream 1.1.eth2 --batch_size 1,5,25,50,100 --loop_iter 1 \ - --protocol UDP-IPv4 --duration 6000 --pull_report \ - --test_rig Testbed-01" + --protocol UDP-IPv4 --duration 6000 --pull_report --ssid $SSID_USED --paswd $PASSWD_USED --security $SECURITY\ + --test_rig Testbed-01 --create_stations --stations 1.1.sta0000,1.1.sta0001" #--influx_host c7-graphana --influx_port 8086 --influx_org Candela \ #--influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ #--influx_bucket ben \ @@ -266,7 +362,6 @@ if [[ $MGRLEN -gt 0 ]]; then #"./test_wanlink.py --name my_wanlink4 --latency_A 20 --latency_B 69 --rate 1000 --jitter_A 53 --jitter_B 73 --jitter_freq 6 --drop_A 12 --drop_B 11 --debug --mgr $MGR" #./test_wpa_passphrases #./tip_station_powersave - #./vap_stations_example #./video_rates "./wlan_capacity_calculator.py -sta 11abg -t Voice -p 48 -m 106 -e WEP -q Yes -b 1 2 5.5 11 -pre Long -s N/A -co G.711 -r Yes -c Yes -m $MGR" "./wlan_capacity_calculator.py -sta 11n -t Voice -d 17 -ch 40 -gu 800 -high 9 -e WEP -q Yes -ip 5 -mc 42 -b 6 9 12 24 -m 1538 -co G.729 -pl Greenfield -cw 15 -r Yes -c Yes -m $MGR" @@ -463,11 +558,13 @@ function test() { chmod 664 "${TEST_DIR}/${NAME}.txt" FILESIZE=$(stat -c%s "${TEST_DIR}/${NAME}_stderr.txt") || 0 if (( FILESIZE > 0)); then + echo "Errors detected" results+=("${CURR_TEST_NAME}${i} Failure STDOUT STDERR") else + echo "No errors detected" results+=("${CURR_TEST_NAME}${i} Success STDOUT diff --git a/py-scripts/vap_stations_example.py b/py-scripts/scripts_deprecated/vap_stations_example.py similarity index 100% rename from py-scripts/vap_stations_example.py rename to py-scripts/scripts_deprecated/vap_stations_example.py diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index 246a0b1c..e8ef1173 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -33,7 +33,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -56,11 +55,21 @@ class IPVariableTime(Realm): mode=0, ap=None, traffic_type=None, - side_a_min_rate=56, side_a_max_rate=0, - side_b_min_rate=56, side_b_max_rate=0, + side_a_min_rate=256000, side_a_max_rate=0, + side_b_min_rate=256000, side_b_max_rate=0, number_template="00000", test_duration="5m", use_ht160=False, + report_file=None, + output_format=None, + layer3_cols=['name', 'tx bytes', 'rx bytes', 'tx rate', 'rx rate'], + monitor_interval='10s', + influx_host=None, + influx_port=None, + influx_org=None, + influx_token=None, + influx_bucket=None, + compared_report=None, ipv6=False, _debug_on=False, _exit_on_error=False, @@ -109,6 +118,16 @@ class IPVariableTime(Realm): self.cx_profile.host = self.host self.cx_profile.port = self.port self.ipv6 = ipv6 + self.report_file = report_file + self.output_format = output_format + self.layer3_cols = layer3_cols + self.monitor_interval = monitor_interval + self.influx_host = influx_host + self.influx_port = influx_port + self.influx_org = influx_org + self.influx_token = influx_token + self.influx_bucket = influx_bucket + self.compared_report = compared_report 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 @@ -161,6 +180,144 @@ class IPVariableTime(Realm): side_b=self.upstream, sleep_time=0) + def run(self): + if self.report_file is None: + new_file_path = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':', + '-') + '_test_ip_variable_time' # create path name + try: + path = os.path.join('/home/lanforge/report-data/', new_file_path) + os.mkdir(path) + except: + curr_dir_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + path = os.path.join(curr_dir_path, new_file_path) + os.mkdir(path) + systeminfopath = str(path) + '/systeminfo.txt' + + if self.output_format in ['csv', 'json', 'html', 'hdf', 'stata', 'pickle', 'pdf', 'png', 'parquet', + 'xlsx']: + report_f = str(path) + '/data.' + self.output_format + output = self.output_format + else: + print( + 'Not supporting this report format or cannot find report format provided. Defaulting to csv data file ' + 'output type, naming it data.csv.') + report_f = str(path) + '/data.csv' + output = 'csv' + else: + systeminfopath = str(self.report_file).split('/')[-1] + report_f = self.report_file + if self.output_format is None: + output = str(self.report_file).split('.')[-1] + else: + output = self.output_format + self.pre_cleanup() + + self.build() + # exit() + if self.create_sta: + if not self.passes(): + print(self.get_fail_message()) + self.exit_fail() + + try: + layer3connections = ','.join([[*x.keys()][0] for x in self.json_get('endp')['endpoint']]) + except: + raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') + + if type(self.layer3_cols) is not list: + layer3_cols = list(self.layer3_cols.split(",")) + # send col names here to file to reformat + else: + layer3_cols = self.layer3_cols + # send col names here to file to reformat + #if type(self.port_mgr_cols) is not list: + #port_mgr_cols = list(self.port_mgr_cols.split(",")) + # send col names here to file to reformat + #else: + #port_mgr_cols = self.port_mgr_cols + # send col names here to file to reformat + if self.debug: + print("Layer 3 Endp column names are...") + print(layer3_cols) + print("Port Manager column names are...") + #print(port_mgr_cols) + + print("Layer 3 Endp column names are...") + print(layer3_cols) + print("Port Manager column names are...") + #print(port_mgr_cols) + + try: + monitor_interval = Realm.parse_time(self.monitor_interval).total_seconds() + except ValueError as error: + print(str(error)) + print(ValueError( + "The time string provided for monitor_interval argument is invalid. Please see supported time stamp increments and inputs for monitor_interval in --help. ")) + exit(1) + self.start(False, False) + + # if self.influx_mgr is None: + # manager = self.mgr + # else: + # manager = self.influx_mgr + + if self.influx_org is not None: + from InfluxRequest import RecordInflux + grapher = RecordInflux(_influx_host=self.influx_host, + _influx_port=self.influx_port, + _influx_org=self.influx_org, + _influx_token=self.influx_token, + _influx_bucket=self.influx_bucket) + devices = [station.split('.')[-1] for station in station_list] + tags = dict() + tags['script'] = 'test_ip_variable_time' + try: + for k in self.influx_tag: + tags[k[0]] = k[1] + except: + pass + grapher.monitor_port_data(longevity=Realm.parse_time(self.test_duration).total_seconds(), + devices=devices, + monitor_interval=Realm.parse_time(self.monitor_interval).total_seconds(), + tags=tags) + + + # Retrieve last data file + compared_rept = None + if self.compared_report: + compared_report_format = self.compared_report.split('.')[-1] + # if compared_report_format not in ['csv', 'json', 'dta', 'pkl','html','xlsx','parquet','h5']: + if compared_report_format != 'csv': + print(ValueError("Cannot process this file type. Please select a different file and re-run script.")) + exit(1) + else: + compared_rept = self.compared_report + + self.cx_profile.monitor(layer3_cols=layer3_cols, + sta_list=self.sta_list, + # port_mgr_cols=port_mgr_cols, + report_file=report_f, + systeminfopath=systeminfopath, + duration_sec=Realm.parse_time(self.test_duration).total_seconds(), + monitor_interval_ms=monitor_interval, + created_cx=layer3connections, + output_format=output, + compared_report=compared_rept, + script_name='test_ip_variable_time', + debug=self.debug) + + self.stop() + if self.create_sta: + if not self.passes(): + print(self.get_fail_message()) + self.exit_fail() + LFUtils.wait_until_ports_admin_up(port_list=self.sta_list) + + if self.passes(): + self.success() + self.cleanup() + print("IP Variable Time Test Report Data: {}".format(report_f)) + def main(): parser = Realm.create_basic_argparse( @@ -324,62 +481,18 @@ python3 ./test_ip_variable_time.py num_sta = 2 if (args.num_stations is not None) and (int(args.num_stations) > 0): num_sta = int(args.num_stations) - + if args.create_sta: + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, + padding_number_=10000, + radio=args.radio) + else: + station_list = args.sta_names.split(",") # Create directory # if file path with output file extension is not given... # check if home/lanforge/report-data exists. if not, save # in new folder based in current file's directory - if args.report_file is None: - new_file_path = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':', - '-') + '_test_ip_variable_time' # create path name - try: - path = os.path.join('/home/lanforge/report-data/', new_file_path) - os.mkdir(path) - except: - curr_dir_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - path = os.path.join(curr_dir_path, new_file_path) - os.mkdir(path) - systeminfopath = str(path) + '/systeminfo.txt' - - if args.output_format in ['csv', 'json', 'html', 'hdf', 'stata', 'pickle', 'pdf', 'png', 'parquet', - 'xlsx']: - report_f = str(path) + '/data.' + args.output_format - output = args.output_format - else: - print( - 'Not supporting this report format or cannot find report format provided. Defaulting to csv data file ' - 'output type, naming it data.csv.') - report_f = str(path) + '/data.csv' - output = 'csv' - - else: - systeminfopath = str(args.report_file).split('/')[-1] - report_f = args.report_file - if args.output_format is None: - output = str(args.report_file).split('.')[-1] - else: - output = args.output_format - print("IP Test Report Data: {}".format(report_f)) - - # Retrieve last data file - compared_rept = None - if args.compared_report: - compared_report_format = args.compared_report.split('.')[-1] - # if compared_report_format not in ['csv', 'json', 'dta', 'pkl','html','xlsx','parquet','h5']: - if compared_report_format != 'csv': - print(ValueError("Cannot process this file type. Please select a different file and re-run script.")) - exit(1) - else: - compared_rept = args.compared_report - - if create_sta: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, - radio=args.radio) - else: - station_list = args.sta_names.split(",") - CX_TYPES = ("tcp", "udp", "lf_tcp", "lf_udp") if (args.traffic_type is None) or (args.traffic_type not in CX_TYPES): @@ -414,106 +527,21 @@ python3 ./test_ip_variable_time.py side_b_min_rate=args.b_min, mode=args.mode, ap=args.ap, + report_file=args.report_file, + output_format=args.output_format, + layer3_cols=args.layer3_cols, + monitor_interval=args.monitor_interval, + influx_host=args.influx_host, + influx_port=args.influx_port, + influx_org=args.influx_org, + influx_token=args.influx_token, + influx_bucket=args.influx_bucket, + compared_report=args.compared_report, ipv6=args.ipv6, traffic_type=args.traffic_type, _debug_on=args.debug) - ip_var_test.pre_cleanup() - - ip_var_test.build() - # exit() - if create_sta: - if not ip_var_test.passes(): - print(ip_var_test.get_fail_message()) - ip_var_test.exit_fail() - - try: - layer3connections = ','.join([[*x.keys()][0] for x in ip_var_test.json_get('endp')['endpoint']]) - except: - raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') - - if type(args.layer3_cols) is not list: - layer3_cols = list(args.layer3_cols.split(",")) - # send col names here to file to reformat - else: - layer3_cols = args.layer3_cols - # send col names here to file to reformat - if type(args.port_mgr_cols) is not list: - port_mgr_cols = list(args.port_mgr_cols.split(",")) - # send col names here to file to reformat - else: - port_mgr_cols = args.port_mgr_cols - # send col names here to file to reformat - if args.debug: - print("Layer 3 Endp column names are...") - print(layer3_cols) - print("Port Manager column names are...") - print(port_mgr_cols) - - print("Layer 3 Endp column names are...") - print(layer3_cols) - print("Port Manager column names are...") - print(port_mgr_cols) - - try: - monitor_interval = Realm.parse_time(args.monitor_interval).total_seconds() - except ValueError as error: - print(str(error)) - print(ValueError( - "The time string provided for monitor_interval argument is invalid. Please see supported time stamp increments and inputs for monitor_interval in --help. ")) - exit(1) - ip_var_test.start(False, False) - - # if args.influx_mgr is None: - # manager = args.mgr - # else: - # manager = args.influx_mgr - - if args.influx_org is not None: - from InfluxRequest import RecordInflux - grapher = RecordInflux(_influx_host=args.influx_host, - _influx_port=args.influx_port, - _influx_org=args.influx_org, - _influx_token=args.influx_token, - _influx_bucket=args.influx_bucket) - devices = [station.split('.')[-1] for station in station_list] - tags = dict() - tags['script'] = 'test_ip_variable_time' - try: - for k in args.influx_tag: - tags[k[0]] = k[1] - except: - pass - grapher.monitor_port_data(longevity=Realm.parse_time(args.test_duration).total_seconds(), - devices=devices, - monitor_interval=Realm.parse_time(args.monitor_interval).total_seconds(), - tags=tags) - - ip_var_test.cx_profile.monitor(layer3_cols=layer3_cols, - sta_list=station_list, - # port_mgr_cols=port_mgr_cols, - report_file=report_f, - systeminfopath=systeminfopath, - duration_sec=Realm.parse_time(args.test_duration).total_seconds(), - monitor_interval_ms=monitor_interval, - created_cx=layer3connections, - output_format=output, - compared_report=compared_rept, - script_name='test_ip_variable_time', - arguments=args, - debug=args.debug) - - ip_var_test.stop() - if create_sta: - if not ip_var_test.passes(): - print(ip_var_test.get_fail_message()) - ip_var_test.exit_fail() - LFUtils.wait_until_ports_admin_up(port_list=station_list) - - if ip_var_test.passes(): - ip_var_test.success() - ip_var_test.cleanup() - print("IP Variable Time Test Report Data: {}".format(report_f)) + ip_var_test.run() if __name__ == "__main__": diff --git a/to_pip.sh b/to_pip.sh index eb1c0d06..60cfe3ae 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -8,8 +8,15 @@ Help() echo "ip_var=lanforge_scripts.IPVariableTime(host='192.168.1.239',port='8080',radio='wiphy0',sta_list=['1.1.sta0000','1.1.sta0001'],ssid='lanforge',password='password',security='wpa2',upstream='eth1',name_prefix='VT',traffic_type='lf_udp',_debug_on=True)" echo "ip_var.build()" echo "ip_var.start(False,False)" + echo "" + echo "EXPORT TO TAR FILE" + echo "./to_pip.sh -a -t TARGET_DIR" + echo "The 't' flag tells to_pip where to store the tar file, -a tells it to make a tar file." } +ARCHIVE=0 +TARGET_DIR='..' + while getopts ":h:a:t:" option; do case "${option}" in h) #display help @@ -357,6 +364,14 @@ sed -i -- 's/from create_station/from ..py_scripts.create_station/g' *.py sed -i -- 's/from cv_test_reports/from .cv_test_reports/g' *.py cd LANforge +echo " +from .add_dut import dut_params, dut_flags +from .add_file_endp import fe_fstype, fe_payload_list, fe_fio_flags, fe_base_endpoint_types +from .lf_json_autogen import LFJsonGet, LFJsonPost +from .lfcli_base import LFCliBase +from .LFRequest import LFRequest +from .LFUtils import * +from .pandas_extensions import pandas_extensions" > __init__.py sed -i -- 's/from LFRequest import LFRequest/from .LFRequest import LFRequest/g' *.py sed -i -- 's/from LFRequest/from .LFRequest/g' *.py sed -i -- 's/from LANforge import LFRequest/import .LFRequest/g' LFUtils.py @@ -382,11 +397,12 @@ sed -i -- 's/GrafanaRequest = importlib.import_module("py-dashboard.GrafanaReque sed -i -- 's/InfluxRequest = importlib.import_module("py-dashboard.InfluxRequest")/from .InfluxRequest import RecordInflux/g' *.py sed -i -- 's/RecordInflux = InfluxRequest.RecordInflux/ /g' *.py -if [[ ${ARCHIVE} -eq 0 ]]; then - Archive() - { - cd ../.. - tar cvzf lanforge_scripts.tar.gz ${TARGET_DIR} - zip lanforge_scripts.zip ${TARGET_DIR} - } +echo "${ARCHIVE}" +if [[ $ARCHIVE -eq 1 ]]; then + echo "Saving archive to ${TARGET_DIR}" + cd ../ + tar cvzf ${TARGET_DIR}/lanforge_scripts.tar.gz . + zip ${TARGET_DIR}/lanforge_scripts.zip . +else + echo "Not saving archive" fi \ No newline at end of file From 17d93860ea857f49d08994fe99e2103c3e09cea7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 23 Sep 2021 14:44:19 -0700 Subject: [PATCH 004/731] Remove dead file link from py_scripts/__init__.py Signed-off-by: Matthew Stidham --- to_pip.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/to_pip.sh b/to_pip.sh index 60cfe3ae..3930a476 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -148,7 +148,6 @@ from .test_status_msg import TestStatusMessage from .testgroup import TestGroup from .testgroup2 import TestGroup2 from .tip_station_powersave import TIPStationPowersave -from .vap_stations_example import VapStations from .video_rates import VideoRates from .wlan_capacity_calculator import main as WlanCapacityCalculator from .ws_generic_monitor_test import WS_Listener" > __init__.py From 85e0587f729aa1620b0d039bb71d785377fd513c Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Fri, 24 Sep 2021 11:44:15 -0700 Subject: [PATCH 005/731] version of port_probe2 that uses minimum logic to print out port probe Signed-off-by: Jed Reynolds --- py-scripts/port_probe2.py | 77 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100755 py-scripts/port_probe2.py diff --git a/py-scripts/port_probe2.py b/py-scripts/port_probe2.py new file mode 100755 index 00000000..6f05b526 --- /dev/null +++ b/py-scripts/port_probe2.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 +import json +import os +import pprint +import sys + +if sys.version_info[0] != 3: + print("This script requires Python 3") + exit(1) + +if 'py-json' not in sys.path: + sys.path.append(os.path.join(os.path.abspath('..'), 'py-json')) + +from time import sleep +from LANforge.lfcli_base import LFCliBase +from realm import Realm + + +# see https://stackoverflow.com/questions/9295439/python-json-loads-fails-with-valueerror-invalid-control-character-at-line-1-c/16544933#16544933 +# re-load and reexport JSON with strict=False? + +class ProbePort2(LFCliBase): + def __init__(self, + lfhost=None, + lfport=None, + debug=False, + eid_str=None): + super().__init__(_lfjson_host=lfhost, + _lfjson_port=lfport, + _debug=debug) + hunks = eid_str.split(".") + self.probepath = "/probe/1/%s/%s" % (hunks[-2], hunks[-1]) + # self.decoder = json.JSONDecoder() + + def run(self): + self.json_post(self.probepath, {}) + sleep(0.2) + response = self.json_get(self.probepath) + if not response: + print("problem probing port %s" % self.probepath) + exit(1) + # pprint.pprint(response) + if "probe-results" not in response: + print("problem probing port %s" % self.probepath) + exit(1) + + probe_res = response["probe-results"][0] + #pprint.pprint(probe_res) + for (key, value) in probe_res.items(): + # probe_results = [key] + print("port "+key) + # pprint.pprint(value['probe results']) + xlated_results = str(value['probe results']).replace("\\n", "\n").replace("\\r", "\r").replace("\\t", "\t") + print(xlated_results) + + +def main(): + parser = Realm.create_bare_argparse( + prog=__name__, + description='''\ + Example: + ./port_probe2.py --port 1.1.eth0 + ''') + + parser.add_argument('--mode', help='Used to force mode of stations') + parser.add_argument('--port_eid', help='EID of station to be used', default="1.1.eth0") + + args = parser.parse_args() + probe = ProbePort2(lfhost=args.mgr, + lfport=args.mgr_port, + debug=args.debug, + eid_str=args.port_eid) + probe.run() + + +if __name__ == "__main__": + main() From 4795541e86bed5379698e0c0505eb1ce99d7c006 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 24 Sep 2021 10:51:56 -0600 Subject: [PATCH 006/731] lf_check.py updated comments ct_us_003_tests.json - initial checkin Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_003_tests.json | 56 +++++++++++++++++++++++++++ py-scripts/tools/lf_check.py | 3 ++ 2 files changed, 59 insertions(+) create mode 100644 py-scripts/tools/ct_us_003_tests.json diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json new file mode 100644 index 00000000..d645977e --- /dev/null +++ b/py-scripts/tools/ct_us_003_tests.json @@ -0,0 +1,56 @@ +{ + "ct_tests_003":{ + "Notes":[ + "The json is used to orchastrate the tests to be run on testbed ct_us_003", + "This json file is used as an input to the ./lf_check.py file", + "The variables that are all capitalized below are replaced with configuration", + "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", + "The replacement is loosely coupled so the upper and lower case convention is used", + "to identify replaced strings in the lf_check.py code." + ] + }, + "test_suites": { + "suite_vap": { + "CT-US-003_VAP": { + "enabled": "TRUE", + "command": "create_vap.py", + "args": "", + "args_list": [ + " --mgr LF_MGR_IP", + " --resource 3", + " --ssid SSID_5G_USED", + " --password SSID_5G_PW_USED", + " --security wpa2", + " --radio wiphy1", + " --upstream_port UPSTREAM_PORT", + " --mode 802.11anAC" + ] + }, + "test_l3_longevity":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2 ", + " --radio 'radio==wiphy1,stations==4,ssid==SSID_5G_USED,ssid_pw==SSID_5G_PW_USED,security==SECURITY_5G_USED' ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000" + ] + }, + "CT-US-001_QA":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + } + } +} + + + + \ No newline at end of file diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 60ce1aed..3122ff95 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -49,6 +49,9 @@ curl -H 'Accept: application/json' http://localhost:8080/ | json_pp curl -u 'user:pass' -H 'Accept: application/json' http://:8080 | json_pp | grep -A 7 "VersionInfo" +6. for Fedora you can do a: dnf group list , to see what all is installed + dnf group install "Development Tools" for example, to install a group + GENERIC NOTES: Starting LANforge: On local or remote system: /home/lanforge/LANforgeGUI/lfclient.bash -cli-socket 3990 -s LF_MGR From a6c6055fa25226da8e75b31558a9b237d7ee8a32 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 24 Sep 2021 13:12:57 -0600 Subject: [PATCH 007/731] lf_check.py : removed exit if radio dictionary not present. The radio dictionay can be read from the device Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 3122ff95..e1ac1b5d 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -481,8 +481,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.radio_dict = self.json_rig["radio_dict"] self.logger.info("self.radio_dict {}".format(self.radio_dict)) else: - self.logger.info("EXITING radio_dict not in json {}".format(self.json_rig)) - exit(1) + self.logger.info("radio_dict not in json {}".format(self.json_rig)) # read dut configuration def read_json_dut(self): From d24ff054f72e0260337eb93ce156ef13efa3a2f2 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 24 Sep 2021 15:09:15 -0600 Subject: [PATCH 008/731] lf_check.py : if the radio dictionary is empty to not error. ct_us_003_tests.json updated for ASUS AP ct_003_AX88U_dut.json : added the ASUS AP configuration Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_003_AX88U_dut.json | 26 ++++++++++++++++++++++++++ py-scripts/tools/ct_us_003_tests.json | 2 +- py-scripts/tools/lf_check.py | 7 ++++--- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 py-scripts/tools/ct_003_AX88U_dut.json diff --git a/py-scripts/tools/ct_003_AX88U_dut.json b/py-scripts/tools/ct_003_AX88U_dut.json new file mode 100644 index 00000000..56165911 --- /dev/null +++ b/py-scripts/tools/ct_003_AX88U_dut.json @@ -0,0 +1,26 @@ +{ + "ct_AX88U_dut":{ + "Notes":[ + "This json file is used as an input to the ./lf_check.py file", + "The variables that are all capitalized below are replaced with configuration", + "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", + "The replacement is loosely coupled so the upper and lower case convention is used", + "to identify replaced strings in the lf_check.py code.", + "The dut related configuration is contained in this file" + ] + }, + "test_dut":{ + "dut_set_name": "DUT_NAME ASUSRT-AX88U", + "dut_name": "ASUSRT-AX88U", + "dut_bssid_2g": "d4:5d:64:a0:7f:78", + "dut_bssid_5g": "d4:5d:64:a0:7f:7c", + "dut_sw": "3.0.0.4.386_44266", + "ssid_5g_used": "asus11ax-5", + "ssid_5g_pw_used": "hello123", + "security_5g_used": "wpa2", + "ssid_2g_used": "asus11ax-2", + "ssid_2g_pw_used": "hello123", + "security_2g_used": "wpa2" + } +} + \ No newline at end of file diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index d645977e..49f6afc3 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -17,7 +17,7 @@ "args": "", "args_list": [ " --mgr LF_MGR_IP", - " --resource 3", + " --resource 1", " --ssid SSID_5G_USED", " --password SSID_5G_PW_USED", " --security wpa2", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index e1ac1b5d..d9b2d3ad 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -760,9 +760,10 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) print(self.test_dict) # loop through radios (For future functionality based on radio) - for radio in self.radio_dict: - # This has been changed to reflect the Radio configuriaton of LANforge, for now print - print("rig json config: RADIO: {radio} DRIVER: {driver} CAPABILITIES {cap} MAX_STA {max_sta} MAX_VAP {max_vap} MAX_VIFS {max_vif}".format( + if self.radio_dict: + for radio in self.radio_dict: + # This has been changed to reflect the Radio configuriaton of LANforge, for now print + print("rig json config: RADIO: {radio} DRIVER: {driver} CAPABILITIES {cap} MAX_STA {max_sta} MAX_VAP {max_vap} MAX_VIFS {max_vif}".format( radio=self.radio_dict[radio]['RADIO'],driver=self.radio_dict[radio]['DRIVER'],cap=self.radio_dict[radio]['CAPABILITIES'], max_sta=self.radio_dict[radio]['MAX_STA'],max_vap=self.radio_dict[radio]['MAX_VAP'],max_vif=self.radio_dict[radio]['MAX_VIFS'])) From 36fef945e50fc81e6f65545a3e8511cc1f364368 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 24 Sep 2021 15:12:05 -0600 Subject: [PATCH 009/731] ct_us_003_tests.json : updated tests Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_003_tests.json | 96 ++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index 49f6afc3..a43d0e5b 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -23,7 +23,7 @@ " --security wpa2", " --radio wiphy1", " --upstream_port UPSTREAM_PORT", - " --mode 802.11anAC" + " --mode 802.11abgn-AX" ] }, "test_l3_longevity":{ @@ -37,7 +37,99 @@ " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000" ] }, - "CT-US-001_QA":{ + "ct-us-003_QA":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + }, + "suite_wc_dp_shorter":{ + "ct-us-003_create_chamberview_dut_0":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "ct-us-003_create_chamberview_mt7915e_sta19":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ct-us-003-scenario ", + " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy1,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" + ] + }, + "ct-us-003_wifi_capacity_mt7915e":{ + "enabled":"TRUE", + "timeout":"600", + "iterations":"1", + "load_db":"skip", + "command":"lf_wifi_capacity_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name wc_m57915e", + " --upstream UPSTREAM_PORT --batch_size 1,10,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "ct-us-003_create_chamberview_dut_for_mt7915e_dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", + " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "ct-us-003_create_chamberview_mt7915e_sta1":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ct-us-003-mt7915e-scenario ", + " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" + ] + }, + "ct-us-003_dataplane_mt7915e_sta1":{ + "enabled":"TRUE", + "load_db":"skip", + "iterations":"1", + "command":"lf_dataplane_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan7", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", + " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", + " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e' ", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "ct-us-003_QA":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", From 071331dd084f3db83b4933ba2e7c2d063e412372 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 24 Sep 2021 15:16:44 -0600 Subject: [PATCH 010/731] ct_us_003_rig.json : updated for correct radio dictionary Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_003_rig.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/ct_us_003_rig.json b/py-scripts/tools/ct_us_003_rig.json index ae52d350..7796d9ce 100644 --- a/py-scripts/tools/ct_us_003_rig.json +++ b/py-scripts/tools/ct_us_003_rig.json @@ -36,8 +36,12 @@ "test_ip": "192.168.50.1" }, "radio_dict":{ - "RADIO_0_CFG":{"KEY":"RADIO_0_CFG","RADIO":"wiphy0","STATIONS":"4","SSID":"ct523c-vap","PASSWD":"ct523c-vap","SECURITY":"wpa2"}, - "RADIO_1_CFG":{"KEY":"RADIO_1_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"ct523c-vap","PASSWD":"ct523c-vap","SECURITY":"wpa2"} + "1.1.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, + "1.1.wiphy1":{"KEY":"1.1.wiphy1","RADIO":"1.1.wiphy1","DRIVER":"mt7915e()","CAPABILITIES":"802.11abgn-AX","MAX_STA":"19","MAX_VAP":"16","MAX_VIFS":"19"}, + "1.2.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, + "1.2.wiphy1":{"KEY":"1.1.wiphy1","RADIO":"1.1.wiphy1","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, + "1.3.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, + "1.3.wiphy1":{"KEY":"1.1.wiphy1","RADIO":"1.1.wiphy1","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"} } } From 92df1ab82d7e2da90a23b4c9828dfaed5168541c Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 24 Sep 2021 15:38:13 -0700 Subject: [PATCH 011/731] Finish pip package creation script Signed-off-by: Matthew Stidham --- py-scripts/create_l3.py | 51 +++++++++++++-------------------- setup.cfg | 6 ++++ setup.py | 44 +++++++++++++++++++++++++++++ to_pip.sh | 62 +++++++++++++++++++++++++++++++++++------ 4 files changed, 123 insertions(+), 40 deletions(-) create mode 100644 setup.cfg create mode 100755 setup.py diff --git a/py-scripts/create_l3.py b/py-scripts/create_l3.py index 68457ce1..a0289b22 100755 --- a/py-scripts/create_l3.py +++ b/py-scripts/create_l3.py @@ -69,37 +69,7 @@ class CreateL3(Realm): self._pass("PASS: Cross-connect build finished") -def main(): - parser = LFCliBase.create_basic_argparse( - prog='create_l3.py', - formatter_class=argparse.RawTextHelpFormatter, - epilog='''\ - Generate traffic between ports - ''', - description='''\ - ''') - - required_args = None - for group in parser._action_groups: - if group.title == "required arguments": - required_args = group - break - if required_args is not None: - required_args.add_argument('--min_rate_a', help='--min_rate_a bps rate minimum for side_a', default=56000) - required_args.add_argument('--min_rate_b', help='--min_rate_b bps rate minimum for side_b', default=56000) - required_args.add_argument('--endp_a', help='--endp_a station list', default=["eth1"], action="append") - required_args.add_argument('--endp_b', help='--upstream port', default="eth2") - - optional_args = None - for group in parser._action_groups: - if group.title == "optional arguments": - optional_args = group - break; - if optional_args is not None: - optional_args.add_argument('--mode', help='Used to force mode of stations', default=0) - optional_args.add_argument('--ap', help='Used to force a connection to a particular AP') - optional_args.add_argument('--number_template', help='Start the station numbering with a particular number. Default is 0000', default=0000) - args = parser.parse_args() +def main(args): num_sta = 2 if (args.num_stations is not None) and (int(args.num_stations) > 0): @@ -126,4 +96,21 @@ def main(): if __name__ == "__main__": - main() + parser = LFCliBase.create_basic_argparse( + prog='create_l3.py', + formatter_class=argparse.RawTextHelpFormatter, + epilog='''\ + Generate traffic between ports + ''', + description='''\ + ''') + parser.add_argument('--min_rate_a', help='--min_rate_a bps rate minimum for side_a', default=56000) + parser.add_argument('--min_rate_b', help='--min_rate_b bps rate minimum for side_b', default=56000) + parser.add_argument('--endp_a', help='--endp_a station list', default=["eth1"], action="append", required=True) + parser.add_argument('--endp_b', help='--upstream port', default="eth2", required=True) + parser.add_argument('--mode', help='Used to force mode of stations', default=0) + parser.add_argument('--ap', help='Used to force a connection to a particular AP') + parser.add_argument('--number_template', help='Start the station numbering with a particular number. Default is 0000', default=0000) + args = parser.parse_args() + + main(args) diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..22746bfc --- /dev/null +++ b/setup.cfg @@ -0,0 +1,6 @@ +[metadata] + +license_files = license.txt + +[options] +packages = find: \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100755 index 00000000..1230ff73 --- /dev/null +++ b/setup.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 + +from setuptools import setup, find_packages + +setup( + name="lanforge_scripts", + version="0.0.1", + author="Candela Technologies", + description="Automate LANforge devices", + license='BSD 3-clause license', + url='https://github.com/greearb/lanforge-scripts', + long_description=open('README.md').read(), + long_description_content_type="text/markdown", + packages=find_packages(), + install_requires=[ + 'pandas', + 'plotly', + 'numpy', + 'cryptography', + 'paramiko', + 'bokeh', + 'pyarrow', + 'websocket-client', + 'xlsxwriter', + 'pyshark', + 'influxdb', + 'influxdb-client', + 'matplotlib', + 'pdfkit', + 'pip-search', + 'pyserial', + 'pexpect-serial', + 'scp', + 'dash', + 'kaleido'], + python_required='>=3.6, <4', + classifiers=[ + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", + ], + project_urls={ + 'Homepage': 'https://www.candelatech.com' + } +) diff --git a/to_pip.sh b/to_pip.sh index 3930a476..6dca63d4 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -1,7 +1,7 @@ #! /bin/bash Help() { - echo "This script modifies lanforge scripts so that it can be imported into python as a library" + echo "This script modifies lanforge scripts so that it can be imported into python as a library from the tar.gz file it creates" echo "store this repository in your python path, and then import lanforge_scripts from anywhere on your machine" echo "An example of how to run this in python is like so:" echo "import lanforge_scripts" @@ -12,6 +12,7 @@ Help() echo "EXPORT TO TAR FILE" echo "./to_pip.sh -a -t TARGET_DIR" echo "The 't' flag tells to_pip where to store the tar file, -a tells it to make a tar file." + echo "When the archive is made, you can install it on any computer with `pip install lanforge_scripts.tar.gz`" } ARCHIVE=0 @@ -38,9 +39,9 @@ cd .. mv lanforge-scripts lanforge_scripts cd lanforge_scripts -ln -s py-scripts/ py_scripts -ln -s py-json/ py_json -ln -s py-dashboard/ py_dashboard +mv py-scripts/ py_scripts +mv py-json/ py_json +mv py-dashboard/ py_dashboard echo "#Automate LANforge devices with lanforge-scripts @@ -206,7 +207,8 @@ sed -i -- 's/lf_cv_base = importlib.import_module("py-json.lf_cv_base")/from ..p sed -i -- 's/base_profile = importlib.import_module("py-json.base_profile")/from ..py_json import base_profile/g' *.py sed -i -- 's/add_file_endp = importlib.import_module("py-json.LANforge.add_file_endp")/from ..py_json.LANforge import add_file_endp/g' *.py sed -i -- 's/lf_graph = importlib.import_module("py-scripts.lf_graph")/from ..py_scripts import lf_graph/g' *.py -sed -i -- 's/GrafanaRequest = importlib.import_module("py-dashboard.GrafanaRequest")/from ..py_dashboard import GrafanaRequest/g' *.py +sed -i -- 's/GrafanaRequest = importlib.import_module("py-dashboard.GrafanaRequest")/from ..py_dashboard.GrafanaRequest import GrafanaRequest/g' *.py +sed -i -- 's/GrafanaRequest = GrafanaRequest.GrafanaRequest/ /g' *.py sed -i -- 's/station_profile = importlib.import_module("py-json.station_profile")/from ..py_json import station_profile/g' *.py sed -i -- 's/cv_test_manager = importlib.import_module("py-scripts.cv_test_manager")/from ..py_scripts import cv_test_manager/g' *.py sed -i -- 's/lf_report = importlib.import_module("py-scripts.lf_report")/from ..py_scripts import lf_report/g' *.py @@ -316,6 +318,8 @@ sed -i -- 's/vap_profile = importlib.import_module("py-json.vap_profile")/from . sed -i -- 's/station_profile = importlib.import_module("py-json.station_profile")/from ..py_json import station_profile/g' *.py sed -i -- 's/PortUtils = port_utils.PortUtils/ /g' *.py sed -i -- 's/LFCliBase = lfcli_base.LFCliBase/ /g' *.py +sed -i -- 's/pandas_extensions = importlib.import_module("py-json.LANforge.pandas_extensions")/from .LANforge.pandas_extensions import pandas_extensions/g' *.py +sed -i -- 's/pandas_extensions.pandas_extensions/pandas_extensions/g' *.py # fix py_dashboard files sed -i -- 's/from GrafanaRequest/from ..py_dashboard.GrafanaRequest/g' *.py @@ -383,6 +387,10 @@ sed -i -- 's/import LANforge.LFRequest/ /g' lfcli_base.py sed -i -- 's/import .LFRequest/from . import LFRequest/g' *.py sed -i -- 's/import .LFUtils/from . import LFUtils/g' *.py sed -i -- 's/LANforge.LFUtils./LFUtils./g' *.py +sed -i -- 's/lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base")/from .lfcli_base import LFCliBase/g' *.py +sed -i -- 's/LFRequest = importlib.import_module("py-json.LANforge.LFRequest")/from .LFRequest import LFRequest/g' *.py +sed -i -- 's/LFRequest.LFRequest/LFRequest/g' *.py +sed -i -- 's/LFCliBase = lfcli_base.LFCliBase/from .lfcli_base import LFCliBase/g' *.py #Convert from importlib to pip compliant method sed -i -- 's/LFUtils = importlib.import_module("py-json.LFUtils.)/from .LFUtils import debug_printer/g' *.py @@ -390,18 +398,56 @@ sed -i -- 's/LFUtils.debug_printer/debug_printer/g' *.py sed -i -- 's/LFRequest = importlib.import_module("py-json.LFRequest.)/from .LFRequest import debug_printer/g' *.py sed -i -- 's/lanforge-scripts/lanforge_scripts/g' *.py sed -i -- 's/LFUtils.debug_printer/debug_printer/g' *.py +sed -i -- 's/lf_json_autogen = importlib.import_module("py-json.LANforge.lf_json_autogen")/from .lf_json_autogen import LFJsonPost/g' *.py +sed -i -- 's/LFJsonPost = lf_json_autogen.LFJsonPost/ /g' *.py cd ../../py_dashboard +echo " +from .GrafanaRequest import GrafanaRequest +from .InfluxRequest import RecordInflux +from .GhostRequest import GhostRequest" > __init__.py sed -i -- 's/GrafanaRequest = importlib.import_module("py-dashboard.GrafanaRequest")/from .GrafanaRequest import GrafanaRequest/g' *.py sed -i -- 's/InfluxRequest = importlib.import_module("py-dashboard.InfluxRequest")/from .InfluxRequest import RecordInflux/g' *.py sed -i -- 's/RecordInflux = InfluxRequest.RecordInflux/ /g' *.py echo "${ARCHIVE}" +py_modules=( 'ap_ctl' + 'emailHelper' + 'lf_mail' + 'lf_tos_plus_test' + 'lf_tx_power' + 'tos_plus_auto' + 'auto_install_gui' + 'cpu_stats' + 'lf_sniff' + 'lf_tos_test' + 'openwrt_ctl' + 'stationStressTest' + 'wifi_ctl_9800_3504') if [[ $ARCHIVE -eq 1 ]]; then echo "Saving archive to ${TARGET_DIR}" - cd ../ - tar cvzf ${TARGET_DIR}/lanforge_scripts.tar.gz . - zip ${TARGET_DIR}/lanforge_scripts.zip . + cd .. + mkdir lanforge_scripts + mv py_json lanforge_scripts + mv py_dashboard lanforge_scripts + mv py_scripts lanforge_scripts + mv label-printer lanforge_scripts/label_printer + for i in "${py_modules[@]}"; do + mv $i lanforge_scripts + done + rm *.pl + rm *.bash + rm -r gui + rm -r json + rm -r LANforge + rm -r __pycache__ + mv *.py lanforge_scripts + mv lanforge_scripts/setup.py . + rm speedtest-cli + rm WlanPro.desktop + mv wifi_diag lanforge_scripts + tar -zcvf ${TARGET_DIR}/lanforge_scripts.tar.gz * + zip ${TARGET_DIR}/lanforge_scripts.zip * else echo "Not saving archive" fi \ No newline at end of file From 55e0d507faaddaf20c889bf9deb30b2be834d771 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 24 Sep 2021 17:02:31 -0600 Subject: [PATCH 012/731] ct_us_003_tests.json : test updates ct_us_001_tests.json : test updates Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 6 +- py-scripts/tools/ct_us_003_tests.json | 370 +++++++++++++++++++++++++- 2 files changed, 371 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index eea19c54..ab627249 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -371,7 +371,7 @@ ] }, "CT-US-001_create_chamberview_dut_2":{ - "enabled":"FALSE", + "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", "args":"", @@ -382,7 +382,7 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-001_create_chamberview_ap":{ - "enabled":"FALSE", + "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", @@ -395,7 +395,7 @@ ] }, "CT-US-001_lf_ap_auto_test": { - "enabled": "FALSE", + "enabled": "TRUE", "command": "lf_ap_auto_test.py", "timeout":"25200", "iterations":"1", diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index a43d0e5b..f8ef385a 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -120,7 +120,7 @@ "args":"", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", - " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan7", + " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan7", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", @@ -139,10 +139,376 @@ " --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } + }, + "suite_wc_dp":{ + "CT-US-003_create_chamberview_dut_for_ATH10K":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", + " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "CT-US-003_create_chamberview_ATH10K(9984)_sta50":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ct-us-003-scenario ", + " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" + ] + }, + "CT-US-003_wifi_capacity_ATH10K(9984)":{ + "enabled":"TRUE", + "timeout":"600", + "iterations":"1", + "load_db":"skip", + "command":"lf_wifi_capacity_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name wc_ATH10K", + " --upstream 1.1.eth1 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", + " --test_rig TEST_RIG ", + " --set DUT_SET_NAME" + ] + }, + "CT-US-003_create_chamberview_dut_ATH10K":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", + " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "CT-US-003_create_chamberview_ATH10K(9984)_sta1":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ct-us-003-ATH10K-scenario ", + " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" + ] + }, + "CT-US-003_dataplane_ATH10K(9984)_sta1":{ + "enabled":"TRUE", + "load_db":"skip", + "timeout":"600", + "iterations":"1", + "command":"lf_dataplane_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan1", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", + " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", + " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)' ", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "CT-US-003_create_chamberview_dut_for_AX210":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", + " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "CT-US-003_create_chamberview_wiphy3_AX210_sta1":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ct-us-003-AX210-scenario ", + " --raw_line \"profile_link 1.1 STA-AX 1 'DUT: DUT_NAME Radio-2' NA wiphy3,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\" " + ] + }, + "CT-US-003_wifi_capacity_wiphy3_AX210_sta1":{ + "enabled":"TRUE", + "load_db":"skip", + "iterations":"1", + "command":"lf_wifi_capacity_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", + " --upstream 1.1.eth1 --batch_size 1 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", + " --pull_report --local_lf_report_dir REPORT_PATH --stations 1.1.wlan3 --test_tag 'AX210'", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "CT-US-003_create_chamberview_dut_for_AX210_dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", + " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "CT-US-003_create_chamberview_wiphy3_AX210_sta1_dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ct-us-003-AX210-scenario ", + " --raw_line \"profile_link 1.1 STA-AX 1 'DUT: DUT_NAME Radio-2' NA wiphy3,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\" " + ] + }, + "CT-US-003_dataplane_wiphy3_AX210_sta1":{ + "enabled":"TRUE", + "load_db":"skip", + "iterations":"1", + "command":"lf_dataplane_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan3", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", + " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", + " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AX210'", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "CT-US-003_create_chamberview_dut_for_mt7915e":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", + " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "CT-US-003_create_chamberview_mt7915e_sta19":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ct-us-003-mt7915e-scenario ", + " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" + ] + }, + "CT-US-003_wifi_capacity_mt7915e":{ + "enabled":"TRUE", + "timeout":"600", + "iterations":"1", + "load_db":"skip", + "command":"lf_wifi_capacity_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct-mt7915e", + " --upstream 1.1.eth1 --batch_size 1,5,10,15,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "CT-US-003_create_chamberview_dut_for_mt7915e_dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", + " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "CT-US-003_create_chamberview_mt7915e_sta1":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ct-us-003-mt7915e-scenario ", + " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" + ] + }, + "CT-US-003_dataplane_mt7915e_sta1":{ + "enabled":"TRUE", + "load_db":"skip", + "iterations":"1", + "command":"lf_dataplane_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt-mt7915e", + " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan7", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", + " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", + " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e' ", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "CT-US-003_create_chamberview_dut_2":{ + "enabled":"FALSE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", + " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ]}, + "CT-US-003_create_chamberview_ap":{ + "enabled":"FALSE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ap-script ", + " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " + ] + }, + "CT-US-003_lf_ap_auto_test": { + "enabled": "FALSE", + "command": "lf_ap_auto_test.py", + "timeout":"25200", + "iterations":"1", + "args": "", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", + " --instance_name ap-auto-instance --config_name test_con --upstream eth2", + " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", + " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", + " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", + " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", + " --set 'Basic Client Connectivity' 1", + " --set 'Multi Band Performance' 1", + " --set 'Stability' 1", + " --set 'Multi-Station Throughput vs Pkt Size' 0,", + " --set 'Throughput vs Pkt Size' 1", + " --set 'Capacity' 1", + " --set 'Band-Steering' 1", + " --set 'Skip 2.4 Ghz Tests' 0", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "CT-US-003_QA":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + }, + "suite_ap":{ + "CT-US-003_create_chamberview_dut_2":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", + " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ]}, + "CT-US-003_create_chamberview_ap":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ap-script ", + " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " + ] + }, + "CT-US-003_lf_ap_auto_test": { + "enabled": "TRUE", + "command": "lf_ap_auto_test.py", + "timeout":"25200", + "iterations":"1", + "args": "", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", + " --instance_name ap-auto-instance --config_name test_con --upstream eth2", + " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", + " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", + " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", + " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", + " --set 'Basic Client Connectivity' 1", + " --set 'Multi Band Performance' 1", + " --set 'Stability' 0", + " --set 'Multi-Station Throughput vs Pkt Size' 0,", + " --set 'Throughput vs Pkt Size' 0", + " --set 'Capacity' 0", + " --set 'Band-Steering' 0", + " --set 'Skip 2.4 Ghz Tests' 1", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "CT-US-003_QA":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } } - } + } } + + \ No newline at end of file From 37199791a83bc32b689c3113d4c2697127dcd815 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 24 Sep 2021 17:46:52 -0600 Subject: [PATCH 013/731] create_vap.py : remove the country country=self.country_code, Signed-off-by: Chuck SmileyRekiere --- py-scripts/create_vap.py | 1 - 1 file changed, 1 deletion(-) diff --git a/py-scripts/create_vap.py b/py-scripts/create_vap.py index d627998b..6086e196 100755 --- a/py-scripts/create_vap.py +++ b/py-scripts/create_vap.py @@ -89,7 +89,6 @@ class CreateVAP(Realm): self.vap_profile.create(resource = self.resource, radio = self.radio, channel = self.channel, - country=self.country_code, up_ = True, debug = False, use_ht40=True, From 87fc693d0a0f21b36b52ef262ce6eb66e38e195c Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 24 Sep 2021 18:34:42 -0600 Subject: [PATCH 014/731] lf_rvr_test.py the '%' cases issues for the args parser Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_rvr_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/lf_rvr_test.py b/py-scripts/lf_rvr_test.py index 628f7720..f1f78762 100755 --- a/py-scripts/lf_rvr_test.py +++ b/py-scripts/lf_rvr_test.py @@ -240,7 +240,7 @@ def main(): parser.add_argument("--dut", default="", help="Specify DUT used by this test, example: linksys-8450") parser.add_argument("--download_speed", default="", - help="Specify requested download speed. Percentage of theoretical is also supported. Default: 85%") + help="Specify requested download speed. Percentage of theoretical is also supported. Default: 85") parser.add_argument("--upload_speed", default="", help="Specify requested upload speed. Percentage of theoretical is also supported. Default: 0") parser.add_argument("--duration", default="", From 8e745d3f75edb4126b7c48688499f4b76588bf0c Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 24 Sep 2021 18:49:38 -0600 Subject: [PATCH 015/731] lf_check.py : removed the ghost post information Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index d9b2d3ad..0d6e3269 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1013,16 +1013,6 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.test_result = "Time Out" background = self.background_purple - # Ghost will put data in stderr - if 'ghost' in command or 'lf_qa' in command: - if self.test_result != "TIMEOUT": - text = open(stderr_log_txt).read() - if 'Error' in text: - self.test_result = "Failure" - background = self.background_red - else: - self.test_result = "Success" - background = self.background_blue if 'lf_qa' in command: line_list = open(stdout_log_txt).readlines() for line in line_list: From d806ee4c25849377d06a8db82bceeb91c077d03e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 14:53:26 -0600 Subject: [PATCH 016/731] lf_help_check.bash : check to see if --help files works on scripts Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_help_check.bash | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 py-scripts/lf_help_check.bash diff --git a/py-scripts/lf_help_check.bash b/py-scripts/lf_help_check.bash new file mode 100755 index 00000000..8a3f3d1e --- /dev/null +++ b/py-scripts/lf_help_check.bash @@ -0,0 +1,8 @@ +#!/bin/bash + +FILES=`ls *.py` +for FILE in $FILES +do + echo $FILE + (timeout 10 python3 ./${FILE} --help > /dev/null && echo PASSED) || echo "FAILED ${FILE}" +done From 6fe41dfd5fed22b3e78be38788f6f15472e8dded Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 15:37:18 -0600 Subject: [PATCH 017/731] stations_connected.py : utility script , fixed the command passing Need to update , there is not help Signed-off-by: Chuck SmileyRekiere --- py-scripts/stations_connected.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/stations_connected.py b/py-scripts/stations_connected.py index 74070fbc..cbe37f49 100755 --- a/py-scripts/stations_connected.py +++ b/py-scripts/stations_connected.py @@ -19,8 +19,8 @@ Realm = realm.Realm class StationsConnected(LFCliBase): def __init__(self, lfjson_host, lfjson_port): - super().__init__(_lfjson_host=lfjson_host, _lfjson_port=lfjson_port, _debug=False) - self.localrealm = Realm(lfclient_host=lfjson_host, lfclient_port=lfjson_port, debug=False) + super().__init__(_lfjson_host=lfjson_host, _lfjson_port=lfjson_port) + self.localrealm = Realm(lfclient_host=lfjson_host, lfclient_port=lfjson_port) self.check_connect() def run(self): From 30cc3c532a5f4874318ced31bd7ca83a575397b9 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 16:03:05 -0600 Subject: [PATCH 018/731] lf_mesh_test.py 85% the argsparser needs 85%% Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_mesh_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/lf_mesh_test.py b/py-scripts/lf_mesh_test.py index 68924e85..c927920e 100755 --- a/py-scripts/lf_mesh_test.py +++ b/py-scripts/lf_mesh_test.py @@ -246,9 +246,9 @@ def main(): parser.add_argument("-u", "--upstream", type=str, default="", help="Upstream port for wifi capacity test ex. 1.1.eth2") - + # argparse uses the % formatting so use %% parser.add_argument("--download_speed", default="", - help="Specify requested download speed. Percentage of theoretical is also supported. Default: 85%") + help="Specify requested download speed. Percentage of theoretical is also supported. Default: 85%%") parser.add_argument("--upload_speed", default="", help="Specify requested upload speed. Percentage of theoretical is also supported. Default: 0") parser.add_argument("--duration", default="", From 12d02af9b6cac9bf49d425299050c89528d49ac1 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 16:26:44 -0600 Subject: [PATCH 019/731] sta_scan_test.py : fixed imports tip_station_powersave.py : added --help lf_qa.py : fixed comments in help Signed-off-by: Chuck SmileyRekiere --- py-scripts/sta_scan_test.py | 17 +++++++++-------- py-scripts/tip_station_powersave.py | 21 +++++++++++++++++++++ py-scripts/tools/lf_qa.py | 2 +- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/py-scripts/sta_scan_test.py b/py-scripts/sta_scan_test.py index e9a9a86c..6b5d3f0a 100755 --- a/py-scripts/sta_scan_test.py +++ b/py-scripts/sta_scan_test.py @@ -14,22 +14,23 @@ License: Free to distribute and modify. LANforge systems must be licensed. import sys import os +import importlib if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) -if 'py-json' not in sys.path: -sys.path.append(os.path.join(os.path.abspath('..'), 'py-json')) - -if 'py-dashboard' not in sys.path: -sys.path.append(os.path.join(os.path.abspath('..'), 'py-dashboard')) - import argparse -from LANforge import LFUtils -from realm import Realm import time +sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) + +lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") +LFCliBase = lfcli_base.LFCliBase +realm = importlib.import_module("py-json.realm") +Realm = realm.Realm +LFUtils = importlib.import_module("py-json.LANforge.LFUtils") + class StaScan(Realm): def __init__(self, diff --git a/py-scripts/tip_station_powersave.py b/py-scripts/tip_station_powersave.py index 1401372e..40038802 100755 --- a/py-scripts/tip_station_powersave.py +++ b/py-scripts/tip_station_powersave.py @@ -5,6 +5,7 @@ import importlib import pprint import time import datetime +import argparse if sys.version_info[0] != 3: print("This script requires Python 3") @@ -380,6 +381,26 @@ class TIPStationPowersave(LFCliBase): self.sta_powersave_disabled_profile.cleanup(desired_stations=self.normal_sta_list) def main(): + + parser = argparse.ArgumentParser( + prog='tip_station_powersave.py', + formatter_class=argparse.RawTextHelpFormatter, + epilog='''\ + tip_station_powersave.py + + ''', + description='''\ +This script uses filters from realm's PacketFilter class to filter pcap output for specific packets. +Currently it uses a filter for association packets using wlan.fc.type_subtype<=3. It is also using a filter +for QOS Null packets using wlan.fc.type_subtype==44. Both filters are also looking for the existence of +either the station MAC or the AP MAC in wlan.addr +These are returned as an array of lines from the output in the format +$subtype $mac_addresses $wlan.fc.pwrmgt + +#Currently, this test can only be applied to UDP connections + ''') + args = parser.parse_args() + lfjson_host = "localhost" lfjson_port = 8080 #station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=4, padding_number_=10000) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 84058b9f..fa0464bb 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -464,7 +464,7 @@ class csv_sqlite_dash(): def main(): parser = argparse.ArgumentParser( - prog='kpi_csv_sq.py', + prog='lf_qa.py', formatter_class=argparse.RawTextHelpFormatter, epilog='''\ read kpi.csv into sqlite database , save png of history and preset on dashboard From 7f330a20536c4d29edb778b61b82e73a2f2f60f9 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 16:35:14 -0600 Subject: [PATCH 020/731] sta_connect_multi_example.py : added simple help Signed-off-by: Chuck SmileyRekiere --- py-scripts/sta_connect_multi_example.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/py-scripts/sta_connect_multi_example.py b/py-scripts/sta_connect_multi_example.py index 9c5dd040..05076429 100755 --- a/py-scripts/sta_connect_multi_example.py +++ b/py-scripts/sta_connect_multi_example.py @@ -3,6 +3,8 @@ import sys import os import importlib +import argparse + if sys.version_info[0] != 3: print("This script requires Python 3") @@ -20,6 +22,18 @@ StaConnect = sta_connect.StaConnect def main(): + parser = argparse.ArgumentParser( + prog='sta_connected_multip_example.py', + formatter_class=argparse.RawTextHelpFormatter, + epilog='''\ + sta_connected_multip_example.py + + ''', + description='''\ +Example of how to instantiate StaConnect and run the test + ''') + args = parser.parse_args() + # create multiple OPEN stations station_names = LFUtils.port_name_series(start_id=0, end_id=1) From 9d528702dd985cb893567b0044b59991b83c71d4 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 16:42:23 -0600 Subject: [PATCH 021/731] stations_connected.py : added argsparse --help Signed-off-by: Chuck SmileyRekiere --- py-scripts/stations_connected.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/py-scripts/stations_connected.py b/py-scripts/stations_connected.py index cbe37f49..0ce91c89 100755 --- a/py-scripts/stations_connected.py +++ b/py-scripts/stations_connected.py @@ -3,6 +3,7 @@ import sys import os import importlib +import argparse if sys.version_info[0] != 3: print("This script requires Python 3") @@ -46,6 +47,20 @@ class StationsConnected(LFCliBase): return counter def main(): + parser = argparse.ArgumentParser( + prog='stations_connected.py', + formatter_class=argparse.RawTextHelpFormatter, + epilog='''\ + stations_connected.py + + ''', + description='''\ +Contains examples of using realm to query stations and get specific information from them + ''') + # if args are added args=parser.parse_args() swap out next line + parser.parse_args() + + qstationsx = StationsConnected("localhost", 8080) bssid = "00:0E:8E:7B:DF:9B" if qstationsx.run(): From 8e78b7af2aa2916471c10fe4116200b77c1c871c Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 16:50:24 -0600 Subject: [PATCH 022/731] test_l3_powersave_traffic.py : added help sta_connect_multi_example.py : updated arsparse Signed-off-by: Chuck SmileyRekiere --- py-scripts/sta_connect_multi_example.py | 3 ++- py-scripts/test_l3_powersave_traffic.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/py-scripts/sta_connect_multi_example.py b/py-scripts/sta_connect_multi_example.py index 05076429..0e76de54 100755 --- a/py-scripts/sta_connect_multi_example.py +++ b/py-scripts/sta_connect_multi_example.py @@ -32,7 +32,8 @@ def main(): description='''\ Example of how to instantiate StaConnect and run the test ''') - args = parser.parse_args() + #args = parser.parse_args() - add this line if adding arguments + parser.parse_args() # create multiple OPEN stations station_names = LFUtils.port_name_series(start_id=0, end_id=1) diff --git a/py-scripts/test_l3_powersave_traffic.py b/py-scripts/test_l3_powersave_traffic.py index b87d419a..bb10c4de 100755 --- a/py-scripts/test_l3_powersave_traffic.py +++ b/py-scripts/test_l3_powersave_traffic.py @@ -4,6 +4,8 @@ import os import importlib import time import datetime +import argparse + if sys.version_info[0] != 3: print("This script requires Python 3") @@ -153,6 +155,19 @@ class L3PowersaveTraffic(LFCliBase): def main(): + parser = argparse.ArgumentParser( + prog='test_l3_powersave_traffic.py', + formatter_class=argparse.RawTextHelpFormatter, + epilog='''\ + test_l3_powersave_traffic.py + + ''', + description='''\ +Example of creating traffic on an l3 connection + ''') + #args = parser.parse_args() - add this line if adding arguments + parser.parse_args() + lfjson_host = "localhost" lfjson_port = 8080 # station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=4, padding_number_=10000) From ae3df346bb1d1ce2b313959744599a2ea640b3e7 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 17:15:36 -0600 Subject: [PATCH 023/731] moved html_template.py to sandbox until file reviewed Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => sandbox}/html_template.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-scripts/{ => sandbox}/html_template.py (100%) diff --git a/py-scripts/html_template.py b/py-scripts/sandbox/html_template.py similarity index 100% rename from py-scripts/html_template.py rename to py-scripts/sandbox/html_template.py From e5f231c679e0e977620902fd90dca5364fd95556 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 17:35:30 -0600 Subject: [PATCH 024/731] ftp_html.py moved to sandbox : will be used in the generic port Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => sandbox}/ftp_html.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-scripts/{ => sandbox}/ftp_html.py (100%) diff --git a/py-scripts/ftp_html.py b/py-scripts/sandbox/ftp_html.py similarity index 100% rename from py-scripts/ftp_html.py rename to py-scripts/sandbox/ftp_html.py From 65cda6e0a728e02238eacd00a3f5864c0ae88c1e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 17:42:19 -0600 Subject: [PATCH 025/731] cicd_testrailAndInfraSetup.py : moved to scripts deprecated Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => scripts_deprecated}/cicd_testrailAndInfraSetup.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-scripts/{ => scripts_deprecated}/cicd_testrailAndInfraSetup.py (100%) diff --git a/py-scripts/cicd_testrailAndInfraSetup.py b/py-scripts/scripts_deprecated/cicd_testrailAndInfraSetup.py similarity index 100% rename from py-scripts/cicd_testrailAndInfraSetup.py rename to py-scripts/scripts_deprecated/cicd_testrailAndInfraSetup.py From 0459f4201ae253559e0fe865d6fe0a2927d28096 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 17:44:33 -0600 Subject: [PATCH 026/731] cicd_TipIntegration.py , cicd_testrail.py : moved to scripts_deprecated Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => scripts_deprecated}/cicd_TipIntegration.py | 0 py-scripts/{ => scripts_deprecated}/cicd_testrail.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename py-scripts/{ => scripts_deprecated}/cicd_TipIntegration.py (100%) rename py-scripts/{ => scripts_deprecated}/cicd_testrail.py (100%) diff --git a/py-scripts/cicd_TipIntegration.py b/py-scripts/scripts_deprecated/cicd_TipIntegration.py similarity index 100% rename from py-scripts/cicd_TipIntegration.py rename to py-scripts/scripts_deprecated/cicd_TipIntegration.py diff --git a/py-scripts/cicd_testrail.py b/py-scripts/scripts_deprecated/cicd_testrail.py similarity index 100% rename from py-scripts/cicd_testrail.py rename to py-scripts/scripts_deprecated/cicd_testrail.py From 25b04f44d74c7ff9ace8fabba654a4784c8c9a09 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 17:46:32 -0600 Subject: [PATCH 027/731] lf_ftp_test.py : move to sandbox Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => sandbox}/lf_ftp_test.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-scripts/{ => sandbox}/lf_ftp_test.py (100%) diff --git a/py-scripts/lf_ftp_test.py b/py-scripts/sandbox/lf_ftp_test.py similarity index 100% rename from py-scripts/lf_ftp_test.py rename to py-scripts/sandbox/lf_ftp_test.py From 2a286d37e82a893178f65a784ceaf35dc8ac1255 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 17:48:23 -0600 Subject: [PATCH 028/731] ghost_profile.py moved to scripts deprecated ghost support suspended Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => scripts_deprecated}/ghost_profile.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-scripts/{ => scripts_deprecated}/ghost_profile.py (100%) diff --git a/py-scripts/ghost_profile.py b/py-scripts/scripts_deprecated/ghost_profile.py similarity index 100% rename from py-scripts/ghost_profile.py rename to py-scripts/scripts_deprecated/ghost_profile.py From d718160153e77a22ab6676390abf54b2be2caff4 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 17:52:34 -0600 Subject: [PATCH 029/731] download_test.py incomplete script moved to sandbox Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => sandbox}/download_test.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-scripts/{ => sandbox}/download_test.py (100%) diff --git a/py-scripts/download_test.py b/py-scripts/sandbox/download_test.py similarity index 100% rename from py-scripts/download_test.py rename to py-scripts/sandbox/download_test.py From 1fbadc99fb3526738a593581dddbf579db1b4164 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 27 Sep 2021 21:22:44 -0600 Subject: [PATCH 030/731] cv_to_grafana.py : updated for help to work Signed-off-by: Chuck SmileyRekiere --- py-scripts/cv_to_grafana.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/py-scripts/cv_to_grafana.py b/py-scripts/cv_to_grafana.py index 8be615e3..e15b0b5a 100755 --- a/py-scripts/cv_to_grafana.py +++ b/py-scripts/cv_to_grafana.py @@ -75,16 +75,20 @@ sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lf_wifi_capacity_test = importlib.import_module("py-scripts.lf_wifi_capacity_test") WiFiCapacityTest = lf_wifi_capacity_test.WiFiCapacityTest -cv_test_manager = importlib.import_module("py-scripts.cv_test_manager") +cv_test_manager = importlib.import_module("py-json.cv_test_manager") create_chamberview = importlib.import_module("py-scripts.create_chamberview") CreateChamberview = create_chamberview.CreateChamberview -DUT = create_chamberview.DUT +create_chamberview_dut = importlib.import_module("py-scripts.create_chamberview_dut") +DUT = create_chamberview_dut.DUT lf_dataplane_test = importlib.import_module("py-scripts.lf_dataplane_test") DataplaneTest = lf_dataplane_test.DataplaneTest grafana_profile = importlib.import_module("py-scripts.grafana_profile") UseGrafana = grafana_profile.UseGrafana lf_ap_auto_test = importlib.import_module("py-scripts.lf_ap_auto_test") +cv_add_base_parser = cv_test_manager.cv_add_base_parser + + def main(): parser = argparse.ArgumentParser( From e446aaed390d657a0ce0ae1435574cf8d31715ca Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Thu, 16 Sep 2021 10:52:49 -0700 Subject: [PATCH 031/731] LFRequest.py: error message prints out called URL Signed-off-by: Jed Reynolds --- py-json/LANforge/LFRequest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/py-json/LANforge/LFRequest.py b/py-json/LANforge/LFRequest.py index d64b2547..491557c0 100644 --- a/py-json/LANforge/LFRequest.py +++ b/py-json/LANforge/LFRequest.py @@ -381,6 +381,7 @@ def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, er xerrors.append("%s: %s" % (headername, err_headers.get(headername))) if len(xerrors) > 0: print(" = = LANforge Error Messages = =") + print(" = = URL: %s" % err_full_url) for xerr in xerrors: print(xerr) if (error_list_ is not None) and isinstance(error_list_, list): From 90232ed5ed4dea49813efa81a7be0a79b8bd2f45 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Thu, 16 Sep 2021 10:54:29 -0700 Subject: [PATCH 032/731] jbr_create_wanlink.py: testing out wanlink creating using autogen Signed-off-by: Jed Reynolds --- py-scripts/sandbox/jbr_create_wanlink.py | 98 ++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100755 py-scripts/sandbox/jbr_create_wanlink.py diff --git a/py-scripts/sandbox/jbr_create_wanlink.py b/py-scripts/sandbox/jbr_create_wanlink.py new file mode 100755 index 00000000..1a0fe9b7 --- /dev/null +++ b/py-scripts/sandbox/jbr_create_wanlink.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python3 +''' +NAME: jbr_create_wanlink.py + +PURPOSE: create a wanlink + +EXAMPLE: +$ ./jbr_create_wanlink.py --host ct521a-jana --wl_name snail + +To enable using lf_json_autogen in other parts of the codebase, set LF_USE_AUTOGEN=1: +$ LF_USE_AUTOGEN=1 ./jbr_jag_test.py --test set_port --host ct521a-lion + +NOTES: + + +TO DO NOTES: + +''' +import sys + +if sys.version_info[0] != 3: + print("This script requires Python3") + exit() + +sys.path.insert(1, "../../py-json") +import argparse +import pprint +from LANforge import lf_json_autogen +from LANforge.lf_json_autogen import LFJsonGet as LFG + + +# import LANforge.lfcli_base +# from LANforge.lfcli_base import LFCliBase + +# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- # + +# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- # +def main(): + parser = argparse.ArgumentParser( + prog=__file__, + formatter_class=argparse.RawTextHelpFormatter, + description='tests creating wanlink') + parser.add_argument("--host", help='specify the GUI to connect to, assumes port 8080') + parser.add_argument("--wl_name", help='name of the wanlink to create') + parser.add_argument("--resource", help='LANforge resource') + + args = parser.parse_args() + if not args.wl_name: + print("No wanlink name provided") + exit(1) + post_rq = lf_json_autogen.LFJsonPost(lfclient_host=args.host, + lfclient_port=8080, + debug_=False, + _exit_on_error=True) + get_request = LFG(lfclient_host=args.host, + lfclient_port=8080, + debug_=False, + _exit_on_error=True) + + post_rq.post_add_rdd(resource=args.resource, + port="rd0a", + peer_ifname="rd0b", + report_timer=1000, + shelf=1, + debug_=False) + post_rq.post_add_rdd(resource=args.resource, + port="rd1a", + peer_ifname="rd1b", + report_timer=1000, + shelf=1, + debug_=False) + endp_a = args.wl_name + "-A" + endp_b = args.wl_name + "-B" + post_rq.post_add_wl_endp(alias=endp_a, + resource=args.resource, + port="rd0a", + shelf=1, + debug_=False) + post_rq.post_add_wl_endp(alias=endp_b, + resource=args.resource, + port="rd1a", + shelf=1, + debug_=True) + post_rq.post_add_cx(alias=args.wl_name, + rx_endp=endp_a, + tx_endp=endp_b, + test_mgr="default_tm", + debug_=True) + + result = get_request.get_wl(eid_list=(args.wl_name)) + pprint.pprint(result) + result = get_request.get_wl_endp(eid_list=(args.wl_name+"-A", args.wl_name+"-B")) + pprint.pprint(result) + + +if __name__ == "__main__": + main() +# From 7d9ab67572c98be3ea5bc6dca9ae1630de74e78e Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Fri, 24 Sep 2021 00:42:18 -0700 Subject: [PATCH 033/731] GUI: jbr_create_wanlink.py WIP rewrote towards updated API Signed-off-by: Jed Reynolds --- py-scripts/sandbox/jbr_create_wanlink.py | 59 +++++++++++++++--------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/py-scripts/sandbox/jbr_create_wanlink.py b/py-scripts/sandbox/jbr_create_wanlink.py index 1a0fe9b7..d745504e 100755 --- a/py-scripts/sandbox/jbr_create_wanlink.py +++ b/py-scripts/sandbox/jbr_create_wanlink.py @@ -25,8 +25,9 @@ if sys.version_info[0] != 3: sys.path.insert(1, "../../py-json") import argparse import pprint -from LANforge import lf_json_autogen -from LANforge.lf_json_autogen import LFJsonGet as LFG +from LANforge.lf_json_autogen import LFSession +from LANforge.lf_json_autogen import LFJsonCommand +from LANforge.lf_json_autogen import LFJsonQuery # import LANforge.lfcli_base @@ -43,53 +44,65 @@ def main(): parser.add_argument("--host", help='specify the GUI to connect to, assumes port 8080') parser.add_argument("--wl_name", help='name of the wanlink to create') parser.add_argument("--resource", help='LANforge resource') + parser.add_argument("--debug", help='turn on debugging', action="store_true") args = parser.parse_args() if not args.wl_name: print("No wanlink name provided") exit(1) - post_rq = lf_json_autogen.LFJsonPost(lfclient_host=args.host, - lfclient_port=8080, - debug_=False, - _exit_on_error=True) - get_request = LFG(lfclient_host=args.host, - lfclient_port=8080, - debug_=False, - _exit_on_error=True) - post_rq.post_add_rdd(resource=args.resource, + session = LFSession(lfclient_url="http://%s:8080" % args.host, + debug=args.debug, + connection_timeout_sec=2.0, + stream_errors=True, + stream_warnings=True, + exit_on_error=True) + command: LFJsonCommand + command = session.get_command() + query: LFJsonQuery + query = session.get_query() + + + command.post_add_rdd(resource=args.resource, port="rd0a", peer_ifname="rd0b", report_timer=1000, shelf=1, - debug_=False) - post_rq.post_add_rdd(resource=args.resource, + debug_=args.debug) + + command.post_add_rdd(resource=args.resource, port="rd1a", peer_ifname="rd1b", report_timer=1000, shelf=1, - debug_=False) + debug_=args.debug) + endp_a = args.wl_name + "-A" endp_b = args.wl_name + "-B" - post_rq.post_add_wl_endp(alias=endp_a, + command.post_add_wl_endp(alias=endp_a, resource=args.resource, port="rd0a", shelf=1, - debug_=False) - post_rq.post_add_wl_endp(alias=endp_b, + debug_=args.debug) + command.post_add_wl_endp(alias=endp_b, resource=args.resource, port="rd1a", shelf=1, - debug_=True) - post_rq.post_add_cx(alias=args.wl_name, + debug_=args.debug) + command.post_add_cx(alias=args.wl_name, rx_endp=endp_a, tx_endp=endp_b, test_mgr="default_tm", - debug_=True) - - result = get_request.get_wl(eid_list=(args.wl_name)) + debug_=args.debug) + ewarn_list = [] + result = query.get_wl(eid_list=(args.wl_name), + wait_sec=0.2, + timeout_sec=2.0, + errors_warnings=ewarn_list, + debug=args.debug) pprint.pprint(result) - result = get_request.get_wl_endp(eid_list=(args.wl_name+"-A", args.wl_name+"-B")) + result = query.get_wl_endp(eid_list=(args.wl_name+"-A", args.wl_name+"-B"), + debug=args.debug) pprint.pprint(result) From 17d4f6d1e2544b093685f94895b904891116151c Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 27 Sep 2021 23:33:23 -0700 Subject: [PATCH 034/731] jbr_create_wanlink.py: adds parameter requiring session creation Signed-off-by: Jed Reynolds --- py-scripts/sandbox/jbr_create_wanlink.py | 1 + 1 file changed, 1 insertion(+) diff --git a/py-scripts/sandbox/jbr_create_wanlink.py b/py-scripts/sandbox/jbr_create_wanlink.py index d745504e..49de010c 100755 --- a/py-scripts/sandbox/jbr_create_wanlink.py +++ b/py-scripts/sandbox/jbr_create_wanlink.py @@ -56,6 +56,7 @@ def main(): connection_timeout_sec=2.0, stream_errors=True, stream_warnings=True, + require_session=True, exit_on_error=True) command: LFJsonCommand command = session.get_command() From cadd7d581cedb15ac5130483cefea7005a9c41aa Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 28 Sep 2021 01:06:46 -0700 Subject: [PATCH 035/731] jbr_create_wanlink.py: many arguments are actually string typed Signed-off-by: Jed Reynolds --- py-scripts/sandbox/jbr_create_wanlink.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/py-scripts/sandbox/jbr_create_wanlink.py b/py-scripts/sandbox/jbr_create_wanlink.py index 49de010c..a7dcf4a5 100755 --- a/py-scripts/sandbox/jbr_create_wanlink.py +++ b/py-scripts/sandbox/jbr_create_wanlink.py @@ -63,38 +63,37 @@ def main(): query: LFJsonQuery query = session.get_query() - command.post_add_rdd(resource=args.resource, port="rd0a", peer_ifname="rd0b", - report_timer=1000, - shelf=1, - debug_=args.debug) + report_timer="1000", + shelf="1", + debug=args.debug) command.post_add_rdd(resource=args.resource, port="rd1a", peer_ifname="rd1b", report_timer=1000, shelf=1, - debug_=args.debug) + debug=args.debug) endp_a = args.wl_name + "-A" endp_b = args.wl_name + "-B" command.post_add_wl_endp(alias=endp_a, resource=args.resource, port="rd0a", - shelf=1, - debug_=args.debug) + shelf="1", + debug=args.debug) command.post_add_wl_endp(alias=endp_b, resource=args.resource, port="rd1a", - shelf=1, - debug_=args.debug) + shelf="1", + debug=args.debug) command.post_add_cx(alias=args.wl_name, rx_endp=endp_a, tx_endp=endp_b, test_mgr="default_tm", - debug_=args.debug) + debug=args.debug) ewarn_list = [] result = query.get_wl(eid_list=(args.wl_name), wait_sec=0.2, @@ -103,6 +102,8 @@ def main(): debug=args.debug) pprint.pprint(result) result = query.get_wl_endp(eid_list=(args.wl_name+"-A", args.wl_name+"-B"), + wait_sec=0.2, + timeout_sec=15.0, debug=args.debug) pprint.pprint(result) From 7bfc9ee7e0ec37cd915ea1973743e719ae1b63ff Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 28 Sep 2021 01:13:00 -0700 Subject: [PATCH 036/731] lf_json_autogen.py: significant updates from the jag-2021-09-27 branch - parameter types - stand-alone request management - session token - expanded class hierarchy: BaseSession <- LFSession, LFBaseRequest <- JsonQuery <- LFJsonQuery LFBaseRequest <- JsonCommand <- LFJsonCommand Signed-off-by: Jed Reynolds --- py-json/LANforge/lf_json_autogen.py | 12060 +++++++++++++++----------- 1 file changed, 7052 insertions(+), 5008 deletions(-) diff --git a/py-json/LANforge/lf_json_autogen.py b/py-json/LANforge/lf_json_autogen.py index 7d3cb307..73af189a 100644 --- a/py-json/LANforge/lf_json_autogen.py +++ b/py-json/LANforge/lf_json_autogen.py @@ -1,67 +1,823 @@ #!/usr/bin/env python3 """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated by LANforge JsonApiPythonGenerator, Mon Sep 13 15:28:41 PDT 2021 - - - WORK IN PROGRESS - - - The API this library provides is actively being changed. - This file expects to live in py-json/LANforge directory. + + LANforge-GUI Source Code + Copyright (C) 1999-2021 Candela Technologies Inc + http:www.candelatech.com + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + Contact: Candela Technologies if you have any + questions. + + LANforge JSON API + + A distinct difference from previous LF scripts is the notion of a session. + Please create a session instance before connecting to your LANforge client. + The session is informative for a GUI user how many scripts are actively + using the GUI. It also provides logging to diagnose how many scripts are + potentially accessing the GUI at the same time. + + EXAMPLE PYTHON USAGE: + ----- ----- ----- 8< ----- ----- ----- 8< ----- ----- ----- + session = LFSession(lfclient_url="http://localhost:8080", + connect_timeout_sec=20, + proxy_map={ + 'http':'http://192.168.1.250:3128' + }, + debug=True, + die_on_error=False); + lf_command = session.get_command() + full_response = [] + first_response = lf_command.json_post( url="/nc_show_ports", + post_data={ + "shelf": 1, + "resource": 1, + "ports": "all" + }, + full_response) + pprint(first_response) + + lf_query = session.get_query() + response = lf_query.get_as_json(url="/port/1/1/list", + debug=True) + pprint(response) + ----- ----- ----- 8< ----- ----- ----- 8< ----- ----- ----- + + The API that this library provides is ACTIVELY BEING CHANGED. + + MAINTENANCE: + To maintain this library, please refer to these files: + * client/candela/lanforge/json_api.py + - the basis for many of the auto-generated python classes + that follow after these class definitions. + * client/candela/lanforge/JsonApiPythonGenerator.java + - the builder class that produces lf_json_autogen + The file json_api.py is intended to be bundled in lfclient.jar and + not to be extracted. It is sourced during build by the JsonApiPythonGenerator + class which appends subclasses to it. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" +import http.client import sys -import os -import importlib -from enum import Enum -from enum import IntFlag if sys.version_info[0] != 3: print("This script requires Python 3") exit() - -sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) +import urllib +from urllib import request +from urllib import error +from urllib import parse +from http.client import HTTPResponse -lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") -LFCliBase = lfcli_base.LFCliBase +import json +import logging +from logging import Logger +import time +import traceback +# from typing import Type +from datetime import datetime +from enum import IntFlag +from pprint import pprint +from pprint import pformat +from enum import Enum -class LFJsonGet(LFCliBase): - def __init__(self, lfclient_host='localhost', - lfclient_port=8080, - debug_=False, - _exit_on_error=False, - _exit_on_fail=False, - _proxy_str=None, - _capture_signal_list=()): - super().__init__(_lfjson_host=lfclient_host, - _lfjson_port=lfclient_port, - _debug=debug_, - _exit_on_error=_exit_on_error, - _exit_on_fail=_exit_on_fail, - _proxy_str=_proxy_str, - _capture_signal_list=_capture_signal_list) +SESSION_HEADER = 'X-LFJson-Session' +LOGGER = Logger('json_api') - @staticmethod - def extract_values(response: dict = None, +def _now_ms() -> int: + return round(time.time() * 1000) + + +def _now_sec() -> int: + return round(time.time() * 1000 * 1000) + + +def _is(text: str) -> bool: + if text is None: + return False + if (len(text) == 0) or (text.strip() == ""): + return False + return True + + +def _not(text: str) -> bool: + return not _is(text=text) + + +def default_proxies() -> dict: + return { + # 'http': 'http://example.com', + # 'https': 'https://example.com' + } + + +def print_diagnostics(url_: str = None, + request_: urllib.request.Request = None, + responses_: list = None, + error_=None, + error_list_: list = None, + debug_: bool = False, + die_on_error_: bool = False): + if debug_: + print("::print_diagnostics: error_.__class__: %s" % error_.__class__) + pprint(error_) + + if url_ is None: + print("WARNING:print_diagnostics: url_ is None") + if request_ is None: + print("WARNING:print_diagnostics: request_ is None") + if error_ is None: + print("WARNING:print_diagnostics: error_ is None") + + method = 'NA' + if hasattr(request_, 'method'): + method = request_.method + err_code = 0 + err_reason = 'NA' + err_headers = [] + err_full_url = url_ + if hasattr(error_, 'code'): + err_code = error_.code + if hasattr(error_, 'reason'): + err_reason = error_.reason + if hasattr(error_, 'headers'): + err_headers = error_.headers + if hasattr(error_, 'get_full_url'): + err_full_url = error_.get_full_url() + xerrors = [] + if err_code == 404: + xerrors.append("[%s HTTP %s] <%s> : %s" % (method, err_code, err_full_url, err_reason)) + else: + if len(err_headers) > 0: + for headername in sorted(err_headers.keys()): + if headername.startswith("X-Error-"): + xerrors.append("%s: %s" % (headername, err_headers.get(headername))) + if len(xerrors) > 0: + print(" = = LANforge Error Messages = =") + print(" = = URL: %s" % err_full_url) + for xerr in xerrors: + print(xerr) + if (error_list_ is not None) and isinstance(error_list_, list): + error_list_.append(xerr) + print(" = = = = = = = = = = = = = = = =") + + if error_.__class__ is urllib.error.HTTPError: + if debug_: + print("----- HTTPError: ------------------------------------ print_diagnostics:") + print("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) + + if err_code == 404: + if (error_list_ is not None) and isinstance(error_list_, list): + error_list_.append("[%s HTTP %s] <%s> : %s" % (method, err_code, err_full_url, err_reason)) + else: + if debug_: + print(" Content-type:[%s] Accept[%s]" % ( + request_.get_header('Content-type'), request_.get_header('Accept'))) + + if hasattr(request_, "data") and (request_.data is not None): + print(" Data:") + pprint(request_.data) + elif debug_: + print(" ") + + if debug_ and (len(err_headers) > 0): + # the HTTPError is of type HTTPMessage a subclass of email.message + print(" Response Headers: ") + for headername in sorted(err_headers.keys()): + print(" %s: %s" % (headername, err_headers.get(headername))) + + if len(responses_) > 0: + print("----- Response: --------------------------------------------------------") + pprint(responses_[0].reason) + if debug_: + print("------------------------------------------------------------------------") + if die_on_error_: + exit(1) + return + + if error_.__class__ is urllib.error.URLError: + print("----- URLError: ---------------------------------------------") + print("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) + print("------------------------------------------------------------------------") + if die_on_error_: + exit(1) + +class Logg: + DEFAULT_LEVEL = logging.WARNING + + def __init__(self, + log_level: int = DEFAULT_LEVEL, + name: str = None, + debug: bool = False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Base class that can be used to send logging messages elsewhere. extend this + in order to send log messages from this framework elsewhere. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + self.level = log_level + self.logger : Logger + + self.start_time = datetime.now() + self.start_time_str = time.strftime("%Y%m%d-%I:%M%:%S") + if name: + self.name = name + if "@" in name: + self.name = name.replace('@', self.start_time_str) + else: + self.name = "started-" + self.start_time_str + self.logger = Logger(name, level=log_level) + + if debug: + self.logg(level=logging.WARNING, message="Logger begun: " + self.name) + + def logg(self, + level: int = logging.WARNING, + message: str = None): + """ + + :param level: python logging priority + :param message: text to send to logging channel + :return: None + """ + if _not(message): + return + if level == logging.CRITICAL: + self.logger.critical(message) + + if level == logging.ERROR: + self.logger.error(message) + + if level == logging.WARNING: + self.logger.warning(message) + + if level == logging.INFO: + self.logger.info(message) + + if level == logging.DEBUG: + self.logger.debug(message) + + + def error(self, message: str = None): + if not message: + return + self.logg(level=logging.ERROR, message=message) + + def warning(self, message: str = None): + if not message: + return + self.logg(level=logging.WARNING, message=message) + + def info(self, message: str = None): + if not message: + return + self.logg(level=logging.INFO, message=message) + + def debug(self, message: str = None): + if not message: + return + self.logg(level=logging.DEBUG, message=message) + + +class BaseLFJsonRequest: + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Perform HTTP get/post/put/delete with extensions specific to LANforge JSON + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + No_Data: dict = {'No Data': 0} + OK_STATUSES = (100, 200, 201, 204, 205, 206, 301, 302, 303, 304, 307, 308, 404) + subclasses = [] + + def __init_subclass__(cls, **kwargs): + super().__init_subclass__(**kwargs) + cls.subclasses.append(cls) + + def __init__(self, + session_obj: 'BaseSession' = None, + debug: bool = False, + stream_errors: bool = True, + stream_warnings: bool = False, + exit_on_error: bool = False): + self.default_headers: dict = {'Accept': 'application/json'} + self.debug_on: bool = False + self.error_list: list = [] + # post_data: dict = No_Data + self.proxies_installed: bool = False + self.session_instance: 'BaseSession' + self.session_instance = None + self.stream_errors: bool = True + self.stream_warnings: bool = False + + if not session_obj: + LOGGER.warning("BaseLFJsonRequest: no session instance") + else: + self.session_instance = session_obj + self.session_id = session_obj.get_session_id() + self.proxies_installed = session_obj.proxies_installed + + self.die_on_error: bool + self.die_on_error = exit_on_error + if session_obj: + self.die_on_error |= session_obj.is_exit_on_error() + + self.lfclient_url = session_obj.get_lfclient_url() + + self.stream_errors = stream_errors + self.warnings = [] + self.stream_warnings = stream_warnings + self.logger = Logg(name="LFJsonRequest-@", debug=debug) + self.debug_on = debug + + def get_corrected_url(self, + url: str = None, + debug: bool = False): + """ + + :param url: If you have a session you can provide the abbreviated URL optionally starting with a slash + :param debug: turn on debugging + :return: full url prepended with + """ + if _not(url): + raise Exception("%s: Bad url[%s]" % (__name__, url)) + + corrected_url: str = url + + if not url.startswith(self.session_instance.get_lfclient_url()): + if url.startswith('/'): + corrected_url = self.session_instance.get_lfclient_url() + url + else: + corrected_url = self.session_instance.get_lfclient_url() + '/' + url + + if _not(corrected_url): + raise Exception("%s: Bad url[%s]" % (__name__, url)) + + if corrected_url.find('//'): + protopos = corrected_url.find("://") + corrected_url = corrected_url[:protopos + 2] + corrected_url[protopos + 2:].replace("//", "/") + + # finding '#' prolly indicates a macvlan (eth1#0) + # finding ' ' prolly indicates a field name that should imply %20 + if corrected_url.find('#') >= 1: + corrected_url = corrected_url.replace('#', '%23') + if corrected_url.find(' ') >= 1: + corrected_url = corrected_url.replace(' ', '%20') + if debug: + self.logger.debug("%s: url [%s] now [%s]" % (str(__class__), url, corrected_url)) + return corrected_url + + def add_error(self, message: str = None): + if not message: + return + if self.stream_errors: + self.logger.error(message=message) + self.error_list.append(message) + + def add_warning(self, message: str = None): + self.logger.warning(message) + if self.stream_errors: + self.logger.warning(message=message) + self.warnings.append(message) + + def get_errors(self) -> list: + return self.error_list + + def get_warnings(self) -> list: + return self.warnings + + def clear_warnings_errors(self, flush_to_session=False): + """ erase errors and warnings """ + if flush_to_session: + if not self.session_instance: + self.logger.error(message="cannot flush messages to session when there is no session instance") + else: + self.session_instance.session_error_list.extend(self.error_list) + self.session_instance.session_warnings_list.extend(self.warnings) + self.error_list = [] + self.warnings = [] + self.logger.info(message='BaseLFJsonRequest.clear()') + + def extract_values(self, + response: dict = None, singular_key: str = None, plural_key: str = None) -> list: """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Extract fields from this response using the expected keys: ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if (singular_key is None) or (plural_key is None) or (not singular_key) or (not plural_key): - raise ValueError("extract_values wants non-empty response, singular_key and plural_key") - if (singular_key in response) and (not response[singular_key]): - return [] - elif (singular_key in response) and (type(response[singular_key]) is dict): - return [response[singular_key]] - elif (plural_key in response) and (not response[plural_key]): - return [] - else: - return response[plural_key] + if not singular_key: + raise ValueError("extract_values wants non-empty singular_key") + if not plural_key: + raise ValueError("extract_values wants non-empty plural_key") + + if singular_key not in response: + if plural_key not in response: + self.add_warning("response did not contain <{}> or <{}>".format(singular_key, plural_key)) + return [] + if not response[plural_key]: + self.add_warning("response[{}] is empty".format(plural_key)) + return response[plural_key] + if not response[singular_key]: + self.add_warning("response[{}] is empty".format(singular_key)) + return response[singular_key] + + def form_post(self, + url: str = None, + post_data: dict = None, + debug: bool = False, + die_on_error_: bool = False): + die_on_error_ |= self.die_on_error + debug |= self.debug_on + responses = [] + # https://stackoverflow.com/a/59635684/11014343 + if (self.session_instance.proxy_map is not None) and (len(self.session_instance.proxy_map) > 0): + # https://stackoverflow.com/a/59635684/11014343 + opener = request.build_opener(request.ProxyHandler(self.session_instance.proxy_map)) + request.install_opener(opener) + + if debug: + self.logger.debug("formPost: url: " + url) + if (post_data is not None) and (post_data is not self.No_Data): + urlenc_data = urllib.parse.urlencode(post_data).encode("utf-8") + if debug: + self.logger.debug("formPost: data looks like:" + str(urlenc_data)) + print("formPost: url: " + url) + myrequest = request.Request(url=url, + data=urlenc_data, + headers=self.default_headers) + else: + myrequest = request.Request(url=url, headers=self.default_headers) + self.logger.info("json_post: No data sent to [%s]" % url) + + myrequest.headers['Content-type'] = 'application/x-www-form-urlencoded' + + try: + resp = urllib.request.urlopen(myrequest) + responses.append(resp) + return responses[0] + + except urllib.error.HTTPError as herror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=herror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error_) + if die_on_error_ and (herror.code != 404): + exit(1) + except urllib.error.URLError as uerror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=uerror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error_) + if die_on_error_: + exit(1) + if die_on_error_: + exit(1) + return None + + def json_post(self, + url: str = "", + post_data: dict = None, + debug: bool = False, + die_on_error: bool = False, + response_json_list: list = None, + method_: str = 'POST', + session_id_: str = ""): + """ + + :param url: URL to post to + :param post_data: data to send in post + :param debug: turn on diagnostics + :param die_on_error: exit() if the return status is not 200 + :param response_json_list: list of result data + :param method_: override HTTP method, please do not override + :param session_id_: insert a session to the header; this is useful in the case where we are + operating outside a session context, like during the __del__ constructor + :return: returns first set of http.client.HTTPResponse data + """ + debug |= self.debug_on + die_on_error |= self.die_on_error + + if self.session_id != self.session_instance.get_session_id(): + self.logger.error("BaseLFJsonRequest.session_id[%s] != session.get_session_id: [%s]" + % (self.session_id, self.session_instance.get_session_id())) + if die_on_error: + exit(1) + responses = [] + url = self.get_corrected_url(url) + if (post_data is not None) and (post_data is not self.No_Data): + myrequest = request.Request(url=url, + method=method_, + data=json.dumps(post_data).encode("utf-8"), + headers=self.default_headers) + else: + myrequest = request.Request(url=url, + headers=self.default_headers, + method=method_, + data=post_data) + self.logger.info("json_post: empty post sent to [%s]" % url) + + myrequest.headers['Content-type'] = 'application/json' + sess_id = self.session_instance.get_session_id() + if _is(sess_id): + myrequest.headers[SESSION_HEADER] = str(sess_id) + elif _is(session_id_): + myrequest.headers[SESSION_HEADER] = str(session_id_) + else: + self.logger.warning("Request sent without X-LFJson-ID header: "+url) + if debug: + self.logger.warning("json_post headers to "+url) + self.logger.warning(pformat(myrequest.headers)) + + # https://stackoverflow.com/a/59635684/11014343 + + resp: http.client.HTTPResponse + try: + resp = urllib.request.urlopen(myrequest) + resp_data = resp.read().decode('utf-8') + if debug and die_on_error: + self.logger.debug(__name__+" ----- json_post: debug: --------------------------------------------") + self.logger.debug("URL: %s :%d " % (url, resp.status)) + self.logger.debug(__name__+" ----- headers -------------------------------------------------") + if resp.status != 200: + self.logger.error(pformat(resp.getheaders())) + self.logger.error(__name__+" ----- response -------------------------------------------------") + self.logger.error(pformat(resp_data)) + self.logger.error(" ----- -------------------------------------------------") + responses.append(resp) + headers = resp.getheaders() + if debug: + self.logger.warning("response headers:") + self.logger.warning(pformat(headers)) + if SESSION_HEADER in headers: + if self.session_id != headers[SESSION_HEADER]: + self.logger.warning("established session header [%s] different from response session header[%s]" + % (self.session_id, headers[SESSION_HEADER])) + if response_json_list is not None: + if type(response_json_list) is not list: + raise ValueError("reponse_json_list needs to be type list") + jzon_str = json.loads(resp_data) + if debug: + self.logger.debug(__name__+":----- json_post debug: --------------------------------------------") + self.logger.debug("URL: %s :%d " % (url, resp.status)) + self.logger.debug(__name__+" ----- headers -------------------------------------------------") + self.logger.debug(pformat(resp.getheaders())) + self.logger.debug(__name__+" ----- response -------------------------------------------------") + self.logger.debug(pformat(jzon_str)) + self.logger.debug("-------------------------------------------------") + response_json_list.append(jzon_str) + if resp.status not in self.OK_STATUSES: + self.logger.debug("----------------- BAD STATUS --------------------------------") + if die_on_error: + exit(1) + return responses[0] + + except urllib.error.HTTPError as herror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=herror, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + + except urllib.error.URLError as uerror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=uerror, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + + if die_on_error: + exit(1) + return None + + def json_put(self, + url: str = None, + debug: bool = False, + die_on_error: bool = False, + response_json_list: list = None): + if not url: + raise ValueError("json_put requires url") + return self.json_post(url=url, + debug=debug | self.debug_on, + die_on_error=die_on_error | self.die_on_error, + response_json_list=response_json_list, + method_='PUT') + + def json_delete(self, + url: str = None, + debug: bool = False, + die_on_error: bool = False): + return self.get_as_json(url=url, + debug=debug | self.debug_on, + die_on_error=die_on_error, + method_='DELETE') + + def get(self, + url: str = None, + debug: bool = False, + die_on_error: bool = False, + method_: str = 'GET', + connection_timeout_sec: int = None): + """ + Makes a HTTP GET request with specified timeout. + :param url: Fully qualified URL to request + :param debug: if true, print out diagnostic information + :param die_on_error: call exit() if query fails to connect, is a 400 or 500 response status. + Responses with 404 status are expected to be normal and will not cause an exit. + :param method_: Override the HTTP METHOD. Please do not override. + :param connection_timeout_sec: number of seconds to have an outstanding request + :return: returns an urllib.response or None + """ + debug |= self.debug_on + die_on_error |= self.die_on_error + + if debug: + self.logger.debug(message="%s url:[%s]" % (__name__, url)) + + if not connection_timeout_sec: + if self.session_instance.get_timeout_sec(): + connection_timeout_sec = self.session_instance.get_timeout_sec() + else: + connection_timeout_sec = 120 + + requested_url = self.get_corrected_url(url, + debug=debug | self.debug_on) + myrequest = request.Request(url=requested_url, + headers=self.default_headers, + method=method_) + if connection_timeout_sec: + myrequest.timeout = connection_timeout_sec + + myresponses = [] + try: + myresponses.append(request.urlopen(myrequest)) + return myresponses[0] + + except urllib.error.HTTPError as herror: + print_diagnostics(url_=requested_url, + request_=myrequest, + responses_=myresponses, + error_=herror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + except urllib.error.URLError as uerror: + print_diagnostics(url_=requested_url, + request_=myrequest, + responses_=myresponses, + error_=uerror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + if die_on_error: + exit(1) + return None + + def get_as_json(self, + url: str = None, + die_on_error: bool = False, + debug: bool = False, + timeout_sec: float = None, + method_='GET'): + """ + :param url: url to do GET request on + :param die_on_error: exit immediate if result status is BAD RESPONSE + :param debug: print diagnostic information about query + :param timeout_sec: number of seconds to wait for a response + :param method_: Overrides the HTTP method used. Please do not override. + :return: get request as Json data + """ + responses = [] + j = self.get(url=url, + debug=debug, + die_on_error=die_on_error, + connection_timeout_sec=timeout_sec, + method_=method_) + responses.append(j) + if len(responses) < 1: + if debug and self.has_errors(): + self.print_errors() + return None + + if responses[0] is None: + if debug: + self.logger.debug(message="No response from " + url) + return None + json_data = json.loads(responses[0].read().decode('utf-8')) + return json_data + + def json_get(self, + url: str = None, + debug: bool = False, + wait_sec: float = None, + request_timeout_sec: float = None, + max_timeout_sec: float = None, + errors_warnings: list = None): + """ + Returns json record from GET request. This will retry until timeout_sec + :param url: URL to make GET request to + :param debug: print diagnostic information if true + :param wait_sec: time to wait before making request, or waiting until you get a non-404 response + :param request_timeout_sec: maximum time each request can take + :param max_timeout_sec: maximum time to spend making requests + :param errors_warnings: if present, fill this with error and warning messages from the response JSON + :return: dictionary of json response from server + """ + debug |= self.debug_on + json_response = None + if not max_timeout_sec: + max_timeout_sec = self.session_instance.max_timeout_sec + + if _not(url): + raise ValueError("json_get called withou url") + + url = self.get_corrected_url(url=url) + + deadline_sec: float = (_now_ms() * 1000) + max_timeout_sec + self.error_list.clear() + attempt_counter = 1 + while _now_sec() < deadline_sec: + time.sleep(wait_sec) + try: + json_response = self.get_as_json(url=url, + debug=debug, + die_on_error=False, + timeout_sec=request_timeout_sec) + if debug: + self.logger.debug("[%s] json_get: URL[%s]" % (attempt_counter, url)) + self.logger.debug(pformat(json_response)) + if json_response is None: + if errors_warnings: + errors_warnings.append("No json_response") + errors_warnings.extend(self.error_list) + if debug: + if hasattr(self, 'print_errors'): + self.print_errors() + else: + self.logger.error("json_get: [%s] no response, check other errors" % url) + time.sleep(wait_sec) + return None + else: + return json_response + except ValueError as ve: + if debug or self.die_on_error: + self.logger.error("json_get: [%s] " % url) + self.logger.error("Exception %s:" % ve) + self.logger.error(traceback.format_exception(ValueError, ve, ve.__traceback__, chain=True)) + # traceback.print_exception(ValueError, ve, ve.__traceback__, chain=True) + if self.die_on_error: + sys.exit(1) + return json_response + + # def set_post_data(self, data): + # """ + # :param data: dictionary of parameters for post + # :return: nothing + # """ + # self.post_data = data + + def has_errors(self): + return (True, False)[len(self.error_list) > 0] + + def print_errors(self): + if not self.has_errors: + self.logger.debug("---------- no errors ----------") + return + for err in self.error_list: + Logg.error("error: %s" % err) - # TODO: rename me to make_port_eid_url @staticmethod - def make_eid_url(eid_list=()): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Convert a list of EIDs into a URL: - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def create_port_eid_url(eid_list: list = None) -> str: + """ ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Convert a list of EIDs into a URL: + :param eid_list + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- """ if not len(eid_list): return "/list" url = "/" @@ -69,2424 +825,41 @@ class LFJsonGet(LFCliBase): return url + eid_list.replace('.', '/') # The first in a series has to define the resource number, - # but the remainder of a series has to match that resource number + # but the remainder of a series has to match that resource number for i in range(0, len(eid_list)): eid = eid_list[i] if i == 0: url += eid.replace('.', '/') elif eid.find('.') > 0: - url += ',' + eid.split('.')[-1] + url += str(',' + eid.split('.')[-1]) else: - url += ','+eid - + url += str(',' + eid) return url - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - If you need to call the URL directly, - request one of these URLs: - /attenuator/ - /attenuator/$shelf_id - /attenuator/$shelf_id/$resource_id - /attenuator/$shelf_id/$resource_id/$port_id - /attenuators/ - /attenuators/$shelf_id - /attenuators/$shelf_id/$resource_id - /attenuators/$shelf_id/$resource_id/$port_id - When requesting specific column names, they need to be URL encoded: - entity+id, module+1, module+2, module+3, module+4, module+5, module+6, module+7, - module+8, name, script, state, temperature - Example URL: /attenuator?fields=entity+id,module+1 - - Example py-json call (it knows the URL): - record = LFJsonGet.get_attenuator(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'entity id': # Entity ID - 'module 1': # Reported attenuator dB settings. - 'module 2': # Reported attenuator dB settings. - 'module 3': # Reported attenuator dB settings. - 'module 4': # Reported attenuator dB settings. - 'module 5': # Reported attenuator dB settings. - 'module 6': # Reported attenuator dB settings. - 'module 7': # Reported attenuator dB settings. - 'module 8': # Reported attenuator dB settings. - 'name': # Attenuator module identifier (shelf . resource . serial-num). - 'script': # Attenuator script state. - 'state': # Attenuator state. - 'temperature': # Temperature in degres Farenheight reported in Attenuator unit. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_attenuator(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/attenuator" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="attenuator", - plural_key="attenuators") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /chamber/ - /chamber/$chamber_name - - When requesting specific column names, they need to be URL encoded: - chamber, chamber+connections, chamber+resources, chamber+type, duts, entity+id, - flags, hide, isolation, marked, open, reported+rotation+%28deg%29, reported+rpm, - reported+tilt+%28deg%29, resource, rotation+%28deg%29, rpm, smas, tilt+%28deg%29, turntable, - turntable+type, virtual - Example URL: /chamber?fields=chamber,chamber+connections - - Example py-json call (it knows the URL): - record = LFJsonGet.get_chamber(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'chamber': # - - 'chamber connections': # - - 'chamber resources': # - - 'chamber type': # - - 'duts': # - - 'entity id': # - - 'flags': # - - 'hide': # - - 'isolation': # - - 'marked': # - - 'open': # - - 'reported rotation (deg)': # - - 'reported rpm ': # - - 'reported tilt (deg)': # - - 'resource': # - - 'rotation (deg)': # - - 'rpm': # - - 'smas': # - - 'tilt (deg)': # - - 'turntable': # - - 'turntable type': # - - 'virtual': # - - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_chamber(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/chamber" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="chamber", - plural_key="chambers") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /control/$command - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_control(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_control(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/control" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /cx/ - /cx/$cx_id - - When requesting specific column names, they need to be URL encoded: - avg+rtt, bps+rx+a, bps+rx+b, drop+pkts+a, drop+pkts+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, - entity+id, name, pkt+rx+a, pkt+rx+b, rpt+timer, rx+drop+%25+a, rx+drop+%25+b, - state, type - Example URL: /cx?fields=avg+rtt,bps+rx+a - - Example py-json call (it knows the URL): - record = LFJsonGet.get_cx(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'avg rtt': # Average Round-Trip-Time (latency) for this connection (ms). - 'bps rx a': # Endpoint A's real receive rate (bps). - 'bps rx b': # Endpoint B's real receive rate (bps). - 'drop pkts a': # The number of packets Endpoint B sent minus the number Endpoint A - # received.This number is not 100% correct as long as packets are in - # flight.After a Quiesce of the test, the number should be perfectly - # accurate. - 'drop pkts b': # The number of packets Endpoint A sent minus the number Endpoint B - # received.This number is not 100% correct as long as packets are in - # flight.After a Quiesce of the test, the number should be perfectly - # accurate. - 'eid': # Cross Connect's Name. - 'endpoints (a ↔ b)': # Endpoints that make up this Cross Connect. - 'entity id': # Cross Connect's Name. - 'name': # Cross Connect's Name. - 'pkt rx a': # Endpoint A's Packets Recieved. - 'pkt rx b': # Endpoint B's Packets Recieved. - 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI - # will ask for updates from the LANforge processes.If the GUI is sluggish, - # increasing the report timers may help. - 'rx drop % a': # Endpoint A percentage packet loss.Calculated using the number of PDUs - # Endpoint B sent minus the number Endpoint A received.This number is not - # 100% correct as long as packets are in flight.After a Quiesce of the - # test, the number should be perfectly accurate. - 'rx drop % b': # Endpoint B percentage packet loss.Calculated using the number of PDUs - # Endpoint A sent minus the number Endpoint B received.This number is not - # 100% correct as long as packets are in flight.After a Quiesce of the - # test, the number should be perfectly accurate. - 'state': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - 'type': # Cross-Connect type. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_cx(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/cx" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /dut/ - /dut/$name - - When requesting specific column names, they need to be URL encoded: - api+version, bssid-1, bssid-2, bssid-3, bssid-4, bssid-5, bssid-6, bssid-7, - bssid-8, dut, eap-id, entity+id, hw+info, image+file, lan, mgt+ip, model+number, - notes, num+ant+radio+1, num+ant+radio+2, num+ant+radio+3, password-1, password-2, - password-3, password-4, password-5, password-6, password-7, password-8, serial+number, - serial+port, ssid-1, ssid-2, ssid-3, ssid-4, ssid-5, ssid-6, ssid-7, ssid-8, - sw+info, wan - Example URL: /dut?fields=api+version,bssid-1 - - Example py-json call (it knows the URL): - record = LFJsonGet.get_dut(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'api version': # API Version - 'bssid-1': # WiFi BSSID for DUT. - 'bssid-2': # WiFi BSSID for DUT. - 'bssid-3': # WiFi BSSID for DUT. - 'bssid-4': # WiFi BSSID for DUT. - 'bssid-5': # WiFi BSSID for DUT. - 'bssid-6': # WiFi BSSID for DUT. - 'bssid-7': # WiFi BSSID for DUT. - 'bssid-8': # WiFi BSSID for DUT. - 'dut': # Devices Under Test - 'eap-id': # EAP Identifier, only used when one of the EAP options are selected. - 'entity id': # Entity ID - 'hw info': # DUT Hardware Info - 'image file': # Image file name. Relative paths assume directory /home/lanforge. Fully - # qualified pathnames begin with a slash (eg - # /usr/lib/share/icons/icon.png).File format should be PNG, JPG or BMP. - 'lan': # IP/Mask for LAN port (192.168.2.1/24). - 'mgt ip': # DUT Management IP address. - 'model number': # DUT model number or product name - 'notes': # Notes - 'num ant radio 1': # Antenna count for DUT radio(s). - 'num ant radio 2': # Antenna count for DUT radio(s). - 'num ant radio 3': # Antenna count for DUT radio(s). - 'password-1': # WiFi Password needed to connect to DUT. - 'password-2': # WiFi Password needed to connect to DUT. - 'password-3': # WiFi Password needed to connect to DUT. - 'password-4': # WiFi Password needed to connect to DUT. - 'password-5': # WiFi Password needed to connect to DUT. - 'password-6': # WiFi Password needed to connect to DUT. - 'password-7': # WiFi Password needed to connect to DUT. - 'password-8': # WiFi Password needed to connect to DUT. - 'serial number': # DUT Identifier (serial-number, or similar) - 'serial port': # Resource and name of LANforge serial port that connects to this DUT. - # (1.1.ttyS0). Does not need to belong to lan_port or wan_port resource. - 'ssid-1': # WiFi SSID advertised by DUT. - 'ssid-2': # WiFi SSID advertised by DUT. - 'ssid-3': # WiFi SSID advertised by DUT. - 'ssid-4': # WiFi SSID advertised by DUT. - 'ssid-5': # WiFi SSID advertised by DUT. - 'ssid-6': # WiFi SSID advertised by DUT. - 'ssid-7': # WiFi SSID advertised by DUT. - 'ssid-8': # WiFi SSID advertised by DUT. - 'sw info': # DUT Software Info - 'wan': # IP/Mask for WAN port (192.168.3.2/24). - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_dut(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/dut" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="dut", - plural_key="duts") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /endp/ - /endp/$endp_id - - When requesting specific column names, they need to be URL encoded: - 1st+rx, a%2Fb, bursty, crc+fail, cwnd, cx+active, cx+estab, cx+estab%2Fs, cx+to, - delay, destination+addr, dropped, dup+pkts, eid, elapsed, entity+id, jitter, - max+pdu, max+rate, min+pdu, min+rate, mng, name, ooo+pkts, pattern, pdu%2Fs+rx, - pdu%2Fs+tx, pps+rx+ll, pps+tx+ll, rcv+buf, replays, run, rx+ber, rx+bytes, - rx+drop+%25, rx+dup+%25, rx+ooo+%25, rx+pdus, rx+pkts+ll, rx+rate, rx+rate+%281%C2%A0min%29, - rx+rate+%28last%29, rx+rate+ll, rx+wrong+dev, script, send+buf, source+addr, - tcp+mss, tcp+rtx, tx+bytes, tx+pdus, tx+pkts+ll, tx+rate, tx+rate+%281%C2%A0min%29, - tx+rate+%28last%29, tx+rate+ll # hidden columns: - drop-count-5m, latency-5m, rt-latency-5m, rx-silence-5m - Example URL: /endp?fields=1st+rx,a%2Fb - - Example py-json call (it knows the URL): - record = LFJsonGet.get_endp(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - '1st rx': # Miliseconds between starting the endpoint and receiving the first - # packet.Note that LANforge UDP connections (not including multicast) will - # wait 20msbefore sending first frame to make sure receiver has adequate - # time to start. - 'a/b': # Display side (A or B) for the endpoint. - 'bursty': # Is the transmit rate bursty or not? - 'crc fail': # Total packets received with a bad payload CRC. - 'cwnd': # Sender's TCP Current Window Size. In units of Maximum Segment Size. - 'cx active': # Total number of active connections for this endpoint. - 'cx estab': # Total times the connection between the endpoints has been established. - 'cx estab/s': # Connections established per second, averaged over the last 30 seconds. - 'cx to': # Number of TCP connection attemtps timed out by LANforge. - 'delay': # Average latency in milliseconds for packets received by this endpoint. - 'destination addr': # Destination Address (MAC, ip/port, VoIP destination). - 'dropped': # Total dropped packets, as identified by gaps in packet sequence numbers. - 'dup pkts': # Total duplicate packets received. Only an estimate, but never less than - # this value. - 'eid': # Entity ID - 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) - 'entity id': # Entity ID - 'jitter': # Exponential decaying average jitter calculated per RFC3393(old_jitter * - # 15/16 + new_jitter * 1/16) - 'max pdu': # The maximum write size.For Ethernet protocols, this is the entire - # Ethernet frame. For UDP, it is the UDP payload size, and for TCP, it - # just means the maximum amount of data that is written per socket - # write.In all cases, the packets on the wire will not exceed theport's - # MTU + Ethernet-Header-Size (typically 1514 for Ethernet) - 'max rate': # Maximum desired transmit rate, in bits per second (bps). - 'min pdu': # The minimum write size.For Ethernet protocols, this is the entire - # Ethernet frame. For UDP, it is the UDP payload size, and for TCP, it - # just means the maximum amount of data that is written per socket - # write.In all cases, the packets on the wire will not exceed theport's - # MTU + Ethernet-Header-Size (typically 1514 for Ethernet) - 'min rate': # Minimum desired transmit rate, in bits per second (bps). - 'mng': # Is the Endpoint managed or not? - 'name': # Endpoint's Name. - 'ooo pkts': # Total out of order packets received. Only an estimate, but never less - # than this value. - 'pattern': # Pattern of bytes this endpoint transmits. - 'pdu/s rx': # Received PDU per second.This counts the protocol reads, such as UDP - # PDUs. - 'pdu/s tx': # Transmitted PDU per second.This counts the protocol writes, such as UDP - # PDUs. - 'pps rx ll': # Estimated total received packets per second (on the wire).For TCP, this - # is an estimate.UDP and Ethernet protocols should be quite accurate on - # normal networks. - 'pps tx ll': # Estimated total transmitted packets per second (on the wire).For TCP, - # this is an estimate.UDP and Ethernet protocols should be quite accurate - # on normal networks. - 'rcv buf': # Configured/Actual values for receiving buffer size (bytes). - 'replays': # Total number of files replayed. - 'run': # Is the Endpoint is Running or not. - 'rx ber': # Received bit-errors. These are only calculated in the LANforge payload - # portion starting 28 bytes into the UDP or TCP payload. In addition, the - # bit-errors are only checked when LANforge CRCis enabled and detected to - # be invalid. If the 28-byte header is corrupted, LANforge will not - # detectit, and may also give false positives for other packet errors. - # Bit-Errors are only calculated forcertain payload patterns: Increasing, - # Decreasing, Zeros, Ones, and the PRBS patterns. - 'rx bytes': # Total received bytes count. - 'rx drop %': # Percentage of packets that should have been received by Endpoint, but - # were not, as calculated by the Cross-Connect. - 'rx dup %': # Percentage of duplicate packets, as detected by sequence numbers. - 'rx ooo %': # Percentage of packets received out of order, as detected by sequence - # numbers. - 'rx pdus': # Total received PDU count.This counts the protocol reads, such as UDP - # PDUs (aka goodput). - 'rx pkts ll': # Estimated total received packet count (on the wire).For TCP, this is an - # estimate.UDP and Ethernet protocols should be quite accurate on normal - # networks. - 'rx rate': # Real receive rate (bps) for this run.This includes only the protocol - # payload (goodput). - 'rx rate (1 min)': # Real receive rate (bps) over the last minute.This includes only the - # protocol payload (goodput). - 'rx rate (last)': # Real receive rate (bps) over the last report interval.This includes only - # the protocol payload (goodput). - 'rx rate ll': # Estimated low-level receive rate (bps) over the last minute.This - # includes any Ethernet, IP, TCP, UDP or similar headers. - 'rx wrong dev': # Total packets received on the wrong device (port). - 'script': # Endpoint script state. - 'send buf': # Configured/Actual values for sending buffer size (bytes). - 'source addr': # - 'tcp mss': # Sender's TCP-MSS (max segment size) setting.This cooresponds to the - # TCP_MAXSEGS socket option,and TCP-MSS plus 54 is the maximum packet size - # on the wirefor Ethernet frames.This is a good option to efficiently - # limit TCP packet size. - 'tcp rtx': # Total packets retransmitted by the TCP stack for this connection.These - # were likely dropped or corrupted in transit. - 'tx bytes': # Total transmitted bytes count. - 'tx pdus': # Total transmitted PDU count.This counts the protocol writes, such as UDP - # PDUs (aka goodput). - 'tx pkts ll': # Estimated total transmitted packet count (on the wire).For TCP, this is - # an estimate.UDP and Ethernet protocols should be quite accurate on - # normal networks. - 'tx rate': # Real transmit rate (bps) for this run.This includes only the protocol - # payload (goodput). - 'tx rate (1 min)': # Real transmit rate (bps) over the last minute.This includes only the - # protocol payload (goodput). - 'tx rate (last)': # Real transmit rate (bps) over the last report interval.This includes - # only the protocol payload (goodput). - 'tx rate ll': # Estimated low-level transmit rate (bps) over the last minute.This - # includes any Ethernet, IP, TCP, UDP or similar headers. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_endp(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/endp" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoint") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /events/ - /events/$event_id - /events/before/$event_id - /events/between/$start_event_id/$end_event_id - /events/last/$event_count - /events/since/$event_id - - When requesting specific column names, they need to be URL encoded: - eid, entity+id, event, event+description, id, name, priority, time-stamp, - type - Example URL: /events?fields=eid,entity+id - - Example py-json call (it knows the URL): - record = LFJsonGet.get_events(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'eid': # Time at which this event was created.This uses the clock on the source - # machine. - 'entity id': # Entity IdentifierExact format depends on the - # type.(shelf.resource.port.endpoint.extra) - 'event': # Event Type - 'event description': # Text description for this event. - 'id': # Unique ID for this event. - 'name': # Name of the entity associated with this event. - 'priority': # Event priority. - 'time-stamp': # Time at which this event was created.This uses the clock on the source - # machine. - 'type': # Entity type. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_events(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/events" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="alert", - plural_key="alerts") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /fileio/ - /fileio/$endp_id - - When requesting specific column names, they need to be URL encoded: - buf-rd, buf-wr, bytes-rd, bytes-wr, crc+fail, eid, entity+id, files+%23, files-read, - files-wr, io+fail, max-file-sz, max-rd-bps, max-rw-sz, max-wr-bps, min-file-sz, - min-rd-bps, min-rw-sz, min-wr-bps, name, read-bps, rpt+timer, rx-bps-20s, - status, tx-bps-20s, type, write-bps - Example URL: /fileio?fields=buf-rd,buf-wr - - Example py-json call (it knows the URL): - record = LFJsonGet.get_fileio(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'buf-rd': # Buffer reads. When doing CRC, it takes two reads per 'packet', because - # we first read the header, then the payload. Non-CRC reads ignore the - # header. - 'buf-wr': # Buffer writes. - 'bytes-rd': # Bytes read. - 'bytes-wr': # Bytes written. - 'crc fail': # 32-bit CRC Errors detected upon READ. - 'eid': # Entity ID - 'entity id': # Entity ID - 'files #': # Number of files to write. - 'files-read': # Files read. - 'files-wr': # Files written. - 'io fail': # Amount of time in miliseconds this test has been experiencing IO - # failures. - 'max-file-sz': # Maximum configured file size (bytes). - 'max-rd-bps': # Maximum configured read rate (bps). - 'max-rw-sz': # Maximum configured size for each call to read(2) or write(2) (bytes). - 'max-wr-bps': # Maximum configured write rate (bps). - 'min-file-sz': # Minimum configured file size (bytes). - 'min-rd-bps': # Minimum configured read rate (bps). - 'min-rw-sz': # Minimum configured size for each call to read(2) or write(2) (bytes). - 'min-wr-bps': # Minimum configured write rate (bps). - 'name': # File Endpoint's Name. - 'read-bps': # File read rate for this endpoint over the duration of the test. - 'rpt timer': # Report Timer (milliseconds).This is how often the GUI will ask for - # updates from the LANforge processes.If the GUI is sluggish, increasing - # the report timers may help. - 'rx-bps-20s': # File read rate for this endpoint over the last 20 seconds. - 'status': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - 'tx-bps-20s': # File write rate for this endpoint over the last 20 seconds. - 'type': # The specific type of this File Endpoint. - 'write-bps': # File write rate for this endpoint over the duration of the test. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_fileio(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/fileio" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoint") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /generic/ - /generic/$endp_id - - When requesting specific column names, they need to be URL encoded: - bps+rx, bps+tx, command, dropped, eid, elapsed, entity+id, last+results, - name, pdu%2Fs+rx, pdu%2Fs+tx, rpt+timer, rpt%23, rx+bytes, rx+pkts, status, tx+bytes, - tx+pkts, type - Example URL: /generic?fields=bps+rx,bps+tx - - Example py-json call (it knows the URL): - record = LFJsonGet.get_generic(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'bps rx': # Receive rate reported by this endpoint. - 'bps tx': # Transmit rate reported by this endpoint. - 'command': # The command that this endpoint executes. - 'dropped': # Dropped PDUs reported by this endpoint. - 'eid': # Entity ID - 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) - 'entity id': # Entity ID - 'last results': # Latest output from the Generic Endpoint. - 'name': # Endpoint's Name. - 'pdu/s rx': # Received packets-per-second reported by this endpoint. - 'pdu/s tx': # Transmitted packets-per-second reported by this endpoint. - 'rpt timer': # Report Timer (milliseconds).This is how often the GUI will ask for - # updates from the LANforge processes.If the GUI is sluggish, increasing - # the report timers may help. - 'rpt#': # The N_th report that we have received. (Some cmds will produce only one - # report, others will produce continuous reports.) - 'rx bytes': # Received bytes reported by this endpoint. - 'rx pkts': # Received PDUs reported by this endpoint. - 'status': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - 'tx bytes': # Transmitted bytes reported by this endpoint. - 'tx pkts': # Transmitted PDUs reported by this endpoint. - 'type': # The specific type of this Generic Endpoint. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_generic(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/generic" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoints") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /gui-cli/ - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_gui_cli(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_gui_cli(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/gui-cli" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /layer4/ - /layer4/$endp_id - - When requesting specific column names, they need to be URL encoded: - %21conn, acc.+denied, bad-proto, bad-url, bytes-rd, bytes-wr, dns-avg, dns-max, - dns-min, eid, elapsed, entity+id, fb-avg, fb-max, fb-min, ftp-host, ftp-port, - ftp-stor, http-p, http-r, http-t, login-denied, name, nf+%284xx%29, other-err, - read, redir, rpt+timer, rslv-h, rslv-p, rx+rate, rx+rate+%281%C2%A0min%29, status, - timeout, total-err, total-urls, tx+rate, tx+rate+%281%C2%A0min%29, type, uc-avg, - uc-max, uc-min, urls%2Fs, write # hidden columns: - rpt-time - Example URL: /layer4?fields=%21conn,acc.+denied - - Example py-json call (it knows the URL): - record = LFJsonGet.get_layer4(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - '!conn': # Could not establish connection. - 'acc. denied': # Access Access Denied Error.This could be password, user-name, - # file-permissions or other error. - 'bad-proto': # Bad protocol. - 'bad-url': # Bad URL format. - 'bytes-rd': # Bytes read. - 'bytes-wr': # Bytes written. - 'dns-avg': # Average time in milliseconds to complete resolving the DNS lookupfor the - # last 100 requests. - 'dns-max': # Maximum time in milliseconds to complete resolving the DNS lookupfor - # requests made in the last 30 seconds. - 'dns-min': # Minimum time in milliseconds to complete resolving the DNS lookupfor - # requests made in the last 30 seconds. - 'eid': # EID - 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) - 'entity id': # Entity ID - 'fb-avg': # Average time in milliseconds for receiving the first byte of the URLfor - # the last 100 requests. - 'fb-max': # Maximum time in milliseconds for receiving the first byte of the URLfor - # requests made in the last 30 seconds. - 'fb-min': # Minimum time in milliseconds for receiving the first byte of the URLfor - # requests made in the last 30 seconds. - 'ftp-host': # FTP HOST Error - 'ftp-port': # FTP PORT Error. - 'ftp-stor': # FTP STOR Error. - 'http-p': # HTTP Post error. - 'http-r': # HTTP RANGE error. - 'http-t': # HTTP PORT Error. - 'login-denied': # Login attempt was denied.Probable cause is user-name or password errors. - 'name': # Endpoint's Name. - 'nf (4xx)': # File not found.For HTTP, an HTTP 4XX error was returned. This is only - # counted when the endpoint has 'Enable 4XX' selected.Includes 403 - # permission denied and 404 not found errors.For other protocols, it - # should be returned any time a file is not found. - 'other-err': # Error not otherwise specified. The actual error code may be found - # inl4helper logs. Contact support if you see these errors:we would like - # to account for all possible errors. - 'read': # Error attempting to read file or URL. - 'redir': # Noticed redirect loop! - 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI - # will ask for updates from the LANforge processes.If the GUI is sluggish, - # increasing the report timers may help. - 'rslv-h': # Couldn't resolve host. - 'rslv-p': # Couldn't resolve Proxy. - 'rx rate': # Payload receive rate (bps). - 'rx rate (1 min)': # Payload receive rate over the last minute (bps). - 'status': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - 'timeout': # Operation timed out. - 'total-err': # Total Errors. - 'total-urls': # URLs processed. - 'tx rate': # Payload transmit rate (bps). - 'tx rate (1 min)': # Payload transmit rate over the last minute (bps). - 'type': # The specific type of this Layer 4-7 Endpoint. - 'uc-avg': # Average time in milliseconds to complete processing of the URLfor the - # last 100 requests. - 'uc-max': # Maximum time in milliseconds to complete processing of the URLfor - # requests made in the last 30 seconds. - 'uc-min': # Minimum time in milliseconds to complete processing of the URLfor - # requests made in the last 30 seconds. - 'urls/s': # URLs processed per second over the last minute. - 'write': # Error attempting to write file or URL. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_layer4(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/layer4" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoint") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /port/ - /port/$shelf_id - /port/$shelf_id/$resource_id - /port/$shelf_id/$resource_id/$port_id - /portprobe/ - /portprobe/$shelf_id/$resource_id/$port_id - /ports/ - /ports/$shelf_id - /ports/$shelf_id/$resource_id - /ports/$shelf_id/$resource_id/$port_id - - When requesting specific column names, they need to be URL encoded: - 4way+time+%28us%29, activity, alias, anqp+time+%28us%29, ap, beacon, bps+rx, bps+rx+ll, - bps+tx, bps+tx+ll, bytes+rx+ll, bytes+tx+ll, channel, collisions, connections, - crypt, cx+ago, cx+time+%28us%29, device, dhcp+%28ms%29, down, entity+id, gateway+ip, - ip, ipv6+address, ipv6+gateway, key%2Fphrase, login-fail, login-ok, logout-fail, - logout-ok, mac, mask, misc, mode, mtu, no+cx+%28us%29, noise, parent+dev, phantom, - port, port+type, pps+rx, pps+tx, qlen, reset, retry+failed, rx+bytes, rx+crc, - rx+drop, rx+errors, rx+fifo, rx+frame, rx+length, rx+miss, rx+over, rx+pkts, - rx-rate, sec, signal, ssid, status, time-stamp, tx+abort, tx+bytes, tx+crr, - tx+errors, tx+fifo, tx+hb, tx+pkts, tx+wind, tx-failed+%25, tx-rate, wifi+retries, - # hidden columns: - beacon_rx_signal, port_cur_flags_h, port_cur_flags_l, port_supported_flags_h, - port_supported_flags_l, resource, rx_multicast, tx_dropped - Example URL: /port?fields=4way+time+%28us%29,activity - - Example py-json call (it knows the URL): - record = LFJsonGet.get_port(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - '4way time (us)': # TIme (in micro-seconds) it took to complete the last WiFi 4-way - # authentication. - 'activity': # Percent of the channel that is utilized over the last minute.This - # includes locally generated traffic as well as anyother systems active on - # this channel.This is a per-radio value. - 'alias': # User-specified alias for this Port. - 'anqp time (us)': # Time (in micro-seconds) it took to complete the last WiFi ANQP - # request/response session. - 'ap': # BSSID of AP for connected stations. - 'beacon': # Number of Wireless beacons from Cell or AP that have been missed. - 'bps rx': # Average bits per second received for the last 30 seconds. - 'bps rx ll': # Bits per second received, including low-level framing (Ethernet Only). - 'bps tx': # Average bits per second transmitted for the last 30 seconds. - 'bps tx ll': # Bits per second transmitted, including low-level framing (Ethernet - # Only). - 'bytes rx ll': # Bytes received, including low-level framing (Ethernet Only). - 'bytes tx ll': # Bytes transmitted, including low-level framing (Ethernet Only). - 'channel': # Channel at the device is currently on, if known. - 'collisions': # Total number of collisions reported by this Interface.For WiFi devices, - # this is number of re-transmit attempts. - 'connections': # Number of wireless connections completed. - 'crypt': # Number of Wireless packets dropped due to inability to decrypt. - 'cx ago': # How long ago was the last WiFi connection attempt started?This relates - # only to the network interface, not any higher level protocol traffic - # upon it. - 'cx time (us)': # Time (in micro-seconds) it took to complete the last WiFi connection to - # the AP. - 'device': # Ethernet device name, as seen by the kernel. - 'dhcp (ms)': # Time (in miliseconds) it took to acquire DHCP lease,or to time out while - # trying to acquire lease. - 'down': # The interface is configured DOWN. It must be configured UP to be in - # active use. - 'entity id': # Entity ID - 'gateway ip': # Default Router/Gateway IP for the Interface. - 'ip': # IP Address of the Interface. - 'ipv6 address': # IPv6 Address for this interface. If global-scope address exists, it - # will be displayed,otherwise link-local will be displayed. - 'ipv6 gateway': # IPv6 default gateway. - 'key/phrase': # WEP Key or WPA Phrase (if enabled). - 'login-fail': # The 'ifup-post' script reported failure. This is usually used for WiFi - # portallogins, but may be customized by the user for other needs. - 'login-ok': # The 'ifup-post' script reported OK. This is usually used for WiFi - # portallogins, but may be customized by the user for other needs. - 'logout-fail': # The 'ifup-post --logout' script reported failure. This is usually used - # for WiFi portallogouts, but may be customized by the user for other - # needs. - 'logout-ok': # The 'ifup-post --logout' script reported OK. This is usually used for - # WiFi portallogouts, but may be customized by the user for other needs. - 'mac': # Ethernet MAC address of the Interface. - 'mask': # IP Mask of the Interface. - 'misc': # Number of Wireless packets dropped on receive due to unspecified - # reasons. - 'mode': # Wireless radio mode (802.11a/b/g). - 'mtu': # MTU (Maximum Transmit Unit) size, in bytes. - 'no cx (us)': # How long was the WiFi disconnect duration for the last disconnection? - 'noise': # Wireless noise level. - 'parent dev': # Parent device or port of this port. Blank if this device is not a child - # of another device or port. - 'phantom': # Is the port PHANTOM (no hardware found) or not. - 'port': # Entity ID - 'port type': # Ports can be Ethernet, Radio, vAP, vSTA, Redirect, or Bridges - 'pps rx': # Average packets per second received for the last 30 seconds. - 'pps tx': # Average packets per second transmitted for the last 30 seconds. - 'qlen': # "Transmit Queue Length for this Interface. - 'reset': # Current Reset-State. - 'retry failed': # Number of Wireless packets that the interface failed to send due to - # excessive retries. - 'rx bytes': # Total number of bytes received by this Interface. - 'rx crc': # Total number of packets dropped because of a bad CRC/FCS. - 'rx drop': # Total number of dropped packets on recieve. Usually means driver/kernel - # is being over-worked. - 'rx errors': # Total number of all types of Receive Errors. - 'rx fifo': # Total number of packets dropped because driver/kernel queues are full. - 'rx frame': # Total number of packets dropped because of framing errors at the - # physical layer. - 'rx length': # Total number of packets dropped because their length was invalid. - 'rx miss': # Total number of packets dropped because of a missed interrupt. - 'rx over': # Total number of packets dropped because of framing errors at the - # physical layer. - 'rx pkts': # Total number of packets received by this Interface. - 'rx-rate': # Reported network device RX link speed. - 'sec': # Number of secondary IP addresses configured or detected. - 'signal': # Wireless signal strength (RSSI). - 'ssid': # WiFi SSID identifier.Use [BLANK] for empty SSID, which means use any - # available SSID when associating. - 'status': # Wireless link status. - 'time-stamp': # Time-Stamp - 'tx abort': # Total packets dropped on transmit because of driver abort. - 'tx bytes': # Total number of bytes sent by this Interface. - 'tx crr': # Total packets dropped on transmit because of carrier error. - 'tx errors': # Total number of all types of Transmit Errors. - 'tx fifo': # Total packets dropped on transmit because outgoing queue was full. - 'tx hb': # Total packets dropped on transmit because of transceiver heartbeat - # errors. - 'tx pkts': # Total number of packets sent by this Interface. - 'tx wind': # Total number dropped on transmit because of Out-of-Window collision. - 'tx-failed %': # Percentage of transmitted Wireless packets that were not ACKed.They - # might have succeeded on retry. - 'tx-rate': # Reported network device TX link speed. - 'wifi retries': # Number of Wireless packets that the wifi radio retried.One packet may be - # tried multiple times and each try would be counted in this stat.Not all - # radios can properly report this statistic. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_port(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/port" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="interface", - plural_key="interfaces") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /probe/ - /probe/$shelf_id/$resource_id/$port_id - - When requesting specific column names, they need to be URL encoded: - entity+id, probe+results - Example URL: /probe?fields=entity+id,probe+results - - Example py-json call (it knows the URL): - record = LFJsonGet.get_probe(eid_list=['1.234', '1.344'], - requested_col_names=['probe results'], - debug_=True) - - The record returned will have these members: - { - 'entity id': # Entity ID - 'probe results': # Probe the low level information about the port. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_probe(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/probe" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="probe-results", - plural_key="probe-results") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /quit - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_quit(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_quit(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/quit" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /radiostatus/ - /radiostatus/$eid - /radiostatus/$shelf_id/$resource_id/$port_id - - When requesting specific column names, they need to be URL encoded: - _links, antenna, ap, capabilities, channel, country, driver, entity+id, firmware+version, - frag, frequency, max_sta, max_vap, max_vifs, monitors_down, monitors_up, - phantom, port, resource, rts, stations_down, stations_up, tx-power, vaps_down, - vaps_up, verbose+debug - Example URL: /radiostatus?fields=_links,antenna - - Example py-json call (it knows the URL): - record = LFJsonGet.get_radiostatus(eid_list=['1.234', '1.344'], - requested_col_names=['firmware version'], - debug_=True) - - The record returned will have these members: - { - '_links': # - - 'antenna': # - - 'ap': # - - 'capabilities': # - - 'channel': # - - 'country': # - - 'driver': # - - 'entity id': # - - 'firmware version': # - - 'frag': # - - 'frequency': # - - 'max_sta': # - - 'max_vap': # - - 'max_vifs': # - - 'monitors_down': # - - 'monitors_up': # - - 'phantom': # - - 'port': # - - 'resource': # - - 'rts': # - - 'stations_down': # - - 'stations_up': # - - 'tx-power': # - - 'vaps_down': # - - 'vaps_up': # - - 'verbose debug': # - - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_radiostatus(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/radiostatus" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="radio", - plural_key="radios") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /resource/ - /resource/$shelf_id - /resource/$shelf_id/$resource_id - - When requesting specific column names, they need to be URL encoded: - bps-rx-3s, bps-tx-3s, cli-port, cpu, ctrl-ip, ctrl-port, eid, entity+id, - free+mem, free+swap, gps, hostname, hw+version, load, max+if-up, max+staged, - mem, phantom, ports, rx+bytes, shelf, sta+up, sw+version, swap, tx+bytes, - # hidden columns: - timestamp - Example URL: /resource?fields=bps-rx-3s,bps-tx-3s - - Example py-json call (it knows the URL): - record = LFJsonGet.get_resource(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'bps-rx-3s': # Rate in bits-per-second that the manager issending management data to - # the resource, averaged over the last 3 seconds.This is TCP payload data, - # and does not count the IP and Ethernet overhead. - 'bps-tx-3s': # Rate in bits-per-second that the manager isreceiving management data - # from the resource, averaged over the last 3 seconds.This is TCP payload - # data, and does not count the IP and Ethernet overhead. - 'cli-port': # Text (telnet) interface IP Port. - 'cpu': # CPU information for the machine. - 'ctrl-ip': # IP Address of the Control Interface. - 'ctrl-port': # Binary interface IP Port. - 'eid': # Resource EID (Shelf.Resource). - 'entity id': # Entity ID - 'free mem': # Free Memory (Kbytes) in the machine. If this is too low, performance - # will be degraded. - 'free swap': # Free Swap (Kbytes) in the machine. If this is too low, performance will - # be degraded. - 'gps': # GPS Info for this machine, if GPS is attached. - 'hostname': # The name for this resource, as reported by the resource. - 'hw version': # Hardware version on the machine. - 'load': # Unix process load.. - 'max if-up': # Max number of interface-config scripts try to run at once. - 'max staged': # Max number of interfaces the system will try to bringup at once. - 'mem': # Total memory (Kbytes) on the machine. - 'phantom': # Is the resource PHANTOM (undiscovered) or not. - 'ports': # All real and phantom ports on this machine. - 'rx bytes': # Total management TCP payload bytes received from the manager process by - # this resource. - 'shelf': # Number of shelf that this resource belongs to. - 'sta up': # Max number of stations to bring up per radio per 0.25s tick. - 'sw version': # LANforge Software version running on the machine. - 'swap': # Total swap space (Kbytes) on the machine. - 'tx bytes': # Total management TCP payload bytes sent from this resource to the - # manager process. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_resource(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/resource" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="resource", - plural_key="resources") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /scan-results/ - /scan-results/$shelf_id/$resource_id/$port_id - /scan-results/$shelf_id/$resource_id/$port_id/$bssid - /scan/ - /scan/$shelf_id/$resource_id/$port_id - /scan/$shelf_id/$resource_id/$port_id/$bssid - /scanresults/ - /scanresults/$shelf_id/$resource_id/$port_id - /scanresults/$shelf_id/$resource_id/$port_id/$bssid - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_scan(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_scan(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/scan" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="scan-results", - plural_key="scan-results") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /stations/ - /stations/$mac - - When requesting specific column names, they need to be URL encoded: - ap, auth-for, capabilities, entity+id, idle, roam-duration, rx+bytes, rx+pkts, - rx+rate, signal, station+bssid, tx+bytes, tx+pkts, tx+rate, tx+retries, tx-failed, - - Example URL: /stations?fields=ap,auth-for - - Example py-json call (it knows the URL): - record = LFJsonGet.get_stations(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'ap': # The Port that owns this station. - 'auth-for': # Duration in seconds this station has been authenticated. - 'capabilities': # Station's negotiated capabilities. - 'entity id': # Entity ID - 'idle': # Miliseconds since this station last received a frame from the peer. - 'roam-duration': # The difference between the authenticate-time on the new APand the last - # frame received on old AP, in milliseconds.It is not always possible to - # compute this accurately,especially if traffic is not flowing during the - # roam. - 'rx bytes': # RX Byte counter for this station. - 'rx pkts': # RX Packets counter for this station. - 'rx rate': # Station last received encoding rate. - 'signal': # Station signal quality. - 'station bssid': # Station's MAC address (BSSID). - 'tx bytes': # TX Byte counter for this station. - 'tx pkts': # TX Packets counter for this station. - 'tx rate': # Station transmit encoding rate. - 'tx retries': # TX Retries counter for this station.This counts retries at the driver - # level.Retries made by the WiFi hardware and/or firmware is not counted. - 'tx-failed': # TX Failed counter for this station.This counts TX failures at the driver - # level.The hardware and/or firmware may have made several failed attempts - # that are not included in this counter. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_stations(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/stations" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="station", - plural_key="stations") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /status-msg/ - /status-msg/$session - /status-msg/$session/$id - /status-msg/$session/$id/ws-msg,... - /status-msg/$session/all - /status-msg/$session/this - /status-msg/sessions - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_status_msg(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_status_msg(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/status-msg" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="sessions/messages", - plural_key="sessions/messages") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /test-group/ - /test-group/$id - /test-groups/ - /test-groups/$id - - When requesting specific column names, they need to be URL encoded: - cross+connects, entity+id, name, run, script - Example URL: /test-group?fields=cross+connects,entity+id - - Example py-json call (it knows the URL): - record = LFJsonGet.get_test_group(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'cross connects': # List of Test Manager's Cross-Connects. - 'entity id': # Entity ID - 'name': # Test Group's Name. - 'run': # Is Test Group running or not. - 'script': # Endpoint script state. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_test_group(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/test-group" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="groups", - plural_key="groups") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /text/ - /text/$group - /text/$group/$class - /text/$group/$class/$key - - When requesting specific column names, they need to be URL encoded: - eid, name, text, type - Example URL: /text?fields=eid,name - - Example py-json call (it knows the URL): - record = LFJsonGet.get_text(eid_list=['1.234', '1.344'], - requested_col_names=['text'], - debug_=True) - - The record returned will have these members: - { - 'eid': # - - 'name': # - - 'text': # - - 'type': # - - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_text(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/text" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="record", - plural_key="records") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /voip-endp/ - /voip-endp/$endp_id - /voip-ep/ - /voip-ep/$endp_id - /voip/ - /voip/$cx_id - /voip_endp/ - /voip_endp/$endp_id - /voip_ep/ - /voip_ep/$endp_id - - When requesting specific column names, they need to be URL encoded: - bps+rx+a, bps+rx+b, delay+a+%E2%86%90+b, delay+a+%E2%86%92+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, - entity+id, jitter+a+%E2%86%90+b, jitter+a+%E2%86%92+b, name, pkt+tx+a%C2%A0%E2%86%90%C2%A0b, - pkt+tx+a%C2%A0%E2%86%92%C2%A0b, rpt+timer, rx+drop+%25+a, rx+drop+%25+b, state, - type - Example URL: /voip?fields=bps+rx+a,bps+rx+b - - Example py-json call (it knows the URL): - record = LFJsonGet.get_voip(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'bps rx a': # Endpoint B's real transmit rate (bps).Measured at the CX Type layer. - 'bps rx b': # Endpoint A's real transmit rate (bps).Measured at the CX Type layer. - 'delay a ← b': # Average Latency in milliseconds for traffic from Endpoint B to Endpoint - # A - 'delay a → b': # Average Latency in milliseconds for traffic from Endpoint A to Endpoint - # B - 'eid': # Entity ID - 'endpoints (a ↔ b)': # Endpoints that make up this Cross Connect. - 'entity id': # Entity ID - 'jitter a ← b': # Average Jitter in milliseconds for traffic from Endpoint B to Endpoint A - 'jitter a → b': # Average Jitter in milliseconds for traffic from Endpoint A to Endpoint B - 'name': # Cross Connect's Name. - 'pkt tx a ← b': # Endpoint B's Packets Transmitted. - 'pkt tx a → b': # Endpoint A's Packets Transmitted. - 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI - # will ask for updates from the LANforge processes.If the GUI is sluggish, - # increasing the report timers may help. - 'rx drop % a': # Endpoint A percentage packet loss.Calculated using the number of PDUs - # Endpoint B sent minus the number Endpoint A received.This number is not - # 100% correct as long as packets are in flight.After a Quiesce of the - # test, the number should be perfectly accurate. - 'rx drop % b': # Endpoint B percentage packet loss.Calculated using the number of PDUs - # Endpoint A sent minus the number Endpoint B received.This number is not - # 100% correct as long as packets are in flight.After a Quiesce of the - # test, the number should be perfectly accurate. - 'state': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - 'type': # Cross-Connect type. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_voip(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/voip" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="connection", - plural_key="connections") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /voip-endp/ - /voip-endp/$endp_id - - When requesting specific column names, they need to be URL encoded: - calls+answered, calls+attempted, calls+completed, calls+failed, cf+404, cf+408, - cf+busy, cf+canceled, delay, destination+addr, dropped, dup+pkts, eid, elapsed, - entity+id, jb+cur, jb+over, jb+silence, jb+under, jitter, mng, name, ooo+pkts, - pesq, pesq+bklg, pesq%23, reg+state, rst, rtp+rtt, run, rx+bytes, rx+pkts, - source+addr, state, tx+bytes, tx+pkts, vad+pkts - Example URL: /voip-endp?fields=calls+answered,calls+attempted - - Example py-json call (it knows the URL): - record = LFJsonGet.get_voip_endp(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'calls answered': # Number of calls that where the remote answered - 'calls attempted': # Number of calls that have been attempted - 'calls completed': # Number of calls that have been successfully completed - 'calls failed': # Number of calls that did not succeed for any reason. - 'cf 404': # Number of calls failed for '404': callee not found. - 'cf 408': # Number of calls failed for '408': callee did not answer. - 'cf busy': # Number of calls failed because callee is busy. - 'cf canceled': # Number of calls failed because they were canceled. - 'delay': # Average latency in milliseconds for packets received by this endpoint. - 'destination addr': # Destination Address (MAC, ip/port, VoIP destination). - 'dropped': # Total dropped packets, as identified by gaps in RTP sequence numbers - # (pre jitter buffer). - 'dup pkts': # Total duplicate packets, as identified by RTP sequence numbers (pre - # jitter buffer). - 'eid': # Entity ID - 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) - 'entity id': # Entity ID - 'jb cur': # Current number of packets in the jitter buffer waiting to be played / - # Jitter Buffer Size. - 'jb over': # Total times the jitter buffer was given more packets than it could hold. - 'jb silence': # Silence is played when there is no valid voice packet, due to drop, or - # reorder/jitter/latency out of range of the jitter buffer. - 'jb under': # Total times the reader asked for a packet to play but the jitter buffer - # was empty. - 'jitter': # Average interpacket variation, calculated per RFC 1889 A.8. - 'mng': # Is the Endpoint managed or not? - 'name': # Endpoint's Name. - 'ooo pkts': # Total out-of-order packets, as identified by RTP sequence numbers (pre - # jitter buffer). - 'pesq': # PESQ Report score for the PESQ report number (PESQ#). - 'pesq bklg': # PESQ server call processing backlog. - 'pesq#': # The pesq-report-number to which the PESQ value cooresponds. - 'reg state': # Current State of the Endpoint. - 'rst': # How many times has the endpoint been restarted due to abnormal - # termination. - 'rtp rtt': # Round trip latency as reported by RTCP - 'run': # Is the Endpoint is Running or not. - 'rx bytes': # Total received bytes count. - 'rx pkts': # Total received packet count. - 'source addr': # Source Address (MAC, ip/port, VoIP source). - 'state': # Phone registration state - 'tx bytes': # Total transmitted bytes count. - 'tx pkts': # Total transmitted packet count. - 'vad pkts': # Total VAD (Silence Suppression) packets suppressed before transmit. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_voip_endp(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/voip-endp" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoints") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /vr-cx/ - /vr-cx/$shelf_id/$resource_id/$port_id - /vr/ - /vr/$shelf_id/$resource_id - /vrcx/ - /vrcx/$shelf_id/$resource_id/$port_id - - When requesting specific column names, they need to be URL encoded: - active+ipv6+router, bgp+4byte+as, bgp+damping, bgp+peers, cluster+id, collision+domain+id, - confederation+id, damping+half+life, damping+max+suppress, damping+reuse, - damping+suppress, entity+id, height, ipv6+radv, is+bgp+reflector, local+as, - multicast+routing, name, netsmith-state, notes, pad, ripv2, router+connections, - router+id, router+id, use+confederation, use+existing+cfg, use+ospf, use+rip+dft+route, - using+bgp, using+olsr, width, x, xorp+sha, y - Example URL: /vr?fields=active+ipv6+router,bgp+4byte+as - - Example py-json call (it knows the URL): - record = LFJsonGet.get_vr(eid_list=['1.234', '1.344'], - requested_col_names=['netsmith-state'], - debug_=True) - - The record returned will have these members: - { - 'active ipv6 router': # - - 'bgp 4byte as': # - - 'bgp damping': # lc_key > lc_col_name- - 'bgp peers': # - - 'cluster id': # - - 'collision domain id': # - - 'confederation id': # - - 'damping half life': # - - 'damping max suppress': # - - 'damping reuse': # - - 'damping suppress': # - - 'entity id': # Entity ID - 'height': # - - 'ipv6 radv': # - - 'is bgp reflector': # - - 'local as': # - - 'multicast routing': # - - 'name': # Name - 'netsmith-state': # - - 'notes': # - - 'pad': # - - 'ripv2': # - - 'router connections': # - - 'router id': # - - 'router id': # - - 'use confederation ': # - - 'use existing cfg': # - - 'use ospf': # - - 'use rip dft route': # - - 'using bgp': # - - 'using olsr': # - - 'width': # - - 'x': # - - 'xorp sha': # - - 'y': # - - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_vr(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/vr" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="virtual-routers", - plural_key="virtual-routers") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /vrcx/ - /vrcx/$shelf_id/$resource_id/$port_id - - When requesting specific column names, they need to be URL encoded: - entity+id, height, interface+cost, local-a, local-b, netsmith-state, remote-a, - remote-b, resource, rip+metric, vrrp+id, vrrp+interval, vrrp+ip, vrrp+ip-prefix, - vrrp+priority, wan+link, width, x, y - Example URL: /vrcx?fields=entity+id,height - - Example py-json call (it knows the URL): - record = LFJsonGet.get_vrcx(eid_list=['1.234', '1.344'], - requested_col_names=['netsmith-state'], - debug_=True) - - The record returned will have these members: - { - 'entity id': # - - 'height': # - - 'interface cost': # - - 'local-a': # - - 'local-b': # - - 'netsmith-state': # - - 'remote-a': # - - 'remote-b': # - - 'resource': # - - 'rip metric': # - - 'vrrp id': # - - 'vrrp interval': # - - 'vrrp ip': # - - 'vrrp ip-prefix': # - - 'vrrp priority': # - - 'wan link': # - - 'width': # - - 'x': # - - 'y': # - - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_vrcx(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/vrcx" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="router-connections", - plural_key="router-connections") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /wl-endp/ - /wl-endp/$wl_ep_id - /wl-ep/ - /wl-ep/$wl_ep_id - /wl/ - /wl/$wl_id - /wl_endp/ - /wl_endp/$wl_ep_id - /wl_ep/ - /wl_ep/$wl_ep_id - /wlendp/$wl_ep_id - - When requesting specific column names, they need to be URL encoded: - bps+rx+a, bps+rx+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, entity+id, k-m, - name, pkt+tx+a%C2%A0%E2%86%90%C2%A0b, pkt+tx+a%C2%A0%E2%86%92%C2%A0b, rpt+timer, - state - Example URL: /wl?fields=bps+rx+a,bps+rx+b - - Example py-json call (it knows the URL): - record = LFJsonGet.get_wl(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'bps rx a': # Endpoint B's Max transmit rate (bps). - 'bps rx b': # Endpoint A's Max transmit rate (bps). - 'eid': # Entity ID - 'endpoints (a ↔ b)': # Endpoints that make up this WanLink. - 'entity id': # Entity ID - 'k-m': # Whether the WanLink is Kernel-Mode or not. - 'name': # WanLink's Name. - 'pkt tx a ← b': # Packets received on endpoint B and transmitted out endpoint A. - 'pkt tx a → b': # Packets received on endpoint A and transmitted out endpoint B. - 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI - # will ask for updates from the LANforge processes.If the GUI is sluggish, - # increasing the report timers may help. - 'state': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_wl(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/wl" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /wl-endp/ - /wl-endp/$wl_ep_id - - When requesting specific column names, they need to be URL encoded: - buffer, corrupt+1, corrupt+2, corrupt+3, corrupt+4, corrupt+5, corrupt+6, - delay, dropfreq+%25, dropped, dup+pkts, dupfreq+%25, eid, elapsed, extrabuf, - failed-late, jitfreq+%25, max+rate, maxjitter, maxlate, name, ooo+pkts, qdisc, - reordfrq+%25, run, rx+bytes, rx+pkts, script, serdelay, tx+bytes, tx+drop+%25, - tx+pkts, tx+rate, tx-failed, wps - Example URL: /wl-endp?fields=buffer,corrupt+1 - - Example py-json call (it knows the URL): - record = LFJsonGet.get_wl_endp(eid_list=['1.234', '1.344'], - requested_col_names=['eid'], - debug_=True) - - The record returned will have these members: - { - 'buffer': # Maximum size of receive buffer, in bytes.This is the sum of the amount - # needed for the transit buffers (delay * bandwidth)plus the WanLink - # "Backlog Buffer:" queue size which handles bursts. - 'corrupt 1': # Counters for how many times this corruption has been applied. - 'corrupt 2': # Counters for how many times this corruption has been applied. - 'corrupt 3': # Counters for how many times this corruption has been applied. - 'corrupt 4': # Counters for how many times this corruption has been applied. - 'corrupt 5': # Counters for how many times this corruption has been applied. - 'corrupt 6': # Counters for how many times this corruption has been applied. - 'delay': # Base induced latency on received packets, in microseconds. - 'dropfreq %': # Frequency out of 1,000,000 to drop a received packet.Select a preset - # value or enter your own. - 'dropped': # Total dropped packets on receive.This does not include the tx-failed - # counters. - 'dup pkts': # Total duplicate packets generated. - 'dupfreq %': # Frequency out of 1,000,000 to duplicate a received packet.Select a - # preset value or enter your own. - 'eid': # Entity ID - 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) - 'extrabuf': # Size of "Backlog Buffer:" setting in WanLink configuration in bytes. - 'failed-late': # Total amount of received packets that could not be transmitted out the - # peer becausethe emulator was overloaded and could not transmit within - # the specified 'lateness' - 'jitfreq %': # Frequency out of 1,000,000 that packets should have jitter applied to - # them.Select a preset value or enter your own. - 'max rate': # Max transmit rate (bps) for this Endpoint. - 'maxjitter': # Maximum additional delay, in microseconds. See Jitter-Frequency as - # well. - 'maxlate': # The maximum lateness in milliseconds allowed before packets will be - # dropped on transmit.If lateness is configured to be automatic, this - # variable will change based onconfigured bandwidth and backlog buffer, - # but will not go below 10ms. - 'name': # Endpoint's Name. - 'ooo pkts': # Total out of order packets generated. - 'qdisc': # Queueing discipline (FIFO, WRR, etc). - 'reordfrq %': # Frequency out of 1,000,000 to re-order a received packet.Select a preset - # value or enter your own. - 'run': # Is the Endpoint is Running or not. - 'rx bytes': # Total received bytes count. - 'rx pkts': # Total received packet count. - 'script': # Endpoint script state. - 'serdelay': # Additional serialization delay for a 1514 byte packet at the configured - # speed (microseconds). - 'tx bytes': # Total transmitted bytes count. - 'tx drop %': # Packet drop percentage over the last 1 minute. - 'tx pkts': # Packets received on the peer interface and transmitted out this - # endpoint's interface. - 'tx rate': # The average speed over the last 30 seconds at which we are - # transmittingout the peer interface.This can be thought of as the actual - # transfer rate for packets entering the interfaceassociated with this - # Endpoint. - 'tx-failed': # Total amount of received packets that could not be transmitted out the - # peer.This includes any tx-failed-late packets. - 'wps': # Enable/Disable showing of WanPaths for individual endpoints. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_wl_endp(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/wl-endp" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoint") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /ws-msg/ - /ws-msg/$sessionid - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_ws_msg(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_ws_msg(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/ws-msg" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - - -"""----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - - These are POST requests - ------ ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - -class LFJsonPost(LFCliBase): - def __init__(self, lfclient_host='localhost', - lfclient_port=8080, - debug_=False, - _exit_on_error=False, - _exit_on_fail=False, - _proxy_str=None, - _capture_signal_list=()): - super().__init__(_lfjson_host=lfclient_host, - _lfjson_port=lfclient_port, - _debug=debug_, - _exit_on_error=_exit_on_error, - _exit_on_fail=_exit_on_fail, - _proxy_str=_proxy_str, - _capture_signal_list=_capture_signal_list) +class JsonQuery(BaseLFJsonRequest): + """ ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + request LANforge JSON data with knowledge of the LANforge JSON headers + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- """ + + def __init__(self, + session_obj: 'BaseSession' = None, + debug=False, + exit_on_error=False): + super().__init__(session_obj=session_obj, + debug=debug | session_obj.is_debug(), + exit_on_error=exit_on_error) + + +class JsonCommand(BaseLFJsonRequest): + def __init__(self, + session_obj: object = None, + debug: bool = False, + exit_on_error: bool = False): + super().__init__(session_obj=session_obj, + debug=debug, + exit_on_error=exit_on_error) + self.logger.debug("%s new instance " % str(__class__)) @staticmethod def set_flags(flag_class: IntFlag, starting_value: int, flag_names=None): @@ -2495,7 +868,7 @@ class LFJsonPost(LFCliBase): :param starting_value: integer flag value to OR values into :param flag_names: list of flag names to convert to integers to OR onto starting_value - Example Usage: + Example Usage: value = LFJsonPost.add_flags(SetPortMumble, 0, flag_names=['bridge', 'dhcp']) print('value now: '+value) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" @@ -2511,13 +884,13 @@ class LFJsonPost(LFCliBase): raise ValueError("%s lacks member:[%s]" % (flag_class.__class__.__name__, flag)) selected_flags.extend([flag_class[member].value - for member in flag_class.__members__ if member == flag]) + for member in flag_class.__members__ if member == flag]) if isinstance(flag, IntFlag): if flag not in flag_class: raise ValueError("%s lacks member:[%s]" % (flag_class.__class__.__name__, flag)) selected_flags.extend([member.value - for member in flag_class.__members___ if member == flag]) + for member in flag_class.__members___ if member == flag]) selected_flags.append(starting_value) result_flags = 0 for i in selected_flags: @@ -2541,7 +914,7 @@ class LFJsonPost(LFCliBase): :param starting_value: integer flag value to OR values into :param flag_names: list of flag names to convert to integers to OR onto starting_value - Example Usage: + Example Usage: value = LFJsonPost.clear_flags(SetPortMumble, 0, flag_names=['bridge', 'dhcp']) print('value now: '+value) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" @@ -2575,29 +948,259 @@ class LFJsonPost(LFCliBase): unselected_val = starting_value unselected_val &= ~flag_names.value return unselected_val + + def start_session(self, + debug: bool = False, + die_without_session_id_: bool = False) -> bool: + responses = [] + debug |= self.debug_on + if not self.session_instance: + raise ValueError("JsonCommand::start_session lacks self.session_instance") + + first_response: HTTPResponse + first_response = self.json_post(url="/newsession", + debug=True, + response_json_list=responses) + if not first_response: + self.logger.warning("No session established.") + self.logger.debug(pformat(first_response)) + self.logger.debug(pformat(responses)) + if die_without_session_id_: + exit(1) + return False + if _not(first_response.msg): + self.logger.error("no session_response.msg: %s" % pformat(first_response)) + if die_without_session_id_: + exit(1) + return False + + if debug: + self.logger.debug("%s: newsession: %s" % (__name__, pformat(first_response))) + # self.session_instance.session_id = first_response["session_id"] + self.logger.debug(pformat( ("start_session headers:", + first_response.getheaders()))) + if SESSION_HEADER not in first_response.headers: + self.logger.error("start_session: no %s in response headers:" % SESSION_HEADER) + self.logger.error(pformat(first_response.headers)) + if die_without_session_id_: + exit(1) + return False + + self.session_id = first_response.getheader(SESSION_HEADER) + self.session_instance.session_id = first_response.getheader(SESSION_HEADER) + return True + + +class BaseSession: + """ + Use this class to make your initial connection to a LANforge GUI. This class can + will create a session id and hold errors and warnings as needed. + """ + + Default_Base_URL: str = "http://localhost:8080" + Default_Retry_Sec: float = 1.0 + Default_Request_Timeout_Sec: float = 120.0 + Default_Max_Timeout_Sec: float = 240.0 + subclasses = [] + + def __init_subclass__(cls, **kwargs): + super().__init_subclass__(**kwargs) + cls.subclasses.append(cls) + + def __init__(self, lfclient_url: str = 'http://localhost:8080', + debug: bool = False, + proxy_map: dict = None, + connection_timeout_sec: float = Default_Request_Timeout_Sec, + max_timeout_sec: float = Default_Max_Timeout_Sec, + retry_sec: float = Default_Retry_Sec, + stream_errors: bool = True, + stream_warnings: bool = False, + exit_on_error: bool = False): + self.debug_on = debug + self.logger = Logg(name='json_api_session') + if debug: + self.logger.level = logging.DEBUG + self.exit_on_error = exit_on_error + self.command_instance: JsonCommand + self.connection_timeout_sec: int = 10 + self.debug_on: bool + self.debug_on = False + self.exit_on_error: bool + self.exit_on_error = False + self.lfclient_url: str + self.max_timeout_sec: float + self.max_timeout_sec = max_timeout_sec + self.proxies_installed: bool + self.proxies_installed = False + self.proxy_map: dict + self.query_instance: JsonQuery + self.query_instance = None + self.retry_sec: float + self.retry_sec = retry_sec + self.session_error_list: list = [] + self.session_id: str + self.session_id = None + self.session_warnings_list: list = [] + self.stream_errors: bool + self.stream_errors = True + self.stream_warnings: bool + self.stream_warnings = False + self.session_connection_check: bool + self.session_connection_check = False + self.session_started_at: int = 0 + + # please see this discussion on ProxyHandlers: + # https://docs.python.org/3/library/urllib.request.html#urllib.request.ProxyHandler + # but this makes much more sense: + # https://gist.github.com/aleiphoenix/4159510 + + if debug: + if proxy_map is None: + self.logger.debug("%s: no proxy_str" % __class__) + else: + self.logger.debug("BaseSession.__init__: proxies_: %s" % pformat(proxy_map)) + + if (proxy_map is not None) and (len(proxy_map) > 0): + if ("http" not in proxy_map) and ("https" not in proxy_map): + raise ValueError("Neither http or https set in proxy definitions. Expects proxy={'http':, 'https':, }") + self.proxy_map = proxy_map + if (proxy_map is not None) and (len(proxy_map) > 0): + opener = urllib.request.build_opener(request.ProxyHandler(proxy_map)) + urllib.request.install_opener(opener) + self.proxies_installed = True + + if connection_timeout_sec: + self.connection_timeout_sec = connection_timeout_sec + self.logger.debug("%s connection timeout sec now [%f]" % (__name__, connection_timeout_sec)) + + self.stream_errors = stream_errors + self.stream_warnings = stream_warnings + + # if debug: + # if self.proxies is None: + # print("BaseSession _init_: no proxies") + # else: + # print("BaseSession _init_: proxies: ") + # pprint.pprint(self.proxies) + + if not lfclient_url.startswith("http://") and not lfclient_url.startswith("https://"): + self.logger.warning("No http:// or https:// found, prepending http:// to " + lfclient_url) + lfclient_url = "http://" + lfclient_url + + # we do not want the lfclient_url to end with a slash + if lfclient_url.endswith('/'): + self.lfclient_url = lfclient_url[0: len(lfclient_url) - 1] + else: + self.lfclient_url = lfclient_url + + # test connection with GUI to get a session id, then set our session ids in those instances + # self.session_connection_check = self.command_instance.start_session(debug=debug) + self.command_instance = None + self.query_instance = None + + # indicate session destroyed if possible + def __del__(self): + if not self.session_connection_check: + self.logger.warning("%s no connection established, exiting" % self.session_connection_check) + return + self.logger.debug("%s: asking for session %s to end" % (__name__, self.session_id)) + BaseSession.end_session(command_obj=self.command_instance, + session_id_=self.session_id) + + def get_command(self) -> 'JsonCommand': + """ + Remember to override this method with your session subclass, it should return LFJsonCommand + :return: registered instance of JsonCommand + """ + if self.command_instance: + return self.command_instance + self.command_instance = JsonCommand(session_obj=self) + return self.command_instance + + def get_query(self) -> 'JsonQuery': + """ + Remember to override this method with your session subclass, it should return LFJsonQuery + :return: registered instance of JsonQuery + """ + if self.query_instance: + return self.query_instance + self.query_instance = JsonQuery(session_obj=self, debug=self.debug_on) + return self.query_instance + + def is_exit_on_error(self) -> bool: + return self.exit_on_error + + def get_lfclient_url(self) -> str: + return self.lfclient_url + + def get_lf_client_error(self) -> str: + return self.lfclient_url + + def is_debug(self) -> bool: + return self.debug_on + + def get_session_id(self) -> str: + return self.session_id + + def get_proxies(self): + return self.proxy_map + + def get_timeout_sec(self) -> float: + return self.connection_timeout_sec + + @classmethod + def end_session(cls, + command_obj: JsonCommand = None, + session_id_: str = ""): + responses = [] + first_response = command_obj.json_post(url="endsession", + debug=True, + response_json_list=responses, + session_id_=session_id_) + pprint(first_response) + pprint(responses) + +# End of json_api.py; subclasses defined below + + +class LFJsonCommand(JsonCommand): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + LFJsonCommand inherits from JsonCommand + Commands are used for POST requests. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def __init__(self, + session_obj: object = None, + debug: bool = False, + exit_on_error: bool = False): + super().__init__(session_obj=session_obj, + debug=debug, + exit_on_error=exit_on_error) + + # Auto generated methods follow: + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_arm_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_arm_endp(self, - alias=None, # Name of endpoint. - cpu_id=None, # Preferred CPU ID on which this endpoint should run. - mx_pkt_sz=None, # Maximum packet size, including all Ethernet headers. - pkt_sz=None, # Minimum packet size, including all Ethernet headers. - port=None, # Port number. - pps=None, # Packets per second to generate. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - tos=None, # The Type of Service, can be HEX. See set_endp_tos for details. - p_type=None, # Endpoint Type : arm_udp - debug_=False): + alias: str = None, # Name of endpoint. [R] + cpu_id: str = None, # Preferred CPU ID on which this endpoint should run. + mx_pkt_sz: str = None, # Maximum packet size, including all Ethernet headers. + pkt_sz: str = None, # Minimum packet size, including all Ethernet headers. + port: str = None, # Port number. [W] + pps: str = None, # Packets per second to generate. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. Required. [R][D:1] + tos: str = None, # The Type of Service, can be HEX. See set_endp_tos for details. + p_type: str = None, # Endpoint Type : arm_udp. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_arm_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -2621,9 +1224,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_arm_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_arm_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2656,25 +1260,25 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_bgp_peer(self, - p_as=None, # BGP Peer Autonomous System number, 0-65535 - delay_open_time=None, # BGP Peer delay open time. - flags=None, # Virtual router BGP Peer flags, see above for definitions. - holdtime=None, # BGP Peer hold-time. - local_dev=None, # BGP Peer Local interface. - nexthop=None, # BGP Peer Nexthop, IPv4 Address. - nexthop6=None, # BGP Peer IPv6 Nexthop address. - peer_id=None, # BGP Peer Identifier: IPv4 Address - peer_index=None, # Peer index in this virtual router (0-7). - resource=None, # Resource number. - shelf=None, # Shelf name/id. - vr_id=None, # Name of virtual router. - debug_=False): + p_as: str = None, # BGP Peer Autonomous System number, 0-65535 + delay_open_time: str = None, # BGP Peer delay open time. + flags: str = None, # Virtual router BGP Peer flags, see above for definitions. + holdtime: str = None, # BGP Peer hold-time. + local_dev: str = None, # BGP Peer Local interface. + nexthop: str = None, # BGP Peer Nexthop, IPv4 Address. + nexthop6: str = None, # BGP Peer IPv6 Nexthop address. + peer_id: str = None, # BGP Peer Identifier: IPv4 Address + peer_index: str = None, # Peer index in this virtual router (0-7). + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + vr_id: str = None, # Name of virtual router. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_bgp_peer(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if p_as is not None: data["as"] = p_as @@ -2702,9 +1306,10 @@ class LFJsonPost(LFCliBase): data["vr_id"] = vr_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_bgp_peer", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_bgp_peer", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2714,17 +1319,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_bond ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_bond(self, - network_devs=None, # Comma-separated list of network devices: eth1,eth2,eth3... - port=None, # Name of the bond device. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + network_devs: str = None, # Comma-separated list of network devices: eth1,eth2,eth3... [W] + port: str = None, # Name of the bond device. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_bond(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if network_devs is not None: data["network_devs"] = network_devs @@ -2736,9 +1341,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_bond", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_bond", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2756,23 +1362,23 @@ class LFJsonPost(LFCliBase): stp_enabled = 1 # Enable Spanning Tree Protocol (STP) def post_add_br(self, - br_aging_time=None, # MAC aging time, in seconds, 32-bit number. - br_flags=None, # Bridge flags, see above. - br_forwarding_delay=None, # How long to wait until the bridge will start forwarding packets. - br_hello_time=None, # How often does the bridge send out STP hello packets. - br_max_age=None, # How long until STP considers a non-responsive bridge dead. - br_priority=None, # Bridge priority, 16-bit number. - network_devs=None, # Comma-separated list of network devices: eth1,eth2,eth3... - port=None, # Name of the bridge device. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + br_aging_time: str = None, # MAC aging time, in seconds, 32-bit number. + br_flags: str = None, # Bridge flags, see above. + br_forwarding_delay: str = None, # How long to wait until the bridge will start forwarding packets. + br_hello_time: str = None, # How often does the bridge send out STP hello packets. + br_max_age: str = None, # How long until STP considers a non-responsive bridge dead. + br_priority: str = None, # Bridge priority, 16-bit number. + network_devs: str = None, # Comma-separated list of network devices: eth1,eth2,eth3... + port: str = None, # Name of the bridge device. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_br(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if br_aging_time is not None: data["br_aging_time"] = br_aging_time @@ -2796,9 +1402,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_br", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_br", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2816,22 +1423,22 @@ class LFJsonPost(LFCliBase): RUNNING = 1 # Set to running state. def post_add_cd(self, - alias=None, # Name of Collision Domain. - bps=None, # Maximum speed at which this collision domain can run. - flags=None, # See above. Leave blank or use 'NA' for no default values. - report_timer=None, # How often to report stats. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - state=None, # RUNNING or STOPPED (default is RUNNING). Use this to start/stop. - p_type=None, # CD Type: WIFI, WISER_SURFACE, WISER_SURFACE_AIR, WISER_AIR_AIR, + alias: str = None, # Name of Collision Domain. [W] + bps: str = None, # Maximum speed at which this collision domain can run. + flags: str = None, # See above. Leave blank or use 'NA' for no default values. + report_timer: str = None, # How often to report stats. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + state: str = None, # RUNNING or STOPPED (default is RUNNING). Use this to start/stop. + p_type: str = None, # CD Type: WIFI, WISER_SURFACE, WISER_SURFACE_AIR, WISER_AIR_AIR, # WISER_NCW - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_cd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -2851,9 +1458,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_cd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2863,15 +1471,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_cd_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_cd_endp(self, - cd=None, # Name of Collision Domain. - endp=None, # Endpoint name/id. - debug_=False): + cd: str = None, # Name of Collision Domain. [R] + endp: str = None, # Endpoint name/id. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_cd_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd is not None: data["cd"] = cd @@ -2879,9 +1487,10 @@ class LFJsonPost(LFCliBase): data["endp"] = endp if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_cd_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_cd_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2891,15 +1500,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_cd_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_cd_vr(self, - cd=None, # Name of Collision Domain. - vr=None, # Virtual-Router name/ID. - debug_=False): + cd: str = None, # Name of Collision Domain. [R] + vr: str = None, # Virtual-Router name/ID. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_cd_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd is not None: data["cd"] = cd @@ -2907,9 +1516,10 @@ class LFJsonPost(LFCliBase): data["vr"] = vr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_cd_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_cd_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2940,35 +1550,56 @@ class LFJsonPost(LFCliBase): raise ValueError("AddChamberChamberFlags has no member:[%s]" % name) return (cls[member].value for member in cls.__members__ if member == name) + class AddChamberTurntableType(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddChamberTurntableType0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + COMXIM = 0x1 # ComXim stand-alone USB connected turn-table. + CT840A = 0x2 # Modbus API turntable in CT840A 2D chamber. + CT850A = 0x0 # TCP-IP Connected turntable in CT850A 2D chamber. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddChamberTurntableType has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + def post_add_chamber(self, - chamber_type=None, # Chamber type, see above. Use 1 for Medium if uncertain. - dut_name1=None, # Name of first DUT in this chamber or NA - dut_name2=None, # Name of second DUT in this chamber or NA - dut_name3=None, # Name of third DUT in this chamber or NA - dut_name4=None, # Name of fourth DUT in this chamber or NA - flags=None, # Flag field for Chamber, see above. - flags_mask=None, # Mask of what flags to pay attention to, or NA for all. - height=None, # Height to be used when drawn in the LANforge-GUI. - isolation=None, # Estimated isolation in db for this chamber. - lanforge1=None, # EID of first LANforge Resource in this chamber or NA - lanforge2=None, # EID of second LANforge Resource in this chamber or NA - lanforge3=None, # EID of third LANforge Resource in this chamber or NA - lanforge4=None, # EID of fourth LANforge Resource in this chamber or NA - name=None, # Name of Chamber, unique identifier. - resource=None, # LANforge Resource ID for controlling turn-table via serial + chamber_type: str = None, # Chamber type, see above. Use 1 for Medium if uncertain. [W] + dut_name1: str = None, # Name of first DUT in this chamber or NA + dut_name2: str = None, # Name of second DUT in this chamber or NA + dut_name3: str = None, # Name of third DUT in this chamber or NA + dut_name4: str = None, # Name of fourth DUT in this chamber or NA + flags: str = None, # Flag field for Chamber, see above. [W] + flags_mask: str = None, # Mask of what flags to pay attention to, or NA for all. + height: str = None, # Height to be used when drawn in the LANforge-GUI. + isolation: str = None, # Estimated isolation in db for this chamber. + lanforge1: str = None, # EID of first LANforge Resource in this chamber or NA + lanforge2: str = None, # EID of second LANforge Resource in this chamber or NA + lanforge3: str = None, # EID of third LANforge Resource in this chamber or NA + lanforge4: str = None, # EID of fourth LANforge Resource in this chamber or NA + name: str = None, # Name of Chamber, unique identifier. [R] + resource: str = None, # LANforge Resource ID for controlling turn-table via serial # protocol. - sma_count=None, # Number of SMA connectors on this chamber, default is 16. - turntable_type=None, # Turn-Table type: see above. - width=None, # Width to be used when drawn in the LANforge-GUI. - x=None, # X coordinate to be used when drawn in the LANforge-GUI. - y=None, # Y coordinate to be used when drawn in the LANforge-GUI. - debug_=False): + sma_count: str = None, # Number of SMA connectors on this chamber, default is 16. + turntable_type: str = None, # Turn-Table type: see above. + width: str = None, # Width to be used when drawn in the LANforge-GUI. + x: str = None, # X coordinate to be used when drawn in the LANforge-GUI. + y: str = None, # Y coordinate to be used when drawn in the LANforge-GUI. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_chamber(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chamber_type is not None: data["chamber_type"] = chamber_type @@ -3012,9 +1643,10 @@ class LFJsonPost(LFCliBase): data["y"] = y if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_chamber", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3033,30 +1665,30 @@ class LFJsonPost(LFCliBase): TERMINATED = 2 # (2) Connection is terminated, signal shall not pass! def post_add_chamber_cx(self, - a_id=None, # EidAntenna in string format for A side connection. - atten_id=None, # EID for the Attenuator module if one is inline on this + a_id: str = None, # EidAntenna in string format for A side connection. + atten_id: str = None, # EID for the Attenuator module if one is inline on this # connection. - b_id=None, # EidAntenna in string format for B side connection. - connection_idx=None, # Connection index, currently up to 32 connections supported - # (0-31) - flags=None, # Flag field for Chamber Connection, see above. - flags_mask=None, # Mask of what flags to pay attention to, or NA for all. - internal=None, # Internal (1) or not (0): Internal connections are no longer + b_id: str = None, # EidAntenna in string format for B side connection. + connection_idx: str = None, # Connection index, currently up to 32 connections supported + # (0-31) [R] + flags: str = None, # Flag field for Chamber Connection, see above. + flags_mask: str = None, # Mask of what flags to pay attention to, or NA for all. + internal: str = None, # Internal (1) or not (0): Internal connections are no longer # supported. - min_atten=None, # Specify minimum attenuation in 10ths of a db. Distance logic - # will not set atten below this. - name=None, # Name of Chamber, unique identifier. - zrssi2=None, # Specify 2.4Ghz zero-attenuation RSSI in 10ths of a db. + min_atten: str = None, # Specify minimum attenuation in 10ths of a db. Distance + # logic will not set atten below this. + name: str = None, # Name of Chamber, unique identifier. [R] + zrssi2: str = None, # Specify 2.4Ghz zero-attenuation RSSI in 10ths of a db. # Distance logic will consider this in its calculations. - zrssi5=None, # Specify 5Ghz zero-attenuation RSSI in 10ths of a db. Distance - # logic will consider this in its calculations. - debug_=False): + zrssi5: str = None, # Specify 5Ghz zero-attenuation RSSI in 10ths of a db. + # Distance logic will consider this in its calculations. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_chamber_cx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if a_id is not None: data["a_id"] = a_id @@ -3082,9 +1714,10 @@ class LFJsonPost(LFCliBase): data["zrssi5"] = zrssi5 if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_chamber_cx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_chamber_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3094,17 +1727,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_chamber_path ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_chamber_path(self, - chamber=None, # Chamber Name. - content=None, # [BLANK] will erase all content, any other text will be appended - # to existing text. Unescaped Value - path=None, # Path Name - debug_=False): + chamber: str = None, # Chamber Name. [R] + content: str = None, # [BLANK] will erase all content, any other text will + # be appended to existing text. + path: str = None, # Path Name [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_chamber_path(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chamber is not None: data["chamber"] = chamber @@ -3114,9 +1747,10 @@ class LFJsonPost(LFCliBase): data["path"] = path if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_chamber_path", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_chamber_path", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3145,22 +1779,23 @@ class LFJsonPost(LFCliBase): unused = "unused" # No signalling is performed, each channel in the list remains idle def post_add_channel_group(self, - alias=None, # Name for this Channel Group. - channels=None, # List of channels to add to this group. - idle_flag=None, # Idle flag (byte) for this channel group, for instance: 0x7e - mtu=None, # MTU (and MRU) for this channel group. Must be a multiple of - # the number of channels if configuring a T1 WanLink. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - span_num=None, # The span number. First span is 1, second is 2... - p_type=None, # The channel-type. Use 'clear' for PPP links. - debug_=False): + alias: str = None, # Name for this Channel Group. [R] + channels: str = None, # List of channels to add to this group. + idle_flag: str = None, # Idle flag (byte) for this channel group, for instance: + # 0x7e + mtu: str = None, # MTU (and MRU) for this channel group. Must be a multiple + # of the number of channels if configuring a T1 WanLink. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + span_num: str = None, # The span number. First span is 1, second is 2... [W] + p_type: str = None, # The channel-type. Use 'clear' for PPP links. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_channel_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -3180,9 +1815,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_channel_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_channel_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3192,17 +1828,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_cx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_cx(self, - alias=None, # Name of the Cross Connect to create. - rx_endp=None, # Name of Receiving endpoint. - test_mgr=None, # Name of test-manager to create the CX on. - tx_endp=None, # Name of Transmitting endpoint. - debug_=False): + alias: str = None, # Name of the Cross Connect to create. [R] + rx_endp: str = None, # Name of Receiving endpoint. [W] + test_mgr: str = None, # Name of test-manager to create the CX on. [W][D:default_tm] + tx_endp: str = None, # Name of Transmitting endpoint. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_cx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -3214,9 +1850,10 @@ class LFJsonPost(LFCliBase): data["tx_endp"] = tx_endp if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_cx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3258,43 +1895,42 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_dut(self, - antenna_count1=None, # Antenna count for first radio. - antenna_count2=None, # Antenna count for second radio. - antenna_count3=None, # Antenna count for third radio. - api_id=None, # DUT API Identifier (none specified yet) - bssid1=None, # BSSID for first radio. - bssid2=None, # BSSID for second radio. - bssid3=None, # BSSID for third radio. - eap_id=None, # EAP Identifier, for EAP-PEAP. - flags=None, # Flag field for DUT, see above. - flags_mask=None, # Optional mask to specify what DUT flags are being set. - hw_version=None, # DUT Hardware Version information - img_file=None, # File-Name for image to represent DUT. - lan_port=None, # IP/Mask for LAN port - mgt_ip=None, # Management IP Address to access DUT - model_num=None, # DUT Model information - name=None, # Name of DUT, cannot contain '.' - passwd1=None, # WiFi Password that can be used to connect to DUT - passwd2=None, # WiFi Password that can be used to connect to DUT - passwd3=None, # WiFi Password that can be used to connect to DUT - serial_num=None, # DUT Identifier (serial-number, etc) - serial_port=None, # Resource and Serial port name on LANforge that connects to DUT - # (1.2.ttyS0). Serial port does not need to be on resource holding - # wan_port or lan_port - ssid1=None, # WiFi SSID that can be used to connect to DUT - ssid2=None, # WiFi SSID that can be used to connect to DUT - ssid3=None, # WiFi SSID that can be used to connect to DUT - sw_version=None, # DUT Software Version information - top_left_x=None, # X Location for Chamber View. - top_left_y=None, # X Location for Chamber View. - wan_port=None, # IP/Mask for WAN port - debug_=False): + antenna_count1: str = None, # Antenna count for first radio. + antenna_count2: str = None, # Antenna count for second radio. + antenna_count3: str = None, # Antenna count for third radio. + api_id: str = None, # DUT API Identifier (none specified yet) + bssid1: str = None, # BSSID for first radio. + bssid2: str = None, # BSSID for second radio. + bssid3: str = None, # BSSID for third radio. + eap_id: str = None, # EAP Identifier, for EAP-PEAP. + flags: str = None, # Flag field for DUT, see above. [W] + flags_mask: str = None, # Optional mask to specify what DUT flags are being set. + hw_version: str = None, # DUT Hardware Version information + img_file: str = None, # File-Name for image to represent DUT. + lan_port: str = None, # IP/Mask for LAN port + mgt_ip: str = None, # Management IP Address to access DUT + model_num: str = None, # DUT Model information + name: str = None, # Name of DUT, cannot contain '.' [R] + passwd1: str = None, # WiFi Password that can be used to connect to DUT + passwd2: str = None, # WiFi Password that can be used to connect to DUT + passwd3: str = None, # WiFi Password that can be used to connect to DUT + serial_num: str = None, # DUT Identifier (serial-number, etc) + serial_port: str = None, # Resource and Serial port name on LANforge that connects to DUT + # (1.2.ttyS0). + ssid1: str = None, # WiFi SSID that can be used to connect to DUT + ssid2: str = None, # WiFi SSID that can be used to connect to DUT + ssid3: str = None, # WiFi SSID that can be used to connect to DUT + sw_version: str = None, # DUT Software Version information + top_left_x: str = None, # X Location for Chamber View. + top_left_y: str = None, # X Location for Chamber View. + wan_port: str = None, # IP/Mask for WAN port + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_dut(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if antenna_count1 is not None: data["antenna_count1"] = antenna_count1 @@ -3354,9 +1990,10 @@ class LFJsonPost(LFCliBase): data["wan_port"] = wan_port if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_dut", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_dut", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3366,16 +2003,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_dut_notes ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_dut_notes(self, - dut=None, # DUT Name. - text=None, # [BLANK] will erase all, any other text will be appended to existing - # text. Unescaped Value - debug_=False): + dut: str = None, # DUT Name. [R] + text: str = None, # [BLANK] will erase all, any other text will be appended to + # existing text. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_dut_notes(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if dut is not None: data["dut"] = dut @@ -3383,9 +2020,10 @@ class LFJsonPost(LFCliBase): data["text"] = text if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_dut_notes", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_dut_notes", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3421,20 +2059,20 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_dut_ssid(self, - bssid=None, # BSSID for cooresponding SSID. - name=None, # Name of DUT, cannot contain '.' - passwd=None, # WiFi Password that can be used to connect to DUT - ssid=None, # WiFi SSID that can be used to connect to DUT - ssid_flags=None, # SSID flags, see above. - ssid_flags_mask=None, # SSID flags mask - ssid_idx=None, # Index of the SSID. Zero-based indexing: (0 - 7) - debug_=False): + bssid: str = None, # BSSID for cooresponding SSID. + name: str = None, # Name of DUT, cannot contain '.' [R] + passwd: str = None, # WiFi Password that can be used to connect to DUT + ssid: str = None, # WiFi SSID that can be used to connect to DUT + ssid_flags: str = None, # SSID flags, see above. + ssid_flags_mask: str = None, # SSID flags mask + ssid_idx: str = None, # Index of the SSID. Zero-based indexing: (0 - 7) [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_dut_ssid(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if bssid is not None: data["bssid"] = bssid @@ -3452,9 +2090,10 @@ class LFJsonPost(LFCliBase): data["ssid_idx"] = ssid_idx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_dut_ssid", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_dut_ssid", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3498,36 +2137,36 @@ class LFJsonPost(LFCliBase): mc_udp = "mc_udp" # LF Multicast IPv4 def post_add_endp(self, - alias=None, # Name of endpoint. - ip_port=None, # IP Port: IP port for layer three endpoints. Use -1 to let the - # LANforge server automatically configure the ip_port. Layer 2 - # endpoints will ignore - is_pkt_sz_random=None, # Yes means use random sized packets, anything else means NO. - is_rate_bursty=None, # Yes means bursty, anything else means NO. - max_pkt=None, # Maximum packet size, including all headers. 0 means 'same', -1 - # means AUTO (5.3.2+) - max_rate=None, # Maximum transmit rate (bps), used if in bursty mode. - min_pkt=None, # Minimum packet size, including all headers. -1 means AUTO - # (5.3.2+) - min_rate=None, # Minimum transmit rate (bps), or only rate if not bursty. - multi_conn=None, # If > 0, will create separate process with this many connections - # per endpoint. See AUTO_HELPER flag - payload_pattern=None, # Payload pattern, see above. - port=None, # Port/Interface name or number. - resource=None, # Resource number. - send_bad_crc_per_million=None, # If NIC supports it, will randomly send X per million packets + alias: str = None, # Name of endpoint. [R] + ip_port: str = None, # IP Port: IP port for layer three endpoints. Use -1 to let + # the LANforge server automatically configure the ip_port. + # Layer 2 endpoints will ignore + is_pkt_sz_random: str = None, # Yes means use random sized packets, anything else means NO. + is_rate_bursty: str = None, # Yes means bursty, anything else means NO. + max_pkt: str = None, # Maximum packet size, including all headers. 0 means 'same', + # -1 means AUTO (5.3.2+) [D:0] + max_rate: str = None, # Maximum transmit rate (bps), used if in bursty mode. + min_pkt: str = None, # Minimum packet size, including all headers. -1 means AUTO + # (5.3.2+) [W][D:-1] + min_rate: str = None, # Minimum transmit rate (bps), or only rate if not bursty. [W] + multi_conn: str = None, # If > 0, will create separate process with this many + # connections per endpoint. See AUTO_HELPER flag + payload_pattern: str = None, # Payload pattern, see above. + port: str = None, # Port/Interface name or number. [R] + resource: str = None, # Resource number. [W] + send_bad_crc_per_million: str = None, # If NIC supports it, will randomly send X per million packets # with bad ethernet Frame Check Sum. - shelf=None, # Shelf name/id. - ttl=None, # Time-to-live, used by UDP Multicast Endpoints only. - p_type=None, # Endpoint Type: See above. - use_checksum=None, # Yes means checksum the payload, anything else means NO. - debug_=False): + shelf: str = None, # Shelf name/id. [R][D:1] + ttl: str = None, # Time-to-live, used by UDP Multicast Endpoints only. + p_type: str = None, # Endpoint Type: See above. [W] + use_checksum: str = None, # Yes means checksum the payload, anything else means NO. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -3565,9 +2204,10 @@ class LFJsonPost(LFCliBase): data["use_checksum"] = use_checksum if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3577,17 +2217,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_event ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_event(self, - details=None, # Event text description. Cannot include double-quote characters. - event_id=None, # Numeric ID for the event to modify, or 'new' if creating a new one. - name=None, # Event entity name. - priority=None, # See set_event_priority for available priorities. - debug_=False): + details: str = None, # Event text description. Cannot include double-quote characters. [R] + event_id: str = None, # Numeric ID for the event to modify, or 'new' if creating a new one. + # [W][D:new] + name: str = None, # Event entity name. + priority: str = None, # See set_event_priority for available priorities. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_event(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if details is not None: data["details"] = details @@ -3599,9 +2240,10 @@ class LFJsonPost(LFCliBase): data["priority"] = priority if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_event", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_event", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3658,36 +2300,56 @@ class LFJsonPost(LFCliBase): random_fixed = "random_fixed" # Means generate one random payload, and send it over zeros = "zeros" # Payload is all zeros (00). + class AddFileEndpType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + fe_cifs = "fe_cifs" # Does a CIFS (Samba) mount + fe_cifs_ip6 = "fe_cifs/ip6" # Does an IPv6 CIFS mount + fe_generic = "fe_generic" # Uses unspecified file protocol + fe_iscsi = "fe_iscsi" # Does a ISCSI mount + fe_nfs = "fe_nfs" # Does an NFSv3 mount + fe_nfs_ip6 = "fe_nfs/ip6" # Does a NFSv3 IPv6 mount + fe_nfs4 = "fe_nfs4" # Does an NFSv4 mount + fe_nfs4_ip6 = "fe_nfs4/ip6" # Does a NFSv4 IPv6 mount + fe_smb2 = "fe_smb2" # Does a SMB v2.0 mount + fe_smb2_ip6 = "fe_smb2/ip6" # Does a SMB v2.0 IPv6 mount + fe_smb21 = "fe_smb21" # Does a SMB v2.1 mount + fe_smb21_ip6 = "fe_smb21/ip6" # Does a SMB v2.1 IPv6 mount + fe_smb30 = "fe_smb30" # Does a SMB v3.0 mount + fe_smb30_ip6 = "fe_smb30/ip6" # Does a SMB v3.0 IPv6 mount + def post_add_file_endp(self, - alias=None, # Name of endpoint. - directory=None, # The directory to read/write in. Absolute path suggested. - fio_flags=None, # File-IO flags, see above for details. - max_read_rate=None, # Maximum read rate, bits-per-second. - max_write_rate=None, # Maximum write rate, bits-per-second. - min_read_rate=None, # Minimum read rate, bits-per-second. - min_write_rate=None, # Minimum write rate, bits-per-second. - mount_dir=None, # Directory to mount/unmount (if blank, will use 'directory'). - mount_options=None, # Optional mount options, passed to the mount command. 'NONE' + alias: str = None, # Name of endpoint. [R] + directory: str = None, # The directory to read/write in. Absolute path suggested. + # [W] + fio_flags: str = None, # File-IO flags, see above for details. + max_read_rate: str = None, # Maximum read rate, bits-per-second. + max_write_rate: str = None, # Maximum write rate, bits-per-second. + min_read_rate: str = None, # Minimum read rate, bits-per-second. + min_write_rate: str = None, # Minimum write rate, bits-per-second. + mount_dir: str = None, # Directory to mount/unmount (if blank, will use + # 'directory'). + mount_options: str = None, # Optional mount options, passed to the mount command. 'NONE' # clears. - payload_pattern=None, # Payload pattern, see above. - port=None, # Port number. - prefix=None, # The prefix of the file(s) to read/write. - resource=None, # Resource number. - retry_timer=None, # Number of miliseconds to retry errored IO calls before giving - # up. - server_mount=None, # The server to mount, ex: 192.168.100.5/exports/test1 - shelf=None, # Shelf name/id. - p_type=None, # Endpoint Type : fe_generic, fe_nfs, fe_nfs4, fe_cifs, fe_iscsi, - # fe_cifs/ip6, fe_nfs/ip6, fe_nfs4/ip6, fe_smb2, fe_smb2/ip6 - # fe_smb21 fe_smb21/ip6 fe_smb30 fe_smb30/ip6 - volume=None, # iSCSI volume to mount - debug_=False): + payload_pattern: str = None, # Payload pattern, see above. + port: str = None, # Port number. [W] + prefix: str = None, # The prefix of the file(s) to read/write. + resource: str = None, # Resource number. [W] + retry_timer: str = None, # Number of miliseconds to retry errored IO calls before + # giving up. + server_mount: str = None, # The server to mount, ex: + # 192.168.100.5/exports/test1 [W] + shelf: str = None, # Shelf name/id. [R][D:1] + p_type: str = None, # Endpoint Type (like fe_nfs) [W] + volume: str = None, # iSCSI volume to mount + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_file_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -3727,9 +2389,10 @@ class LFJsonPost(LFCliBase): data["volume"] = volume if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_file_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_file_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3739,18 +2402,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_gen_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_gen_endp(self, - alias=None, # Name of endpoint. - port=None, # Port number. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - p_type=None, # Endpoint Type : gen_generic - debug_=False): + alias: str = None, # Name of endpoint. [R] + port: str = None, # Port number. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + p_type: str = None, # Endpoint Type : gen_generic [W][D:gen_generic] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_gen_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -3764,9 +2427,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_gen_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_gen_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3776,19 +2440,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_gre ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_gre(self, - local_lower_ip=None, # The local lower-level IP to use. - port=None, # Name of the GRE to create, suggested to start with 'gre' - remote_lower_ip=None, # The remote lower-level IP to use. - report_timer=None, # Report timer for this port, leave blank or use NA for defaults. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + local_lower_ip: str = None, # The local lower-level IP to use. + port: str = None, # Name of the GRE to create, suggested to start with 'gre' [W] + remote_lower_ip: str = None, # The remote lower-level IP to use. + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_gre(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if local_lower_ip is not None: data["local_lower_ip"] = local_lower_ip @@ -3804,9 +2468,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_gre", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_gre", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3836,17 +2501,17 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_group(self, - flags=None, # Flags for this group, see above. - flags_mask=None, # Mask for flags that we care about, use 0xFFFFFFFF or leave blank for - # all. - name=None, # The name of the test group. Must be unique across all groups. - debug_=False): + flags: str = None, # Flags for this group, see above. + flags_mask: str = None, # Mask for flags that we care about, use 0xFFFFFFFF or leave blank + # for all. + name: str = None, # The name of the test group. Must be unique across all groups. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if flags is not None: data["flags"] = flags @@ -3856,9 +2521,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3940,40 +2606,40 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_l4_endp(self, - alias=None, # Name of endpoint. - block_size=None, # TFTP Block size, in bytes. - dns_cache_timeout=None, # In seconds, how long to cache DNS lookups. 0 means no caching at - # all. - http_auth_type=None, # Bit-field for allowable http-authenticate methods. - ip_addr=None, # Local IP address, for binding to specific secondary IP. - max_speed=None, # In bits-per-second, can rate limit upload or download speed of - # the URL contents. 0 means infinite. - port=None, # Port number. - proxy_auth_type=None, # Bit-field for allowable proxy-authenticate methods. - proxy_port=None, # HTTP Proxy port if you are using a proxy. - proxy_server=None, # The name of our proxy server if using one. - proxy_userpwd=None, # The user-name and password for proxy authentication, format: + alias: str = None, # Name of endpoint. [R] + block_size: str = None, # TFTP Block size, in bytes. + dns_cache_timeout: str = None, # In seconds, how long to cache DNS lookups. 0 means no + # caching at all. + http_auth_type: str = None, # Bit-field for allowable http-authenticate methods. + ip_addr: str = None, # Local IP address, for binding to specific secondary IP. + max_speed: str = None, # In bits-per-second, can rate limit upload or download speed + # of the URL contents. 0 means infinite. + port: str = None, # Port number. [W] + proxy_auth_type: str = None, # Bit-field for allowable proxy-authenticate methods. + proxy_port: str = None, # HTTP Proxy port if you are using a proxy. + proxy_server: str = None, # The name of our proxy server if using one. + proxy_userpwd: str = None, # The user-name and password for proxy authentication, format: # user:passwd. - quiesce_after=None, # Quiesce test after this many URLs have been processed. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - smtp_from=None, # SMTP From address. - ssl_cert_fname=None, # Name of SSL Certs file. - timeout=None, # How long to wait for a connection, in milliseconds - p_type=None, # Endpoint Type : l4_generic - url=None, # The URL, see syntax above. Can also be a local file. - url_rate=None, # How often should we process the URL(s), per 10 + quiesce_after: str = None, # Quiesce test after this many URLs have been processed. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + smtp_from: str = None, # SMTP From address. + ssl_cert_fname: str = None, # Name of SSL Certs file. + timeout: str = None, # How long to wait for a connection, in milliseconds + p_type: str = None, # Endpoint Type : l4_generic [W] + url: str = None, # The URL, see syntax above. Can also be a local file. + url_rate: str = None, # How often should we process the URL(s), per 10 # minutes.
  • 600: 1/s
  • 1200: 2/s
  • 1800: 3/s
  • 2400: - # 4/s
- user_agent=None, # User-Agent string. Leave blank for default. Also SMTP-TO: + # 4/s [R][D:600] + user_agent: str = None, # User-Agent string. Leave blank for default. Also SMTP-TO: # <a@b.com><c@d.com>...<q@x.com> - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_l4_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -4019,9 +2685,10 @@ class LFJsonPost(LFCliBase): data["user_agent"] = user_agent if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_l4_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_l4_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4053,21 +2720,21 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_monitor(self, - aid=None, # AID, may be used when sniffing on /AX radios. - ap_name=None, # Name for this Monitor interface, for example: moni0 - bssid=None, # BSSID to use when sniffing on /AX radios, optional. - flags=None, # Flags for this monitor interface. - flags_mask=None, # Flags mask for this monitor interface. - radio=None, # Name of the physical radio interface, for example: wiphy0 - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + aid: str = None, # AID, may be used when sniffing on /AX radios. + ap_name: str = None, # Name for this Monitor interface, for example: moni0 [W] + bssid: str = None, # BSSID to use when sniffing on /AX radios, optional. + flags: str = None, # Flags for this monitor interface. + flags_mask: str = None, # Flags mask for this monitor interface. + radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_monitor(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aid is not None: data["aid"] = aid @@ -4087,9 +2754,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_monitor", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_monitor", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4099,22 +2767,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_mvlan ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_mvlan(self, - flags=None, # 0x1: Create admin-down. - index=None, # Optional: The index of the VLAN, (the 4 in eth0#4) - mac=None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: - # xx:xx:xx:*:*:xx - old_name=None, # The temporary name, used for configuring un-discovered hardware. - port=None, # Port number of an existing Ethernet interface. - report_timer=None, # Report timer for this port, leave blank or use NA for defaults. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + flags: str = None, # 0x1: Create admin-down. + index: str = None, # Optional: The index of the VLAN, (the 4 in + # eth0#4) + mac: str = None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: + # xx:xx:xx:*:*:xx [W] + old_name: str = None, # The temporary name, used for configuring un-discovered hardware. + port: str = None, # Port number of an existing Ethernet interface. [W] + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_mvlan(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if flags is not None: data["flags"] = flags @@ -4134,9 +2803,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_mvlan", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_mvlan", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4146,48 +2816,49 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_ppp_link(self, - auth=None, # YES if you want to authenticate. Default is NO. - channel_groups=None, # List of channel groups, see above. - debug=None, # YES for debug, otherwise debugging for the ppp connection is - # off. - down_time_max_ms=None, # Maximum length of downtime (ms) for PPP link between runs, or - # 0 for the link to be always up. - down_time_min_ms=None, # Minimum length of downtime (ms) for PPP link between runs, or - # 0 for the link to be always up. - dst_ip=None, # Destination IP address for this PPP connection. - extra_args=None, # Extra arguments to be passed directly to the pppd server. - holdoff=None, # Seconds between attempt to bring link back up if it dies, + auth: str = None, # YES if you want to authenticate. Default is NO. + channel_groups: str = None, # List of channel groups, see above. + p_debug: str = None, # YES for debug, otherwise debugging for the ppp connection + # is off. + down_time_max_ms: str = None, # Maximum length of downtime (ms) for PPP link between runs, + # or 0 for the link to be always up. + down_time_min_ms: str = None, # Minimum length of downtime (ms) for PPP link between runs, + # or 0 for the link to be always up. + dst_ip: str = None, # Destination IP address for this PPP connection. + extra_args: str = None, # Extra arguments to be passed directly to the pppd server. + holdoff: str = None, # Seconds between attempt to bring link back up if it dies, # suggest 1. - lcp_echo_failure=None, # LCP echo failures before we determine links is dead, suggest - # 5. - lcp_echo_interval=None, # Seconds between LCP echos, suggest 1. - mlppp_descriptor=None, # A unique key for use with multi-link PPP connections. - persist=None, # YES if you want to persist the connection. This is suggested. - pppoe_transport_port=None, # Port number (or name) for underlying PPPoE transport. - resource=None, # Resource (machine) number. - run_time_max_ms=None, # Maximum uptime (ms) for PPP link during an experiment, or 0 - # for the link to be always up. - run_time_min_ms=None, # Minimum uptime (ms) for PPP link during an experiment, or 0 - # for the link to be always up. - shelf=None, # Shelf name/id. - src_ip=None, # Source IP address for this PPP connection. - transport_type=None, # What sort of transport this ppp link uses. - tty_transport_device=None, # TTY device for PPP links associated with TTYs. - unit=None, # Unit number for the PPP link. ie, the 7 in ppp7. - debug_=False): + lcp_echo_failure: str = None, # LCP echo failures before we determine links is dead, + # suggest 5. + lcp_echo_interval: str = None, # Seconds between LCP echos, suggest 1. + mlppp_descriptor: str = None, # A unique key for use with multi-link PPP connections. + persist: str = None, # YES if you want to persist the connection. This is + # suggested. + pppoe_transport_port: str = None, # Port number (or name) for underlying PPPoE transport. + resource: str = None, # Resource (machine) number. [W] + run_time_max_ms: str = None, # Maximum uptime (ms) for PPP link during an experiment, or + # 0 for the link to be always up. + run_time_min_ms: str = None, # Minimum uptime (ms) for PPP link during an experiment, or + # 0 for the link to be always up. + shelf: str = None, # Shelf name/id. [R] + src_ip: str = None, # Source IP address for this PPP connection. + transport_type: str = None, # What sort of transport this ppp link uses. + tty_transport_device: str = None, # TTY device for PPP links associated with TTYs. + unit: str = None, # Unit number for the PPP link. ie, the 7 in ppp7. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_ppp_link(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if auth is not None: data["auth"] = auth if channel_groups is not None: data["channel_groups"] = channel_groups - if debug is not None: - data["debug"] = debug + if p_debug is not None: + data["debug"] = p_debug if down_time_max_ms is not None: data["down_time_max_ms"] = down_time_max_ms if down_time_min_ms is not None: @@ -4226,9 +2897,10 @@ class LFJsonPost(LFCliBase): data["unit"] = unit if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_ppp_link", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4305,28 +2977,28 @@ class LFJsonPost(LFCliBase): vlan = "vlan" # 802.1q VLAN. Specify VID with the 'freq' option. def post_add_profile(self, - alias_prefix=None, # Port alias prefix, aka hostname prefix. - antenna=None, # Antenna count for this profile. - bandwidth=None, # 0 (auto), 20, 40, 80 or 160 - eap_id=None, # EAP Identifier - flags_mask=None, # Specify what flags to set. - freq=None, # WiFi frequency to be used, 0 means default. - instance_count=None, # Number of devices (stations, vdevs, etc) - mac_pattern=None, # Optional MAC-Address pattern, for instance: xx:xx:xx:*:*:xx - name=None, # Profile Name. - passwd=None, # WiFi Password to be used (AP Mode), [BLANK] means no password. - profile_flags=None, # Flags for this profile, see above. - profile_type=None, # Profile type: See above. - ssid=None, # WiFi SSID to be used, [BLANK] means any. - vid=None, # Vlan-ID (only valid for vlan profiles). - wifi_mode=None, # WiFi Mode for this profile. - debug_=False): + alias_prefix: str = None, # Port alias prefix, aka hostname prefix. + antenna: str = None, # Antenna count for this profile. + bandwidth: str = None, # 0 (auto), 20, 40, 80 or 160 + eap_id: str = None, # EAP Identifier + flags_mask: str = None, # Specify what flags to set. + freq: str = None, # WiFi frequency to be used, 0 means default. + instance_count: str = None, # Number of devices (stations, vdevs, etc) + mac_pattern: str = None, # Optional MAC-Address pattern, for instance: xx:xx:xx:*:*:xx + name: str = None, # Profile Name. [R] + passwd: str = None, # WiFi Password to be used (AP Mode), [BLANK] means no password. + profile_flags: str = None, # Flags for this profile, see above. + profile_type: str = None, # Profile type: See above. [W] + ssid: str = None, # WiFi SSID to be used, [BLANK] means any. + vid: str = None, # Vlan-ID (only valid for vlan profiles). + wifi_mode: str = None, # WiFi Mode for this profile. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias_prefix is not None: data["alias_prefix"] = alias_prefix @@ -4360,9 +3032,10 @@ class LFJsonPost(LFCliBase): data["wifi_mode"] = wifi_mode if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4372,16 +3045,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_profile_notes ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_profile_notes(self, - dut=None, # Profile Name. - text=None, # [BLANK] will erase all, any other text will be appended to + dut: str = None, # Profile Name. [R] + text: str = None, # [BLANK] will erase all, any other text will be appended to # existing text. Unescaped Value - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_profile_notes(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if dut is not None: data["dut"] = dut @@ -4389,9 +3062,10 @@ class LFJsonPost(LFCliBase): data["text"] = text if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_profile_notes", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_profile_notes", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4401,18 +3075,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_rdd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_rdd(self, - peer_ifname=None, # The peer (other) RedirectDevice in this pair. - port=None, # Name of the Redirect Device to create. - report_timer=None, # Report timer for this port, leave blank or use NA for defaults. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + peer_ifname: str = None, # The peer (other) RedirectDevice in this pair. + port: str = None, # Name of the Redirect Device to create. [W] + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_rdd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if peer_ifname is not None: data["peer_ifname"] = peer_ifname @@ -4426,9 +3100,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_rdd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_rdd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4438,17 +3113,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_sec_ip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_sec_ip(self, - ip_list=None, # IP1/prefix,IP2/prefix,...IPZ/prefix. - port=None, # Name of network device (Port) to which these IPs will be added. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix. [W] + port: str = None, # Name of network device (Port) to which these IPs will be added. + # [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_sec_ip(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ip_list is not None: data["ip_list"] = ip_list @@ -4460,9 +3136,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_sec_ip", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_sec_ip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4567,43 +3244,44 @@ class LFJsonPost(LFCliBase): p_bitmap_ = "[bitmap]" # '0xff 00 ...' to directly specify the MCS bitmap. def post_add_sta(self, - ampdu_density=None, # 0-7, or 0xFF to not set. - ampdu_factor=None, # 0-3, or 0xFF to not set. - ap=None, # The Access Point BSSID this Virtual STA should be associated with - # (example: 00:11:22:33:4:55, or DEFAULT for any). - flags=None, # Flags for this interface (see above.) - flags_mask=None, # If set, only these flags will be considered. - ieee80211w=None, # Management Frame Protection: 0: disabled, 1: optional, 2: Required. - key=None, # Encryption key (WEP, WPA, WPA2, WPA3, etc) for this Virtual STA. + ampdu_density: str = None, # 0-7, or 0xFF to not set. + ampdu_factor: str = None, # 0-3, or 0xFF to not set. + ap: str = None, # The Access Point BSSID this Virtual STA should be associated with + flags: str = None, # Flags for this interface (see above.) [W] + flags_mask: str = None, # If set, only these flags will be considered. + ieee80211w: str = None, # Management Frame Protection: 0: disabled, 1: optional, 2: + # Required. + key: str = None, # Encryption key (WEP, WPA, WPA2, WPA3, etc) for this Virtual STA. # Prepend with 0x for ascii-hex input. - mac=None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: - # xx:xx:xx:*:*:xx - max_amsdu=None, # 1 == enabled, 0 == disabled, 0xFF == do not set. - mode=None, # WiFi mode:
  • 0: AUTO,
  • 1: 802.11a
  • 2: b
  • 3: - # g
  • 4: abg
  • 5: abgn
  • 6: bgn
  • 7: bg
  • - #
  • 8: abgnAC
  • 9 anAC
  • 10 an
  • 11 - # bgnAC
  • 12 abgnAX
  • 13 bgnAX
  • 14 anAX
  • 15 - # aAX
- nickname=None, # Nickname for this Virtual STA. (No longer used) - radio=None, # Name of the physical radio interface, for example: wiphy0 - rate=None, # Max rate, see help above. - resource=None, # Resource number. - shelf=None, # Shelf number. - ssid=None, # SSID for this Virtual STA. Use [BLANK] for empty SSID. Start with - # 0x for HEX interpretation. - sta_br_ip=None, # IP Address for station bridging. Set to 0.0.0.0 to use MAC bridging. - sta_name=None, # Name for this Virtual STA, for example: sta0 - wpa_cfg_file=None, # WPA Supplicant config file. - x_coord=None, # Floating point number. - y_coord=None, # Floating point number. - z_coord=None, # Floating point number. - debug_=False): + mac: str = None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: + # xx:xx:xx:*:*:xx [W] + max_amsdu: str = None, # 1 == enabled, 0 == disabled, 0xFF == do not set. + mode: str = None, # WiFi mode:
  • 0: AUTO,
  • 1: 802.11a
  • 2: b
  • + #
  • 3: g
  • 4: abg
  • 5: abgn
  • 6: bgn
  • + #
  • 7: bg
  • 8: abgnAC
  • 9 anAC
  • 10 + # an
  • 11 bgnAC
  • 12 abgnAX
  • 13 bgnAX
  • 14 + # anAX
  • 15 aAX
[D:0] + nickname: str = None, # Nickname for this Virtual STA. (No longer used) + radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] + rate: str = None, # Max rate, see help above. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + ssid: str = None, # SSID for this Virtual STA. Use [BLANK] for empty SSID. Start with + # 0x for HEX interpretation. [W] + sta_br_ip: str = None, # IP Address for station bridging. Set to 0.0.0.0 to use MAC + # bridging. + sta_name: str = None, # Name for this Virtual STA, for example: sta0 [W] + wpa_cfg_file: str = None, # WPA Supplicant config file. + x_coord: str = None, # Floating point number. + y_coord: str = None, # Floating point number. + z_coord: str = None, # Floating point number. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_sta(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ampdu_density is not None: data["ampdu_density"] = ampdu_density @@ -4651,9 +3329,10 @@ class LFJsonPost(LFCliBase): data["z_coord"] = z_coord if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_sta", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_sta", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4677,27 +3356,35 @@ class LFJsonPost(LFCliBase): p_533_ft = 3 # 399-533 feet p_655_ft = 4 # 533-655 feet + class AddT1SpanType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + Digium_T1 = "Digium_T1" # + Sangoma_E1 = "Sangoma_E1" # + Sangoma_T1 = "Sangoma_T1" # + def post_add_t1_span(self, - buildout=None, # Buildout, Integer, see above. - coding=None, # Coding: T1: ami or b8zs. E1: ami or hdb3 - cpu_id=None, # CPU identifier (A, B, etc) for multiport Sangoma resources. - first_channel=None, # The first DS0 channel for this span. - framing=None, # Framing: T1: esf or d4. E1: cas or ccs. - mtu=None, # MTU for this span (used by in-band management, if at all). - pci_bus=None, # PCI Bus number, needed for Sangoma resources. - pci_slot=None, # PCI slot number, needed for Sangoma resources. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - span_num=None, # The span number. First span is 1, second is 2... - timing=None, # Timing: 0 == do not use, 1 == primary, 2 == secondary.. - p_type=None, # Currently supported types are: Sangoma_T1, Sangoma_E1, Digium_T1 - debug_=False): + buildout: str = None, # Buildout, Integer, see above. + coding: str = None, # Coding: T1: ami or b8zs. E1: ami or hdb3 + cpu_id: str = None, # CPU identifier (A, B, etc) for multiport Sangoma resources. + first_channel: str = None, # The first DS0 channel for this span. + framing: str = None, # Framing: T1: esf or d4. E1: cas or ccs. + mtu: str = None, # MTU for this span (used by in-band management, if at all). + pci_bus: str = None, # PCI Bus number, needed for Sangoma resources. + pci_slot: str = None, # PCI slot number, needed for Sangoma resources. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + span_num: str = None, # The span number. First span is 1, second is 2... [W] + timing: str = None, # Timing: 0 == do not use, 1 == primary, 2 == secondary.. + p_type: str = None, # Currently supported types listed above. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_t1_span(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if buildout is not None: data["buildout"] = buildout @@ -4727,9 +3414,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_t1_span", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_t1_span", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4739,17 +3427,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_text_blob ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_text_blob(self, - name=None, # Text name, for instance '2-AP-test-case' - text=None, # [BLANK] will erase all, any other text will be appended to existing - # text. Unescaped Value - p_type=None, # Text type identifier stream, for instance 'cv-connectivity' - debug_=False): + name: str = None, # Text name, for instance '2-AP-test-case' [R] + text: str = None, # [BLANK] will erase all, any other text will be appended to + # existing text. Unescaped Value + p_type: str = None, # Text type identifier stream, for instance 'cv-connectivity' [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_text_blob(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -4759,9 +3447,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_text_blob", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_text_blob", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4771,15 +3460,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_tgcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_tgcx(self, - cxname=None, # The name of the CX. - tgname=None, # The name of the test group. - debug_=False): + cxname: str = None, # The name of the CX. [R] + tgname: str = None, # The name of the test group. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_tgcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cxname is not None: data["cxname"] = cxname @@ -4787,9 +3476,10 @@ class LFJsonPost(LFCliBase): data["tgname"] = tgname if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_tgcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_tgcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4821,19 +3511,19 @@ class LFJsonPost(LFCliBase): TX_BPS_RATE_OOR_3S = 0 # tx-bps over last 3 seconds is out of range. def post_add_threshold(self, - endp=None, # Endpoint name or ID. - thresh_id=None, # Threshold ID. If adding new threshold, use -1, otherwise use - # correct ID. - thresh_max=None, # Maximum acceptable value for this threshold. - thresh_min=None, # Minimum acceptable value for this threshold. - thresh_type=None, # Threshold type, integer, (see above). - debug_=False): + endp: str = None, # Endpoint name or ID. [R] + thresh_id: str = None, # Threshold ID. If adding new threshold, use -1, otherwise use + # correct ID. [W] + thresh_max: str = None, # Maximum acceptable value for this threshold. + thresh_min: str = None, # Minimum acceptable value for this threshold. + thresh_type: str = None, # Threshold type, integer, (see above). + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_threshold(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp is not None: data["endp"] = endp @@ -4847,9 +3537,10 @@ class LFJsonPost(LFCliBase): data["thresh_type"] = thresh_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_threshold", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_threshold", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4859,22 +3550,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_tm ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_tm(self, - name=None, # The name of the test manager. Must be unique across test managers. - debug_=False): + name: str = None, # The name of the test manager. Must be unique across test managers. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_tm(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_tm", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_tm", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4918,23 +3610,24 @@ class LFJsonPost(LFCliBase): udp = "udp" # def post_add_traffic_profile(self, - instance_count=None, # Number of connections per device - max_pdu=None, # Minimum PDU size - max_speed=None, # Opposite-Direction Speed in bps. - min_pdu=None, # Minimum PDU size - min_speed=None, # Opposite-Direction Speed in bps. - name=None, # Profile Name. - tos=None, # IP Type-of-Service - traffic_profile_flags=None, # Flags for this profile, none defined at this point. - traffic_profile_flags_mask=None, # Specify what flags to set. - p_type=None, # Profile type: See above.. - debug_=False): + instance_count: str = None, # Number of connections per device + max_pdu: str = None, # Minimum PDU size + max_speed: str = None, # Opposite-Direction Speed in bps. + min_pdu: str = None, # Minimum PDU size + min_speed: str = None, # Opposite-Direction Speed in bps. + name: str = None, # Profile Name. [R] + tos: str = None, # IP Type-of-Service + traffic_profile_flags: str = None, # Flags for this profile, none defined at this + # point. + traffic_profile_flags_mask: str = None, # Specify what flags to set. + p_type: str = None, # Profile type: See above. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_traffic_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if instance_count is not None: data["instance_count"] = instance_count @@ -4958,9 +3651,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_traffic_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_traffic_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4970,17 +3664,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_traffic_profile_notes ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_traffic_profile_notes(self, - dut=None, # Profile Name. - text=None, # [BLANK] will erase all, any other text will be appended - # to existing text. Unescaped - # Value - debug_=False): + dut: str = None, # Profile Name. [R] + text: str = None, # [BLANK] will erase all, any other text will be + # appended to existing text. Unescaped Value + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_traffic_profile_notes(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if dut is not None: data["dut"] = dut @@ -4988,9 +3682,10 @@ class LFJsonPost(LFCliBase): data["text"] = text if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_traffic_profile_notes", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_traffic_profile_notes", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5074,36 +3769,37 @@ class LFJsonPost(LFCliBase): g = 3 # 802.11g def post_add_vap(self, - ap_name=None, # Name for this Virtual AP, for example: vap0 - beacon=None, # The beacon interval, in 1kus (1.024 ms), default 100, range: 15..65535 - custom_cfg=None, # Custom hostapd config file, if you want to craft your own config. - dtim_period=None, # DTIM period, range 1..255. Default 2. - flags=None, # Flags for this interface (see above.) - flags_mask=None, # If set, only these flags will be considered. - frag_thresh=None, # UN-USED, Was Fragmentation threshold, which is now set with - # set_wifi_radio, use NA - ieee80211w=None, # Management Frame Protection: 0: disabled, 1: optional, 2: Required. - key=None, # Encryption key for this Virtual AP. Prepend with 0x for ascii-hex + ap_name: str = None, # Name for this Virtual AP, for example: vap0 [W] + beacon: str = None, # The beacon interval, in 1kus (1.024 ms), default 100, range: + # 15..65535 + custom_cfg: str = None, # Custom hostapd config file, if you want to craft your own config. + dtim_period: str = None, # DTIM period, range 1..255. Default 2. + flags: str = None, # Flags for this interface (see above.) [W] + flags_mask: str = None, # If set, only these flags will be considered. + frag_thresh: str = None, # UN-USED, Was Fragmentation threshold, which is now set with + # set_wifi_radio, use NA [W] + ieee80211w: str = None, # Management Frame Protection: 0: disabled, 1: optional, 2: Required. + key: str = None, # Encryption key for this Virtual AP. Prepend with 0x for ascii-hex # representation. - mac=None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: + mac: str = None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: # xx:xx:xx:*:*:xx - max_sta=None, # Maximum number of Stations allowed to join this AP (1..2007) - mode=None, # WiFi mode: see table - radio=None, # Name of the physical radio interface, for example: wiphy0 - rate=None, # Max rate, see help for add_vsta - resource=None, # Resource number. - shelf=None, # Shelf number. - ssid=None, # SSID for this Virtual AP. - x_coord=None, # Floating point number. - y_coord=None, # Floating point number. - z_coord=None, # Floating point number. - debug_=False): + max_sta: str = None, # Maximum number of Stations allowed to join this AP (1..2007) + mode: str = None, # WiFi mode: see table [W] + radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] + rate: str = None, # Max rate, see help for add_vsta + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + ssid: str = None, # SSID for this Virtual AP. [W] + x_coord: str = None, # Floating point number. + y_coord: str = None, # Floating point number. + z_coord: str = None, # Floating point number. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vap(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ap_name is not None: data["ap_name"] = ap_name @@ -5147,9 +3843,10 @@ class LFJsonPost(LFCliBase): data["z_coord"] = z_coord if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vap", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vap", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5227,24 +3924,24 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_venue(self, - description=None, # User-supplied description, ie: Big City Ball Park; + description: str = None, # User-supplied description, ie: Big City Ball Park; # 47-characters max. - freq_24=None, # Frequency list for 2.4Ghz band, see above. - freq_5=None, # Frequency list for 5Ghz band, see above. - resource=None, # Resource number. - shelf=None, # Shelf number. - venu_id=None, # Number to uniquely identify this venue on this resource. - x1=None, # Floating point coordinate for lower-left corner. - x2=None, # Floating point coordinate for upper-right corner. - y1=None, # Floating point coordinate for lower-left corner. - y2=None, # Floating point coordinate for upper-right corner. - debug_=False): + freq_24: str = None, # Frequency list for 2.4Ghz band, see above. + freq_5: str = None, # Frequency list for 5Ghz band, see above. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + venu_id: str = None, # Number to uniquely identify this venue on this resource. [W] + x1: str = None, # Floating point coordinate for lower-left corner. + x2: str = None, # Floating point coordinate for upper-right corner. + y1: str = None, # Floating point coordinate for lower-left corner. + y2: str = None, # Floating point coordinate for upper-right corner. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_venue(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if description is not None: data["description"] = description @@ -5268,9 +3965,10 @@ class LFJsonPost(LFCliBase): data["y2"] = y2 if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_venue", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_venue", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5280,19 +3978,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_vlan ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_vlan(self, - old_name=None, # The temporary name, used for configuring un-discovered hardware. - port=None, # Port number of an existing Ethernet interface. - report_timer=None, # Report timer for this port, leave blank or use NA for defaults. - resource=None, # Resource number. - shelf=None, # Shelf number. - vid=None, # The VLAN-ID for this 802.1Q VLAN interface. - debug_=False): + old_name: str = None, # The temporary name, used for configuring un-discovered hardware. + port: str = None, # Port number of an existing Ethernet interface. [W] + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + vid: str = None, # The VLAN-ID for this 802.1Q VLAN interface. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vlan(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if old_name is not None: data["old_name"] = old_name @@ -5308,9 +4006,10 @@ class LFJsonPost(LFCliBase): data["vid"] = vid if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vlan", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vlan", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5320,34 +4019,35 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_voip_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_voip_endp(self, - alias=None, # Name of endpoint. - auth_user_name=None, # Use this field for authentication user name. AUTO or blank mean - # use phone number. - display_name=None, # User-Name to be displayed. Use AUTO to display phone number. - gateway_port=None, # IP Port for SIP gateway (defaults to 5060). - ip_addr=None, # Use this IP for local IP address. Useful when there are + alias: str = None, # Name of endpoint. [R] + auth_user_name: str = None, # Use this field for authentication user name. AUTO or blank + # mean use phone number. + display_name: str = None, # User-Name to be displayed. Use AUTO to display phone number. + gateway_port: str = None, # IP Port for SIP gateway (defaults to 5060). + ip_addr: str = None, # Use this IP for local IP address. Useful when there are # multiple IPs on a port. - peer_phone_num=None, # Use AUTO to use phone number of peer endpoint, otherwise + peer_phone_num: str = None, # Use AUTO to use phone number of peer endpoint, otherwise # specify a number: user[@host[:port]] - phone_num=None, # Phone number for Endpoint - port=None, # Port number or name. - proxy_passwd=None, # Password to be used when registering with proxy/gateway. - resource=None, # Resource number. - rtp_port=None, # RTP port to use for send and receive. - rx_sound_file=None, # File name to save received PCM data to. Will be in WAV format, - # or AUTO - shelf=None, # Shelf name/id. - sip_gateway=None, # SIP Gateway/Proxy Name, this is who to register with, or AUTO - tx_sound_file=None, # File name containing the sound sample we will be playing. - vad_max_timer=None, # How often should we force a packet, even if VAD is on. - vad_timer=None, # How much silence (milliseconds) before VAD is enabled. - debug_=False): + phone_num: str = None, # Phone number for Endpoint [W] + port: str = None, # Port number or name. [W] + proxy_passwd: str = None, # Password to be used when registering with proxy/gateway. + resource: str = None, # Resource number. [W] + rtp_port: str = None, # RTP port to use for send and receive. + rx_sound_file: str = None, # File name to save received PCM data to. Will be in WAV + # format, or AUTO + shelf: str = None, # Shelf name/id. [R][D:1] + sip_gateway: str = None, # SIP Gateway/Proxy Name, this is who to register with, or + # AUTO + tx_sound_file: str = None, # File name containing the sound sample we will be playing. + vad_max_timer: str = None, # How often should we force a packet, even if VAD is on. + vad_timer: str = None, # How much silence (milliseconds) before VAD is enabled. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_voip_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -5385,9 +4085,10 @@ class LFJsonPost(LFCliBase): data["vad_timer"] = vad_timer if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_voip_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_voip_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5429,25 +4130,25 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_vr(self, - alias=None, # Name of virtual router. - flags=None, # Virtual router flags, see above for definitions. - height=None, # Height to be used when drawn in the LANforge-GUI. - notes=None, # Notes for this Virtual Router. Put in quotes if the notes include + alias: str = None, # Name of virtual router. [R] + flags: str = None, # Virtual router flags, see above for definitions. + height: str = None, # Height to be used when drawn in the LANforge-GUI. + notes: str = None, # Notes for this Virtual Router. Put in quotes if the notes include # white-space. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - vr_id=None, # Leave blank, use NA or 0xFFFF unless you are certain of the value you + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + vr_id: str = None, # Leave blank, use NA or 0xFFFF unless you are certain of the value you # want to enter. - width=None, # Width to be used when drawn in the LANforge-GUI. - x=None, # X coordinate to be used when drawn in the LANforge-GUI. - y=None, # Y coordinate to be used when drawn in the LANforge-GUI. - debug_=False): + width: str = None, # Width to be used when drawn in the LANforge-GUI. + x: str = None, # X coordinate to be used when drawn in the LANforge-GUI. + y: str = None, # Y coordinate to be used when drawn in the LANforge-GUI. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -5471,9 +4172,10 @@ class LFJsonPost(LFCliBase): data["y"] = y if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5507,25 +4209,25 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_vr_bgp(self, - bgp_id=None, # BGP Identifier: IPv4 Address - cluster_id=None, # Cluster ID, IPv4 Address. Use NA if not clustering. - confed_id=None, # Confederation ID 1-65535. Use NA if not in a confederation. - flags=None, # Virtual router BGP flags, see above for definitions. - half_life=None, # Halflife in minutes for damping configuration. - local_as=None, # BGP Autonomous System number, 1-65535 - max_suppress=None, # Maximum hold down time in minutes for damping configuration. - resource=None, # Resource number. - reuse=None, # Route flag damping reuse threshold, in minutes. - shelf=None, # Shelf name/id. - suppress=None, # Route flag damping cutoff threshold, in minutes. - vr_id=None, # Name of virtual router. - debug_=False): + bgp_id: str = None, # BGP Identifier: IPv4 Address [W] + cluster_id: str = None, # Cluster ID, IPv4 Address. Use NA if not clustering. + confed_id: str = None, # Confederation ID 1-65535. Use NA if not in a confederation. + flags: str = None, # Virtual router BGP flags, see above for definitions. + half_life: str = None, # Halflife in minutes for damping configuration. + local_as: str = None, # BGP Autonomous System number, 1-65535 + max_suppress: str = None, # Maximum hold down time in minutes for damping configuration. + resource: str = None, # Resource number. [W] + reuse: str = None, # Route flag damping reuse threshold, in minutes. + shelf: str = None, # Shelf name/id. [R][D:1] + suppress: str = None, # Route flag damping cutoff threshold, in minutes. + vr_id: str = None, # Name of virtual router. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vr_bgp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if bgp_id is not None: data["bgp_id"] = bgp_id @@ -5553,9 +4255,10 @@ class LFJsonPost(LFCliBase): data["vr_id"] = vr_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vr_bgp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vr_bgp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5598,47 +4301,48 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_vrcx(self, - dhcp_dns=None, # IP Address of DNS server. - dhcp_dns6=None, # IPv6 Address of DNS server. - dhcp_domain=None, # DHCP Domain name to serve. - dhcp_lease_time=None, # DHCP Lease time (in seconds) - dhcp_max=None, # Minimum IP address range to serve. - dhcp_max6=None, # Minimum IPv6 address to serve. - dhcp_min=None, # Minimum IP address range to serve. - dhcp_min6=None, # Minimum IPv6 address to serve. - flags=None, # Flags, specify if subnets 0-7 are in use, see above for others. - height=None, # Height to be used when drawn in the LANforge-GUI. - interface_cost=None, # If using OSPF, this sets the cost for this link (1-65535). - local_dev=None, # Name of port A, the local network device pair. - local_dev_b=None, # Name of port B for the local redirect device pair. - nexthop=None, # The next-hop to use when routing packets out this interface. - ospf_area=None, # If using OSPF, this sets the OSPF area for this interface. Default - # is 0.0.0.0. - remote_dev=None, # Name the remote network device. - remote_dev_b=None, # Name of port B for the remote network device. - resource=None, # Resource number. - rip_metric=None, # If using RIP, this determines the RIP metric (cost), (1-15, 15 is - # infinite). - shelf=None, # Shelf name/id. - subnets=None, # Subnets associated with this link, format: 1.1.1.1/24,1.1.2.1/16... - vr_name=None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add a - # stand-alone endpoint. - vrrp_id=None, # VRRP id, must be unique in this virtual router (1-255) - vrrp_interval=None, # VRRP broadcast message interval, in seconds (1-255) - vrrp_ip=None, # VRRP IPv4 address..ignored if not flagged for VRRP. - vrrp_ip_prefix=None, # Number of bits in subnet mask, ie 24 for 255.255.255.0 - vrrp_priority=None, # VRRP Priority (1-255, higher is more priority.) - wanlink=None, # The name of the WanLink that connects the two B ports. - width=None, # Width to be used when drawn in the LANforge-GUI. - x=None, # X coordinate to be used when drawn in the LANforge-GUI. - y=None, # Y coordinate to be used when drawn in the LANforge-GUI. - debug_=False): + dhcp_dns: str = None, # IP Address of DNS server. + dhcp_dns6: str = None, # IPv6 Address of DNS server. + dhcp_domain: str = None, # DHCP Domain name to serve. + dhcp_lease_time: str = None, # DHCP Lease time (in seconds) + dhcp_max: str = None, # Minimum IP address range to serve. + dhcp_max6: str = None, # Minimum IPv6 address to serve. + dhcp_min: str = None, # Minimum IP address range to serve. + dhcp_min6: str = None, # Minimum IPv6 address to serve. + flags: str = None, # Flags, specify if subnets 0-7 are in use, see above for others. + height: str = None, # Height to be used when drawn in the LANforge-GUI. + interface_cost: str = None, # If using OSPF, this sets the cost for this link (1-65535). + local_dev: str = None, # Name of port A, the local network device pair. [W] + local_dev_b: str = None, # Name of port B for the local redirect device pair. [W] + nexthop: str = None, # The next-hop to use when routing packets out this interface. + ospf_area: str = None, # If using OSPF, this sets the OSPF area for this interface. + # Default is 0.0.0.0. + remote_dev: str = None, # Name the remote network device. [W] + remote_dev_b: str = None, # Name of port B for the remote network device. [W] + resource: str = None, # Resource number. [W] + rip_metric: str = None, # If using RIP, this determines the RIP metric (cost), (1-15, 15 + # is infinite). + shelf: str = None, # Shelf name/id. [R][D:1] + subnets: str = None, # Subnets associated with this link, format: + # 1.1.1.1/24,1.1.2.1/16... + vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add + # a stand-alone endpoint. [R][D:FREE_LIST] + vrrp_id: str = None, # VRRP id, must be unique in this virtual router (1-255) + vrrp_interval: str = None, # VRRP broadcast message interval, in seconds (1-255) + vrrp_ip: str = None, # VRRP IPv4 address..ignored if not flagged for VRRP. + vrrp_ip_prefix: str = None, # Number of bits in subnet mask, ie 24 for 255.255.255.0 + vrrp_priority: str = None, # VRRP Priority (1-255, higher is more priority.) + wanlink: str = None, # The name of the WanLink that connects the two B ports. [W] + width: str = None, # Width to be used when drawn in the LANforge-GUI. + x: str = None, # X coordinate to be used when drawn in the LANforge-GUI. + y: str = None, # Y coordinate to be used when drawn in the LANforge-GUI. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vrcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if dhcp_dns is not None: data["dhcp_dns"] = dhcp_dns @@ -5704,9 +4408,10 @@ class LFJsonPost(LFCliBase): data["y"] = y if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vrcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5716,21 +4421,21 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_vrcx2 ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_vrcx2(self, - local_dev=None, # Name of port A for the connection. - nexthop6=None, # The IPv6 next-hop to use when routing packets out this interface. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - subnets6=None, # IPv6 Subnets associated with this link, format: + local_dev: str = None, # Name of port A for the connection. [W] + nexthop6: str = None, # The IPv6 next-hop to use when routing packets out this interface. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + subnets6: str = None, # IPv6 Subnets associated with this link, format: # aaaa:bbbb::0/64,cccc:dddd:eeee::0/64... - vr_name=None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add a - # stand-alone endpoint. - debug_=False): + vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add a + # stand-alone endpoint. [W][D:FREE_LIST] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vrcx2(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if local_dev is not None: data["local_dev"] = local_dev @@ -5746,9 +4451,10 @@ class LFJsonPost(LFCliBase): data["vr_name"] = vr_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vrcx2", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vrcx2", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5765,68 +4471,72 @@ class LFJsonPost(LFCliBase): SHOW_WP = 1 # Show WanPaths in wanlink endpoint table in GUI def post_add_wl_endp(self, - alias=None, # Name of WanPath. - cpu_id=None, # The CPU/thread that this process should run on (kernel-mode - # only). - description=None, # Description for this endpoint, put in single quotes if it + alias: str = None, # Name of WanPath. [R] + cpu_id: str = None, # The CPU/thread that this process should run on + # (kernel-mode only). + description: str = None, # Description for this endpoint, put in single quotes if it # contains spaces. - dest_ip=None, # Selection filter: Destination IP. - dest_ip_mask=None, # Selection filter: Destination IP MASK. - drop_every_xth_pkt=None, # YES to periodically drop every Xth pkt, NO to drop packets + dest_ip: str = None, # Selection filter: Destination IP. + dest_ip_mask: str = None, # Selection filter: Destination IP MASK. + drop_every_xth_pkt: str = None, # YES to periodically drop every Xth pkt, NO to drop packets # randomly. - drop_freq=None, # How often, out of 1,000,000 packets, should we purposefully - # drop a packet. - dup_every_xth_pkt=None, # YES to periodically duplicate every Xth pkt, NO to duplicate - # packets randomly. - dup_freq=None, # How often, out of 1,000,000 packets, should we purposefully - # duplicate a packet. - extra_buffer=None, # The extra amount of bytes to buffer before dropping pkts, in - # units of 1024, use -1 for AUTO. - ignore_bandwidth=None, # Should we ignore the bandwidth settings from the playback + drop_freq: str = None, # How often, out of 1,000,000 packets, should we + # purposefully drop a packet. [W] + dup_every_xth_pkt: str = None, # YES to periodically duplicate every Xth pkt, NO to + # duplicate packets randomly. + dup_freq: str = None, # How often, out of 1,000,000 packets, should we + # purposefully duplicate a packet. [W] + extra_buffer: str = None, # The extra amount of bytes to buffer before dropping pkts, + # in units of 1024, use -1 for AUTO. [D:-1] + ignore_bandwidth: str = None, # Should we ignore the bandwidth settings from the playback # file? YES, NO, or NA. - ignore_dup=None, # Should we ignore the Duplicate Packet settings from the + ignore_dup: str = None, # Should we ignore the Duplicate Packet settings from the # playback file? YES, NO, or NA. - ignore_latency=None, # Should we ignore the latency settings from the playback file? - # YES, NO, or NA. - ignore_loss=None, # Should we ignore the packet-loss settings from the playback + ignore_latency: str = None, # Should we ignore the latency settings from the playback # file? YES, NO, or NA. - jitter_freq=None, # How often, out of 1,000,000 packets, should we apply random - # jitter. - latency=None, # The base latency added to all packets, in milliseconds (or add - # 'us' suffix for microseconds) - max_drop_amt=None, # Maximum amount of packets to drop in a row. Default is 1. - max_jitter=None, # The maximum jitter, in milliseconds (or add 'us' suffix for - # microseconds) - max_lateness=None, # Maximum amount of un-intentional delay before pkt is dropped. - # Default is AUTO - max_rate=None, # Maximum transmit rate (bps) for this WanLink. - max_reorder_amt=None, # Maximum amount of packets by which to reorder, Default is 10. - min_drop_amt=None, # Minimum amount of packets to drop in a row. Default is 1. - min_reorder_amt=None, # Minimum amount of packets by which to reorder, Default is 1. - playback_capture=None, # ON or OFF, should we play back a WAN capture file? - playback_capture_file=None, # Name of the WAN capture file to play back. - playback_loop=None, # Should we loop the playback file, YES or NO or NA. - port=None, # Port number. - reorder_every_xth_pkt=None, # YES to periodically reorder every Xth pkt, NO to reorder + ignore_loss: str = None, # Should we ignore the packet-loss settings from the + # playback file? YES, NO, or NA. + jitter_freq: str = None, # How often, out of 1,000,000 packets, should we apply + # random jitter. + latency: str = None, # The base latency added to all packets, in milliseconds (or + # add 'us' suffix for microseconds) [W] + max_drop_amt: str = None, # Maximum amount of packets to drop in a row. Default is 1. + # [D:1] + max_jitter: str = None, # The maximum jitter, in milliseconds (or add 'us' suffix + # for microseconds) [W] + max_lateness: str = None, # Maximum amount of un-intentional delay before pkt is + # dropped. Default is AUTO + max_rate: str = None, # Maximum transmit rate (bps) for this WanLink. + max_reorder_amt: str = None, # Maximum amount of packets by which to reorder, Default is + # 10. [D:10] + min_drop_amt: str = None, # Minimum amount of packets to drop in a row. Default is 1. + # [D:1] + min_reorder_amt: str = None, # Minimum amount of packets by which to reorder, Default is + # 1. [D:1] + playback_capture: str = None, # ON or OFF, should we play back a WAN capture file? + playback_capture_file: str = None, # Name of the WAN capture file to play back. + playback_loop: str = None, # Should we loop the playback file, YES or NO or NA. + port: str = None, # Port number. [W] + reorder_every_xth_pkt: str = None, # YES to periodically reorder every Xth pkt, NO to reorder # packets randomly. - reorder_freq=None, # How often, out of 1,000,000 packets, should we make a packet - # out of order. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - source_ip=None, # Selection filter: Source IP. - source_ip_mask=None, # Selection filter: Source IP MASK. - speed=None, # The maximum speed this WanLink will accept (bps). - test_mgr=None, # The name of the Test-Manager this WanPath is to use. Leave + reorder_freq: str = None, # How often, out of 1,000,000 packets, should we make a + # packet out of order. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + source_ip: str = None, # Selection filter: Source IP. + source_ip_mask: str = None, # Selection filter: Source IP MASK. + speed: str = None, # The maximum speed this WanLink will accept (bps). [W] + test_mgr: str = None, # The name of the Test-Manager this WanPath is to use. Leave # blank for no restrictions. - wanlink=None, # Name of WanLink to which we are adding this WanPath. - wle_flags=None, # WanLink Endpoint specific flags, see above. - debug_=False): + wanlink: str = None, # Name of WanLink to which we are adding this WanPath. [R] + wle_flags: str = None, # WanLink Endpoint specific flags, see above. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_wl_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -5904,9 +4614,10 @@ class LFJsonPost(LFCliBase): data["wle_flags"] = wle_flags if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_wl_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_wl_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5916,20 +4627,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#admin ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_admin(self, - arg1=None, # Argument 1: xorp-port | scan-rslts-file | iface-name | iface-eid | + arg1: str = None, # Argument 1: xorp-port | scan-rslts-file | iface-name | iface-eid | # rfgen-message | id - arg2=None, # Argument 2: scan key | message | angle | dest-radio - arg3=None, # Argument 3: noprobe | migrate-sta-mac-pattern - arg5=None, # Argument 4: table-speed - cmd=None, # Admin command: + arg2: str = None, # Argument 2: scan key | message | angle | dest-radio + arg3: str = None, # Argument 3: noprobe | migrate-sta-mac-pattern + arg5: str = None, # Argument 4: table-speed + cmd: str = None, # Admin command: # resync_clock|write_xorp_cfg|scan_complete|ifup_post_complete|flush_complete|req_migrate|rfgen|chamber|clean_logs - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_admin(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if arg1 is not None: data["arg1"] = arg1 @@ -5943,9 +4654,10 @@ class LFJsonPost(LFCliBase): data["cmd"] = cmd if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/admin", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/admin", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5955,15 +4667,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#apply_vr_cfg ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_apply_vr_cfg(self, - resource=None, # The number of the resource in question, or 'ALL'. - shelf=None, # The number of the shelf in question, or 'ALL'. - debug_=False): + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:ALL] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_apply_vr_cfg(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -5971,9 +4683,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/apply_vr_cfg", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/apply_vr_cfg", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5983,16 +4696,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#blink_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_blink_attenuator(self, - resource=None, # Resource number. - serno=None, # Serial number for requested Attenuator, or 'all'. - shelf=None, # Shelf number, usually 1. - debug_=False): + resource: str = None, # Resource number. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number, usually 1. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_blink_attenuator(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -6002,9 +4715,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/blink_attenuator", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/blink_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6040,18 +4754,18 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_c_show_ports(self, - port=None, # Port number, or 'all'. - probe_flags=None, # See above, add them together for multiple probings. Leave blank if - # you want stats only. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + port: str = None, # Port number, or 'all'. [W] + probe_flags: str = None, # See above, add them together for multiple probings. Leave + # blank if you want stats only. + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_c_show_ports(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -6063,9 +4777,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/c_show_ports", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/c_show_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6075,15 +4790,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#cancel_vr_cfg ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_cancel_vr_cfg(self, - resource=None, # The number of the resource in question, or 'ALL'. - shelf=None, # The number of the shelf in question, or 'ALL'. - debug_=False): + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:ALL] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_cancel_vr_cfg(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -6091,9 +4806,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/cancel_vr_cfg", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/cancel_vr_cfg", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6103,23 +4819,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_cd_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_cd_counters(self, - cd_name=None, # Name of Collision Domain, or 'all'. Null argument is same as - # 'all'. - debug_=False): + cd_name: str = None, # Name of Collision Domain, or 'all'. Null argument is same + # as 'all'. [W][D:all] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_cd_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd_name is not None: data["cd_name"] = cd_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_cd_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_cd_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6129,23 +4846,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_cx_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_cx_counters(self, - cx_name=None, # Name of Cross Connect, or 'all'. Null argument is same as - # 'all'. - debug_=False): + cx_name: str = None, # Name of Cross Connect, or 'all'. Null argument is same as + # 'all'. [W][D:all] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_cx_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_cx_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_cx_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6155,19 +4873,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_endp_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_endp_counters(self, - endp_name=None, # Name of Endpoint, or 'all'. Null argument is same as - # 'all'. - incr_seqno=None, # Enter 'YES' if you want the target to increment the + endp_name: str = None, # Name of Endpoint, or 'all'. Null argument is same as + # 'all'. [W][D:all] + incr_seqno: str = None, # Enter 'YES' if you want the target to increment the # cfg-seq-no. - just_latency=None, # Enter 'YES' if you only want to clear latency counters, + just_latency: str = None, # Enter 'YES' if you only want to clear latency counters, # and see above for RXGAP. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_endp_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name @@ -6177,9 +4895,10 @@ class LFJsonPost(LFCliBase): data["just_latency"] = just_latency if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_endp_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_endp_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6189,22 +4908,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_group(self, - name=None, # The name of the test group. - debug_=False): + name: str = None, # The name of the test group. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6223,18 +4943,18 @@ class LFJsonPost(LFCliBase): dhcp_leases = "dhcp_leases" # Remove dhcp lease files for IPv4 and IPv6 DHCP def post_clear_port_counters(self, - extra=None, # Clear something else instead: dhcp4_lease | dhcp6_lease | + extra: str = None, # Clear something else instead: dhcp4_lease | dhcp6_lease | # dhcp_leases - port=None, # The number of the port in question, or 'ALL'. - resource=None, # The number of the resource in question, or 'ALL'. - shelf=None, # The number of the shelf in question, or 'ALL'. - debug_=False): + port: str = None, # The number of the port in question, or 'ALL'. [W] + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_port_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if extra is not None: data["extra"] = extra @@ -6246,9 +4966,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_port_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_port_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6258,15 +4979,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_resource_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_resource_counters(self, - resource=None, # The number of the resource in question, or 'ALL'. - shelf=None, # The number of the shelf in question, or 'ALL'. - debug_=False): + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. + # [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_resource_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -6274,9 +4996,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_resource_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_resource_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6286,15 +5009,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_wp_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_wp_counters(self, - endp_name=None, # Name of WanLink Endpoint. - wp_name=None, # Name of WanPath to clear. - debug_=False): + endp_name: str = None, # Name of WanLink Endpoint. [W] + wp_name: str = None, # Name of WanPath to clear. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_wp_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name @@ -6302,9 +5025,10 @@ class LFJsonPost(LFCliBase): data["wp_name"] = wp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_wp_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_wp_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6314,18 +5038,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#create_client ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_create_client(self, - name=None, # A single name with no white-spaces (15 characters or less) - password=None, # Can be blank or 'NA' if no password is set, otherwise must be the - # password. Use IGNORE for no change. - super_user=None, # 1 If you want this user to have Administrative powers, 0 or blank - # otherwise. - debug_=False): + name: str = None, # A single name with no white-spaces (15 characters or less) [W] + password: str = None, # Can be blank or 'NA' if no password is set, otherwise must be + # the password. Use IGNORE for no change. + super_user: str = None, # 1 If you want this user to have Administrative powers, 0 or + # blank otherwise. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_create_client(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -6335,9 +5059,10 @@ class LFJsonPost(LFCliBase): data["super_user"] = super_user if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/create_client", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/create_client", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6346,17 +5071,32 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#diag ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class DiagType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + NA = "NA" # everything (default) + alerts = "alerts" # alert messages + clients = "clients" # connected clients + counters = "counters" # endpoint counters + endpoints = "endpoints" # list of endpoints + fds = "fds" # file descriptors + iobuffer = "iobuffer" # + license = "license" # license contents + shelf = "shelf" # + def post_diag(self, - arg1=None, # Optional: Endpoint name to diag. - p_type=None, # Default (blank) is everything, options: alerts, license, counters, fds, + arg1: str = None, # Optional: Endpoint name to diag. + p_type: str = None, # Default (blank) is everything, options: alerts, license, counters, fds, # clients, endpoints, shelf, iobuffer. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_diag(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if arg1 is not None: data["arg1"] = arg1 @@ -6364,9 +5104,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/diag", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/diag", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6376,16 +5117,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#discover ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_discover(self, - disconnect=None, # Set to 'disconnect' to force disconnect to remote resource process. - resource=None, # Resource ID. Use if discovering Attenuators. - shelf=None, # Shelf-ID, only used if discovering Attenuators. - debug_=False): + disconnect: str = None, # Set to 'disconnect' to force disconnect to remote resource process. + resource: str = None, # Resource ID. Use if discovering Attenuators. [W] + shelf: str = None, # Shelf-ID, only used if discovering Attenuators. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_discover(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if disconnect is not None: data["disconnect"] = disconnect @@ -6395,9 +5136,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/discover", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/discover", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6407,15 +5149,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#do_pesq ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_do_pesq(self, - endp_name=None, # Name of Endpoint. - result_file_name=None, # The name of the file received by the endpoint. - debug_=False): + endp_name: str = None, # Name of Endpoint. [W] + result_file_name: str = None, # The name of the file received by the endpoint. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_do_pesq(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name @@ -6423,9 +5165,10 @@ class LFJsonPost(LFCliBase): data["result_file_name"] = result_file_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/do_pesq", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/do_pesq", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6435,17 +5178,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#file ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_file(self, - card=None, # Card ID - cmd=None, # Only 'Download' supported for now, 'Upload' reserved for future use. - filename=None, # File to transfer. - shelf=None, # Shelf ID - debug_=False): + card: str = None, # Resource ID [W] + cmd: str = None, # Only 'Download' supported for now, 'Upload' reserved for future use. + # [W][D:Download] + filename: str = None, # File to transfer. [W] + shelf: str = None, # Shelf ID [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_file(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if card is not None: data["card"] = card @@ -6457,9 +5201,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/file", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/file", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6469,17 +5214,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#flash_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_flash_attenuator(self, - filename=None, # File to use when uploading to attenuator. - resource=None, # Resource number. - serno=None, # Serial number for requested Attenuator, or 'all'. - shelf=None, # Shelf number, usually 1. - debug_=False): + filename: str = None, # File to use when uploading to attenuator. + resource: str = None, # Resource number. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number, usually 1. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_flash_attenuator(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if filename is not None: data["filename"] = filename @@ -6491,9 +5236,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/flash_attenuator", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/flash_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6503,15 +5249,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getavglatency ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getavglatency(self, - aorb=None, # For AtoB, enter 'B', for BtoA, enter 'A'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getavglatency(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6519,9 +5265,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getavglatency", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getavglatency", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6531,15 +5278,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getinrxbps ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getinrxbps(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getinrxbps(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6547,9 +5294,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getinrxbps", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getinrxbps", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6559,15 +5307,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getinrxrate ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getinrxrate(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getinrxrate(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6575,9 +5323,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getinrxrate", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getinrxrate", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6587,15 +5336,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getintxrate ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getintxrate(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getintxrate(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6603,9 +5352,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getintxrate", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getintxrate", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6615,15 +5365,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getipadd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getipadd(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getipadd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6631,9 +5381,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getipadd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getipadd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6643,15 +5394,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getmac ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getmac(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getmac(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6659,9 +5410,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getmac", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getmac", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6671,15 +5423,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getmask ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getmask(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect name + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getmask(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6687,9 +5439,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getmask", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getmask", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6699,15 +5452,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getpktdrops ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getpktdrops(self, - aorb=None, # For AtoB, enter 'B', for BtoA, enter 'A'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getpktdrops(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6715,9 +5468,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getpktdrops", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getpktdrops", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6727,15 +5481,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getrxendperrpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getrxendperrpkts(self, - aorb=None, # For AtoB, enter 'B', for BtoA, enter 'A'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getrxendperrpkts(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6743,9 +5497,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getrxendperrpkts", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getrxendperrpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6755,15 +5510,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getrxpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getrxpkts(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getrxpkts(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6771,9 +5526,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getrxpkts", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getrxpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6783,15 +5539,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getrxporterrpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getrxporterrpkts(self, - aorb=None, # For AtoB, enter 'B', for BtoA, enter 'A'. - cx=None, # Cross-connect name - debug_=False): + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getrxporterrpkts(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6799,9 +5555,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getrxporterrpkts", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getrxporterrpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6811,15 +5568,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#gettxpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_gettxpkts(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_gettxpkts(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6827,9 +5584,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/gettxpkts", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/gettxpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6839,23 +5597,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#gossip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_gossip(self, - message=None, # Message to show to others currently logged on. Unescaped Value - debug_=False): + message: str = None, # Message to show to others currently logged on. Unescaped Value [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_gossip(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if message is not None: data["message"] = message if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/gossip", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/gossip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6865,22 +5624,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#help ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_help(self, - command=None, # The command to get help for. Can be 'all', or blank. - debug_=False): + command: str = None, # The command to get help for. Can be 'all', or blank. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_help(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if command is not None: data["command"] = command if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/help", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/help", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6890,19 +5650,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#init_wiser ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_init_wiser(self, - file_name=None, # The WISER file name for the desired emulation, or 'NA' for empty + file_name: str = None, # The WISER file name for the desired emulation, or 'NA' for empty # string. - node_count=None, # The number of WISER nodes for the desired emulation, or 'NA' for + node_count: str = None, # The number of WISER nodes for the desired emulation, or 'NA' for # empty string. - resource=None, # The number of the resource in question. - shelf=None, # The number of the shelf in question. - debug_=False): + resource: str = None, # The number of the resource in question. [W] + shelf: str = None, # The number of the shelf in question. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_init_wiser(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if file_name is not None: data["file_name"] = file_name @@ -6914,9 +5674,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/init_wiser", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/init_wiser", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6926,16 +5687,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#licenses ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_licenses(self, - popup=None, # If 'popup', then cause a GUI popup msg, otherwise, just show text. - show_file=None, # If 'yes', then show the license file, not the parsed license + popup: str = None, # If 'popup', then cause a GUI popup msg, otherwise, just show text. + show_file: str = None, # If 'yes', then show the license file, not the parsed license # information. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_licenses(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if popup is not None: data["popup"] = popup @@ -6943,9 +5704,10 @@ class LFJsonPost(LFCliBase): data["show_file"] = show_file if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/licenses", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/licenses", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6955,21 +5717,21 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#load ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_load(self, - action=None, # Should be 'append' or 'overwrite'. - clean_chambers=None, # If yes, then Chambers will be cleaned up when overwrite is selected, + action: str = None, # Should be 'append' or 'overwrite'. [W] + clean_chambers: str = None, # If yes, then Chambers will be cleaned up when overwrite is selected, # otherwise they will be kept. - clean_dut=None, # If yes, then DUT will be cleaned up when overwrite is selected, + clean_dut: str = None, # If yes, then DUT will be cleaned up when overwrite is selected, # otherwise they will be kept. - clean_profiles=None, # If yes, then clean all profiles when overwrite is selected, otherwise + clean_profiles: str = None, # If yes, then clean all profiles when overwrite is selected, otherwise # they will be kept. - name=None, # The name of the database to load. (DFLT is the default) - debug_=False): + name: str = None, # The name of the database to load. (DFLT is the default) [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_load(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if action is not None: data["action"] = action @@ -6983,9 +5745,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/load", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/load", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7031,15 +5794,15 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_log_level(self, - level=None, # Integer corresponding to the logging flags. - target=None, # Options: 'gnu' | [file-endp-name]. - debug_=False): + level: str = None, # Integer corresponding to the logging flags. [W] + target: str = None, # Options: 'gnu' | [file-endp-name]. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_log_level(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if level is not None: data["level"] = level @@ -7047,9 +5810,10 @@ class LFJsonPost(LFCliBase): data["target"] = target if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/log_level", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/log_level", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7059,22 +5823,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#log_msg ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_log_msg(self, - message=None, # Message to log. Unescaped Value - debug_=False): + message: str = None, # Message to log. Unescaped Value [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_log_msg(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if message is not None: data["message"] = message if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/log_msg", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/log_msg", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7084,16 +5849,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#login ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_login(self, - name=None, # A single name with no white-spaces (15 characters or less) - password=None, # Can be blank or 'NA' if no password is set, otherwise must be the + name: str = None, # A single name with no white-spaces (15 characters or less) [W] + password: str = None, # Can be blank or 'NA' if no password is set, otherwise must be the # password. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_login(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -7101,9 +5866,10 @@ class LFJsonPost(LFCliBase): data["password"] = password if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/login", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/login", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7113,17 +5879,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#motd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_motd(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_motd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/motd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/motd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7133,16 +5900,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_cd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_cd(self, - collision_domain=None, # Name of the Collision Domain, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + collision_domain: str = None, # Name of the Collision Domain, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_cd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if collision_domain is not None: data["collision_domain"] = collision_domain @@ -7152,9 +5919,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_cd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7164,16 +5932,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_channel_groups ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_channel_groups(self, - channel_name=None, # Name of the channel, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + channel_name: str = None, # Name of the channel, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_channel_groups(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if channel_name is not None: data["channel_name"] = channel_name @@ -7183,9 +5951,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_channel_groups", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_channel_groups", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7195,15 +5964,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_endpoints ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_endpoints(self, - endpoint=None, # Name of endpoint, or 'all'. - extra=None, # See above. - debug_=False): + endpoint: str = None, # Name of endpoint, or 'all'. [W] + extra: str = None, # See above. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_endpoints(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint @@ -7211,9 +5980,10 @@ class LFJsonPost(LFCliBase): data["extra"] = extra if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_endpoints", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_endpoints", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7223,22 +5993,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_pesq ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_pesq(self, - endpoint=None, # Name of endpoint, or 'all'. - debug_=False): + endpoint: str = None, # Name of endpoint, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_pesq(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_pesq", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_pesq", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7274,18 +6045,18 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_nc_show_ports(self, - port=None, # Port number, or 'all'. - probe_flags=None, # See above, add them together for multiple probings. Leave blank - # if you want stats only. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + port: str = None, # Port number, or 'all'. [W] + probe_flags: str = None, # See above, add them together for multiple probings. Leave + # blank if you want stats only. + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_ports(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -7297,9 +6068,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_ports", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7309,16 +6081,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_ppp_links ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_ppp_links(self, - link_num=None, # Ppp-Link number of the span, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + link_num: str = None, # Ppp-Link number of the span, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_ppp_links(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if link_num is not None: data["link_num"] = link_num @@ -7328,9 +6100,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_ppp_links", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_ppp_links", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7340,16 +6113,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_spans ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_spans(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - span_number=None, # Span-Number of the span, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + span_number: str = None, # Span-Number of the span, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_spans(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7359,9 +6132,10 @@ class LFJsonPost(LFCliBase): data["span_number"] = span_number if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_spans", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_spans", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7371,16 +6145,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_vr(self, - resource=None, # Resource number, or 'all'. - router=None, # Name of the Virtual Router, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + router: str = None, # Name of the Virtual Router, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7390,9 +6164,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7402,16 +6177,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_vrcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_vrcx(self, - cx_name=None, # Name of the Virtual Router Connection, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + cx_name: str = None, # Name of the Virtual Router Connection, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_vrcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name @@ -7421,9 +6196,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_vrcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7433,22 +6209,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#notify_dhcp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_notify_dhcp(self, - cmd=None, # set/down/timeout/info: What does DHCP want us to do? - netmask=None, # New subnet mask. - new_dns=None, # New DNS server(s) for use by this interface. - new_ip=None, # New IP address. - new_ip6=None, # New Global IPv6 address: ipv6/prefix - new_mtu=None, # New MTU. - new_router=None, # One or more default routers. LANforge will only use the first one. - port=None, # Interface name. - reason=None, # DHCP reason, informational mostly. - debug_=False): + cmd: str = None, # set/down/timeout/info: What does DHCP want us to do? [W] + netmask: str = None, # New subnet mask. + new_dns: str = None, # New DNS server(s) for use by this interface. + new_ip: str = None, # New IP address. + new_ip6: str = None, # New Global IPv6 address: ipv6/prefix + new_mtu: str = None, # New MTU. + new_router: str = None, # One or more default routers. LANforge will only use the first + # one. + port: str = None, # Interface name. [W] + reason: str = None, # DHCP reason, informational mostly. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_notify_dhcp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cmd is not None: data["cmd"] = cmd @@ -7470,9 +6247,10 @@ class LFJsonPost(LFCliBase): data["reason"] = reason if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/notify_dhcp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/notify_dhcp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7482,17 +6260,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#port_reset_completed ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_port_reset_completed(self, - extra=None, # IP for SECIP, blank for others. - port=None, # The port in question. - p_type=None, # SUNOS, NORMAL, or SECIP..let us know what kind of reset + extra: str = None, # IP for SECIP, blank for others. + port: str = None, # The port in question. [W] + p_type: str = None, # SUNOS, NORMAL, or SECIP..let us know what kind of reset # completed. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_port_reset_completed(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if extra is not None: data["extra"] = extra @@ -7502,9 +6280,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/port_reset_completed", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/port_reset_completed", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7514,17 +6293,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#probe_port ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_probe_port(self, - key=None, # Unique identifier for this request. Usually left blank.
- port=None, # Port number or name - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + key: str = None, # Unique identifier for this request. Usually left blank.
+ port: str = None, # Port number or name [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_probe_port(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if key is not None: data["key"] = key @@ -7536,9 +6315,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/probe_port", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/probe_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7548,15 +6328,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#probe_ports ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_probe_ports(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_probe_ports(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7564,9 +6344,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/probe_ports", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/probe_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7576,22 +6357,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#quiesce_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_quiesce_endp(self, - endp_name=None, # Name of the endpoint, or 'all'. - debug_=False): + endp_name: str = None, # Name of the endpoint, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_quiesce_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/quiesce_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/quiesce_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7601,22 +6383,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#quiesce_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_quiesce_group(self, - name=None, # The name of the test group, or 'all' - debug_=False): + name: str = None, # The name of the test group, or 'all' [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_quiesce_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/quiesce_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/quiesce_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7626,17 +6409,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#quit ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_quit(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_quit(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/quit", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/quit", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7646,15 +6430,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#reboot_os ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_reboot_os(self, - resource=None, # Resource number, or ALL. - shelf=None, # Shelf number, or ALL. - debug_=False): + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_reboot_os(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7662,9 +6446,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/reboot_os", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/reboot_os", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7674,18 +6459,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#report ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_report(self, - reporting_on=None, # Should we globally enable/disable reporting. (YES, NO or NA) - rpt_dir=None, # Directory in which reports should be saved. - save_endps=None, # Should we save endpoint reports or not. (YES, NO or NA) - save_ports=None, # Should we save Port reports or not. (YES, NO or NA) - save_resource=None, # Should we save Resource reports or not. (YES, NO or NA) - debug_=False): + reporting_on: str = None, # Should we globally enable/disable reporting. (YES, NO or NA) + rpt_dir: str = None, # Directory in which reports should be saved. [W] + save_endps: str = None, # Should we save endpoint reports or not. (YES, NO or NA) + save_ports: str = None, # Should we save Port reports or not. (YES, NO or NA) + save_resource: str = None, # Should we save Resource reports or not. (YES, NO or NA) + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_report(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if reporting_on is not None: data["reporting_on"] = reporting_on @@ -7699,9 +6484,10 @@ class LFJsonPost(LFCliBase): data["save_resource"] = save_resource if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/report", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/report", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7720,19 +6506,19 @@ class LFJsonPost(LFCliBase): YES = "YES" # (include logout) Call portal-bot.pl ... --logout before going down. def post_reset_port(self, - port=None, # Port number to reset, or ALL. - pre_ifdown=None, # See above. Leave blank or use NA if unsure. - reset_ospf=None, # If set to 'NO' or 'NA', then OSPF will not be updated. Otherwise, it - # will be updated. - resource=None, # Resource number, or ALL. - shelf=None, # Shelf number, or ALL. - debug_=False): + port: str = None, # Port number to reset, or ALL. [W] + pre_ifdown: str = None, # See above. Leave blank or use NA if unsure. + reset_ospf: str = None, # If set to 'NO' or 'NA', then OSPF will not be updated. Otherwise, + # it will be updated. + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_reset_port(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -7746,9 +6532,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/reset_port", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/reset_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7758,16 +6545,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#reset_serial_span ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_reset_serial_span(self, - resource=None, # Resource (machine) number. - shelf=None, # Shelf number - span=None, # Serial-Span number to reset. - debug_=False): + resource: str = None, # Resource (machine) number. [W] + shelf: str = None, # Shelf number [R][D:1] + span: str = None, # Serial-Span number to reset. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_reset_serial_span(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7777,9 +6564,10 @@ class LFJsonPost(LFCliBase): data["span"] = span if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/reset_serial_span", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/reset_serial_span", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7789,16 +6577,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_attenuator(self, - resource=None, # Resource number - serno=None, # Serial number for requested Attenuator. - shelf=None, # Shelf number, usually 1 - debug_=False): + resource: str = None, # Resource number [W] + serno: str = None, # Serial number for requested Attenuator. [W] + shelf: str = None, # Shelf number, usually 1 [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_attenuator(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7808,9 +6596,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_attenuator", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7820,22 +6609,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_cd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cd(self, - cd=None, # Name of Collision Domain. - debug_=False): + cd: str = None, # Name of Collision Domain. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_cd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd is not None: data["cd"] = cd if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_cd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7845,15 +6635,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_cd_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cd_endp(self, - cd=None, # Name of Collision Domain. - endp=None, # Endpoint name/id. - debug_=False): + cd: str = None, # Name of Collision Domain. [W] + endp: str = None, # Endpoint name/id. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_cd_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd is not None: data["cd"] = cd @@ -7861,9 +6651,10 @@ class LFJsonPost(LFCliBase): data["endp"] = endp if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_cd_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_cd_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7873,15 +6664,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_cd_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cd_vr(self, - cd=None, # Name of Collision Domain. - endp=None, # Virtual-Router name/id. - debug_=False): + cd: str = None, # Name of Collision Domain. [W] + endp: str = None, # Virtual-Router name/id. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_cd_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd is not None: data["cd"] = cd @@ -7889,9 +6680,10 @@ class LFJsonPost(LFCliBase): data["endp"] = endp if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_cd_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_cd_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7901,22 +6693,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_chamber ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_chamber(self, - chamber=None, # Chamber name, or 'ALL' - debug_=False): + chamber: str = None, # Chamber name, or 'ALL' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_chamber(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chamber is not None: data["chamber"] = chamber if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_chamber", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7926,15 +6719,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_chamber_path ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_chamber_path(self, - chamber=None, # Chamber Name. - path=None, # Path Name, use 'ALL' to delete all paths. - debug_=False): + chamber: str = None, # Chamber Name. [W] + path: str = None, # Path Name, use 'ALL' to delete all paths. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_chamber_path(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chamber is not None: data["chamber"] = chamber @@ -7942,9 +6735,10 @@ class LFJsonPost(LFCliBase): data["path"] = path if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_chamber_path", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_chamber_path", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7954,16 +6748,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_channel_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_channel_group(self, - channel_name=None, # Name of the channel, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + channel_name: str = None, # Name of the channel, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_channel_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if channel_name is not None: data["channel_name"] = channel_name @@ -7973,9 +6767,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_channel_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_channel_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7985,15 +6780,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_client ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_client(self, - client_name=None, # Name of the client profile you wish to remove. - client_password=None, # Client password. Not required if we are super-user. - debug_=False): + client_name: str = None, # Name of the client profile you wish to remove. [W] + client_password: str = None, # Client password. Not required if we are super-user. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_client(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if client_name is not None: data["client_name"] = client_name @@ -8001,9 +6796,10 @@ class LFJsonPost(LFCliBase): data["client_password"] = client_password if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_client", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_client", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8013,15 +6809,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_cx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cx(self, - cx_name=None, # Name of the cross-connect, or 'all'. - test_mgr=None, # Name of test-mgr, or 'all'. - debug_=False): + cx_name: str = None, # Name of the cross-connect, or 'all'. [W] + test_mgr: str = None, # Name of test-mgr, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_cx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name @@ -8029,9 +6825,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_cx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8041,22 +6838,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_db ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_db(self, - db_name=None, # Name of the database to delete. - debug_=False): + db_name: str = None, # Name of the database to delete. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_db(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if db_name is not None: data["db_name"] = db_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_db", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_db", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8066,22 +6864,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_dut ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_dut(self, - shelf=None, # DUT name, or 'ALL' - debug_=False): + shelf: str = None, # DUT name, or 'ALL' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_dut(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if shelf is not None: data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_dut", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_dut", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8091,22 +6890,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_endp(self, - endp_name=None, # Name of the endpoint, or 'YES_ALL'. - debug_=False): + endp_name: str = None, # Name of the endpoint, or 'YES_ALL'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8116,22 +6916,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_event ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_event(self, - event_id=None, # Numeric event-id, or 'all' - debug_=False): + event_id: str = None, # Numeric event-id, or 'all' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_event(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if event_id is not None: data["event_id"] = event_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_event", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_event", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8141,22 +6942,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_group(self, - name=None, # The name of the test group. - debug_=False): + name: str = None, # The name of the test group. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8166,16 +6968,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_ppp_link(self, - resource=None, # Resource number that holds this PppLink. - shelf=None, # Name/id of the shelf. - unit_num=None, # Unit-Number for the PppLink to be deleted. - debug_=False): + resource: str = None, # Resource number that holds this PppLink. [W] + shelf: str = None, # Name/id of the shelf. [R][D:1] + unit_num: str = None, # Unit-Number for the PppLink to be deleted. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_ppp_link(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8185,9 +6987,10 @@ class LFJsonPost(LFCliBase): data["unit_num"] = unit_num if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_ppp_link", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8197,22 +7000,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_profile(self, - name=None, # Profile name, or 'ALL' - debug_=False): + name: str = None, # Profile name, or 'ALL' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8222,15 +7026,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_resource ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_resource(self, - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_resource(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8238,9 +7042,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_resource", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_resource", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8250,15 +7055,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_rfgen ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_rfgen(self, - resource=None, # Resource number - shelf=None, # Shelf number, usually 1 - debug_=False): + resource: str = None, # Resource number [W] + shelf: str = None, # Shelf number, usually 1 [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_rfgen(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8266,9 +7071,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_rfgen", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_rfgen", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8278,17 +7084,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_sec_ip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_sec_ip(self, - ip_list=None, # IP1/prefix,IP2/prefix,...IPZ/prefix, or ALL - port=None, # Name of network device (Port) from which these IPs will be removed. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix, or ALL [W] + port: str = None, # Name of network device (Port) from which these IPs will be removed. + # [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_sec_ip(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ip_list is not None: data["ip_list"] = ip_list @@ -8300,9 +7107,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_sec_ip", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_sec_ip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8312,16 +7120,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_span ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_span(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - span_num=None, # Span-Number of the channel, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + span_num: str = None, # Span-Number of the channel, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_span(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8331,9 +7139,10 @@ class LFJsonPost(LFCliBase): data["span_num"] = span_num if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_span", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_span", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8343,22 +7152,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_test_mgr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_test_mgr(self, - test_mgr=None, # Name of the test manager to be removed. - debug_=False): + test_mgr: str = None, # Name of the test manager to be removed. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_test_mgr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if test_mgr is not None: data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_test_mgr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_test_mgr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8368,15 +7178,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_text_blob ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_text_blob(self, - name=None, # Text Blob Name, or 'ALL' - p_type=None, # Text Blob type, or 'ALL' - debug_=False): + name: str = None, # Text Blob Name, or 'ALL' [W] + p_type: str = None, # Text Blob type, or 'ALL' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_text_blob(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -8384,9 +7194,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_text_blob", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_text_blob", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8396,15 +7207,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_tgcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_tgcx(self, - cxname=None, # The name of the CX. - tgname=None, # The name of the test group. - debug_=False): + cxname: str = None, # The name of the CX. [W] + tgname: str = None, # The name of the test group. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_tgcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cxname is not None: data["cxname"] = cxname @@ -8412,9 +7223,10 @@ class LFJsonPost(LFCliBase): data["tgname"] = tgname if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_tgcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_tgcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8424,15 +7236,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_threshold ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_threshold(self, - endp=None, # Endpoint name or ID. - thresh_id=None, # Threshold ID to remove. Use 'all' to remove all. - debug_=False): + endp: str = None, # Endpoint name or ID. [W] + thresh_id: str = None, # Threshold ID to remove. Use 'all' to remove all. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_threshold(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp is not None: data["endp"] = endp @@ -8440,9 +7252,10 @@ class LFJsonPost(LFCliBase): data["thresh_id"] = thresh_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_threshold", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_threshold", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8452,22 +7265,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_traffic_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_traffic_profile(self, - name=None, # Profile name, or 'ALL' - debug_=False): + name: str = None, # Profile name, or 'ALL' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_traffic_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_traffic_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_traffic_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8477,16 +7291,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_venue ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_venue(self, - resource=None, # Resource number, or 'ALL' - shelf=None, # Shelf number. - venu_id=None, # Number to uniquely identify this venue on this resource, or 'ALL' - debug_=False): + resource: str = None, # Resource number, or 'ALL' [W] + shelf: str = None, # Shelf number. [R][D:1] + venu_id: str = None, # Number to uniquely identify this venue on this resource, or 'ALL' + # [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_venue(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8496,9 +7311,10 @@ class LFJsonPost(LFCliBase): data["venu_id"] = venu_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_venue", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_venue", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8508,16 +7324,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_vlan ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vlan(self, - port=None, # Port number or name of the virtual interface. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + port: str = None, # Port number or name of the virtual interface. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_vlan(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -8527,9 +7343,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_vlan", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_vlan", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8539,16 +7356,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vr(self, - resource=None, # Resource number, or 'all'. - router_name=None, # Virtual Router name, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + router_name: str = None, # Virtual Router name, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8558,9 +7375,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8570,20 +7388,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_vrcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vrcx(self, - connection_name=None, # Virtual Router Connection name, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - vr_id=None, # If not removing from the free-list, then supply the virtual-router - # name/ID here. Leave blank or use NA for free-list. - vrcx_only=None, # If we should NOT delete underlying auto-created objects, enter + connection_name: str = None, # Virtual Router Connection name, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + vr_id: str = None, # If not removing from the free-list, then supply the + # virtual-router name/ID here. Leave blank or use NA for free-list. + vrcx_only: str = None, # If we should NOT delete underlying auto-created objects, enter # 'vrcx_only' here, otherwise leave blank or use NA. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_vrcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if connection_name is not None: data["connection_name"] = connection_name @@ -8597,9 +7415,10 @@ class LFJsonPost(LFCliBase): data["vrcx_only"] = vrcx_only if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_vrcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8609,15 +7428,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_wanpath ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_wanpath(self, - endp_name=None, # Name of the endpoint. - wp_name=None, # Name of the wanpath. - debug_=False): + endp_name: str = None, # Name of the endpoint. [W] + wp_name: str = None, # Name of the wanpath. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_wanpath(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name @@ -8625,9 +7444,10 @@ class LFJsonPost(LFCliBase): data["wp_name"] = wp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_wanpath", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_wanpath", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8637,20 +7457,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rpt_script ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rpt_script(self, - endp=None, # Endpoint name or ID. - flags=None, # See above for description of the defined flags. - group_action=None, # All or Sequential. - loop_count=None, # How many times to loop before stopping (0 is infinite). - name=None, # Script name. - private=None, # Private encoding for the particular script. - p_type=None, # One of: NONE, Script2544, ScriptHunt, ScriptWL - debug_=False): + endp: str = None, # Endpoint name or ID. [W] + flags: str = None, # See above for description of the defined flags. + group_action: str = None, # All or Sequential. + loop_count: str = None, # How many times to loop before stopping (0 is infinite). + name: str = None, # Script name. [W] + private: str = None, # Private encoding for the particular script. + p_type: str = None, # One of: NONE, Script2544, ScriptHunt, ScriptWL + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rpt_script(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp is not None: data["endp"] = endp @@ -8668,9 +7488,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rpt_script", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rpt_script", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8689,18 +7510,18 @@ class LFJsonPost(LFCliBase): trigger_freq__freq_ = "trigger freq [freq]" # scan exactly those frequencies def post_scan_wifi(self, - extra=None, # Extra arguments to the scan script, see above. - key=None, # Unique identifier for this request. Usually left blank. - port=None, # Port number or name of the virtual interface. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + extra: str = None, # Extra arguments to the scan script, see above. + key: str = None, # Unique identifier for this request. Usually left blank. + port: str = None, # Port number or name of the virtual interface. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_scan_wifi(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if extra is not None: data["extra"] = extra @@ -8714,9 +7535,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/scan_wifi", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/scan_wifi", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8751,37 +7573,37 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_arm_info(self, - arm_flags=None, # Armageddon-related flags, see above for details. - burst=None, # Burst amount, can significantly improve throughput with some - # modern drivers, similar to 'multi_pkts', and uses the 'xmit_more' - # linux skb option. - dst_mac=None, # The destination MAC address. - dst_mac_count=None, # How many destination MACs to iterate through. - ip_dst_max=None, # Maximum destination IP address to use. - ip_dst_min=None, # Minimum destination IP address to use. - ip_src_max=None, # Maximum source IP address to use. - ip_src_min=None, # Minimum source IP address to use. - max_pkt_size=None, # Maximum packet size, including all Ethernet headers (but not + arm_flags: str = None, # Armageddon-related flags, see above for details. + burst: str = None, # Burst amount, can significantly improve throughput with some + # modern drivers, similar to 'multi_pkts', and uses the + # 'xmit_more' linux skb option. + dst_mac: str = None, # The destination MAC address. + dst_mac_count: str = None, # How many destination MACs to iterate through. + ip_dst_max: str = None, # Maximum destination IP address to use. + ip_dst_min: str = None, # Minimum destination IP address to use. + ip_src_max: str = None, # Maximum source IP address to use. + ip_src_min: str = None, # Minimum source IP address to use. + max_pkt_size: str = None, # Maximum packet size, including all Ethernet headers (but not # CRC). - min_pkt_size=None, # Minimum packet size, including all Ethernet headers (but not + min_pkt_size: str = None, # Minimum packet size, including all Ethernet headers (but not # CRC). - multi_pkts=None, # The number of identical packets to send before creating a new + multi_pkts: str = None, # The number of identical packets to send before creating a new # one. - name=None, # Name of the Endpoint we are setting. - pkts_to_send=None, # The number of packets to send. Set to zero for infinite. - src_mac=None, # The source MAC address. - src_mac_count=None, # How many source MACs to iterate through. - udp_dst_max=None, # Minimum destination UDP port. - udp_dst_min=None, # Minimum destination UDP port. - udp_src_max=None, # Maximum source UDP port. - udp_src_min=None, # Minimum source UDP port. - debug_=False): + name: str = None, # Name of the Endpoint we are setting. [R] + pkts_to_send: str = None, # The number of packets to send. Set to zero for infinite. + src_mac: str = None, # The source MAC address. + src_mac_count: str = None, # How many source MACs to iterate through. + udp_dst_max: str = None, # Minimum destination UDP port. + udp_dst_min: str = None, # Minimum destination UDP port. + udp_src_max: str = None, # Maximum source UDP port. + udp_src_min: str = None, # Minimum source UDP port. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_arm_info(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if arm_flags is not None: data["arm_flags"] = arm_flags @@ -8823,9 +7645,10 @@ class LFJsonPost(LFCliBase): data["udp_src_min"] = udp_src_min if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_arm_info", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_arm_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8834,26 +7657,35 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetAttenuatorMode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + p_0 = "0" # Normal + p_1 = "1" # Pulse mode (API Tech 4205A modules directly connected via USB only) + def post_set_attenuator(self, - atten_idx=None, # Attenuator index, or 'all'. - mode=None, # 0 == normal attenuator, 1 == pulse mode (API Tech 4205A + atten_idx: str = None, # Attenuator index, or 'all'. [W] + mode: str = None, # 0 == normal attenuator, 1 == pulse mode (API Tech 4205A # modules directly connected via USB only) - pulse_count=None, # Number of pulses (0-255) - pulse_interval_ms=None, # Time between pulses, in mili-seconds (0-60000). - pulse_time_ms=None, # Time interval between pulse groups in miliseconds (1-60000) - pulse_width_us5=None, # Pulse width in units of 1/2 micro second. So, if you want + pulse_count: str = None, # Number of pulses (0-255) + pulse_interval_ms: str = None, # Time between pulses, in mili-seconds (0-60000). + pulse_time_ms: str = None, # Time interval between pulse groups in miliseconds + # (1-60000) + pulse_width_us5: str = None, # Pulse width in units of 1/2 micro second. So, if you want # 1.5us, use value 3 (0-60000) - resource=None, # Resource number. - serno=None, # Serial number for requested Attenuator, or 'all'. - shelf=None, # Shelf number, usually 1. - val=None, # Requested attenution in 1/10ths of dB (ddB). - debug_=False): + resource: str = None, # Resource number. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number, usually 1. [R][D:1] + val: str = None, # Requested attenution in 1/10ths of dB (ddB). [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_attenuator(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if atten_idx is not None: data["atten_idx"] = atten_idx @@ -8877,9 +7709,10 @@ class LFJsonPost(LFCliBase): data["val"] = val if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_attenuator", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8889,21 +7722,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_chamber ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_chamber(self, - chamber=None, # Chamber name - cur_rotation=None, # Primarily used to store the last known rotation for turntables - # that do not report absolute position. Use NA or leave blank if - # unsure. - position=None, # Absolute position in degrees. - speed_rpm=None, # Speed in rpm (floating point number is accepted - tilt=None, # Absolute tilt in degrees. - turntable=None, # Turn-table address, for instance: 192.168.1.22:3001 - debug_=False): + chamber: str = None, # Chamber name [W] + cur_rotation: str = None, # Primarily used to store the last known rotation for turntables + # that do not report absolute position. + position: str = None, # Absolute position in degrees. + speed_rpm: str = None, # Speed in rpm (floating point number is accepted + tilt: str = None, # Absolute tilt in degrees. + turntable: str = None, # Turn-table address, for instance: 192.168.1.22:3001 + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_chamber(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chamber is not None: data["chamber"] = chamber @@ -8919,9 +7751,10 @@ class LFJsonPost(LFCliBase): data["turntable"] = turntable if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_chamber", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8931,17 +7764,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_cx_report_timer ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_cx_report_timer(self, - cx_name=None, # Name of cross-connect, or 'all'. - cxonly=None, # If you want to set the timer for ONLY the CX, and not - milliseconds=None, # Report timer length in milliseconds. - test_mgr=None, # Name of the test manager, or 'all'. - debug_=False): + cx_name: str = None, # Name of cross-connect, or 'all'. [W] + cxonly: str = None, # If you want to set the timer for ONLY the CX, and not + milliseconds: str = None, # Report timer length in milliseconds. + # [W,250-60000][D:5000] + test_mgr: str = None, # Name of the test manager, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_cx_report_timer(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name @@ -8953,9 +7787,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_cx_report_timer", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_cx_report_timer", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8976,16 +7811,16 @@ class LFJsonPost(LFCliBase): SWITCH = "SWITCH" # Sets the CX(s) in the running state, stopping any conflicting tests. def post_set_cx_state(self, - cx_name=None, # Name of the cross-connect, or 'all'. - cx_state=None, # One of: RUNNING, SWITCH, QUIESCE, STOPPED, or DELETED. - test_mgr=None, # Name of the test-manager, or 'all'. - debug_=False): + cx_name: str = None, # Name of the cross-connect, or 'all'. [W] + cx_state: str = None, # One of: RUNNING, SWITCH, QUIESCE, STOPPED, or DELETED. [W] + test_mgr: str = None, # Name of the test-manager, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_cx_state(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name @@ -8995,9 +7830,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_cx_state", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_cx_state", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9007,18 +7843,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_addr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_addr(self, - ip=None, # The IP Address. Used for TCP/IP and UDP/IP protocols. - mac=None, # The MAC address. Only needed for LANforge protocol Endpoints. - max_port=None, # The Maximum IP Port. Used for TCP/IP and UDP/IP protocols. - min_port=None, # The Minimum IP Port. Used for TCP/IP and UDP/IP protocols. - name=None, # The name of the endpoint we are configuring. - debug_=False): + ip: str = None, # The IP Address. Used for TCP/IP and UDP/IP protocols. + mac: str = None, # The MAC address. Only needed for LANforge protocol Endpoints. + max_port: str = None, # The Maximum IP Port. Used for TCP/IP and UDP/IP protocols. + min_port: str = None, # The Minimum IP Port. Used for TCP/IP and UDP/IP protocols. + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_addr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ip is not None: data["ip"] = ip @@ -9032,9 +7868,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_addr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_addr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9044,40 +7881,41 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_details ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_details(self, - conn_timeout=None, # For TCP, the max time in miliseconds to wait for connection - # to establish. - dst_mac=None, # Destination MAC address, used for custom Ethernet replays. - max_conn_timer=None, # The maximum duration (in ms) this connection should run + conn_timeout: str = None, # For TCP, the max time in miliseconds to wait for + # connection to establish. + dst_mac: str = None, # Destination MAC address, used for custom Ethernet + # replays. + max_conn_timer: str = None, # The maximum duration (in ms) this connection should run # before re-establishing. - max_ip_port=None, # The maximum IP Port value. (The value for min ip port is + max_ip_port: str = None, # The maximum IP Port value. (The value for min ip port is # set through the add_endp/ip_port parameter.) If greater - # than min, each connection will use a random value between - # min and max. - max_reconn_pause=None, # The maximum time between re-connects, in ms. - mcast_src_ip=None, # Multicast source address (used in SSM mode, multicast + # than min, each connection will use a random value + # between min and max. + max_reconn_pause: str = None, # The maximum time between re-connects, in ms. + mcast_src_ip: str = None, # Multicast source address (used in SSM mode, multicast # endpoints only) - mcast_src_port=None, # Multicast source address (used in SSM mode, multicast + mcast_src_port: str = None, # Multicast source address (used in SSM mode, multicast # endpoints only) - min_conn_timer=None, # The minimum duration (in ms) this connection should run + min_conn_timer: str = None, # The minimum duration (in ms) this connection should run # before re-establishing. - min_reconn_pause=None, # The minimum time between re-connects, in ms. - name=None, # The name of the endpoint we are configuring. - pkts_to_send=None, # Number of packets to send before stopping. 0 means + min_reconn_pause: str = None, # The minimum time between re-connects, in ms. + name: str = None, # The name of the endpoint we are configuring. [R] + pkts_to_send: str = None, # Number of packets to send before stopping. 0 means # infinite. - rcvbuf_size=None, # The receive buffer (window) size. Zero for AUTO - sndbuf_size=None, # The sending buffer (window) size. Zero for AUTO - tcp_delack_segs=None, # NA: No longer supported. - tcp_max_delack=None, # NA: No longer supported. - tcp_min_delack=None, # NA: No longer supported. - tcp_mss=None, # TCP Maximum Segment Size, affects packet size on the wire - # (88 - 32767). - debug_=False): + rcvbuf_size: str = None, # The receive buffer (window) size. Zero for AUTO + sndbuf_size: str = None, # The sending buffer (window) size. Zero for AUTO + tcp_delack_segs: str = None, # NA: No longer supported. + tcp_max_delack: str = None, # NA: No longer supported. + tcp_min_delack: str = None, # NA: No longer supported. + tcp_mss: str = None, # TCP Maximum Segment Size, affects packet size on the + # wire (88 - 32767). + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_details(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if conn_timeout is not None: data["conn_timeout"] = conn_timeout @@ -9115,9 +7953,10 @@ class LFJsonPost(LFCliBase): data["tcp_mss"] = tcp_mss if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_details", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_details", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9126,17 +7965,25 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_file ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetEndpFilePlayback(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + OFF = "OFF" # off + ON = "ON" # on + def post_set_endp_file(self, - file=None, # The file name to read the playback packets from. - name=None, # The name of the endpoint we are configuring. - playback=None, # Should we playback the capture or not? ON or OFF. - debug_=False): + file: str = None, # The file name to read the playback packets from. + name: str = None, # The name of the endpoint we are configuring. [R] + playback: str = None, # Should we playback the capture or not? ON or OFF. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_file(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if file is not None: data["file"] = file @@ -9146,9 +7993,10 @@ class LFJsonPost(LFCliBase): data["playback"] = playback if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_file", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_file", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9176,16 +8024,16 @@ class LFJsonPost(LFCliBase): UseAutoNAT = "UseAutoNAT" # NAT friendly behavior def post_set_endp_flag(self, - flag=None, # The name of the flag. - name=None, # The name of the endpoint we are configuring. - val=None, # Either 1 (for on), or 0 (for off). - debug_=False): + flag: str = None, # The name of the flag. [R] + name: str = None, # The name of the endpoint we are configuring. [R] + val: str = None, # Either 1 (for on), or 0 (for off). [R,0-1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_flag(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if flag is not None: data["flag"] = flag @@ -9195,9 +8043,10 @@ class LFJsonPost(LFCliBase): data["val"] = val if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_flag", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_flag", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9224,17 +8073,17 @@ class LFJsonPost(LFCliBase): zeros = "zeros" # Payload is all zeros (00). def post_set_endp_payload(self, - name=None, # The name of the endpoint we are configuring. - payload=None, # For custom payloads, enter the payload in hex, up to 2048 + name: str = None, # The name of the endpoint we are configuring. [R] + payload: str = None, # For custom payloads, enter the payload in hex, up to 2048 # bytes. Unescaped Value - payload_type=None, # The payload type. See help for add_endp. - debug_=False): + payload_type: str = None, # The payload type. See help for add_endp. [W][D:increasing] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_payload(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -9244,9 +8093,10 @@ class LFJsonPost(LFCliBase): data["payload_type"] = payload_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_payload", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_payload", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9256,18 +8106,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_pld_bounds ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_pld_bounds(self, - is_random=None, # YES if random, anything else for NO. - max_pld_size=None, # The maximum payload size, in bytes. - min_pld_size=None, # The minimum payload size, in bytes. - name=None, # The name of the endpoint we are configuring. - use_checksum=None, # YES if use checksum on payload, anything else for NO. - debug_=False): + is_random: str = None, # YES if random, anything else for NO. + max_pld_size: str = None, # The maximum payload size, in bytes. + min_pld_size: str = None, # The minimum payload size, in bytes. + name: str = None, # The name of the endpoint we are configuring. [R] + use_checksum: str = None, # YES if use checksum on payload, anything else for NO. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_pld_bounds(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if is_random is not None: data["is_random"] = is_random @@ -9281,9 +8131,10 @@ class LFJsonPost(LFCliBase): data["use_checksum"] = use_checksum if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_pld_bounds", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_pld_bounds", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9293,17 +8144,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_proxy ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_proxy(self, - enabled=None, # YES or NO to enable or disable proxying. - endp_name=None, # Name of endpoint. - proxy_ip=None, # Proxy IP Address. - proxy_ip_port=None, # Proxy IP Port. - debug_=False): + enabled: str = None, # YES or NO to enable or disable proxying. + endp_name: str = None, # Name of endpoint. [W] + proxy_ip: str = None, # Proxy IP Address. + proxy_ip_port: str = None, # Proxy IP Port. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_proxy(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if enabled is not None: data["enabled"] = enabled @@ -9315,9 +8166,10 @@ class LFJsonPost(LFCliBase): data["proxy_ip_port"] = proxy_ip_port if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_proxy", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_proxy", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9327,16 +8179,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_quiesce ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_quiesce(self, - name=None, # The name of the endpoint we are configuring. - quiesce=None, # The number of seconds to quiesce this endpoint when told to - # quiesce. - debug_=False): + name: str = None, # The name of the endpoint we are configuring. [R] + quiesce: str = None, # The number of seconds to quiesce this endpoint when told to + # quiesce. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_quiesce(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -9344,9 +8196,10 @@ class LFJsonPost(LFCliBase): data["quiesce"] = quiesce if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_quiesce", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_quiesce", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9356,15 +8209,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_report_timer ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_report_timer(self, - endp_name=None, # Name of endpoint. - milliseconds=None, # Report timer length in milliseconds. - debug_=False): + endp_name: str = None, # Name of endpoint. [R] + milliseconds: str = None, # Report timer length in milliseconds. + # [W,250-60000][D:5000] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_report_timer(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name @@ -9372,9 +8226,10 @@ class LFJsonPost(LFCliBase): data["milliseconds"] = milliseconds if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_report_timer", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_report_timer", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9394,16 +8249,16 @@ class LFJsonPost(LFCliBase): THROUGHPUT = "THROUGHPUT" # def post_set_endp_tos(self, - name=None, # The name of the endpoint we are configuring. - priority=None, # The socket priority, can be any positive number. - tos=None, # The Type of Service, can be HEX, see above. - debug_=False): + name: str = None, # The name of the endpoint we are configuring. [R] + priority: str = None, # The socket priority, can be any positive number. + tos: str = None, # The Type of Service, can be HEX, see above. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_tos(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -9413,9 +8268,10 @@ class LFJsonPost(LFCliBase): data["tos"] = tos if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_tos", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_tos", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9425,17 +8281,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_tx_bounds ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_tx_bounds(self, - is_bursty=None, # YES if bursty, anything else for NO. - max_tx_rate=None, # The maximum transmit rate, in bits per second (bps). - min_tx_rate=None, # The minimum transmit rate, in bits per second (bps). - name=None, # The name of the endpoint we are configuring. - debug_=False): + is_bursty: str = None, # YES if bursty, anything else for NO. + max_tx_rate: str = None, # The maximum transmit rate, in bits per second (bps). + min_tx_rate: str = None, # The minimum transmit rate, in bits per second (bps). + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_tx_bounds(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if is_bursty is not None: data["is_bursty"] = is_bursty @@ -9447,9 +8303,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_tx_bounds", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_tx_bounds", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9565,20 +8422,20 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_event_interest(self, - ei_flags=None, # Event Interest flags, see above. - event_cnt=None, # Maximum number of events to store. - events1=None, # See description for possible values. - events2=None, # See description for possible values. - events3=None, # See description for possible values. - events4=None, # See description for possible values. - var1=None, # Currently un-used. - debug_=False): + ei_flags: str = None, # Event Interest flags, see above. [W] + event_cnt: str = None, # Maximum number of events to store. + events1: str = None, # See description for possible values. + events2: str = None, # See description for possible values. + events3: str = None, # See description for possible values. + events4: str = None, # See description for possible values. + var1: str = None, # Currently un-used. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_event_interest(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ei_flags is not None: data["ei_flags"] = ei_flags @@ -9596,9 +8453,10 @@ class LFJsonPost(LFCliBase): data["var1"] = var1 if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_event_interest", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_event_interest", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9647,15 +8505,15 @@ class LFJsonPost(LFCliBase): WARNING = "WARNING" # def post_set_event_priority(self, - event=None, # Number or name for the event, see above. - priority=None, # Number or name for the priority. - debug_=False): + event: str = None, # Number or name for the event, see above. [R,0-21] + priority: str = None, # Number or name for the priority. [R,0-5] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_event_priority(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if event is not None: data["event"] = event @@ -9663,9 +8521,10 @@ class LFJsonPost(LFCliBase): data["priority"] = priority if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_event_priority", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_event_priority", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9675,24 +8534,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_fe_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_fe_info(self, - directory=None, # The directory to read/write in. Absolute path suggested. - io_direction=None, # Should we be reading or writing: options: read, write - max_file_size=None, # The maximum file size, in bytes. - max_rw_sz=None, # Maximum read/write size, in bytes. - min_file_size=None, # The minimum file size, in bytes. - min_rw_sz=None, # Minimum read/write size, in bytes. - name=None, # The name of the file endpoint we are configuring. - num_files=None, # Number of files to create when writing. - prefix=None, # The prefix of the file(s) to read/write. - quiesce_after_files=None, # If non-zero, quiesce test after this many files have been + directory: str = None, # The directory to read/write in. Absolute path suggested. + io_direction: str = None, # Should we be reading or writing: options: read, write + max_file_size: str = None, # The maximum file size, in bytes. + max_rw_sz: str = None, # Maximum read/write size, in bytes. + min_file_size: str = None, # The minimum file size, in bytes. + min_rw_sz: str = None, # Minimum read/write size, in bytes. + name: str = None, # The name of the file endpoint we are configuring. [R] + num_files: str = None, # Number of files to create when writing. + prefix: str = None, # The prefix of the file(s) to read/write. + quiesce_after_files: str = None, # If non-zero, quiesce test after this many files have been # read/written. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_fe_info(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if directory is not None: data["directory"] = directory @@ -9716,9 +8575,10 @@ class LFJsonPost(LFCliBase): data["quiesce_after_files"] = quiesce_after_files if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_fe_info", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_fe_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9741,17 +8601,17 @@ class LFJsonPost(LFCliBase): # +Event def post_set_flag(self, - client=None, # Specify the user, if it is not the current user. Requires admin + client: str = None, # Specify the user, if it is not the current user. Requires admin # privileges. - flag=None, # The name of the flag. - val=None, # Either 1 (for on), or 0 (for off). - debug_=False): + flag: str = None, # The name of the flag. [R] + val: str = None, # Either 1 (for on), or 0 (for off). [R,0-1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_flag(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if client is not None: data["client"] = client @@ -9761,9 +8621,10 @@ class LFJsonPost(LFCliBase): data["val"] = val if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_flag", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_flag", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9773,16 +8634,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_gen_cmd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_gen_cmd(self, - command=None, # The rest of the command line arguments. Unescaped Value - name=None, # The name of the file endpoint we are configuring. - debug_=False): + command: str = None, # The rest of the command line arguments. Unescaped Value [R] + name: str = None, # The name of the file endpoint we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_gen_cmd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if command is not None: data["command"] = command @@ -9790,9 +8651,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_gen_cmd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_gen_cmd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9802,20 +8664,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_gps_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_gps_info(self, - altitude=None, # Altitude, assumes units are Meters. - ew=None, # East or west (Longitude). - lattitude=None, # The lattitude, as read from a GPS device. - longitude=None, # The longitude, as ready from a GPS device. - ns=None, # North or South (Latitude). - resource=None, # Resource number for the port to be modified. - shelf=None, # Shelf number for the port to be modified, or SELF. - debug_=False): + altitude: str = None, # Altitude, assumes units are Meters. + ew: str = None, # East or west (Longitude). + lattitude: str = None, # The lattitude, as read from a GPS device. + longitude: str = None, # The longitude, as ready from a GPS device. + ns: str = None, # North or South (Latitude). + resource: str = None, # Resource number for the port to be modified. [W] + shelf: str = None, # Shelf number for the port to be modified, or SELF. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_gps_info(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if altitude is not None: data["altitude"] = altitude @@ -9833,9 +8695,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_gps_info", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_gps_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9845,20 +8708,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_ifup_script ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_ifup_script(self, - flags=None, # Currently un-defined, use NA - port=None, # WiFi interface name or number. - post_ifup_script=None, # Script name with optional args, will run after interface - # comes up and gets IP. Unescaped - # Value - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + flags: str = None, # Currently un-defined, use NA + port: str = None, # WiFi interface name or number. [W] + post_ifup_script: str = None, # Script name with optional args, will run after interface + # comes up and gets IP. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_ifup_script(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if flags is not None: data["flags"] = flags @@ -9872,9 +8734,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_ifup_script", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_ifup_script", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9884,23 +8747,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_license ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_license(self, - licenses=None, # License keys all appended into a single line. Unescaped Value - debug_=False): + licenses: str = None, # License keys all appended into a single line. Unescaped Value [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_license(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if licenses is not None: data["licenses"] = licenses if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_license", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_license", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9910,18 +8774,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_mc_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_mc_endp(self, - mcast_dest_port=None, # Multicast destination IP Port, for example: 55000 - mcast_group=None, # Multicast group IP, ie: 224.1.1.2 IPv6 supported as well. - name=None, # The name of the endpoint we are configuring. - rcv_mcast=None, # Should we attempt to receive? Values: Yes or No - ttl=None, # Time to live for the multicast packets generated. - debug_=False): + mcast_dest_port: str = None, # Multicast destination IP Port, for example: 55000 + mcast_group: str = None, # Multicast group IP, ie: 224.1.1.2 IPv6 supported as well. + name: str = None, # The name of the endpoint we are configuring. [R] + rcv_mcast: str = None, # Should we attempt to receive? Values: Yes or No + ttl: str = None, # Time to live for the multicast packets generated. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_mc_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if mcast_dest_port is not None: data["mcast_dest_port"] = mcast_dest_port @@ -9935,9 +8799,10 @@ class LFJsonPost(LFCliBase): data["ttl"] = ttl if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_mc_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_mc_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9947,16 +8812,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_password ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_password(self, - client=None, # Specify the client. If left blank, will use current client. - new_password=None, # New password, or 'NA' for blank password. - old_password=None, # Old password, or 'NA' for blank password. - debug_=False): + client: str = None, # Specify the client. If left blank, will use current client. + new_password: str = None, # New password, or 'NA' for blank password. [W] + old_password: str = None, # Old password, or 'NA' for blank password. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_password(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if client is not None: data["client"] = client @@ -9966,9 +8831,10 @@ class LFJsonPost(LFCliBase): data["old_password"] = old_password if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_password", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_password", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9977,23 +8843,32 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_poll_mode ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetPollModeMode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + polling = "polling" # + push = "push" # + def post_set_poll_mode(self, - mode=None, # 'polling' or 'push'. - debug_=False): + mode: str = None, # 'polling' or 'push'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_poll_mode(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if mode is not None: data["mode"] = mode if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_poll_mode", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_poll_mode", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10190,65 +9065,68 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_port(self, - alias=None, # A user-defined name for this interface. Can be BLANK or NA. - br_aging_time=None, # MAC aging time, in seconds, 32-bit number (or peer IP for GRE). - br_forwarding_delay=None, # How long to wait until the bridge will start forwarding packets. - br_hello_time=None, # How often does the bridge send out STP hello packets. - br_max_age=None, # How long until STP considers a non-responsive bridge dead. - br_port_cost=None, # STP Port cost for a port (this applies only to NON-BRIDGE + alias: str = None, # A user-defined name for this interface. Can be BLANK or NA. + br_aging_time: str = None, # MAC aging time, in seconds, 32-bit number (or peer IP for + # GRE). + br_forwarding_delay: str = None, # How long to wait until the bridge will start forwarding + # packets. + br_hello_time: str = None, # How often does the bridge send out STP hello packets. + br_max_age: str = None, # How long until STP considers a non-responsive bridge dead. + br_port_cost: str = None, # STP Port cost for a port (this applies only to NON-BRIDGE # interfaces). - br_port_priority=None, # STP Port priority for a port (this applies only to NON-BRIDGE + br_port_priority: str = None, # STP Port priority for a port (this applies only to NON-BRIDGE # interfaces). - br_priority=None, # Bridge priority, 16-bit number. - bypass_wdt=None, # Watch Dog Timer (in seconds) for this port. Zero (0) to disable. - cmd_flags=None, # Command Flags: See above, or NA. - cpu_mask=None, # CPU Mask for CPUs that should service this interface. Zero is - # don't set (let OS make the decision). This value will be applied - # to the proper /proc/irq/[irq-num]/smp_affinity file by the - # pin_irq.pl script. - current_flags=None, # See above, or NA. - current_flags_msk=None, # This sets 'interest' for flags 'Enable RADIUS service' and higher. - # See above, or NA. - dhcp_client_id=None, # Optional string of up to 63 bytes in length to be passed to the - # dhclient process. See above. - dhcp_hostname=None, # Optional string of up to 63 bytes in length to be passed to the - # dhclient process. Option 12, see above. - dhcp_vendor_id=None, # Optional string of up to 63 bytes in length to be passed to the - # dhclient process. See above. - dns_servers=None, # DNS servers for use by traffic on this port, comma-separated list, - # BLANK means zero-length string. - flags2=None, # Bridge & other flags, see above. - gateway=None, # IP address of the gateway device - used for IP routing, or NA. - interest=None, # Which things are we really interested in setting. Can over-ride - # defaults based on the other arguments. - ip_addr=None, # IP address for the port, or NA. - ipsec_concentrator=None, # IP Address of IPSec concentrator. - ipsec_local_id=None, # Local Identifier for this IPSec tunnel. - ipsec_passwd=None, # Password for IPSec, for pubkey, use: pubkey:[pem-file-name], for - # instance: pubkey:station.pem - ipsec_remote_id=None, # Remote Identifier for this IPSec tunnel. - ipv6_addr_global=None, # Global scoped IPv6 address. - ipv6_addr_link=None, # Link scoped IPv6 address. - ipv6_dflt_gw=None, # IPv6 default gateway. - mac=None, # MAC address to set this port to, or leave blank to not set it, or - # NA. - mtu=None, # Maximum Transmit Unit (MTU) for this interface. Can be blank or - # NA. - netmask=None, # Netmask which this port should use, or NA. - port=None, # Port number for the port to be modified. - report_timer=None, # How often, in milliseconds, should we poll stats on this + br_priority: str = None, # Bridge priority, 16-bit number. + bypass_wdt: str = None, # Watch Dog Timer (in seconds) for this port. Zero (0) to + # disable. + cmd_flags: str = None, # Command Flags: See above, or NA. + cpu_mask: str = None, # CPU Mask for CPUs that should service this interface. Zero is + # don't set (let OS make the decision). This value will be + # applied to the proper /proc/irq/[irq-num]/smp_affinity file by + # the pin_irq.pl script. + current_flags: str = None, # See above, or NA. + current_flags_msk: str = None, # This sets 'interest' for flags 'Enable RADIUS service' and + # higher. See above, or NA. + dhcp_client_id: str = None, # Optional string of up to 63 bytes in length to be passed to + # the dhclient process. See above. + dhcp_hostname: str = None, # Optional string of up to 63 bytes in length to be passed to + # the dhclient process. Option 12, see above. + dhcp_vendor_id: str = None, # Optional string of up to 63 bytes in length to be passed to + # the dhclient process. See above. + dns_servers: str = None, # DNS servers for use by traffic on this port, comma-separated + # list, BLANK means zero-length string. + flags2: str = None, # Bridge & other flags, see above. + gateway: str = None, # IP address of the gateway device - used for IP routing, or NA. + interest: str = None, # Which things are we really interested in setting. Can + # over-ride defaults based on the other arguments. + ip_addr: str = None, # IP address for the port, or NA. + ipsec_concentrator: str = None, # IP Address of IPSec concentrator. + ipsec_local_id: str = None, # Local Identifier for this IPSec tunnel. + ipsec_passwd: str = None, # Password for IPSec, for pubkey, use: pubkey:[pem-file-name], + # for instance: pubkey:station.pem + ipsec_remote_id: str = None, # Remote Identifier for this IPSec tunnel. + ipv6_addr_global: str = None, # Global scoped IPv6 address. + ipv6_addr_link: str = None, # Link scoped IPv6 address. + ipv6_dflt_gw: str = None, # IPv6 default gateway. + mac: str = None, # MAC address to set this port to, or leave blank to not set it, + # or NA. + mtu: str = None, # Maximum Transmit Unit (MTU) for this interface. Can be blank + # or NA. + netmask: str = None, # Netmask which this port should use, or NA. + port: str = None, # Port number for the port to be modified. [W] + report_timer: str = None, # How often, in milliseconds, should we poll stats on this # interface? - resource=None, # Resource number for the port to be modified. - shelf=None, # Shelf number for the port to be modified. - sta_br_id=None, # WiFi STAtion bridge ID. Zero means none. - tx_queue_len=None, # Transmit Queue Length for this interface. Can be blank or NA. - debug_=False): + resource: str = None, # Resource number for the port to be modified. [W] + shelf: str = None, # Shelf number for the port to be modified. [R][D:1] + sta_br_id: str = None, # WiFi STAtion bridge ID. Zero means none. + tx_queue_len: str = None, # Transmit Queue Length for this interface. Can be blank or NA. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_port(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -10326,9 +9204,10 @@ class LFJsonPost(LFCliBase): data["tx_queue_len"] = tx_queue_len if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_port", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10338,19 +9217,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_port_alias ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_port_alias(self, - alias=None, # New alias to assign to this virtual interface. - port=None, # Physical Port identifier that owns the virtual interface. - resource=None, # Resource number for the port to be modified. - shelf=None, # Shelf number for the port to be modified. - vport=None, # Virtual port identifier. MAC for MAC-VLANs, VLAN-ID for 802.1Q + alias: str = None, # New alias to assign to this virtual interface. [W] + port: str = None, # Physical Port identifier that owns the virtual interface. [R] + resource: str = None, # Resource number for the port to be modified. [W] + shelf: str = None, # Shelf number for the port to be modified. [R][D:1] + vport: str = None, # Virtual port identifier. MAC for MAC-VLANs, VLAN-ID for 802.1Q # vlans. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_port_alias(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -10364,9 +9243,10 @@ class LFJsonPost(LFCliBase): data["vport"] = vport if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_port_alias", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_port_alias", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10376,17 +9256,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_ppp_link_state ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_ppp_link_state(self, - link=None, # Unit Number of the PPP Link, or 'all'. - ppp_state=None, # One of: RUNNING, STOPPED, or DELETED. - resource=None, # Number of the Resource, or 'all'. - shelf=None, # Name of the Shelf, or 'all'. - debug_=False): + link: str = None, # Unit Number of the PPP Link, or 'all'. [W] + ppp_state: str = None, # One of: RUNNING, STOPPED, or DELETED. [R] + resource: str = None, # Number of the Resource, or 'all'. [W] + shelf: str = None, # Name of the Shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_ppp_link_state(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if link is not None: data["link"] = link @@ -10398,9 +9278,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_ppp_link_state", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_ppp_link_state", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10417,29 +9298,29 @@ class LFJsonPost(LFCliBase): skip_load_db_on_start = 1 # Should we skip loading the DB on start? def post_set_resource(self, - device_profiles=None, # List of profiles, see above - max_helper_count=None, # Maximum number of helper traffic generation processes. 0 means - # CPU-core-count (AUTO). - max_staged_bringup=None, # Maximum amount of interfaces attempting to come up at once. - # Default is 50 - max_station_bringup=None, # Maximum amount of stations to bring up per radio per tick. + device_profiles: str = None, # List of profiles, see above + max_helper_count: str = None, # Maximum number of helper traffic generation processes. 0 + # means CPU-core-count (AUTO). + max_staged_bringup: str = None, # Maximum amount of interfaces attempting to come up at + # once. Default is 50 + max_station_bringup: str = None, # Maximum amount of stations to bring up per radio per tick. # Default is 12. - max_trying_ifup=None, # Maximum amount of interfaces running the network config 'ifup' - # logic. Default is 15 - resource=None, # Number of the Resource, or all. - resource_flags=None, # System wide flags, often requires a reboot for changes to take - # effect. - resource_flags_mask=None, # What flags to change. If unset, default is all. - shelf=None, # Name of the Shelf, or all. - top_left_x=None, # X Location for Chamber View. - top_left_y=None, # X Location for Chamber View. - debug_=False): + max_trying_ifup: str = None, # Maximum amount of interfaces running the network config + # 'ifup' logic. Default is 15 + resource: str = None, # Number of the Resource, or all. [W] + resource_flags: str = None, # System wide flags, often requires a reboot for changes to + # take effect. + resource_flags_mask: str = None, # What flags to change. If unset, default is all. + shelf: str = None, # Name of the Shelf, or all. [R][D:1] + top_left_x: str = None, # X Location for Chamber View. + top_left_y: str = None, # X Location for Chamber View. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_resource(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if device_profiles is not None: data["device_profiles"] = device_profiles @@ -10465,9 +9346,10 @@ class LFJsonPost(LFCliBase): data["top_left_y"] = top_left_y if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_resource", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_resource", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10498,26 +9380,27 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_rfgen(self, - bb_gain=None, # RX Gain, 0 - 62 in 2dB steps - freq_khz=None, # Center frequency in Khz - gain=None, # Main TX/RX Amp, 0 or 14 (dB), default is 14 - p_id=None, # RF Generator ID, not used at this time, enter 'NA' or 0. - if_gain=None, # Fine-tune TX/RX Gain, 0 - 40 dB - pulse_count=None, # Number of pulses (0-255) - pulse_interval_us=None, # Time between pulses, in micro-seconds. - pulse_width_us=None, # Requested pulse width, units are in micro-seconds. - resource=None, # Resource number. - rfgen_flags=None, # RF Generator flags, see above. - rfgen_flags_mask=None, # Mask of what flags to set, see above. - shelf=None, # Shelf number, usually 1. - sweep_time_ms=None, # Time interval between pulse groups in miliseconds - debug_=False): + bb_gain: str = None, # RX Gain, 0 - 62 in 2dB steps + freq_khz: str = None, # Center frequency in Khz + gain: str = None, # Main TX/RX Amp, 0 or 14 (dB), default is 14 + p_id: str = None, # RF Generator ID, not used at this time, enter 'NA' or 0. + # [D:NA] + if_gain: str = None, # Fine-tune TX/RX Gain, 0 - 40 dB + pulse_count: str = None, # Number of pulses (0-255) + pulse_interval_us: str = None, # Time between pulses, in micro-seconds. + pulse_width_us: str = None, # Requested pulse width, units are in micro-seconds. + resource: str = None, # Resource number. [W] + rfgen_flags: str = None, # RF Generator flags, see above. + rfgen_flags_mask: str = None, # Mask of what flags to set, see above. + shelf: str = None, # Shelf number, usually 1. [R][D:1] + sweep_time_ms: str = None, # Time interval between pulse groups in miliseconds + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_rfgen(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if bb_gain is not None: data["bb_gain"] = bb_gain @@ -10547,9 +9430,10 @@ class LFJsonPost(LFCliBase): data["sweep_time_ms"] = sweep_time_ms if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_rfgen", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_rfgen", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10607,20 +9491,20 @@ class LFJsonPost(LFCliBase): ScriptWL = "ScriptWL" # For iterating through WanLink settings def post_set_script(self, - endp=None, # Endpoint, Test Group or Attenuator name or ID. - flags=None, # See above for description of the defined flags. - group_action=None, # How to handle group script operations: ALL, Sequential - loop_count=None, # How many times to loop before stopping (0 is infinite). - name=None, # Script name. - private=None, # Private encoding for the particular script. - p_type=None, # One of: NONE, Script2544, ScriptHunt, ScriptWL, ScriptAtten - debug_=False): + endp: str = None, # Endpoint, Test Group or Attenuator name or ID. [R] + flags: str = None, # See above for description of the defined flags. + group_action: str = None, # How to handle group script operations: ALL, Sequential + loop_count: str = None, # How many times to loop before stopping (0 is infinite). + name: str = None, # Script name. [W] + private: str = None, # Private encoding for the particular script. + p_type: str = None, # One of: NONE, Script2544, ScriptHunt, ScriptWL, ScriptAtten + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_script(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp is not None: data["endp"] = endp @@ -10638,9 +9522,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_script", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_script", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10650,17 +9535,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_sec_ip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_sec_ip(self, - ip_list=None, # IP1/prefix,IP2/prefix,...IPZ/prefix. - port=None, # Name of network device (Port) to which these IPs will be added. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix. [W] + port: str = None, # Name of network device (Port) to which these IPs will be added. + # [R] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_sec_ip(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ip_list is not None: data["ip_list"] = ip_list @@ -10672,9 +9558,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_sec_ip", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_sec_ip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10684,35 +9571,38 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_voip_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_voip_info(self, - codec=None, # Codec to use for the voice stream, supported values: G711U, - # G711A, SPEEX, g726-16, g726-24, g726-32, g726-40, g729a. - first_call_delay=None, # How long to wait before making first call, in seconds. - jitter_buffer_sz=None, # The size of the jitter buffer in packets. Default value is 8. - local_sip_port=None, # Local SIP UDP port. Default is min-rtp-port + 2. - loop_call_count=None, # How many calls to make, zero means infinite. - loop_wavefile_count=None, # How many times to play the wave file, zero means infinite. - max_call_duration=None, # How long should the call be, in seconds. - max_inter_call_gap=None, # Maximum time to wait between calls, in seconds. - messaging_protocol=None, # Messaging protocol, supported values: SIP. - min_call_duration=None, # How long should the call be, in seconds. - min_inter_call_gap=None, # Minimum time to wait between calls, in seconds. - name=None, # The name of the endpoint we are configuring. - pesq_server_ip=None, # LANforge PESQ server IP address. - pesq_server_passwd=None, # LANforge PESQ server password. Default is to use no + codec: str = None, # Codec to use for the voice stream, supported values: + # G711U, G711A, SPEEX, g726-16, g726-24, g726-32, g726-40, + # g729a. + first_call_delay: str = None, # How long to wait before making first call, in seconds. + jitter_buffer_sz: str = None, # The size of the jitter buffer in packets. Default value + # is 8. + local_sip_port: str = None, # Local SIP UDP port. Default is min-rtp-port + 2. + loop_call_count: str = None, # How many calls to make, zero means infinite. + loop_wavefile_count: str = None, # How many times to play the wave file, zero means + # infinite. + max_call_duration: str = None, # How long should the call be, in seconds. + max_inter_call_gap: str = None, # Maximum time to wait between calls, in seconds. + messaging_protocol: str = None, # Messaging protocol, supported values: SIP. + min_call_duration: str = None, # How long should the call be, in seconds. + min_inter_call_gap: str = None, # Minimum time to wait between calls, in seconds. + name: str = None, # The name of the endpoint we are configuring. [R] + pesq_server_ip: str = None, # LANforge PESQ server IP address. + pesq_server_passwd: str = None, # LANforge PESQ server password. Default is to use no # authentication (blank entry). - pesq_server_port=None, # LANforge PESQ server port, default is 3998. - reg_expire_timer=None, # SIP Registration expire timer, in seconds. - ringing_timer=None, # How long (milliseconds) to wait in the ringing state before - # flagging call as no-answer. - sound_dev=None, # Which sound device should we play sound to. (see + pesq_server_port: str = None, # LANforge PESQ server port, default is 3998. + reg_expire_timer: str = None, # SIP Registration expire timer, in seconds. + ringing_timer: str = None, # How long (milliseconds) to wait in the ringing state + # before flagging call as no-answer. + sound_dev: str = None, # Which sound device should we play sound to. (see # set_endp_flags). - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_voip_info(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if codec is not None: data["codec"] = codec @@ -10752,9 +9642,10 @@ class LFJsonPost(LFCliBase): data["sound_dev"] = sound_dev if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_voip_info", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_voip_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10764,23 +9655,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_vrcx_cost ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_vrcx_cost(self, - interface_cost=None, # If using OSPF, this sets the cost for this link (1-65535). - local_dev=None, # Name of port A for the local redirect device pair. - local_dev_b=None, # Name of port B for the local redirect device pair. - remote_dev=None, # Name of port B for the remote redirect device pair. - remote_dev_b=None, # Name of port B for the remote redirect device pair. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - vr_name=None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add - # a stand-alone endpoint. - wanlink=None, # The name of the WanLink that connects the two B ports. - debug_=False): + interface_cost: str = None, # If using OSPF, this sets the cost for this link (1-65535). + local_dev: str = None, # Name of port A for the local redirect device pair. + local_dev_b: str = None, # Name of port B for the local redirect device pair. + remote_dev: str = None, # Name of port B for the remote redirect device pair. + remote_dev_b: str = None, # Name of port B for the remote redirect device pair. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to + # add a stand-alone endpoint. [W][D:FREE_LIST] + wanlink: str = None, # The name of the WanLink that connects the two B ports. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_vrcx_cost(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if interface_cost is not None: data["interface_cost"] = interface_cost @@ -10802,9 +9693,10 @@ class LFJsonPost(LFCliBase): data["wanlink"] = wanlink if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_vrcx_cost", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_vrcx_cost", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10814,39 +9706,41 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wanlink_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wanlink_info(self, - drop_freq=None, # How often, out of 1,000,000 packets, should we + drop_freq: str = None, # How often, out of 1,000,000 packets, should we # purposefully drop a packet. - dup_freq=None, # How often, out of 1,000,000 packets, should we + dup_freq: str = None, # How often, out of 1,000,000 packets, should we # purposefully duplicate a packet. - extra_buffer=None, # The extra amount of bytes to buffer before dropping pkts, - # in units of 1024. Use -1 for AUTO. - jitter_freq=None, # How often, out of 1,000,000 packets, should we apply + extra_buffer: str = None, # The extra amount of bytes to buffer before dropping + # pkts, in units of 1024. Use -1 for AUTO. + jitter_freq: str = None, # How often, out of 1,000,000 packets, should we apply # jitter. - latency=None, # The base latency added to all packets, in milliseconds - # (or add 'us' suffix for microseconds - max_drop_amt=None, # Maximum amount of packets to drop in a row. Default is 1. - max_jitter=None, # The maximum jitter, in milliseconds (or ad 'us' suffix - # for microseconds) - max_lateness=None, # Maximum amount of un-intentional delay before pkt is + latency: str = None, # The base latency added to all packets, in + # milliseconds (or add 'us' suffix for microseconds + max_drop_amt: str = None, # Maximum amount of packets to drop in a row. Default + # is 1. + max_jitter: str = None, # The maximum jitter, in milliseconds (or ad 'us' + # suffix for microseconds) + max_lateness: str = None, # Maximum amount of un-intentional delay before pkt is # dropped. Default is AUTO - max_reorder_amt=None, # Maximum amount of packets by which to reorder, Default is - # 10. - min_drop_amt=None, # Minimum amount of packets to drop in a row. Default is 1. - min_reorder_amt=None, # Minimum amount of packets by which to reorder, Default is - # 1. - name=None, # The name of the endpoint we are configuring. - playback_capture_file=None, # Name of the WAN capture file to play back. - reorder_freq=None, # How often, out of 1,000,000 packets, should we make a + max_reorder_amt: str = None, # Maximum amount of packets by which to reorder, + # Default is 10. + min_drop_amt: str = None, # Minimum amount of packets to drop in a row. Default + # is 1. + min_reorder_amt: str = None, # Minimum amount of packets by which to reorder, + # Default is 1. + name: str = None, # The name of the endpoint we are configuring. [R] + playback_capture_file: str = None, # Name of the WAN capture file to play back. + reorder_freq: str = None, # How often, out of 1,000,000 packets, should we make a # packet out of order. - speed=None, # The maximum speed of traffic this endpoint will accept - # (bps). - debug_=False): + speed: str = None, # The maximum speed of traffic this endpoint will + # accept (bps). + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wanlink_info(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if drop_freq is not None: data["drop_freq"] = drop_freq @@ -10880,9 +9774,10 @@ class LFJsonPost(LFCliBase): data["speed"] = speed if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wanlink_info", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wanlink_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10891,18 +9786,26 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wanlink_pcap ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetWanlinkPcapCapture(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + OFF = "OFF" # stop capturing + ON = "ON" # start capturing + def post_set_wanlink_pcap(self, - capture=None, # Should we capture or not? ON or OFF. - directory=None, # The directory name in which packet capture files will be + capture: str = None, # Should we capture or not? ON or OFF. [R] + directory: str = None, # The directory name in which packet capture files will be # written. - name=None, # The name of the endpoint we are configuring. - debug_=False): + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wanlink_pcap(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if capture is not None: data["capture"] = capture @@ -10912,9 +9815,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wanlink_pcap", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wanlink_pcap", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10949,24 +9853,24 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_wanpath_corruption(self, - byte=None, # The byte to use for OVERWRITE_FIXED (or NA). - flags=None, # The flags for this corruption. - index=None, # The corruption to modify (0-5). - max_offset=None, # The maximum offset from start of Ethernet packet for the - # byte to be modified. - min_offset=None, # The minimum offset from start of Ethernet packet for the - # byte to be modified. - name=None, # WanLink name - path=None, # WanPath name - rate=None, # Specifies how often, per million, this corruption should - # be applied. - debug_=False): + byte: str = None, # The byte to use for OVERWRITE_FIXED (or NA). + flags: str = None, # The flags for this corruption. + index: str = None, # The corruption to modify (0-5). [R,0-5] + max_offset: str = None, # The maximum offset from start of Ethernet packet for + # the byte to be modified. + min_offset: str = None, # The minimum offset from start of Ethernet packet for + # the byte to be modified. + name: str = None, # WanLink name [R] + path: str = None, # WanPath name [R] + rate: str = None, # Specifies how often, per million, this corruption + # should be applied. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wanpath_corruption(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if byte is not None: data["byte"] = byte @@ -10986,9 +9890,10 @@ class LFJsonPost(LFCliBase): data["rate"] = rate if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wanpath_corruption", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wanpath_corruption", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10998,23 +9903,25 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wanpath_filter ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wanpath_filter(self, - defer_flush=None, # Enter 'YES' if you do NOT want this flushed to the remote. - dst_filter=None, # The destination MAC or IP/Mask, 'NA' for PCAP. - filter_type=None, # The filter type, one of: MAC, IP, PCAP. - passive=None, # Enter 'YES' if you do NOT want to use this filter currently. - reverse=None, # If you want the logic reversed, use 'ON', otherwise set to - # 'OFF' - src_filter=None, # The source MAC or IP/Mask. For PCAP, this is the only + defer_flush: str = None, # Enter 'YES' if you do NOT want this flushed to the + # remote. + dst_filter: str = None, # The destination MAC or IP/Mask, 'NA' for PCAP. + filter_type: str = None, # The filter type, one of: MAC, IP, PCAP. + passive: str = None, # Enter 'YES' if you do NOT want to use this filter + # currently. + reverse: str = None, # If you want the logic reversed, use 'ON', otherwise set + # to 'OFF' + src_filter: str = None, # The source MAC or IP/Mask. For PCAP, this is the only # filter. - wl_name=None, # The name of the WanLink endpoint we are configuring. - wp_name=None, # The name of the WanPath we are configuring. - debug_=False): + wl_name: str = None, # The name of the WanLink endpoint we are configuring. [R] + wp_name: str = None, # The name of the WanPath we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wanpath_filter(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if defer_flush is not None: data["defer_flush"] = defer_flush @@ -11034,9 +9941,10 @@ class LFJsonPost(LFCliBase): data["wp_name"] = wp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wanpath_filter", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wanpath_filter", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11055,16 +9963,16 @@ class LFJsonPost(LFCliBase): STOPPED = "STOPPED" # then it will not be running at any time. def post_set_wanpath_running(self, - running=None, # The state, one of: AS_PARENT, RUNNING, STOPPED. - wl_name=None, # The name of the WanLink endpoint we are configuring. - wp_name=None, # The name of the WanPath we are configuring. - debug_=False): + running: str = None, # The state, one of: AS_PARENT, RUNNING, STOPPED. [R] + wl_name: str = None, # The name of the WanLink endpoint we are configuring. [R] + wp_name: str = None, # The name of the WanPath we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wanpath_running(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if running is not None: data["running"] = running @@ -11074,9 +9982,10 @@ class LFJsonPost(LFCliBase): data["wp_name"] = wp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wanpath_running", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wanpath_running", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11119,31 +10028,31 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_wifi_corruptions(self, - corrupt_flags=None, # Specify packet types to corrupt (see flags above). - corrupt_per_mil=None, # Per-million: Station to randomly corrupt selected + corrupt_flags: str = None, # Specify packet types to corrupt (see flags above). + corrupt_per_mil: str = None, # Per-million: Station to randomly corrupt selected # message types by this amount. - delay_flags=None, # Specify packet types to delay (see flags above). - delay_max=None, # miliseconds: Station to randomly delay processing + delay_flags: str = None, # Specify packet types to delay (see flags above). + delay_max: str = None, # miliseconds: Station to randomly delay processing # received messages, max time - delay_min=None, # miliseconds: Station to randomly delay processing + delay_min: str = None, # miliseconds: Station to randomly delay processing # received messages, min time - dup_flags=None, # Specify packet types to duplicate (see flags above). - dup_per_65535=None, # Percentage, represented as x per 65535 of packets we + dup_flags: str = None, # Specify packet types to duplicate (see flags above). + dup_per_65535: str = None, # Percentage, represented as x per 65535 of packets we # should duplicate. - ignore_flags=None, # Specify packet types to ignore (see flags above). - ignore_per_mil=None, # Per-million: Station to randomly ignore selected message - # types by this amount. - port=None, # WiFi interface name or number. - req_flush=None, # Set to 1 if you wish to flush changes to kernel now. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + ignore_flags: str = None, # Specify packet types to ignore (see flags above). + ignore_per_mil: str = None, # Per-million: Station to randomly ignore selected + # message types by this amount. + port: str = None, # WiFi interface name or number. [W] + req_flush: str = None, # Set to 1 if you wish to flush changes to kernel now. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_corruptions(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if corrupt_flags is not None: data["corrupt_flags"] = corrupt_flags @@ -11173,9 +10082,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_corruptions", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_corruptions", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11185,19 +10095,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wifi_custom ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_custom(self, - port=None, # WiFi interface name or number. - resource=None, # Resource number. - shelf=None, # Shelf number. - text=None, # [BLANK] will erase all, any other text will be appended to - # existing text. Unescaped Value - p_type=None, # NA for now, may specify specific locations later. - debug_=False): + port: str = None, # WiFi interface name or number. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + text: str = None, # [BLANK] will erase all, any other text will be appended to + # existing text. + p_type: str = None, # NA for now, may specify specific locations later. [D:NA] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_custom(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -11211,9 +10121,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_custom", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_custom", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11223,55 +10134,55 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wifi_extra ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_extra(self, - anonymous_identity=None, # Anonymous identity string for EAP. - anqp_3gpp_cell_net=None, # 802.11u 3GCPP Cellular Network Info, VAP only. - ca_cert=None, # CA-CERT file name. - client_cert=None, # 802.11u Client cert file: /etc/wpa_supplicant/ca.pem - domain=None, # 802.11u domain: mytelco.com - eap=None, # EAP method: MD5, MSCHAPV2, OTP, GTC, TLS, PEAP, TTLS. - group=None, # Group cyphers: CCMP, TKIP, WEP104, WEP40, or combination. - hessid=None, # 802.11u HESSID (MAC address format) (or peer for WDS + anonymous_identity: str = None, # Anonymous identity string for EAP. + anqp_3gpp_cell_net: str = None, # 802.11u 3GCPP Cellular Network Info, VAP only. + ca_cert: str = None, # CA-CERT file name. + client_cert: str = None, # 802.11u Client cert file: /etc/wpa_supplicant/ca.pem + domain: str = None, # 802.11u domain: mytelco.com + eap: str = None, # EAP method: MD5, MSCHAPV2, OTP, GTC, TLS, PEAP, TTLS. + group: str = None, # Group cyphers: CCMP, TKIP, WEP104, WEP40, or combination. + hessid: str = None, # 802.11u HESSID (MAC address format) (or peer for WDS # stations). - identity=None, # EAP Identity string. - imsi=None, # 802.11u IMSI: 310026-000000000 - ipaddr_type_avail=None, # 802.11u network type available, integer, VAP only. - key=None, # WEP key0. This should be entered in ascii-hex. Use this only - # for WEP. - key_mgmt=None, # Key management: WPA-PSK, WPA-EAP, IEEE8021X, NONE, + identity: str = None, # EAP Identity string. + imsi: str = None, # 802.11u IMSI: 310026-000000000 + ipaddr_type_avail: str = None, # 802.11u network type available, integer, VAP only. + key: str = None, # WEP key0. This should be entered in ascii-hex. Use this + # only for WEP. + key_mgmt: str = None, # Key management: WPA-PSK, WPA-EAP, IEEE8021X, NONE, # WPA-PSK-SHA256, WPA-EAP-SHA256 or combo. - milenage=None, # 802.11u milenage: + milenage: str = None, # 802.11u milenage: # 90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82 - network_auth_type=None, # 802.11u network authentication type, VAP only. - network_type=None, # 802.11u network type, integer, VAP only. - pac_file=None, # EAP-FAST PAC-File name. (For AP, this field is the RADIUS + network_auth_type: str = None, # 802.11u network authentication type, VAP only. + network_type: str = None, # 802.11u network type, integer, VAP only. + pac_file: str = None, # EAP-FAST PAC-File name. (For AP, this field is the RADIUS # secret password) - pairwise=None, # Pairwise ciphers: CCMP, TKIP, NONE, or combination. - password=None, # EAP Password string. - phase1=None, # Outer-authentication, ie TLS tunnel parameters. - phase2=None, # Inner authentication with TLS tunnel. - pin=None, # EAP-SIM pin string. (For AP, this field is HS20 Operating + pairwise: str = None, # Pairwise ciphers: CCMP, TKIP, NONE, or combination. + password: str = None, # EAP Password string. + phase1: str = None, # Outer-authentication, ie TLS tunnel parameters. + phase2: str = None, # Inner authentication with TLS tunnel. + pin: str = None, # EAP-SIM pin string. (For AP, this field is HS20 Operating # Class) - pk_passwd=None, # EAP private key password. (For AP, this field is HS20 + pk_passwd: str = None, # EAP private key password. (For AP, this field is HS20 # connection capability) - port=None, # WiFi interface name or number. - private_key=None, # EAP private key certificate file name. (For AP, this field - # is HS20 WAN Metrics) - psk=None, # WPA(2) pre-shared key. If unsure, use this field for any + port: str = None, # WiFi interface name or number. [W] + private_key: str = None, # EAP private key certificate file name. (For AP, this + # field is HS20 WAN Metrics) + psk: str = None, # WPA(2) pre-shared key. If unsure, use this field for any # password entry. Prepend with 0x for ascii-hex # representation. - realm=None, # 802.11u realm: mytelco.com - resource=None, # Resource number. - roaming_consortium=None, # 802.11u roaming consortium: 223344 (15 characters max) - shelf=None, # Shelf number. - venue_group=None, # 802.11u Venue Group, integer. VAP only. - venue_type=None, # 802.11u Venue Type, integer. VAP only. - debug_=False): + realm: str = None, # 802.11u realm: mytelco.com + resource: str = None, # Resource number. [W] + roaming_consortium: str = None, # 802.11u roaming consortium: 223344 (15 characters max) + shelf: str = None, # Shelf number. [R][D:1] + venue_group: str = None, # 802.11u Venue Group, integer. VAP only. + venue_type: str = None, # 802.11u Venue Type, integer. VAP only. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_extra(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if anonymous_identity is not None: data["anonymous_identity"] = anonymous_identity @@ -11339,9 +10250,10 @@ class LFJsonPost(LFCliBase): data["venue_type"] = venue_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_extra", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_extra", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11351,34 +10263,34 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wifi_extra2 ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_extra2(self, - corrupt_gtk_rekey_mic=None, # Per-million: AP corrupts GTK Rekey MIC. - freq_24=None, # Frequency list for 2.4Ghz band, see above. - freq_5=None, # Frequency list for 5Ghz band, see above. - ignore_assoc=None, # Per-million: AP ignore assoc request percentage. - ignore_auth=None, # Per-million: AP ignore auth request percentage. - ignore_probe=None, # Per-million: AP ignore probe percentage. - ignore_reassoc=None, # Per-million: AP ignore re-assoc request percentage. - ocsp=None, # OCSP settings: 0=disabled, 1=try, but to not require + corrupt_gtk_rekey_mic: str = None, # Per-million: AP corrupts GTK Rekey MIC. + freq_24: str = None, # Frequency list for 2.4Ghz band, see above. + freq_5: str = None, # Frequency list for 5Ghz band, see above. + ignore_assoc: str = None, # Per-million: AP ignore assoc request percentage. + ignore_auth: str = None, # Per-million: AP ignore auth request percentage. + ignore_probe: str = None, # Per-million: AP ignore probe percentage. + ignore_reassoc: str = None, # Per-million: AP ignore re-assoc request percentage. + ocsp: str = None, # OCSP settings: 0=disabled, 1=try, but to not require # response, 2=require valid OCSP stapling response. - port=None, # WiFi interface name or number. - post_ifup_script=None, # Script name with optional args, will run after interface - # comes up and gets IP. - radius_ip=None, # RADIUS server IP Address (AP Only) - radius_port=None, # RADIUS server IP Port (AP Only) - req_flush=None, # Set to 1 if you wish to flush changes to kernel now. - resource=None, # Resource number. - sae_pwe=None, # Set SAE-PWE, 0 == hunting-and-pecking, 1 == + port: str = None, # WiFi interface name or number. [W] + post_ifup_script: str = None, # Script name with optional args, will run after + # interface comes up and gets IP. + radius_ip: str = None, # RADIUS server IP Address (AP Only) + radius_port: str = None, # RADIUS server IP Port (AP Only) + req_flush: str = None, # Set to 1 if you wish to flush changes to kernel now. + resource: str = None, # Resource number. [W] + sae_pwe: str = None, # Set SAE-PWE, 0 == hunting-and-pecking, 1 == # hash-to-element, 2 allow both. - shelf=None, # Shelf number. - venue_id=None, # Venue-ID for this wifi device. VAP in same venue will + shelf: str = None, # Shelf number. [R][D:1] + venue_id: str = None, # Venue-ID for this wifi device. VAP in same venue will # share neigh reports as appropriate. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_extra2(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if corrupt_gtk_rekey_mic is not None: data["corrupt_gtk_rekey_mic"] = corrupt_gtk_rekey_mic @@ -11416,9 +10328,10 @@ class LFJsonPost(LFCliBase): data["venue_id"] = venue_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_extra2", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_extra2", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11478,57 +10391,58 @@ class LFJsonPost(LFCliBase): g = 3 # 802.11g def post_set_wifi_radio(self, - active_peer_count=None, # Number of locally-cached peer objects for this radio. - ampdu_factor=None, # ax200/ax210 only, currently. Requires module reload. OS + active_peer_count: str = None, # Number of locally-cached peer objects for this radio. + ampdu_factor: str = None, # ax200/ax210 only, currently. Requires module reload. OS # Default: 0xFF - antenna=None, # Antenna configuration: 0 Diversity/All, 1 Fixed-A (1x1), 4 - # AB (2x2), 7 ABC (3x3), 8 ABCD (4x4), 9 8x8 - channel=None, # Channel number for this radio device. Frequency takes + antenna: str = None, # Antenna configuration: 0 Diversity/All, 1 Fixed-A (1x1), + # 4 AB (2x2), 7 ABC (3x3), 8 ABCD (4x4), 9 8x8 + channel: str = None, # Channel number for this radio device. Frequency takes # precedence if both are set to non-default values. - # 0xFFFF, AUTO or DEFAULT means ANY. - const_tx=None, # RF Pattern Generator , encoded as a single 32-bit integer. - # See above. - country=None, # Country number for this radio device. - flags=None, # Flags for this interface (see above.) - flags_mask=None, # If set, only these flags will be considered. - frag_thresh=None, # Fragmentation Threshold (256 - 2346, 2346 == disabled). - frequency=None, # Frequency for this radio. 0xFFFF, AUTO or DEFAULT - # means ANY. - fwname=None, # Firmware name (for example: firmware-5.bin) - fwver=None, # Firmware API version (for example, 5 if firmware is based on - # firmware-5.bin - mac=None, # Used to identify when name cannot be trusted (2.6.34+ + const_tx: str = None, # RF Pattern Generator , encoded as a single 32-bit + # integer. See above. + country: str = None, # Country number for this radio device. + flags: str = None, # Flags for this interface (see above.) + flags_mask: str = None, # If set, only these flags will be considered. + frag_thresh: str = None, # Fragmentation Threshold (256 - 2346, 2346 == disabled). + frequency: str = None, # Frequency for this radio. 0xFFFF, AUTO or + # DEFAULT means ANY. + fwname: str = None, # Firmware name (for example: firmware-5.bin) + fwver: str = None, # Firmware API version (for example, 5 if firmware is based + # on firmware-5.bin + mac: str = None, # Used to identify when name cannot be trusted (2.6.34+ # kernels). - max_amsdu=None, # Maximum number of frames per AMSDU that may be transmitted. - # See above. - mode=None, # WiFi mode, see table - peer_count=None, # Number of peer objects for this radio. - pref_ap=None, # Preferred AP BSSID for all station vdevs on this radio. - pulse2_interval_us=None, # Pause between pattern burst for RF noise generator. - pulse_interval=None, # RF Pattern generator: interval between pulses in usecs. - pulse_width=None, # RF Pattern generator: pulse width in usecs. - radio=None, # Name of the physical radio interface, for example: wiphy0 - rate=None, # No longer used, specify the rate on the virtual station(s) - # instead. - rate_ctrl_count=None, # Number of rate-ctrl objects for this radio. - resource=None, # Resource number. - rts=None, # The RTS Threshold for this radio (off, or 1-2347). - shelf=None, # Shelf number. - skid_limit=None, # Firmware hash-table Skid Limit for this radio. - stations_count=None, # Number of stations supported by this radio. - tids_count=None, # TIDs count for this radio. - tx_pulses=None, # Number of pattern pulses per burst for RF noise generator. - txdesc_count=None, # Transmit descriptor count for this radio. - txpower=None, # The transmit power setting for this radio. (AUTO for system - # defaults) - vdev_count=None, # Configure radio vdev count. - debug_=False): + max_amsdu: str = None, # Maximum number of frames per AMSDU that may be + # transmitted. See above. + mode: str = None, # WiFi mode, see table + peer_count: str = None, # Number of peer objects for this radio. + pref_ap: str = None, # Preferred AP BSSID for all station vdevs on this radio. + pulse2_interval_us: str = None, # Pause between pattern burst for RF noise generator. + pulse_interval: str = None, # RF Pattern generator: interval between pulses in usecs. + pulse_width: str = None, # RF Pattern generator: pulse width in usecs. + radio: str = None, # Name of the physical radio interface, for example: wiphy0 + # [W] + rate: str = None, # No longer used, specify the rate on the virtual + # station(s) instead. + rate_ctrl_count: str = None, # Number of rate-ctrl objects for this radio. + resource: str = None, # Resource number. [W] + rts: str = None, # The RTS Threshold for this radio (off, or 1-2347). + shelf: str = None, # Shelf number. [R][D:1] + skid_limit: str = None, # Firmware hash-table Skid Limit for this radio. + stations_count: str = None, # Number of stations supported by this radio. + tids_count: str = None, # TIDs count for this radio. + tx_pulses: str = None, # Number of pattern pulses per burst for RF noise + # generator. + txdesc_count: str = None, # Transmit descriptor count for this radio. + txpower: str = None, # The transmit power setting for this radio. (AUTO for + # system defaults) + vdev_count: str = None, # Configure radio vdev count. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_radio(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if active_peer_count is not None: data["active_peer_count"] = active_peer_count @@ -11598,9 +10512,10 @@ class LFJsonPost(LFCliBase): data["vdev_count"] = vdev_count if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_radio", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_radio", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11610,27 +10525,29 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wifi_txo ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_txo(self, - port=None, # WiFi interface name or number. - resource=None, # Resource number. - shelf=None, # Shelf number. - txo_bw=None, # Configure bandwidth: 0 == 20, 1 == 40, 2 == 80, 3 == 160, 4 == + port: str = None, # WiFi interface name or number. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + txo_bw: str = None, # Configure bandwidth: 0 == 20, 1 == 40, 2 == 80, 3 == 160, 4 == # 80+80. - txo_enable=None, # Set to 1 if you wish to enable transmit override, 0 to disable. - txo_mcs=None, # Configure the MCS (0-3 for CCK, 0-7 for OFDM, 0-7 for HT, 0-9 for - # VHT, 0-11 for HE - txo_nss=None, # Configure number of spatial streams (0 == nss1, 1 == nss2, ...). - txo_pream=None, # Select rate preamble: 0 == OFDM, 1 == CCK, 2 == HT, 3 == VHT, 4 == - # HE_SU. - txo_retries=None, # Configure number of retries. 0 or 1 means no retries). - txo_sgi=None, # Should rates be sent with short-guard-interval or not? - txo_txpower=None, # Configure TX power in db. Use 255 for system defaults. - debug_=False): + txo_enable: str = None, # Set to 1 if you wish to enable transmit override, 0 to + # disable. + txo_mcs: str = None, # Configure the MCS (0-3 for CCK, 0-7 for OFDM, 0-7 for HT, 0-9 + # for VHT, 0-11 for HE + txo_nss: str = None, # Configure number of spatial streams (0 == nss1, 1 == nss2, + # ...). + txo_pream: str = None, # Select rate preamble: 0 == OFDM, 1 == CCK, 2 == HT, 3 == VHT, + # 4 == HE_SU. + txo_retries: str = None, # Configure number of retries. 0 or 1 means no retries). + txo_sgi: str = None, # Should rates be sent with short-guard-interval or not? + txo_txpower: str = None, # Configure TX power in db. Use 255 for system defaults. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_txo(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -11656,9 +10573,10 @@ class LFJsonPost(LFCliBase): data["txo_txpower"] = txo_txpower if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_txo", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_txo", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11693,23 +10611,23 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_wl_corruption(self, - byte=None, # The byte to use for OVERWRITE_FIXED (or NA). - flags=None, # The flags for this corruption. - index=None, # The corruption to modify (0-5). - max_offset=None, # The maximum offset from start of Ethernet packet for the byte - # to be modified. - min_offset=None, # The minimum offset from start of Ethernet packet for the byte - # to be modified. - name=None, # WanLink name - rate=None, # Specifies how often, per million, this corruption should be - # applied. - debug_=False): + byte: str = None, # The byte to use for OVERWRITE_FIXED (or NA). + flags: str = None, # The flags for this corruption. + index: str = None, # The corruption to modify (0-5). [R,0-5] + max_offset: str = None, # The maximum offset from start of Ethernet packet for the + # byte to be modified. + min_offset: str = None, # The minimum offset from start of Ethernet packet for the + # byte to be modified. + name: str = None, # WanLink name [R] + rate: str = None, # Specifies how often, per million, this corruption should + # be applied. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wl_corruption(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if byte is not None: data["byte"] = byte @@ -11727,9 +10645,10 @@ class LFJsonPost(LFCliBase): data["rate"] = rate if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wl_corruption", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wl_corruption", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11747,15 +10666,15 @@ class LFJsonPost(LFCliBase): WRR__queue_queue_____ = "WRR,[queue,queue,...]" # Weighted Round Robbin is also available def post_set_wl_qdisc(self, - name=None, # WanLink name - qdisc=None, # FIFO, WRR,a,b,c,d,e,f,g etc - debug_=False): + name: str = None, # WanLink name [R] + qdisc: str = None, # FIFO, WRR,a,b,c,d,e,f,g etc [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wl_qdisc(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -11763,9 +10682,10 @@ class LFJsonPost(LFCliBase): data["qdisc"] = qdisc if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wl_qdisc", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wl_qdisc", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11793,19 +10713,19 @@ class LFJsonPost(LFCliBase): Test_Mgr = "Test_Mgr" # def post_show_alerts(self, - card=None, # Alert resource filter. - endp=None, # Alert endpoint filter. - extra=None, # Extra filter, currently ignored. - port=None, # Alert port filter (can be port name or number). - shelf=None, # Alert shelf filter. - p_type=None, # Alert type filter. - debug_=False): + card: str = None, # Alert resource filter. + endp: str = None, # Alert endpoint filter. + extra: str = None, # Extra filter, currently ignored. + port: str = None, # Alert port filter (can be port name or number). + shelf: str = None, # Alert shelf filter. + p_type: str = None, # Alert type filter. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_alerts(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if card is not None: data["card"] = card @@ -11821,9 +10741,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_alerts", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_alerts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11833,16 +10754,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_attenuators ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_attenuators(self, - resource=None, # Resource number, or 'all'. - serno=None, # Serial number for requested Attenuator, or 'all'. - shelf=None, # Shelf number or alias, can be 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_attenuators(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -11852,9 +10773,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_attenuators", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_attenuators", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11864,16 +10786,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_cd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_cd(self, - collision_domain=None, # Name of the Collision Domain, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + collision_domain: str = None, # Name of the Collision Domain, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_cd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if collision_domain is not None: data["collision_domain"] = collision_domain @@ -11883,9 +10805,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_cd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11895,22 +10818,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_chamber ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_chamber(self, - name=None, # Chamber Name or 'ALL'. - debug_=False): + name: str = None, # Chamber Name or 'ALL'. [W][D:ALL] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_chamber(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_chamber", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11920,16 +10844,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_channel_groups ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_channel_groups(self, - channel_name=None, # Name of the channel, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + channel_name: str = None, # Name of the channel, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_channel_groups(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if channel_name is not None: data["channel_name"] = channel_name @@ -11939,9 +10863,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_channel_groups", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_channel_groups", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11951,17 +10876,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_clients ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_clients(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_clients(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/show_clients", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_clients", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11971,15 +10897,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_cx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_cx(self, - cross_connect=None, # Specify cross-connect to act on, or 'all'. - test_mgr=None, # Specify test-mgr to act on, or 'all'. - debug_=False): + cross_connect: str = None, # Specify cross-connect to act on, or 'all'. [W] + test_mgr: str = None, # Specify test-mgr to act on, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_cx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cross_connect is not None: data["cross_connect"] = cross_connect @@ -11987,9 +10913,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_cx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11999,15 +10926,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_cxe ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_cxe(self, - cross_connect=None, # Specify cross-connect to show, or 'all'. - test_mgr=None, # Specify test-mgr to use, or 'all'. - debug_=False): + cross_connect: str = None, # Specify cross-connect to show, or 'all'. [W] + test_mgr: str = None, # Specify test-mgr to use, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_cxe(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cross_connect is not None: data["cross_connect"] = cross_connect @@ -12015,9 +10942,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_cxe", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_cxe", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12027,17 +10955,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_dbs ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_dbs(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_dbs(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/show_dbs", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_dbs", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12047,22 +10976,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_dut ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_dut(self, - name=None, # DUT Name or 'ALL'. - debug_=False): + name: str = None, # DUT Name or 'ALL'. [W][D:ALL] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_dut(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_dut", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_dut", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12072,15 +11002,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_endp_payload ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_endp_payload(self, - max_bytes=None, # The max number of payload bytes to print out, default is 128. - name=None, # The name of the endpoint we are configuring. - debug_=False): + max_bytes: str = None, # The max number of payload bytes to print out, default is + # 128. [R][D:128] + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_endp_payload(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if max_bytes is not None: data["max_bytes"] = max_bytes @@ -12088,9 +11019,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_endp_payload", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_endp_payload", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12100,15 +11032,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_endpoints ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_endpoints(self, - endpoint=None, # Name of endpoint, or 'all'. - extra=None, # See above. - debug_=False): + endpoint: str = None, # Name of endpoint, or 'all'. [R] + extra: str = None, # See above. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_endpoints(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint @@ -12116,9 +11048,10 @@ class LFJsonPost(LFCliBase): data["extra"] = extra if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_endpoints", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_endpoints", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12128,23 +11061,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_err ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_err(self, - message=None, # Message to show to others currently logged on. Unescaped Value - debug_=False): + message: str = None, # Message to show to others currently logged on. Unescaped Value [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_err(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if message is not None: data["message"] = message if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_err", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_err", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12154,17 +11088,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_event_interest ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_event_interest(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_event_interest(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/show_event_interest", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_event_interest", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12192,19 +11127,19 @@ class LFJsonPost(LFCliBase): Test_Mgr = "Test_Mgr" # def post_show_events(self, - card=None, # Event resource filter. - endp=None, # Event endpoint filter. - extra=None, # Extra filter, currently ignored. - port=None, # Event port filter (can be port name or number). - shelf=None, # Event shelf filter. - p_type=None, # Event type filter. - debug_=False): + card: str = None, # Event resource filter. + endp: str = None, # Event endpoint filter. + extra: str = None, # Extra filter, currently ignored. + port: str = None, # Event port filter (can be port name or number). + shelf: str = None, # Event shelf filter. + p_type: str = None, # Event type filter. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_events(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if card is not None: data["card"] = card @@ -12220,9 +11155,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_events", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_events", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12232,19 +11168,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_files ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_files(self, - dir_flags=None, # Determines format of listing, see above. - directory=None, # The sub-directory in which to list. - p_filter=None, # An optional filter, as used by the 'ls' command. - key=None, # A special key, can be used for scripting. - resource=None, # The machine to search in. - shelf=None, # The virtual shelf to search in. Use 0 for manager machine. - debug_=False): + dir_flags: str = None, # Determines format of listing, see above. + directory: str = None, # The sub-directory in which to list. + p_filter: str = None, # An optional filter, as used by the 'ls' command. + key: str = None, # A special key, can be used for scripting. + resource: str = None, # The machine to search in. [W] + shelf: str = None, # The virtual shelf to search in. Use 0 for manager machine. + # [R,0-1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_files(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if dir_flags is not None: data["dir_flags"] = dir_flags @@ -12260,9 +11197,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_files", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_files", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12272,22 +11210,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_group(self, - group=None, # Can be name of test group. Use 'all' or leave blank for all groups. - debug_=False): + group: str = None, # Can be name of test group. Use 'all' or leave blank for all groups. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if group is not None: data["group"] = group if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12297,22 +11236,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_pesq ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_pesq(self, - endpoint=None, # Name of endpoint, or 'all'. - debug_=False): + endpoint: str = None, # Name of endpoint, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_pesq(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_pesq", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_pesq", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12322,18 +11262,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_ports ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_ports(self, - port=None, # Port number, or 'all'. - probe_flags=None, # See above, add them together for multiple probings. Leave blank if - # you want stats only. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + port: str = None, # Port number, or 'all'. [W] + probe_flags: str = None, # See above, add them together for multiple probings. Leave blank + # if you want stats only. + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_ports(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -12345,9 +11285,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_ports", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12357,16 +11298,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_ppp_links ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_ppp_links(self, - link_num=None, # Ppp-Link number of the span, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + link_num: str = None, # Ppp-Link number of the span, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_ppp_links(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if link_num is not None: data["link_num"] = link_num @@ -12376,9 +11317,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_ppp_links", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_ppp_links", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12388,22 +11330,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_profile(self, - name=None, # Profile Name or 'ALL'. - debug_=False): + name: str = None, # Profile Name or 'ALL'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12413,15 +11356,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_resources ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_resources(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Shelf number or alias, can be 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_resources(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12429,9 +11372,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_resources", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_resources", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12441,15 +11385,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_rfgen ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_rfgen(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Shelf number or alias, can be 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_rfgen(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12457,9 +11401,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_rfgen", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_rfgen", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12469,17 +11414,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_rt ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_rt(self, - key=None, # Unique identifier for this request. Usually left blank. - resource=None, # Resource number. - shelf=None, # Shelf number. - virtual_router=None, # Name of the virtual router. - debug_=False): + key: str = None, # Unique identifier for this request. Usually left blank. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + virtual_router: str = None, # Name of the virtual router. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_rt(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if key is not None: data["key"] = key @@ -12491,9 +11436,10 @@ class LFJsonPost(LFCliBase): data["virtual_router"] = virtual_router if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_rt", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_rt", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12503,15 +11449,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_script_results ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_script_results(self, - endpoint=None, # Name of endpoint, test-group, or 'all'. - key=None, # Optional 'key' to be used in keyed-text message result. - debug_=False): + endpoint: str = None, # Name of endpoint, test-group, or 'all'. [R] + key: str = None, # Optional 'key' to be used in keyed-text message result. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_script_results(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint @@ -12519,9 +11465,10 @@ class LFJsonPost(LFCliBase): data["key"] = key if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_script_results", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_script_results", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12531,16 +11478,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_spans ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_spans(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - span_number=None, # Span-Number of the span, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + span_number: str = None, # Span-Number of the span, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_spans(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12550,9 +11497,10 @@ class LFJsonPost(LFCliBase): data["span_number"] = span_number if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_spans", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_spans", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12562,16 +11510,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_text_blob ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_text_blob(self, - brief=None, # Set to 'brief' for a brief listing of all text blobs. - name=None, # Text Blob Name or 'ALL'. - p_type=None, # Text Blob type or 'ALL'. - debug_=False): + brief: str = None, # Set to 'brief' for a brief listing of all text blobs. + name: str = None, # Text Blob Name or 'ALL'. [R] + p_type: str = None, # Text Blob type or 'ALL'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_text_blob(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if brief is not None: data["brief"] = brief @@ -12581,9 +11529,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_text_blob", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_text_blob", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12593,22 +11542,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_tm ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_tm(self, - test_mgr=None, # Can be name of test manager, or 'all'. - debug_=False): + test_mgr: str = None, # Can be name of test manager, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_tm(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if test_mgr is not None: data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_tm", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_tm", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12618,22 +11568,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_traffic_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_traffic_profile(self, - name=None, # Profile Name or 'ALL'. - debug_=False): + name: str = None, # Profile Name or 'ALL'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_traffic_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_traffic_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_traffic_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12643,16 +11594,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_venue ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_venue(self, - resource=None, # Resource number, or 'ALL' - shelf=None, # Shelf number. - venu_id=None, # Number to uniquely identify this venue on this resource, or 'ALL' - debug_=False): + resource: str = None, # Resource number, or 'ALL' [W] + shelf: str = None, # Shelf number. [R][D:1] + venu_id: str = None, # Number to uniquely identify this venue on this resource, or 'ALL' + # [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_venue(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12662,9 +11614,10 @@ class LFJsonPost(LFCliBase): data["venu_id"] = venu_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_venue", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_venue", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12674,16 +11627,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_vr(self, - resource=None, # Resource number, or 'all'. - router=None, # Name of the Virtual Router, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + router: str = None, # Name of the Virtual Router, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12693,9 +11646,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12705,16 +11659,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_vrcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_vrcx(self, - cx_name=None, # Name of the Virtual Router Connection, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + cx_name: str = None, # Name of the Virtual Router Connection, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_vrcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name @@ -12724,9 +11678,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_vrcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12736,15 +11691,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_wanpaths ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_wanpaths(self, - endpoint=None, # Name of endpoint, or 'all'. - wanpath=None, # Name of wanpath, or 'all'. - debug_=False): + endpoint: str = None, # Name of endpoint, or 'all'. [W] + wanpath: str = None, # Name of wanpath, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_wanpaths(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint @@ -12752,9 +11707,10 @@ class LFJsonPost(LFCliBase): data["wanpath"] = wanpath if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_wanpaths", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_wanpaths", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12764,18 +11720,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#shutdown ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown(self, - chdir=None, # Directory to cd to before dying. Only useful when using gprof to debug, - # or 'NA' to ignore. - really=None, # Must be 'YES' for command to really work. - serverctl=None, # Enter 'YES' to do a ./serverctl.bash restart to restart all LANforge - # processes. - debug_=False): + chdir: str = None, # Directory to cd to before dying. Only useful when using gprof to + # debug, or 'NA' to ignore. + really: str = None, # Must be 'YES' for command to really work. + serverctl: str = None, # Enter 'YES' to do a ./serverctl.bash restart to restart all + # LANforge processes. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_shutdown(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chdir is not None: data["chdir"] = chdir @@ -12785,9 +11741,10 @@ class LFJsonPost(LFCliBase): data["serverctl"] = serverctl if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/shutdown", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/shutdown", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12797,15 +11754,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#shutdown_os ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown_os(self, - resource=None, # Resource number, or ALL. - shelf=None, # Shelf number, or ALL. - debug_=False): + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_shutdown_os(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12813,9 +11770,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/shutdown_os", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/shutdown_os", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12825,15 +11783,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#shutdown_resource ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown_resource(self, - resource=None, # Resource number, or ALL. - shelf=None, # Shelf number, or ALL. - debug_=False): + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_shutdown_resource(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12841,9 +11799,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/shutdown_resource", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/shutdown_resource", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12876,22 +11835,22 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_sniff_port(self, - display=None, # The DISPLAY option, for example: 192.168.1.5:0.0. Will guess if left - # blank. - duration=None, # Duration for doing a capture (in seconds). Default is 5 minutes for - # dumpcap/tshark, and forever for wireshark - flags=None, # Flags that control how the sniffing is done. - outfile=None, # Optional file location for saving a capture. - port=None, # The port we are trying to run the packet sniffer on. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + display: str = None, # The DISPLAY option, for example: 192.168.1.5:0.0. Will guess if + # left blank. + duration: str = None, # Duration for doing a capture (in seconds). Default is 5 minutes + # for dumpcap/tshark, and forever for wireshark + flags: str = None, # Flags that control how the sniffing is done. + outfile: str = None, # Optional file location for saving a capture. + port: str = None, # The port we are trying to run the packet sniffer on. [R] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_sniff_port(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if display is not None: data["display"] = display @@ -12909,9 +11868,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/sniff_port", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/sniff_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12921,22 +11881,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#start_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_start_endp(self, - endp_name=None, # Name of the cross-connect, or 'all'. - debug_=False): + endp_name: str = None, # Name of the cross-connect, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_start_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/start_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/start_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12946,22 +11907,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#start_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_start_group(self, - name=None, # The name of the test group. - debug_=False): + name: str = None, # The name of the test group. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_start_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/start_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/start_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12971,16 +11933,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#start_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_start_ppp_link(self, - resource=None, # Resource number that holds this PppLink. - shelf=None, # Name/id of the shelf. - unit_num=None, # Unit-Number for the PppLink to be started. - debug_=False): + resource: str = None, # Resource number that holds this PppLink. [W] + shelf: str = None, # Name/id of the shelf. [R][D:1] + unit_num: str = None, # Unit-Number for the PppLink to be started. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_start_ppp_link(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12990,9 +11952,10 @@ class LFJsonPost(LFCliBase): data["unit_num"] = unit_num if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/start_ppp_link", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/start_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13002,22 +11965,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#stop_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_stop_endp(self, - endp_name=None, # Name of the endpoint, or 'all'. - debug_=False): + endp_name: str = None, # Name of the endpoint, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_stop_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/stop_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/stop_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13027,22 +11991,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#stop_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_stop_group(self, - name=None, # The name of the test group, or 'all' - debug_=False): + name: str = None, # The name of the test group, or 'all' [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_stop_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/stop_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/stop_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13052,16 +12017,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#stop_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_stop_ppp_link(self, - resource=None, # Resource number that holds this PppLink. - shelf=None, # Name/id of the shelf. - unit_num=None, # Unit-Number for the PppLink to be stopped. - debug_=False): + resource: str = None, # Resource number that holds this PppLink. [W] + shelf: str = None, # Name/id of the shelf. [R][D:1] + unit_num: str = None, # Unit-Number for the PppLink to be stopped. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_stop_ppp_link(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -13071,9 +12036,10 @@ class LFJsonPost(LFCliBase): data["unit_num"] = unit_num if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/stop_ppp_link", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/stop_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13083,19 +12049,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#tail ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_tail(self, - cmd=None, # Command: start, stop, results - key=None, # File-name that we should be tailing. - message=None, # The contents to display (for results only) Unescaped - # Value - resource=None, # Resource that holds the file. - shelf=None, # Shelf that holds the resource that holds the file. - debug_=False): + cmd: str = None, # Command: start, stop, results + key: str = None, # File-name that we should be tailing. + message: str = None, # The contents to display (for results only) Unescaped Value + resource: str = None, # Resource that holds the file. [W] + shelf: str = None, # Shelf that holds the resource that holds the file. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_tail(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cmd is not None: data["cmd"] = cmd @@ -13109,9 +12075,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/tail", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/tail", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13121,15 +12088,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#tm_register ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_tm_register(self, - client_name=None, # Name of client to be registered. (dflt is current client) - test_mgr=None, # Name of test manager (can be all.) - debug_=False): + client_name: str = None, # Name of client to be registered. (dflt is current client) [W] + test_mgr: str = None, # Name of test manager (can be all.) [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_tm_register(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if client_name is not None: data["client_name"] = client_name @@ -13137,9 +12104,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/tm_register", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/tm_register", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13149,15 +12117,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#tm_unregister ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_tm_unregister(self, - client_name=None, # Name of client to be un-registered. (dflt is current client) - test_mgr=None, # Name of test manager (can be all.) - debug_=False): + client_name: str = None, # Name of client to be un-registered. (dflt is current client) + # [W] + test_mgr: str = None, # Name of test manager (can be all.) [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_tm_unregister(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if client_name is not None: data["client_name"] = client_name @@ -13165,9 +12134,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/tm_unregister", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/tm_unregister", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13177,17 +12147,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#version ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_version(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_version(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/version", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/version", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13197,17 +12168,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#who ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_who(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_who(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/who", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/who", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13217,19 +12189,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#wifi_cli_cmd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_wifi_cli_cmd(self, - port=None, # Name of the WiFi station or AP interface to which this command - # will be directed. - resource=None, # Resource number. - shelf=None, # Shelf number. - wpa_cli_cmd=None, # Command to pass to wpa_cli or hostap_cli. This must be - # single-quoted. - debug_=False): + port: str = None, # Name of the WiFi station or AP interface to which this command + # will be directed. [R] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + wpa_cli_cmd: str = None, # Command to pass to wpa_cli or hostap_cli. This must be + # single-quoted. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_wifi_cli_cmd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -13241,9 +12213,10 @@ class LFJsonPost(LFCliBase): data["wpa_cli_cmd"] = wpa_cli_cmd if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/wifi_cli_cmd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/wifi_cli_cmd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13253,17 +12226,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#wifi_event ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_wifi_event(self, - device=None, # Interface or PHY in most cases. - event=None, # What happened. - msg=None, # Entire event in human readable form. - status=None, # Status on what happened. - debug_=False): + device: str = None, # Interface or PHY in most cases. [R] + event: str = None, # What happened. [R] + msg: str = None, # Entire event in human readable form. + status: str = None, # Status on what happened. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_wifi_event(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if device is not None: data["device"] = device @@ -13275,9 +12248,10 @@ class LFJsonPost(LFCliBase): data["status"] = status if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/wifi_event", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/wifi_event", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13287,15 +12261,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#wiser_reset ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_wiser_reset(self, - resource=None, # Resource number, or ALL. - shelf=None, # Shelf number, or ALL. - debug_=False): + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_wiser_reset(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -13303,9 +12277,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/wiser_reset", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/wiser_reset", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13315,21 +12290,3090 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#write ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_write(self, - db_name=None, # The name the backup shall be saved as (blank means dflt) - debug_=False): + db_name: str = None, # The name the backup shall be saved as (blank means dflt) + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_write(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if db_name is not None: data["db_name"] = db_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/write", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/write", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # + + + +class LFJsonQuery(JsonQuery): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + LFJsonQuery inherits from JsonQuery. + Queries are used for GET requests. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def __init__(self, + session_obj: object = None, + debug: bool = False, + exit_on_error: bool = False): + super().__init__(session_obj=session_obj, + debug=debug, + exit_on_error=exit_on_error) + + # Auto generated methods follow: + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /attenuator/ + /attenuator/$shelf_id + /attenuator/$shelf_id/$resource_id + /attenuator/$shelf_id/$resource_id/$port_id + /attenuators/ + /attenuators/$shelf_id + /attenuators/$shelf_id/$resource_id + /attenuators/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + entity+id, module+1, module+2, module+3, module+4, module+5, module+6, module+7, + module+8, name, script, state, temperature + Example URL: /attenuator?fields=entity+id,module+1 + + Example py-json call (it knows the URL): + record = LFJsonGet.get_attenuator(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'entity id': # Entity ID + 'module 1': # Reported attenuator dB settings. + 'module 2': # Reported attenuator dB settings. + 'module 3': # Reported attenuator dB settings. + 'module 4': # Reported attenuator dB settings. + 'module 5': # Reported attenuator dB settings. + 'module 6': # Reported attenuator dB settings. + 'module 7': # Reported attenuator dB settings. + 'module 8': # Reported attenuator dB settings. + 'name': # Attenuator module identifier (shelf . resource . serial-num). + 'script': # Attenuator script state. + 'state': # Attenuator state. + 'temperature': # Temperature in degres Farenheight reported in Attenuator unit. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_attenuator(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/attenuator" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="attenuator", + plural_key="attenuators") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /chamber/ + /chamber/$chamber_name + + When requesting specific column names, they need to be URL encoded: + chamber, chamber+connections, chamber+resources, chamber+type, duts, entity+id, + flags, hide, isolation, marked, open, reported+rotation+%28deg%29, reported+rpm, + reported+tilt+%28deg%29, resource, rotation+%28deg%29, rpm, smas, tilt+%28deg%29, turntable, + turntable+type, virtual + Example URL: /chamber?fields=chamber,chamber+connections + + Example py-json call (it knows the URL): + record = LFJsonGet.get_chamber(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'chamber': # - + 'chamber connections': # - + 'chamber resources': # - + 'chamber type': # - + 'duts': # - + 'entity id': # - + 'flags': # - + 'hide': # - + 'isolation': # - + 'marked': # - + 'open': # - + 'reported rotation (deg)': # - + 'reported rpm ': # - + 'reported tilt (deg)': # - + 'resource': # - + 'rotation (deg)': # - + 'rpm': # - + 'smas': # - + 'tilt (deg)': # - + 'turntable': # - + 'turntable type': # - + 'virtual': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_chamber(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/chamber" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="chamber", + plural_key="chambers") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /control/$command + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_control(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_control(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/control" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /cx/ + /cx/$cx_id + + When requesting specific column names, they need to be URL encoded: + avg+rtt, bps+rx+a, bps+rx+b, drop+pkts+a, drop+pkts+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, + entity+id, name, pkt+rx+a, pkt+rx+b, rpt+timer, rx+drop+%25+a, rx+drop+%25+b, + state, type + Example URL: /cx?fields=avg+rtt,bps+rx+a + + Example py-json call (it knows the URL): + record = LFJsonGet.get_cx(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'avg rtt': # Average Round-Trip-Time (latency) for this connection (ms). + 'bps rx a': # Endpoint A's real receive rate (bps). + 'bps rx b': # Endpoint B's real receive rate (bps). + 'drop pkts a': # The number of packets Endpoint B sent minus the number Endpoint A + # received.This number is not 100% correct as long as packets are in + # flight.After a Quiesce of the test, the number should be perfectly + # accurate. + 'drop pkts b': # The number of packets Endpoint A sent minus the number Endpoint B + # received.This number is not 100% correct as long as packets are in + # flight.After a Quiesce of the test, the number should be perfectly + # accurate. + 'eid': # Cross Connect's Name. + 'endpoints (a ↔ b)': # Endpoints that make up this Cross Connect. + 'entity id': # Cross Connect's Name. + 'name': # Cross Connect's Name. + 'pkt rx a': # Endpoint A's Packets Recieved. + 'pkt rx b': # Endpoint B's Packets Recieved. + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'rx drop % a': # Endpoint A percentage packet loss.Calculated using the number of PDUs + # Endpoint B sent minus the number Endpoint A received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'rx drop % b': # Endpoint B percentage packet loss.Calculated using the number of PDUs + # Endpoint A sent minus the number Endpoint B received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'state': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'type': # Cross-Connect type. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_cx(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/cx" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /dut/ + /dut/$name + + When requesting specific column names, they need to be URL encoded: + api+version, bssid-1, bssid-2, bssid-3, bssid-4, bssid-5, bssid-6, bssid-7, + bssid-8, dut, eap-id, entity+id, hw+info, image+file, lan, mgt+ip, model+number, + notes, num+ant+radio+1, num+ant+radio+2, num+ant+radio+3, password-1, password-2, + password-3, password-4, password-5, password-6, password-7, password-8, serial+number, + serial+port, ssid-1, ssid-2, ssid-3, ssid-4, ssid-5, ssid-6, ssid-7, ssid-8, + sw+info, wan + Example URL: /dut?fields=api+version,bssid-1 + + Example py-json call (it knows the URL): + record = LFJsonGet.get_dut(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'api version': # API Version + 'bssid-1': # WiFi BSSID for DUT. + 'bssid-2': # WiFi BSSID for DUT. + 'bssid-3': # WiFi BSSID for DUT. + 'bssid-4': # WiFi BSSID for DUT. + 'bssid-5': # WiFi BSSID for DUT. + 'bssid-6': # WiFi BSSID for DUT. + 'bssid-7': # WiFi BSSID for DUT. + 'bssid-8': # WiFi BSSID for DUT. + 'dut': # Devices Under Test + 'eap-id': # EAP Identifier, only used when one of the EAP options are selected. + 'entity id': # Entity ID + 'hw info': # DUT Hardware Info + 'image file': # Image file name. Relative paths assume directory /home/lanforge. Fully + # qualified pathnames begin with a slash (eg + # /usr/lib/share/icons/icon.png).File format should be PNG, JPG or BMP. + 'lan': # IP/Mask for LAN port (192.168.2.1/24). + 'mgt ip': # DUT Management IP address. + 'model number': # DUT model number or product name + 'notes': # Notes + 'num ant radio 1': # Antenna count for DUT radio(s). + 'num ant radio 2': # Antenna count for DUT radio(s). + 'num ant radio 3': # Antenna count for DUT radio(s). + 'password-1': # WiFi Password needed to connect to DUT. + 'password-2': # WiFi Password needed to connect to DUT. + 'password-3': # WiFi Password needed to connect to DUT. + 'password-4': # WiFi Password needed to connect to DUT. + 'password-5': # WiFi Password needed to connect to DUT. + 'password-6': # WiFi Password needed to connect to DUT. + 'password-7': # WiFi Password needed to connect to DUT. + 'password-8': # WiFi Password needed to connect to DUT. + 'serial number': # DUT Identifier (serial-number, or similar) + 'serial port': # Resource and name of LANforge serial port that connects to this DUT. + # (1.1.ttyS0). Does not need to belong to lan_port or wan_port resource. + 'ssid-1': # WiFi SSID advertised by DUT. + 'ssid-2': # WiFi SSID advertised by DUT. + 'ssid-3': # WiFi SSID advertised by DUT. + 'ssid-4': # WiFi SSID advertised by DUT. + 'ssid-5': # WiFi SSID advertised by DUT. + 'ssid-6': # WiFi SSID advertised by DUT. + 'ssid-7': # WiFi SSID advertised by DUT. + 'ssid-8': # WiFi SSID advertised by DUT. + 'sw info': # DUT Software Info + 'wan': # IP/Mask for WAN port (192.168.3.2/24). + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_dut(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/dut" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="dut", + plural_key="duts") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /endp/ + /endp/$endp_id + + When requesting specific column names, they need to be URL encoded: + 1st+rx, a%2Fb, bursty, crc+fail, cwnd, cx+active, cx+estab, cx+estab%2Fs, cx+to, + delay, destination+addr, dropped, dup+pkts, eid, elapsed, entity+id, jitter, + max+pdu, max+rate, min+pdu, min+rate, mng, name, ooo+pkts, pattern, pdu%2Fs+rx, + pdu%2Fs+tx, pps+rx+ll, pps+tx+ll, rcv+buf, replays, run, rx+ber, rx+bytes, + rx+drop+%25, rx+dup+%25, rx+ooo+%25, rx+pdus, rx+pkts+ll, rx+rate, rx+rate+%281%C2%A0min%29, + rx+rate+%28last%29, rx+rate+ll, rx+wrong+dev, script, send+buf, source+addr, + tcp+mss, tcp+rtx, tx+bytes, tx+pdus, tx+pkts+ll, tx+rate, tx+rate+%281%C2%A0min%29, + tx+rate+%28last%29, tx+rate+ll # hidden columns: + drop-count-5m, latency-5m, rt-latency-5m, rx-silence-5m + Example URL: /endp?fields=1st+rx,a%2Fb + + Example py-json call (it knows the URL): + record = LFJsonGet.get_endp(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + '1st rx': # Miliseconds between starting the endpoint and receiving the first + # packet.Note that LANforge UDP connections (not including multicast) will + # wait 20msbefore sending first frame to make sure receiver has adequate + # time to start. + 'a/b': # Display side (A or B) for the endpoint. + 'bursty': # Is the transmit rate bursty or not? + 'crc fail': # Total packets received with a bad payload CRC. + 'cwnd': # Sender's TCP Current Window Size. In units of Maximum Segment Size. + 'cx active': # Total number of active connections for this endpoint. + 'cx estab': # Total times the connection between the endpoints has been established. + 'cx estab/s': # Connections established per second, averaged over the last 30 seconds. + 'cx to': # Number of TCP connection attemtps timed out by LANforge. + 'delay': # Average latency in milliseconds for packets received by this endpoint. + 'destination addr': # Destination Address (MAC, ip/port, VoIP destination). + 'dropped': # Total dropped packets, as identified by gaps in packet sequence numbers. + 'dup pkts': # Total duplicate packets received. Only an estimate, but never less than + # this value. + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'jitter': # Exponential decaying average jitter calculated per RFC3393(old_jitter * + # 15/16 + new_jitter * 1/16) + 'max pdu': # The maximum write size.For Ethernet protocols, this is the entire + # Ethernet frame. For UDP, it is the UDP payload size, and for TCP, it + # just means the maximum amount of data that is written per socket + # write.In all cases, the packets on the wire will not exceed theport's + # MTU + Ethernet-Header-Size (typically 1514 for Ethernet) + 'max rate': # Maximum desired transmit rate, in bits per second (bps). + 'min pdu': # The minimum write size.For Ethernet protocols, this is the entire + # Ethernet frame. For UDP, it is the UDP payload size, and for TCP, it + # just means the maximum amount of data that is written per socket + # write.In all cases, the packets on the wire will not exceed theport's + # MTU + Ethernet-Header-Size (typically 1514 for Ethernet) + 'min rate': # Minimum desired transmit rate, in bits per second (bps). + 'mng': # Is the Endpoint managed or not? + 'name': # Endpoint's Name. + 'ooo pkts': # Total out of order packets received. Only an estimate, but never less + # than this value. + 'pattern': # Pattern of bytes this endpoint transmits. + 'pdu/s rx': # Received PDU per second.This counts the protocol reads, such as UDP + # PDUs. + 'pdu/s tx': # Transmitted PDU per second.This counts the protocol writes, such as UDP + # PDUs. + 'pps rx ll': # Estimated total received packets per second (on the wire).For TCP, this + # is an estimate.UDP and Ethernet protocols should be quite accurate on + # normal networks. + 'pps tx ll': # Estimated total transmitted packets per second (on the wire).For TCP, + # this is an estimate.UDP and Ethernet protocols should be quite accurate + # on normal networks. + 'rcv buf': # Configured/Actual values for receiving buffer size (bytes). + 'replays': # Total number of files replayed. + 'run': # Is the Endpoint is Running or not. + 'rx ber': # Received bit-errors. These are only calculated in the LANforge payload + # portion starting 28 bytes into the UDP or TCP payload. In addition, the + # bit-errors are only checked when LANforge CRCis enabled and detected to + # be invalid. If the 28-byte header is corrupted, LANforge will not + # detectit, and may also give false positives for other packet errors. + # Bit-Errors are only calculated forcertain payload patterns: Increasing, + # Decreasing, Zeros, Ones, and the PRBS patterns. + 'rx bytes': # Total received bytes count. + 'rx drop %': # Percentage of packets that should have been received by Endpoint, but + # were not, as calculated by the Cross-Connect. + 'rx dup %': # Percentage of duplicate packets, as detected by sequence numbers. + 'rx ooo %': # Percentage of packets received out of order, as detected by sequence + # numbers. + 'rx pdus': # Total received PDU count.This counts the protocol reads, such as UDP + # PDUs (aka goodput). + 'rx pkts ll': # Estimated total received packet count (on the wire).For TCP, this is an + # estimate.UDP and Ethernet protocols should be quite accurate on normal + # networks. + 'rx rate': # Real receive rate (bps) for this run.This includes only the protocol + # payload (goodput). + 'rx rate (1 min)': # Real receive rate (bps) over the last minute.This includes only the + # protocol payload (goodput). + 'rx rate (last)': # Real receive rate (bps) over the last report interval.This includes only + # the protocol payload (goodput). + 'rx rate ll': # Estimated low-level receive rate (bps) over the last minute.This + # includes any Ethernet, IP, TCP, UDP or similar headers. + 'rx wrong dev': # Total packets received on the wrong device (port). + 'script': # Endpoint script state. + 'send buf': # Configured/Actual values for sending buffer size (bytes). + 'source addr': # + 'tcp mss': # Sender's TCP-MSS (max segment size) setting.This cooresponds to the + # TCP_MAXSEGS socket option,and TCP-MSS plus 54 is the maximum packet size + # on the wirefor Ethernet frames.This is a good option to efficiently + # limit TCP packet size. + 'tcp rtx': # Total packets retransmitted by the TCP stack for this connection.These + # were likely dropped or corrupted in transit. + 'tx bytes': # Total transmitted bytes count. + 'tx pdus': # Total transmitted PDU count.This counts the protocol writes, such as UDP + # PDUs (aka goodput). + 'tx pkts ll': # Estimated total transmitted packet count (on the wire).For TCP, this is + # an estimate.UDP and Ethernet protocols should be quite accurate on + # normal networks. + 'tx rate': # Real transmit rate (bps) for this run.This includes only the protocol + # payload (goodput). + 'tx rate (1 min)': # Real transmit rate (bps) over the last minute.This includes only the + # protocol payload (goodput). + 'tx rate (last)': # Real transmit rate (bps) over the last report interval.This includes + # only the protocol payload (goodput). + 'tx rate ll': # Estimated low-level transmit rate (bps) over the last minute.This + # includes any Ethernet, IP, TCP, UDP or similar headers. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_endp(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/endp" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /endsession + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_endsession(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_endsession(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/endsession" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /events/ + /events/$event_id + /events/before/$event_id + /events/between/$start_event_id/$end_event_id + /events/last/$event_count + /events/since/$event_id + + When requesting specific column names, they need to be URL encoded: + eid, entity+id, event, event+description, id, name, priority, time-stamp, + type + Example URL: /events?fields=eid,entity+id + + Example py-json call (it knows the URL): + record = LFJsonGet.get_events(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'eid': # Time at which this event was created.This uses the clock on the source + # machine. + 'entity id': # Entity IdentifierExact format depends on the + # type.(shelf.resource.port.endpoint.extra) + 'event': # Event Type + 'event description': # Text description for this event. + 'id': # Unique ID for this event. + 'name': # Name of the entity associated with this event. + 'priority': # Event priority. + 'time-stamp': # Time at which this event was created.This uses the clock on the source + # machine. + 'type': # Entity type. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_events(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/events" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="alert", + plural_key="alerts") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /fileio/ + /fileio/$endp_id + + When requesting specific column names, they need to be URL encoded: + buf-rd, buf-wr, bytes-rd, bytes-wr, crc+fail, eid, entity+id, files+%23, files-read, + files-wr, io+fail, max-file-sz, max-rd-bps, max-rw-sz, max-wr-bps, min-file-sz, + min-rd-bps, min-rw-sz, min-wr-bps, name, read-bps, rpt+timer, rx-bps-20s, + status, tx-bps-20s, type, write-bps + Example URL: /fileio?fields=buf-rd,buf-wr + + Example py-json call (it knows the URL): + record = LFJsonGet.get_fileio(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'buf-rd': # Buffer reads. When doing CRC, it takes two reads per 'packet', because + # we first read the header, then the payload. Non-CRC reads ignore the + # header. + 'buf-wr': # Buffer writes. + 'bytes-rd': # Bytes read. + 'bytes-wr': # Bytes written. + 'crc fail': # 32-bit CRC Errors detected upon READ. + 'eid': # Entity ID + 'entity id': # Entity ID + 'files #': # Number of files to write. + 'files-read': # Files read. + 'files-wr': # Files written. + 'io fail': # Amount of time in miliseconds this test has been experiencing IO + # failures. + 'max-file-sz': # Maximum configured file size (bytes). + 'max-rd-bps': # Maximum configured read rate (bps). + 'max-rw-sz': # Maximum configured size for each call to read(2) or write(2) (bytes). + 'max-wr-bps': # Maximum configured write rate (bps). + 'min-file-sz': # Minimum configured file size (bytes). + 'min-rd-bps': # Minimum configured read rate (bps). + 'min-rw-sz': # Minimum configured size for each call to read(2) or write(2) (bytes). + 'min-wr-bps': # Minimum configured write rate (bps). + 'name': # File Endpoint's Name. + 'read-bps': # File read rate for this endpoint over the duration of the test. + 'rpt timer': # Report Timer (milliseconds).This is how often the GUI will ask for + # updates from the LANforge processes.If the GUI is sluggish, increasing + # the report timers may help. + 'rx-bps-20s': # File read rate for this endpoint over the last 20 seconds. + 'status': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'tx-bps-20s': # File write rate for this endpoint over the last 20 seconds. + 'type': # The specific type of this File Endpoint. + 'write-bps': # File write rate for this endpoint over the duration of the test. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_fileio(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/fileio" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /generic/ + /generic/$endp_id + + When requesting specific column names, they need to be URL encoded: + bps+rx, bps+tx, command, dropped, eid, elapsed, entity+id, last+results, + name, pdu%2Fs+rx, pdu%2Fs+tx, rpt+timer, rpt%23, rx+bytes, rx+pkts, status, tx+bytes, + tx+pkts, type + Example URL: /generic?fields=bps+rx,bps+tx + + Example py-json call (it knows the URL): + record = LFJsonGet.get_generic(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps rx': # Receive rate reported by this endpoint. + 'bps tx': # Transmit rate reported by this endpoint. + 'command': # The command that this endpoint executes. + 'dropped': # Dropped PDUs reported by this endpoint. + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'last results': # Latest output from the Generic Endpoint. + 'name': # Endpoint's Name. + 'pdu/s rx': # Received packets-per-second reported by this endpoint. + 'pdu/s tx': # Transmitted packets-per-second reported by this endpoint. + 'rpt timer': # Report Timer (milliseconds).This is how often the GUI will ask for + # updates from the LANforge processes.If the GUI is sluggish, increasing + # the report timers may help. + 'rpt#': # The N_th report that we have received. (Some cmds will produce only one + # report, others will produce continuous reports.) + 'rx bytes': # Received bytes reported by this endpoint. + 'rx pkts': # Received PDUs reported by this endpoint. + 'status': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'tx bytes': # Transmitted bytes reported by this endpoint. + 'tx pkts': # Transmitted PDUs reported by this endpoint. + 'type': # The specific type of this Generic Endpoint. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_generic(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/generic" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoints") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /gui-cli/ + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_gui_cli(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_gui_cli(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/gui-cli" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /layer4/ + /layer4/$endp_id + + When requesting specific column names, they need to be URL encoded: + %21conn, acc.+denied, bad-proto, bad-url, bytes-rd, bytes-wr, dns-avg, dns-max, + dns-min, eid, elapsed, entity+id, fb-avg, fb-max, fb-min, ftp-host, ftp-port, + ftp-stor, http-p, http-r, http-t, login-denied, name, nf+%284xx%29, other-err, + read, redir, rpt+timer, rslv-h, rslv-p, rx+rate, rx+rate+%281%C2%A0min%29, status, + timeout, total-err, total-urls, tx+rate, tx+rate+%281%C2%A0min%29, type, uc-avg, + uc-max, uc-min, urls%2Fs, write # hidden columns: + rpt-time + Example URL: /layer4?fields=%21conn,acc.+denied + + Example py-json call (it knows the URL): + record = LFJsonGet.get_layer4(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + '!conn': # Could not establish connection. + 'acc. denied': # Access Access Denied Error.This could be password, user-name, + # file-permissions or other error. + 'bad-proto': # Bad protocol. + 'bad-url': # Bad URL format. + 'bytes-rd': # Bytes read. + 'bytes-wr': # Bytes written. + 'dns-avg': # Average time in milliseconds to complete resolving the DNS lookupfor the + # last 100 requests. + 'dns-max': # Maximum time in milliseconds to complete resolving the DNS lookupfor + # requests made in the last 30 seconds. + 'dns-min': # Minimum time in milliseconds to complete resolving the DNS lookupfor + # requests made in the last 30 seconds. + 'eid': # EID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'fb-avg': # Average time in milliseconds for receiving the first byte of the URLfor + # the last 100 requests. + 'fb-max': # Maximum time in milliseconds for receiving the first byte of the URLfor + # requests made in the last 30 seconds. + 'fb-min': # Minimum time in milliseconds for receiving the first byte of the URLfor + # requests made in the last 30 seconds. + 'ftp-host': # FTP HOST Error + 'ftp-port': # FTP PORT Error. + 'ftp-stor': # FTP STOR Error. + 'http-p': # HTTP Post error. + 'http-r': # HTTP RANGE error. + 'http-t': # HTTP PORT Error. + 'login-denied': # Login attempt was denied.Probable cause is user-name or password errors. + 'name': # Endpoint's Name. + 'nf (4xx)': # File not found.For HTTP, an HTTP 4XX error was returned. This is only + # counted when the endpoint has 'Enable 4XX' selected.Includes 403 + # permission denied and 404 not found errors.For other protocols, it + # should be returned any time a file is not found. + 'other-err': # Error not otherwise specified. The actual error code may be found + # inl4helper logs. Contact support if you see these errors:we would like + # to account for all possible errors. + 'read': # Error attempting to read file or URL. + 'redir': # Noticed redirect loop! + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'rslv-h': # Couldn't resolve host. + 'rslv-p': # Couldn't resolve Proxy. + 'rx rate': # Payload receive rate (bps). + 'rx rate (1 min)': # Payload receive rate over the last minute (bps). + 'status': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'timeout': # Operation timed out. + 'total-err': # Total Errors. + 'total-urls': # URLs processed. + 'tx rate': # Payload transmit rate (bps). + 'tx rate (1 min)': # Payload transmit rate over the last minute (bps). + 'type': # The specific type of this Layer 4-7 Endpoint. + 'uc-avg': # Average time in milliseconds to complete processing of the URLfor the + # last 100 requests. + 'uc-max': # Maximum time in milliseconds to complete processing of the URLfor + # requests made in the last 30 seconds. + 'uc-min': # Minimum time in milliseconds to complete processing of the URLfor + # requests made in the last 30 seconds. + 'urls/s': # URLs processed per second over the last minute. + 'write': # Error attempting to write file or URL. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_layer4(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/layer4" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /newsession + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_newsession(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_newsession(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/newsession" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /port/ + /port/$shelf_id + /port/$shelf_id/$resource_id + /port/$shelf_id/$resource_id/$port_id + /portprobe/ + /portprobe/$shelf_id/$resource_id/$port_id + /ports/ + /ports/$shelf_id + /ports/$shelf_id/$resource_id + /ports/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + 4way+time+%28us%29, activity, alias, anqp+time+%28us%29, ap, beacon, bps+rx, bps+rx+ll, + bps+tx, bps+tx+ll, bytes+rx+ll, bytes+tx+ll, channel, collisions, connections, + crypt, cx+ago, cx+time+%28us%29, device, dhcp+%28ms%29, down, entity+id, gateway+ip, + ip, ipv6+address, ipv6+gateway, key%2Fphrase, login-fail, login-ok, logout-fail, + logout-ok, mac, mask, misc, mode, mtu, no+cx+%28us%29, noise, parent+dev, phantom, + port, port+type, pps+rx, pps+tx, qlen, reset, retry+failed, rx+bytes, rx+crc, + rx+drop, rx+errors, rx+fifo, rx+frame, rx+length, rx+miss, rx+over, rx+pkts, + rx-rate, sec, signal, ssid, status, time-stamp, tx+abort, tx+bytes, tx+crr, + tx+errors, tx+fifo, tx+hb, tx+pkts, tx+wind, tx-failed+%25, tx-rate, wifi+retries, + # hidden columns: + beacon_rx_signal, port_cur_flags_h, port_cur_flags_l, port_supported_flags_h, + port_supported_flags_l, resource, rx_multicast, tx_dropped + Example URL: /port?fields=4way+time+%28us%29,activity + + Example py-json call (it knows the URL): + record = LFJsonGet.get_port(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + '4way time (us)': # TIme (in micro-seconds) it took to complete the last WiFi 4-way + # authentication. + 'activity': # Percent of the channel that is utilized over the last minute.This + # includes locally generated traffic as well as anyother systems active on + # this channel.This is a per-radio value. + 'alias': # User-specified alias for this Port. + 'anqp time (us)': # Time (in micro-seconds) it took to complete the last WiFi ANQP + # request/response session. + 'ap': # BSSID of AP for connected stations. + 'beacon': # Number of Wireless beacons from Cell or AP that have been missed. + 'bps rx': # Average bits per second received for the last 30 seconds. + 'bps rx ll': # Bits per second received, including low-level framing (Ethernet Only). + 'bps tx': # Average bits per second transmitted for the last 30 seconds. + 'bps tx ll': # Bits per second transmitted, including low-level framing (Ethernet + # Only). + 'bytes rx ll': # Bytes received, including low-level framing (Ethernet Only). + 'bytes tx ll': # Bytes transmitted, including low-level framing (Ethernet Only). + 'channel': # Channel at the device is currently on, if known. + 'collisions': # Total number of collisions reported by this Interface.For WiFi devices, + # this is number of re-transmit attempts. + 'connections': # Number of wireless connections completed. + 'crypt': # Number of Wireless packets dropped due to inability to decrypt. + 'cx ago': # How long ago was the last WiFi connection attempt started?This relates + # only to the network interface, not any higher level protocol traffic + # upon it. + 'cx time (us)': # Time (in micro-seconds) it took to complete the last WiFi connection to + # the AP. + 'device': # Ethernet device name, as seen by the kernel. + 'dhcp (ms)': # Time (in miliseconds) it took to acquire DHCP lease,or to time out while + # trying to acquire lease. + 'down': # The interface is configured DOWN. It must be configured UP to be in + # active use. + 'entity id': # Entity ID + 'gateway ip': # Default Router/Gateway IP for the Interface. + 'ip': # IP Address of the Interface. + 'ipv6 address': # IPv6 Address for this interface. If global-scope address exists, it + # will be displayed,otherwise link-local will be displayed. + 'ipv6 gateway': # IPv6 default gateway. + 'key/phrase': # WEP Key or WPA Phrase (if enabled). + 'login-fail': # The 'ifup-post' script reported failure. This is usually used for WiFi + # portallogins, but may be customized by the user for other needs. + 'login-ok': # The 'ifup-post' script reported OK. This is usually used for WiFi + # portallogins, but may be customized by the user for other needs. + 'logout-fail': # The 'ifup-post --logout' script reported failure. This is usually used + # for WiFi portallogouts, but may be customized by the user for other + # needs. + 'logout-ok': # The 'ifup-post --logout' script reported OK. This is usually used for + # WiFi portallogouts, but may be customized by the user for other needs. + 'mac': # Ethernet MAC address of the Interface. + 'mask': # IP Mask of the Interface. + 'misc': # Number of Wireless packets dropped on receive due to unspecified + # reasons. + 'mode': # Wireless radio mode (802.11a/b/g). + 'mtu': # MTU (Maximum Transmit Unit) size, in bytes. + 'no cx (us)': # How long was the WiFi disconnect duration for the last disconnection? + 'noise': # Wireless noise level. + 'parent dev': # Parent device or port of this port. Blank if this device is not a child + # of another device or port. + 'phantom': # Is the port PHANTOM (no hardware found) or not. + 'port': # Entity ID + 'port type': # Ports can be Ethernet, Radio, vAP, vSTA, Redirect, or Bridges + 'pps rx': # Average packets per second received for the last 30 seconds. + 'pps tx': # Average packets per second transmitted for the last 30 seconds. + 'qlen': # "Transmit Queue Length for this Interface. + 'reset': # Current Reset-State. + 'retry failed': # Number of Wireless packets that the interface failed to send due to + # excessive retries. + 'rx bytes': # Total number of bytes received by this Interface. + 'rx crc': # Total number of packets dropped because of a bad CRC/FCS. + 'rx drop': # Total number of dropped packets on recieve. Usually means driver/kernel + # is being over-worked. + 'rx errors': # Total number of all types of Receive Errors. + 'rx fifo': # Total number of packets dropped because driver/kernel queues are full. + 'rx frame': # Total number of packets dropped because of framing errors at the + # physical layer. + 'rx length': # Total number of packets dropped because their length was invalid. + 'rx miss': # Total number of packets dropped because of a missed interrupt. + 'rx over': # Total number of packets dropped because of framing errors at the + # physical layer. + 'rx pkts': # Total number of packets received by this Interface. + 'rx-rate': # Reported network device RX link speed. + 'sec': # Number of secondary IP addresses configured or detected. + 'signal': # Wireless signal strength (RSSI). + 'ssid': # WiFi SSID identifier.Use [BLANK] for empty SSID, which means use any + # available SSID when associating. + 'status': # Wireless link status. + 'time-stamp': # Time-Stamp + 'tx abort': # Total packets dropped on transmit because of driver abort. + 'tx bytes': # Total number of bytes sent by this Interface. + 'tx crr': # Total packets dropped on transmit because of carrier error. + 'tx errors': # Total number of all types of Transmit Errors. + 'tx fifo': # Total packets dropped on transmit because outgoing queue was full. + 'tx hb': # Total packets dropped on transmit because of transceiver heartbeat + # errors. + 'tx pkts': # Total number of packets sent by this Interface. + 'tx wind': # Total number dropped on transmit because of Out-of-Window collision. + 'tx-failed %': # Percentage of transmitted Wireless packets that were not ACKed.They + # might have succeeded on retry. + 'tx-rate': # Reported network device TX link speed. + 'wifi retries': # Number of Wireless packets that the wifi radio retried.One packet may be + # tried multiple times and each try would be counted in this stat.Not all + # radios can properly report this statistic. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_port(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/port" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="interface", + plural_key="interfaces") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /probe/ + /probe/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + entity+id, probe+results + Example URL: /probe?fields=entity+id,probe+results + + Example py-json call (it knows the URL): + record = LFJsonGet.get_probe(eid_list=['1.234', '1.344'], + requested_col_names=['probe results'], + debug=True) + + The record returned will have these members: + { + 'entity id': # Entity ID + 'probe results': # Probe the low level information about the port. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_probe(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/probe" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="probe-results", + plural_key="probe-results") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /quit + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_quit(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_quit(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/quit" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /radiostatus/ + /radiostatus/$eid + /radiostatus/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + _links, antenna, ap, capabilities, channel, country, driver, entity+id, firmware+version, + frag, frequency, max_sta, max_vap, max_vifs, monitors_down, monitors_up, + phantom, port, resource, rts, stations_down, stations_up, tx-power, vaps_down, + vaps_up, verbose+debug + Example URL: /radiostatus?fields=_links,antenna + + Example py-json call (it knows the URL): + record = LFJsonGet.get_radiostatus(eid_list=['1.234', '1.344'], + requested_col_names=['firmware version'], + debug=True) + + The record returned will have these members: + { + '_links': # - + 'antenna': # - + 'ap': # - + 'capabilities': # - + 'channel': # - + 'country': # - + 'driver': # - + 'entity id': # - + 'firmware version': # - + 'frag': # - + 'frequency': # - + 'max_sta': # - + 'max_vap': # - + 'max_vifs': # - + 'monitors_down': # - + 'monitors_up': # - + 'phantom': # - + 'port': # - + 'resource': # - + 'rts': # - + 'stations_down': # - + 'stations_up': # - + 'tx-power': # - + 'vaps_down': # - + 'vaps_up': # - + 'verbose debug': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_radiostatus(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/radiostatus" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="radio", + plural_key="radios") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /resource/ + /resource/$shelf_id + /resource/$shelf_id/$resource_id + + When requesting specific column names, they need to be URL encoded: + bps-rx-3s, bps-tx-3s, cli-port, cpu, ctrl-ip, ctrl-port, eid, entity+id, + free+mem, free+swap, gps, hostname, hw+version, load, max+if-up, max+staged, + mem, phantom, ports, rx+bytes, shelf, sta+up, sw+version, swap, tx+bytes, + # hidden columns: + timestamp + Example URL: /resource?fields=bps-rx-3s,bps-tx-3s + + Example py-json call (it knows the URL): + record = LFJsonGet.get_resource(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps-rx-3s': # Rate in bits-per-second that the manager issending management data to + # the resource, averaged over the last 3 seconds.This is TCP payload data, + # and does not count the IP and Ethernet overhead. + 'bps-tx-3s': # Rate in bits-per-second that the manager isreceiving management data + # from the resource, averaged over the last 3 seconds.This is TCP payload + # data, and does not count the IP and Ethernet overhead. + 'cli-port': # Text (telnet) interface IP Port. + 'cpu': # CPU information for the machine. + 'ctrl-ip': # IP Address of the Control Interface. + 'ctrl-port': # Binary interface IP Port. + 'eid': # Resource EID (Shelf.Resource). + 'entity id': # Entity ID + 'free mem': # Free Memory (Kbytes) in the machine. If this is too low, performance + # will be degraded. + 'free swap': # Free Swap (Kbytes) in the machine. If this is too low, performance will + # be degraded. + 'gps': # GPS Info for this machine, if GPS is attached. + 'hostname': # The name for this resource, as reported by the resource. + 'hw version': # Hardware version on the machine. + 'load': # Unix process load.. + 'max if-up': # Max number of interface-config scripts try to run at once. + 'max staged': # Max number of interfaces the system will try to bringup at once. + 'mem': # Total memory (Kbytes) on the machine. + 'phantom': # Is the resource PHANTOM (undiscovered) or not. + 'ports': # All real and phantom ports on this machine. + 'rx bytes': # Total management TCP payload bytes received from the manager process by + # this resource. + 'shelf': # Number of shelf that this resource belongs to. + 'sta up': # Max number of stations to bring up per radio per 0.25s tick. + 'sw version': # LANforge Software version running on the machine. + 'swap': # Total swap space (Kbytes) on the machine. + 'tx bytes': # Total management TCP payload bytes sent from this resource to the + # manager process. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_resource(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/resource" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="resource", + plural_key="resources") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /scan-results/ + /scan-results/$shelf_id/$resource_id/$port_id + /scan-results/$shelf_id/$resource_id/$port_id/$bssid + /scan/ + /scan/$shelf_id/$resource_id/$port_id + /scan/$shelf_id/$resource_id/$port_id/$bssid + /scanresults/ + /scanresults/$shelf_id/$resource_id/$port_id + /scanresults/$shelf_id/$resource_id/$port_id/$bssid + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_scan(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_scan(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/scan" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="scan-results", + plural_key="scan-results") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /stations/ + /stations/$mac + + When requesting specific column names, they need to be URL encoded: + ap, auth-for, capabilities, entity+id, idle, roam-duration, rx+bytes, rx+pkts, + rx+rate, signal, station+bssid, tx+bytes, tx+pkts, tx+rate, tx+retries, tx-failed, + + Example URL: /stations?fields=ap,auth-for + + Example py-json call (it knows the URL): + record = LFJsonGet.get_stations(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'ap': # The Port that owns this station. + 'auth-for': # Duration in seconds this station has been authenticated. + 'capabilities': # Station's negotiated capabilities. + 'entity id': # Entity ID + 'idle': # Miliseconds since this station last received a frame from the peer. + 'roam-duration': # The difference between the authenticate-time on the new APand the last + # frame received on old AP, in milliseconds.It is not always possible to + # compute this accurately,especially if traffic is not flowing during the + # roam. + 'rx bytes': # RX Byte counter for this station. + 'rx pkts': # RX Packets counter for this station. + 'rx rate': # Station last received encoding rate. + 'signal': # Station signal quality. + 'station bssid': # Station's MAC address (BSSID). + 'tx bytes': # TX Byte counter for this station. + 'tx pkts': # TX Packets counter for this station. + 'tx rate': # Station transmit encoding rate. + 'tx retries': # TX Retries counter for this station.This counts retries at the driver + # level.Retries made by the WiFi hardware and/or firmware is not counted. + 'tx-failed': # TX Failed counter for this station.This counts TX failures at the driver + # level.The hardware and/or firmware may have made several failed attempts + # that are not included in this counter. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_stations(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/stations" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="station", + plural_key="stations") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /status-msg/ + /status-msg/$session + /status-msg/$session/$id + /status-msg/$session/$id/ws-msg,... + /status-msg/$session/all + /status-msg/$session/this + /status-msg/sessions + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_status_msg(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_status_msg(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/status-msg" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="sessions/messages", + plural_key="sessions/messages") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /test-group/ + /test-group/$id + /test-groups/ + /test-groups/$id + + When requesting specific column names, they need to be URL encoded: + cross+connects, entity+id, name, run, script + Example URL: /test-group?fields=cross+connects,entity+id + + Example py-json call (it knows the URL): + record = LFJsonGet.get_test_group(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'cross connects': # List of Test Manager's Cross-Connects. + 'entity id': # Entity ID + 'name': # Test Group's Name. + 'run': # Is Test Group running or not. + 'script': # Endpoint script state. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_test_group(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/test-group" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="groups", + plural_key="groups") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /text/ + /text/$group + /text/$group/$class + /text/$group/$class/$key + + When requesting specific column names, they need to be URL encoded: + eid, name, text, type + Example URL: /text?fields=eid,name + + Example py-json call (it knows the URL): + record = LFJsonGet.get_text(eid_list=['1.234', '1.344'], + requested_col_names=['text'], + debug=True) + + The record returned will have these members: + { + 'eid': # - + 'name': # - + 'text': # - + 'type': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_text(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/text" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="record", + plural_key="records") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /voip-endp/ + /voip-endp/$endp_id + /voip-ep/ + /voip-ep/$endp_id + /voip/ + /voip/$cx_id + /voip_endp/ + /voip_endp/$endp_id + /voip_ep/ + /voip_ep/$endp_id + + When requesting specific column names, they need to be URL encoded: + bps+rx+a, bps+rx+b, delay+a+%E2%86%90+b, delay+a+%E2%86%92+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, + entity+id, jitter+a+%E2%86%90+b, jitter+a+%E2%86%92+b, name, pkt+tx+a%C2%A0%E2%86%90%C2%A0b, + pkt+tx+a%C2%A0%E2%86%92%C2%A0b, rpt+timer, rx+drop+%25+a, rx+drop+%25+b, state, + type + Example URL: /voip?fields=bps+rx+a,bps+rx+b + + Example py-json call (it knows the URL): + record = LFJsonGet.get_voip(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps rx a': # Endpoint B's real transmit rate (bps).Measured at the CX Type layer. + 'bps rx b': # Endpoint A's real transmit rate (bps).Measured at the CX Type layer. + 'delay a ← b': # Average Latency in milliseconds for traffic from Endpoint B to Endpoint + # A + 'delay a → b': # Average Latency in milliseconds for traffic from Endpoint A to Endpoint + # B + 'eid': # Entity ID + 'endpoints (a ↔ b)': # Endpoints that make up this Cross Connect. + 'entity id': # Entity ID + 'jitter a ← b': # Average Jitter in milliseconds for traffic from Endpoint B to Endpoint A + 'jitter a → b': # Average Jitter in milliseconds for traffic from Endpoint A to Endpoint B + 'name': # Cross Connect's Name. + 'pkt tx a ← b': # Endpoint B's Packets Transmitted. + 'pkt tx a → b': # Endpoint A's Packets Transmitted. + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'rx drop % a': # Endpoint A percentage packet loss.Calculated using the number of PDUs + # Endpoint B sent minus the number Endpoint A received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'rx drop % b': # Endpoint B percentage packet loss.Calculated using the number of PDUs + # Endpoint A sent minus the number Endpoint B received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'state': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'type': # Cross-Connect type. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_voip(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/voip" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="connection", + plural_key="connections") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /voip-endp/ + /voip-endp/$endp_id + + When requesting specific column names, they need to be URL encoded: + calls+answered, calls+attempted, calls+completed, calls+failed, cf+404, cf+408, + cf+busy, cf+canceled, delay, destination+addr, dropped, dup+pkts, eid, elapsed, + entity+id, jb+cur, jb+over, jb+silence, jb+under, jitter, mng, name, ooo+pkts, + pesq, pesq+bklg, pesq%23, reg+state, rst, rtp+rtt, run, rx+bytes, rx+pkts, + source+addr, state, tx+bytes, tx+pkts, vad+pkts + Example URL: /voip-endp?fields=calls+answered,calls+attempted + + Example py-json call (it knows the URL): + record = LFJsonGet.get_voip_endp(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'calls answered': # Number of calls that where the remote answered + 'calls attempted': # Number of calls that have been attempted + 'calls completed': # Number of calls that have been successfully completed + 'calls failed': # Number of calls that did not succeed for any reason. + 'cf 404': # Number of calls failed for '404': callee not found. + 'cf 408': # Number of calls failed for '408': callee did not answer. + 'cf busy': # Number of calls failed because callee is busy. + 'cf canceled': # Number of calls failed because they were canceled. + 'delay': # Average latency in milliseconds for packets received by this endpoint. + 'destination addr': # Destination Address (MAC, ip/port, VoIP destination). + 'dropped': # Total dropped packets, as identified by gaps in RTP sequence numbers + # (pre jitter buffer). + 'dup pkts': # Total duplicate packets, as identified by RTP sequence numbers (pre + # jitter buffer). + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'jb cur': # Current number of packets in the jitter buffer waiting to be played / + # Jitter Buffer Size. + 'jb over': # Total times the jitter buffer was given more packets than it could hold. + 'jb silence': # Silence is played when there is no valid voice packet, due to drop, or + # reorder/jitter/latency out of range of the jitter buffer. + 'jb under': # Total times the reader asked for a packet to play but the jitter buffer + # was empty. + 'jitter': # Average interpacket variation, calculated per RFC 1889 A.8. + 'mng': # Is the Endpoint managed or not? + 'name': # Endpoint's Name. + 'ooo pkts': # Total out-of-order packets, as identified by RTP sequence numbers (pre + # jitter buffer). + 'pesq': # PESQ Report score for the PESQ report number (PESQ#). + 'pesq bklg': # PESQ server call processing backlog. + 'pesq#': # The pesq-report-number to which the PESQ value cooresponds. + 'reg state': # Current State of the Endpoint. + 'rst': # How many times has the endpoint been restarted due to abnormal + # termination. + 'rtp rtt': # Round trip latency as reported by RTCP + 'run': # Is the Endpoint is Running or not. + 'rx bytes': # Total received bytes count. + 'rx pkts': # Total received packet count. + 'source addr': # Source Address (MAC, ip/port, VoIP source). + 'state': # Phone registration state + 'tx bytes': # Total transmitted bytes count. + 'tx pkts': # Total transmitted packet count. + 'vad pkts': # Total VAD (Silence Suppression) packets suppressed before transmit. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_voip_endp(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/voip-endp" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoints") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /vr-cx/ + /vr-cx/$shelf_id/$resource_id/$port_id + /vr/ + /vr/$shelf_id/$resource_id + /vrcx/ + /vrcx/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + active+ipv6+router, bgp+4byte+as, bgp+damping, bgp+peers, cluster+id, collision+domain+id, + confederation+id, damping+half+life, damping+max+suppress, damping+reuse, + damping+suppress, entity+id, height, ipv6+radv, is+bgp+reflector, local+as, + multicast+routing, name, netsmith-state, notes, pad, ripv2, router+connections, + router+id, router+id, use+confederation, use+existing+cfg, use+ospf, use+rip+dft+route, + using+bgp, using+olsr, width, x, xorp+sha, y + Example URL: /vr?fields=active+ipv6+router,bgp+4byte+as + + Example py-json call (it knows the URL): + record = LFJsonGet.get_vr(eid_list=['1.234', '1.344'], + requested_col_names=['netsmith-state'], + debug=True) + + The record returned will have these members: + { + 'active ipv6 router': # - + 'bgp 4byte as': # - + 'bgp damping': # lc_key > lc_col_name- + 'bgp peers': # - + 'cluster id': # - + 'collision domain id': # - + 'confederation id': # - + 'damping half life': # - + 'damping max suppress': # - + 'damping reuse': # - + 'damping suppress': # - + 'entity id': # Entity ID + 'height': # - + 'ipv6 radv': # - + 'is bgp reflector': # - + 'local as': # - + 'multicast routing': # - + 'name': # Name + 'netsmith-state': # - + 'notes': # - + 'pad': # - + 'ripv2': # - + 'router connections': # - + 'router id': # - + 'router id': # - + 'use confederation ': # - + 'use existing cfg': # - + 'use ospf': # - + 'use rip dft route': # - + 'using bgp': # - + 'using olsr': # - + 'width': # - + 'x': # - + 'xorp sha': # - + 'y': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_vr(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/vr" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="virtual-routers", + plural_key="virtual-routers") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /vrcx/ + /vrcx/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + entity+id, height, interface+cost, local-a, local-b, netsmith-state, remote-a, + remote-b, resource, rip+metric, vrrp+id, vrrp+interval, vrrp+ip, vrrp+ip-prefix, + vrrp+priority, wan+link, width, x, y + Example URL: /vrcx?fields=entity+id,height + + Example py-json call (it knows the URL): + record = LFJsonGet.get_vrcx(eid_list=['1.234', '1.344'], + requested_col_names=['netsmith-state'], + debug=True) + + The record returned will have these members: + { + 'entity id': # - + 'height': # - + 'interface cost': # - + 'local-a': # - + 'local-b': # - + 'netsmith-state': # - + 'remote-a': # - + 'remote-b': # - + 'resource': # - + 'rip metric': # - + 'vrrp id': # - + 'vrrp interval': # - + 'vrrp ip': # - + 'vrrp ip-prefix': # - + 'vrrp priority': # - + 'wan link': # - + 'width': # - + 'x': # - + 'y': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_vrcx(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/vrcx" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="router-connections", + plural_key="router-connections") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /wl-endp/ + /wl-endp/$wl_ep_id + /wl-ep/ + /wl-ep/$wl_ep_id + /wl/ + /wl/$wl_id + /wl_endp/ + /wl_endp/$wl_ep_id + /wl_ep/ + /wl_ep/$wl_ep_id + /wlendp/$wl_ep_id + + When requesting specific column names, they need to be URL encoded: + bps+rx+a, bps+rx+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, entity+id, k-m, + name, pkt+tx+a%C2%A0%E2%86%90%C2%A0b, pkt+tx+a%C2%A0%E2%86%92%C2%A0b, rpt+timer, + state + Example URL: /wl?fields=bps+rx+a,bps+rx+b + + Example py-json call (it knows the URL): + record = LFJsonGet.get_wl(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps rx a': # Endpoint B's Max transmit rate (bps). + 'bps rx b': # Endpoint A's Max transmit rate (bps). + 'eid': # Entity ID + 'endpoints (a ↔ b)': # Endpoints that make up this WanLink. + 'entity id': # Entity ID + 'k-m': # Whether the WanLink is Kernel-Mode or not. + 'name': # WanLink's Name. + 'pkt tx a ← b': # Packets received on endpoint B and transmitted out endpoint A. + 'pkt tx a → b': # Packets received on endpoint A and transmitted out endpoint B. + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'state': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_wl(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/wl" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /wl-endp/ + /wl-endp/$wl_ep_id + + When requesting specific column names, they need to be URL encoded: + buffer, corrupt+1, corrupt+2, corrupt+3, corrupt+4, corrupt+5, corrupt+6, + delay, dropfreq+%25, dropped, dup+pkts, dupfreq+%25, eid, elapsed, extrabuf, + failed-late, jitfreq+%25, max+rate, maxjitter, maxlate, name, ooo+pkts, qdisc, + reordfrq+%25, run, rx+bytes, rx+pkts, script, serdelay, tx+bytes, tx+drop+%25, + tx+pkts, tx+rate, tx-failed, wps + Example URL: /wl-endp?fields=buffer,corrupt+1 + + Example py-json call (it knows the URL): + record = LFJsonGet.get_wl_endp(eid_list=['1.234', '1.344'], + requested_col_names=['eid'], + debug=True) + + The record returned will have these members: + { + 'buffer': # Maximum size of receive buffer, in bytes.This is the sum of the amount + # needed for the transit buffers (delay * bandwidth)plus the WanLink + # "Backlog Buffer:" queue size which handles bursts. + 'corrupt 1': # Counters for how many times this corruption has been applied. + 'corrupt 2': # Counters for how many times this corruption has been applied. + 'corrupt 3': # Counters for how many times this corruption has been applied. + 'corrupt 4': # Counters for how many times this corruption has been applied. + 'corrupt 5': # Counters for how many times this corruption has been applied. + 'corrupt 6': # Counters for how many times this corruption has been applied. + 'delay': # Base induced latency on received packets, in microseconds. + 'dropfreq %': # Frequency out of 1,000,000 to drop a received packet.Select a preset + # value or enter your own. + 'dropped': # Total dropped packets on receive.This does not include the tx-failed + # counters. + 'dup pkts': # Total duplicate packets generated. + 'dupfreq %': # Frequency out of 1,000,000 to duplicate a received packet.Select a + # preset value or enter your own. + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'extrabuf': # Size of "Backlog Buffer:" setting in WanLink configuration in bytes. + 'failed-late': # Total amount of received packets that could not be transmitted out the + # peer becausethe emulator was overloaded and could not transmit within + # the specified 'lateness' + 'jitfreq %': # Frequency out of 1,000,000 that packets should have jitter applied to + # them.Select a preset value or enter your own. + 'max rate': # Max transmit rate (bps) for this Endpoint. + 'maxjitter': # Maximum additional delay, in microseconds. See Jitter-Frequency as + # well. + 'maxlate': # The maximum lateness in milliseconds allowed before packets will be + # dropped on transmit.If lateness is configured to be automatic, this + # variable will change based onconfigured bandwidth and backlog buffer, + # but will not go below 10ms. + 'name': # Endpoint's Name. + 'ooo pkts': # Total out of order packets generated. + 'qdisc': # Queueing discipline (FIFO, WRR, etc). + 'reordfrq %': # Frequency out of 1,000,000 to re-order a received packet.Select a preset + # value or enter your own. + 'run': # Is the Endpoint is Running or not. + 'rx bytes': # Total received bytes count. + 'rx pkts': # Total received packet count. + 'script': # Endpoint script state. + 'serdelay': # Additional serialization delay for a 1514 byte packet at the configured + # speed (microseconds). + 'tx bytes': # Total transmitted bytes count. + 'tx drop %': # Packet drop percentage over the last 1 minute. + 'tx pkts': # Packets received on the peer interface and transmitted out this + # endpoint's interface. + 'tx rate': # The average speed over the last 30 seconds at which we are + # transmittingout the peer interface.This can be thought of as the actual + # transfer rate for packets entering the interfaceassociated with this + # Endpoint. + 'tx-failed': # Total amount of received packets that could not be transmitted out the + # peer.This includes any tx-failed-late packets. + 'wps': # Enable/Disable showing of WanPaths for individual endpoints. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_wl_endp(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/wl-endp" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /ws-msg/ + /ws-msg/$sessionid + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_ws_msg(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_ws_msg(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/ws-msg" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + +class LFSession(BaseSession): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This subclass of BaseSession knows about LFJsonQuery and LFJsonCommand + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def __init__(self, lfclient_url: str = 'http://localhost:8080', + debug: bool = False, + proxy_map: dict = None, + connection_timeout_sec: float = None, + stream_errors: bool = True, + stream_warnings: bool = False, + require_session: bool = False, + exit_on_error: bool = False): + """ + :param debug: turn on diagnostic information + :param proxy_map: a dict with addresses of proxies to route requests through. + E.G.: { 'http':'http://192.168.1.253:3128', 'https':'https://192.168.1.253:443' } + :param connection_timeout_sec: timeout in second to wait for a connect to the LANforge client (GUI) + This timeout does should not apply to long running client requests, there are individual + timeouts for those conditions, such as max_timeout_sec. + :param stream_errors: print HTTP JSON API errors to system out and logging stream + :param stream_warnings: print HTTP JSON API warnings to system out and logging stream + :param require_session: exit(1) if unable to establish a session_id + :param exit_on_error: on requests failing HTTP requests on besides error 404, + exit(1). This does not include failing to establish a session_id + """ + super().__init__(lfclient_url=lfclient_url, + debug=debug, + proxy_map=proxy_map, + connection_timeout_sec=connection_timeout_sec, + stream_errors=stream_errors, + stream_warnings=stream_warnings, + exit_on_error=exit_on_error) + self.command_instance = LFJsonCommand(session_obj=self, debug=debug, exit_on_error=exit_on_error) + self.query_instance = LFJsonQuery(session_obj=self, debug=debug, exit_on_error=exit_on_error) + self.session_connection_check = \ + self.command_instance.start_session(debug=debug, + die_without_session_id_=require_session) + if self.session_connection_check: + self.session_id = self.command_instance.session_id + self.query_instance.session_id = self.session_id + else: + self.logger.error('LFSession failed to establish session_id') + if require_session and ((not self.command_instance.session_id) or (not self.session_id)): + self.logger.error('LFSession failed to setup session_id correctly') + + def get_command(self) -> LFJsonCommand: + """ + Remember to override this method with your session subclass, it should return LFJsonCommand + :return: registered instance of JsonCommand + """ + if self.command_instance: + return self.command_instance + self.command_instance = LFJsonCommand(session_obj=self) + return self.command_instance + + def get_query(self) -> LFJsonQuery: + """ + Remember to override this method with your session subclass, it should return LFJsonQuery + :return: registered instance of JsonQuery + """ + if self.query_instance: + return self.query_instance + self.query_instance = LFJsonQuery(session_obj=self, debug=self.debug_on) + return self.query_instance From 12db2f0fc3649c07fd6faf6ddbed772de8707258 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 28 Sep 2021 06:02:53 -0600 Subject: [PATCH 037/731] connection_test.py : moved to sandbox Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => sandbox}/connection_test.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-scripts/{ => sandbox}/connection_test.py (100%) diff --git a/py-scripts/connection_test.py b/py-scripts/sandbox/connection_test.py similarity index 100% rename from py-scripts/connection_test.py rename to py-scripts/sandbox/connection_test.py From 28a23a3221b187883a93e72cd58eafc6be609c9e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 28 Sep 2021 06:17:48 -0600 Subject: [PATCH 038/731] ct_us_001_tests.json : added lf_help_check.bash to the regression ct_us_004_tests.json : added lf_help_check.bash to the regression Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 20 ++++++++++++++++++++ py-scripts/tools/ct_us_004_tests.json | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index ab627249..616d3e9d 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -10,6 +10,17 @@ ] }, "test_suites":{ + "suite_hc":{ + "CT-US-001_lf_help_check":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"lf_help_check.bash", + "args":"", + "args_list":[ + " " + ] + } + }, "suite_l3":{ "test_l3_longevity":{ "enabled":"TRUE", @@ -130,6 +141,15 @@ } }, "suite_wc_dp":{ + "CT-US-001_lf_help_check":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"lf_help_check.bash", + "args":"", + "args_list":[ + " " + ] + }, "CT-US-001_create_chamberview_dut_for_ATH10K":{ "enabled":"TRUE", "load_db":"skip", diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index d5d4787d..c0772e3b 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -295,6 +295,15 @@ } }, "suite_wc_dp":{ + "CT-US-004_lf_help_check":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"lf_help_check.bash", + "args":"", + "args_list":[ + " " + ] + }, "CT-US-004_create_chamberview_dut_for_ATH10K":{ "enabled":"TRUE", "load_db":"skip", From f4e45aadeb6f694ca02c046a47f944e4211a4cd5 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 28 Sep 2021 09:11:20 -0700 Subject: [PATCH 039/731] set_port.py: corrects updated LFJsonCommand references that have changed Signed-off-by: Jed Reynolds --- py-json/LANforge/set_port.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/py-json/LANforge/set_port.py b/py-json/LANforge/set_port.py index f6fa7f3b..0bfcc9eb 100644 --- a/py-json/LANforge/set_port.py +++ b/py-json/LANforge/set_port.py @@ -6,17 +6,16 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit() - -sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) -lf_json_autogen = importlib.import_module("py-json.LANforge.lf_json_autogen") -LFJsonPost = lf_json_autogen.LFJsonPost +sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) if os.environ.get("LF_USE_AUTOGEN") == 1: - set_port_current_flags = LFJsonPost.SetPortCurrentFlags.__members__ - set_port_cmd_flags = LFJsonPost.SetPortCmdFlags.__members__ - set_port_interest_flags = LFJsonPost.SetPortInterest.__members__ + lf_json_autogen = importlib.import_module("py-json.LANforge.lf_json_autogen") + LFJsonCommand = lf_json_autogen.LFJsonCommand + set_port_current_flags = LFJsonCommand.SetPortCurrentFlags.__members__ + set_port_cmd_flags = LFJsonCommand.SetPortCmdFlags.__members__ + set_port_interest_flags = LFJsonCommand.SetPortInterest.__members__ else: set_port_current_flags = { From 373323f9c7bee1af9da705499901509356900a92 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 28 Sep 2021 16:43:14 -0600 Subject: [PATCH 040/731] ct_us_001_rig.json : cleaned up spaces lf_json_convert.py new tool for converting json to but used in cookbooks Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_rig.json | 6 +-- py-scripts/tools/lf_json_convert.py | 62 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 5 deletions(-) create mode 100755 py-scripts/tools/lf_json_convert.py diff --git a/py-scripts/tools/ct_us_001_rig.json b/py-scripts/tools/ct_us_001_rig.json index 27cd5fdc..fc4163b4 100644 --- a/py-scripts/tools/ct_us_001_rig.json +++ b/py-scripts/tools/ct_us_001_rig.json @@ -45,8 +45,4 @@ "1.1.wiphy6":{"KEY":"1.1.wiphy6","RADIO":"1.1.wiphy6","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, "1.1.wiphy7":{"KEY":"1.1.wiphy7","RADIO":"1.1.wiphy7","DRIVER":"mt7915e()","CAPABILITIES":"802.11abgn-AX","MAX_STA":"19","MAX_VAP":"16","MAX_VIFS":"19"} } -} - - - - \ No newline at end of file +} \ No newline at end of file diff --git a/py-scripts/tools/lf_json_convert.py b/py-scripts/tools/lf_json_convert.py new file mode 100755 index 00000000..5f188d44 --- /dev/null +++ b/py-scripts/tools/lf_json_convert.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 +''' +File: read in .json and convert for cookbook +Usage: lf_json_convert.py --file +Example: lf_json_convert.py --file +''' +# visit http://127.0.0.1:8050/ in your web browser. +import sys +import os +import importlib +import argparse + +class file_convert(): + def __init__(self, + _file = ''): + self.file = _file + self.file2 = "{}_edit".format(_file) + + # Helper methods + def json_file(self): + file_fd = open(self.file, 'r') + file2_fd = open(self.file2, 'w+') + file2_fd.write('{\n') + file2_fd.write('"text": [ "
{",')
+        for line in file_fd:
+            #print(line)
+            line = line.replace('"','"').replace('\n','')
+            line = '"' + line + '\\n",'
+            file2_fd.write('{}\n'.format(line))
+        file2_fd.write('"
"]\n') + file2_fd.write('},') + file_fd.close() + file2_fd.close() + +# Feature, Sum up the subtests passed/failed from the kpi files for each run, poke those into the database, and generate a kpi graph for them. +def main(): + + parser = argparse.ArgumentParser( + prog='lf_json_convert.py', + formatter_class=argparse.RawTextHelpFormatter, + epilog='''\ + lf_json_convert.py converts json for cookbook the output is _edit + + ''', + description='''\ +File: read in .json and convert for cookbook +Usage: lf_json_convert.py --file +Example: lf_json_convert.py --file + + ''') + parser.add_argument('--file', help='--file file.json', required=True) #TODO is this needed + + args = parser.parse_args() + + __file = args.file + + convert = file_convert(_file = __file) + convert.json_file() + +if __name__ == '__main__': + main() + From 7e9b2565c07e21d1a2cf6284f7d026098236e966 Mon Sep 17 00:00:00 2001 From: jitendracandela Date: Wed, 29 Sep 2021 11:48:12 +0530 Subject: [PATCH 041/731] added quiesce_after --- py-json/http_profile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py-json/http_profile.py b/py-json/http_profile.py index 9acd05d5..09982d24 100644 --- a/py-json/http_profile.py +++ b/py-json/http_profile.py @@ -27,6 +27,7 @@ class HTTPProfile(LFCliBase): self.dest = "/dev/null" self.port_util = PortUtils(self.local_realm) self.max_speed = 0 #infinity + self.quiesce_after = 0 # infinity def check_errors(self, debug=False): fields_list = ["!conn", "acc.+denied", "bad-proto", "bad-url", "other-err", "total-err", "rslv-p", "rslv-h", @@ -164,7 +165,8 @@ class HTTPProfile(LFCliBase): "timeout": 10, "url_rate": self.requests_per_ten, "url": url, - "proxy_auth_type": 0x200 + "proxy_auth_type": 0x200, + "quiesce_after": self.quiesce_after } else: endp_data = { @@ -179,7 +181,8 @@ class HTTPProfile(LFCliBase): "ssl_cert_fname": "ca-bundle.crt", "proxy_port": 0, "max_speed": self.max_speed, - "proxy_auth_type": 0x200 + "proxy_auth_type": 0x200, + "quiesce_after": self.quiesce_after } url = "cli-json/add_l4_endp" self.local_realm.json_post(url, endp_data, debug_=debug_, From dd5ac0140fd7aab787e484dcd73ddd43aaec6e04 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 29 Sep 2021 06:12:34 -0600 Subject: [PATCH 042/731] lf_json_convert.py : updated to work around the --raw_lines with \" Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_json_convert.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/lf_json_convert.py b/py-scripts/tools/lf_json_convert.py index 5f188d44..80f47a60 100755 --- a/py-scripts/tools/lf_json_convert.py +++ b/py-scripts/tools/lf_json_convert.py @@ -21,11 +21,13 @@ class file_convert(): file_fd = open(self.file, 'r') file2_fd = open(self.file2, 'w+') file2_fd.write('{\n') - file2_fd.write('"text": [ "
{",')
+        file2_fd.write('"text": [ "
**{}**\\n",'.format(self.file))
         for line in file_fd:
-            #print(line)
             line = line.replace('"','"').replace('\n','')
+            # to avoid --raw_line \"  issues the \" it creates a \& which the reader does not like
+            line = line.replace('\&','\\\&')
             line = '"' + line + '\\n",'
+
             file2_fd.write('{}\n'.format(line))
         file2_fd.write('"
"]\n') file2_fd.write('},') @@ -40,6 +42,7 @@ def main(): formatter_class=argparse.RawTextHelpFormatter, epilog='''\ lf_json_convert.py converts json for cookbook the output is _edit + NOTE: CANNOT have extra blank lines at the end of the json to display correctly. ''', description='''\ From df0accb650da7992a5b20d41ceae72565e3e884d Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 29 Sep 2021 06:28:43 -0600 Subject: [PATCH 043/731] lf_json_convert.py : prefix with conversion to have cookbook_ and leave the .json extension. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_json_convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/lf_json_convert.py b/py-scripts/tools/lf_json_convert.py index 80f47a60..4d72a8af 100755 --- a/py-scripts/tools/lf_json_convert.py +++ b/py-scripts/tools/lf_json_convert.py @@ -14,7 +14,7 @@ class file_convert(): def __init__(self, _file = ''): self.file = _file - self.file2 = "{}_edit".format(_file) + self.file2 = "cookbook_{}".format(_file) # Helper methods def json_file(self): From 9553e7c92de10d99a630df52c232aa621d4e1da8 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Wed, 29 Sep 2021 14:23:11 -0700 Subject: [PATCH 044/731] rvr: Add example command to the help. Signed-off-by: Ben Greear --- py-scripts/lf_rvr_test.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/py-scripts/lf_rvr_test.py b/py-scripts/lf_rvr_test.py index f1f78762..a103afa5 100755 --- a/py-scripts/lf_rvr_test.py +++ b/py-scripts/lf_rvr_test.py @@ -226,6 +226,21 @@ def main(): Example: + ./lf_rvr_test.py --mgr localhost --port 8080 --lf_user lanforge --lf_password lanforge \\ + --instance_name rvr-instance --config_name test_con --upstream 1.1.eth1 \\ + --dut RootAP --duration 15s --station 1.1.wlan0 \\ + --download_speed 85% --upload_speed 56Kbps \\ + --raw_line 'pkts: MTU' \\ + --raw_line 'directions: DUT Transmit' \\ + --raw_line 'traffic_types: TCP' \\ + --test_rig Ferndale-Mesh-01 --pull_report \\ + --raw_line 'attenuator: 1.1.1040' \\ + --raw_line 'attenuations: 0..+50..950' \\ + --raw_line 'attenuator_mod: 3' \\ + --influx_host c7-graphana --influx_port 8086 --influx_org Candela \\ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \\ + --influx_bucket ben \\ + --influx_tag testbed Ferndale-Mesh """ ) From cf9f8da0ce90db9f9260c6c9c08f401b98a30286 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Wed, 29 Sep 2021 14:32:04 -0700 Subject: [PATCH 045/731] rvr: Add local_lf_report_dir argument. Untested as of now. Signed-off-by: Ben Greear --- py-scripts/lf_rvr_test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/py-scripts/lf_rvr_test.py b/py-scripts/lf_rvr_test.py index a103afa5..9b53ab2c 100755 --- a/py-scripts/lf_rvr_test.py +++ b/py-scripts/lf_rvr_test.py @@ -124,7 +124,7 @@ class RvrTest(cvtest): lf_host="localhost", lf_port=8080, ssh_port=22, - local_path="", + local_lf_report_dir="", graph_groups=None, lf_user="lanforge", lf_password="lanforge", @@ -167,8 +167,8 @@ class RvrTest(cvtest): self.raw_lines_file = raw_lines_file self.sets = sets self.ssh_port = ssh_port - self.local_path = local_path self.graph_groups = graph_groups + self.local_lf_report_dir = local_lf_report_dir def setup(self): # Nothing to do at this time. @@ -212,7 +212,7 @@ class RvrTest(cvtest): self.create_and_run_test(self.load_old_cfg, self.test_name, self.instance_name, self.config_name, self.sets, self.pull_report, self.lf_host, self.lf_user, self.lf_password, - cv_cmds, ssh_port=self.ssh_port, local_lf_report_dir=self.local_path, + cv_cmds, ssh_port=self.ssh_port, local_lf_report_dir=self.local_lf_report_dir, graph_groups_file=self.graph_groups) self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name @@ -262,6 +262,7 @@ def main(): help="Specify duration of each traffic run") parser.add_argument("--graph_groups", help="File to save graph_groups to", default=None) parser.add_argument("--report_dir", default="") + parser.add_argument("--local_lf_report_dir", help="--local_lf_report_dir default '' put where dataplane script run from",default="") args = parser.parse_args() From 6846b2a1199c4a4b6de38729aafb9d89320076c2 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 29 Sep 2021 17:08:32 -0600 Subject: [PATCH 046/731] test_l3_longevity.py : added 6g functionality Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 260 ++++++++++++++++++++++++++++---- 1 file changed, 233 insertions(+), 27 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index a7953099..fcfce6f4 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -117,8 +117,10 @@ class L3VariableTime(Realm): ap_read=False, ap_port='/dev/ttyUSB0', ap_baud='115200', + ap_cmd_6g='wl -i wl2 bs_data', ap_cmd_5g='wl -i wl1 bs_data', ap_cmd_2g='wl -i wl0 bs_data', + ap_chanim_cmd_6g='wl -i wl2 chanim_stats', ap_chanim_cmd_5g='wl -i wl1 chanim_stats', ap_chanim_cmd_2g='wl -i wl0 chanim_stats', ap_test_mode=False, @@ -202,15 +204,20 @@ class L3VariableTime(Realm): self.ap_read = ap_read self.ap_port = ap_port self.ap_baud = ap_baud + self.ap_cmd_6g = ap_cmd_6g self.ap_cmd_5g = ap_cmd_5g self.ap_cmd_2g = ap_cmd_2g + self.ap_chanim_cmd_6g = ap_chanim_cmd_6g self.ap_chanim_cmd_5g = ap_chanim_cmd_5g self.ap_chanim_cmd_2g = ap_chanim_cmd_2g self.ap_test_mode = ap_test_mode + self.ap_6g_umsched = "" + self.ap_6g_msched = "" self.ap_5g_umsched = "" self.ap_5g_msched = "" self.ap_24g_umsched = "" self.ap_24g_msched = "" + self.ap_ofdma_6g = "" self.ap_ofdma_5g = "" self.ap_ofdma_24g = "" @@ -261,6 +268,12 @@ class L3VariableTime(Realm): self.cx_profile.port = self.lfclient_port self.cx_profile.name_prefix = self.name_prefix + def get_ap_6g_umsched(self): + return self.ap_6g_umsched + + def get_ap_6g_msched(self): + return self.ap_6g_msched + def get_ap_5g_umsched(self): return self.ap_5g_umsched @@ -273,6 +286,9 @@ class L3VariableTime(Realm): def get_ap_24g_msched(self): return self.ap_5g_msched + def get_ap_ofdma_6g(self): + return self.ap_ofdma_6g + def get_ap_ofdma_5g(self): return self.ap_ofdma_5g @@ -524,7 +540,24 @@ class L3VariableTime(Realm): print("ap_custom_cmd: {} WARNING unable to read AP ".format(ap_custom_cmd)) return ap_results + + def read_ap_stats_6g(self): + # 6ghz: wl -i wl2 bs_data + ap_stats_6g = "" + try: + # configure the serial interface + ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) + ss = SerialSpawn(ser) + ss.sendline(str(self.ap_cmd_6g)) + ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + ap_stats_6g = ss.before.decode('utf-8','ignore') + print("ap_stats_6g from AP: {}".format(ap_stats_6g)) + + except: + print("WARNING: ap_stats_6g unable to read AP") + return ap_stats_6g + def read_ap_stats_5g(self): # 5ghz: wl -i wl1 bs_data ap_stats_5g = "" @@ -538,7 +571,7 @@ class L3VariableTime(Realm): print("ap_stats_5g from AP: {}".format(ap_stats_5g)) except: - print("WARNING unable to read AP") + print("WARNING: ap_stats_5g unable to read AP") return ap_stats_5g @@ -555,10 +588,27 @@ class L3VariableTime(Realm): print("ap_stats_2g from AP: {}".format(ap_stats_2g)) except: - print("WARNING unable to read AP") + print("WARNING: ap_stats_2g unable to read AP") return ap_stats_2g + def read_ap_chanim_stats_6g(self): + # 5ghz: wl -i wl1 chanim_stats + ap_chanim_stats_6g = "" + try: + # configure the serial interface + ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) + ss = SerialSpawn(ser) + ss.sendline(str(self.ap_chanim_cmd_6g)) + ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + ap_chanim_stats_6g = ss.before.decode('utf-8','ignore') + print("read_ap_chanim_stats_6g {}".format(ap_chanim_stats_6g)) + + except: + print("WARNING: read_ap_chanim_stats_6g unable to read AP") + + return ap_chanim_stats_6g + def read_ap_chanim_stats_5g(self): # 5ghz: wl -i wl1 chanim_stats @@ -573,7 +623,7 @@ class L3VariableTime(Realm): print("read_ap_chanim_stats_5g {}".format(ap_chanim_stats_5g)) except: - print("WARNING unable to read AP") + print("WARNING: read_ap_chanim_stats_5g unable to read AP") return ap_chanim_stats_5g @@ -590,7 +640,7 @@ class L3VariableTime(Realm): print("read_ap_chanim_stats_2g {}".format(ap_chanim_stats_2g)) except: - print("WARNING unable to read AP") + print("WARNING: read_ap_chanim_stats_2g unable to read AP") return ap_chanim_stats_2g @@ -666,6 +716,7 @@ class L3VariableTime(Realm): self.build(rebuild=True) if self.ap_scheduler_stats or self.ap_ofdma_stats: + self.ap_custom_cmd('wl -i wl2 dump_clear') self.ap_custom_cmd('wl -i wl1 dump_clear') self.ap_custom_cmd('wl -i wl0 dump_clear') @@ -718,16 +769,131 @@ class L3VariableTime(Realm): # AP OUTPUT if self.ap_read: + # 6G test mode if self.ap_test_mode: # Create the test data as a continuous string - ap_stats_5g="{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 bs_data\n", + ap_stats_6g="{}{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 bs_data\n", "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n", "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") - print("ap_stats {}".format(ap_stats_5g)) + print("ap_stats 6g{}".format(ap_stats_6g)) + + # Create the test data as a continuous string + ap_chanim_stats_6g = "{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 chanim_stats\n", + "version: 3\n", + "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", + #`"0xe06a 61 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") + '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') + #"0xe06a 1.67 15.00 0.00 17.00 0.00 0.00 97.33 53.00 2.00 0 0 -91 65 343370578\n") + + else: + # read from the AP 6g + ap_stats_6g = self.read_ap_stats_6g() + ap_chanim_stats_6g = self.read_ap_chanim_stats_6g() + + ap_stats_6g_rows = ap_stats_6g.splitlines() + print("From AP stats: ap_stats_6g_rows {}".format(ap_stats_6g_rows)) + + ap_chanim_stats_rows_6g = ap_chanim_stats_6g.splitlines() + print("From AP chanim: ap_chanim_stats_rows_6g {}".format(ap_chanim_stats_rows_6g)) + channel_utilization = 0 + + # Query all of our ports + # Note: the endp eid is the shelf.resource.port.endp-id + port_eids = self.gather_port_eids() + for eid_name in port_eids: + eid = self.name_to_eid(eid_name) + url = "/port/%s/%s/%s"%(eid[0], eid[1], eid[2]) + # read LANforge to get the mac + response = self.json_get(url) + if (response is None) or ("interface" not in response): + print("6g query-port: %s: incomplete response:"%(url)) + pprint(response) + else: + # print("response".format(response)) + pprint(response) + p = response['interface'] + print("#### 6g From LANforge: p, response['insterface']:{}".format(p)) + mac = p['mac'] + #print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) + + # Parse the ap stats to find the matching mac then use that row for reporting + for row in ap_stats_6g_rows: + split_row = row.split() + #print("split_row {}".format(split_row)) + #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + if self.ap_test_mode: + if split_row[0].lower() != mac.lower(): + ap_row = split_row + mac_found_6g = True + else: + try: + # split_row[0].lower() , mac from AP + # mac.lower() , mac from LANforge + if split_row[0].lower() == mac.lower(): + ap_row = split_row + mac_found_6g = True + except: + print("6g 'No stations are currently associated.'? from AP") + print(" since possibly no stations: excption on compare split_row[0].lower() ") + if mac_found_6g == True: + mac_found_6g = False + print("6g selected ap_row (from split_row): {}".format(ap_row)) + + # Find latency, jitter for connections using this port. + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port(p["port"], endps) + + # now report the ap_chanim_stats along side of the ap_stats_6g + xtop_reported = False + for row in ap_chanim_stats_rows_6g: + split_row = row.split() + if xtop_reported: + print("6g xtop_reported row: {row}".format(row=row)) + print("6g xtop_reported split_row: {split_row}".format(split_row=split_row)) + try: + xtop = split_row[7] + print("6g xtop {xtop}".format(xtop=xtop)) + except: + print("6g detected chanspec with reading chanim_stats, exception reading xtop") + + try: + channel_utilization = float(100) - float(xtop) + print("6g channel_utilization {utilization}".format(utilization=channel_utilization)) + except: + print("6g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") + # should be only one channel utilization + break + else: + try: + if split_row[0].lower() == 'chanspec': + print("6g chanspec found xtop_reported = True") + xtop_reported = True + except: + print("6g Error reading xtop") + # ap information is passed with ap_row so all information needs to be contained in ap_row + ap_row.append(str(channel_utilization)) + print("6g channel_utilization {channel_utilization}".format(channel_utilization=channel_utilization)) + print("6g ap_row {ap_row}".format(ap_row=ap_row)) + + ap_stats_6g_col_titles = ['Station Address','PHY Mbps','Data Mbps','Air Use','Data Use','Retries','bw','mcs','Nss','ofdma','mu-mimo','channel_utilization'] + + self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll , ap_row, ap_stats_6g_col_titles) #ap_stats_5g_col_titles used as a length + # 5G test mode + if self.ap_test_mode: + # Create the test data as a continuous string + ap_stats_5g="{}{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 bs_data\n", + "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", + "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", + "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", + "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", + "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n", + "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") + print("ap_stats 5g {}".format(ap_stats_5g)) # Create the test data as a continuous string ap_chanim_stats_5g = "{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 chanim_stats\n", @@ -758,7 +924,7 @@ class L3VariableTime(Realm): # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("query-port: %s: incomplete response:"%(url)) + print("query-port 5g: %s: incomplete response:"%(url)) pprint(response) else: # print("response".format(response)) @@ -785,11 +951,11 @@ class L3VariableTime(Realm): ap_row = split_row mac_found_5g = True except: - print(" 'No stations are currently associated.'? from AP") - print(" since possibly no stations: excption on compare split_row[0].lower() ") + print("5g 'No stations are currently associated.'? from AP") + print("5g since possibly no stations: excption on compare split_row[0].lower() ") if mac_found_5g == True: mac_found_5g = False - print("selected ap_row (from split_row): {}".format(ap_row)) + print("5g selected ap_row (from split_row): {}".format(ap_row)) # Find latency, jitter for connections using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port(p["port"], endps) @@ -820,20 +986,21 @@ class L3VariableTime(Realm): print("5g chanspec found xtop_reported = True") xtop_reported = True except: - print("Error reading xtop") + print("5g Error reading xtop") # ap information is passed with ap_row so all information needs to be contained in ap_row ap_row.append(str(channel_utilization)) - print("channel_utilization {channel_utilization}".format(channel_utilization=channel_utilization)) - print("ap_row {ap_row}".format(ap_row=ap_row)) + print("5g channel_utilization {channel_utilization}".format(channel_utilization=channel_utilization)) + print("5g ap_row {ap_row}".format(ap_row=ap_row)) ap_stats_5g_col_titles = ['Station Address','PHY Mbps','Data Mbps','Air Use','Data Use','Retries','bw','mcs','Nss','ofdma','mu-mimo','channel_utilization'] self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll , ap_row, ap_stats_5g_col_titles) #ap_stats_5g_col_titles used as a length + # 2g test mode if self.ap_test_mode: # Create the test data as a continuous string - ap_stats_2g="{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 bs_data\n", + ap_stats_2g="{}{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl0 bs_data\n", "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", @@ -870,7 +1037,7 @@ class L3VariableTime(Realm): # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("query-port: %s: incomplete response:"%(url)) + print("2g query-port: %s: incomplete response:"%(url)) pprint(response) else: # print("response".format(response)) @@ -897,11 +1064,11 @@ class L3VariableTime(Realm): ap_row = split_row mac_found_2g = True except: - print(" 'No stations are currently associated.'? from AP") - print(" since possibly no stations: excption on compare split_row[0].lower() ") + print("2g 'No stations are currently associated.'? from AP") + print("2g since possibly no stations: excption on compare split_row[0].lower() ") if mac_found_2g == True: mac_found_2g = False - print("selected ap_row (from split_row): {}".format(ap_row)) + print("2g selected ap_row (from split_row): {}".format(ap_row)) # Find latency, jitter for connections using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port(p["port"], endps) @@ -911,8 +1078,8 @@ class L3VariableTime(Realm): for row in ap_chanim_stats_rows_2g: split_row = row.split() if xtop_reported: - print("xtop_reported 2g row: {row}".format(row=row)) - print("xtop_reported 2g split_row: {split_row}".format(split_row=split_row)) + print("2g xtop_reported row: {row}".format(row=row)) + print("2g xtop_reported split_row: {split_row}".format(split_row=split_row)) try: xtop = split_row[7] print("2g xtop {xtop}".format(xtop=xtop)) @@ -932,11 +1099,11 @@ class L3VariableTime(Realm): print("2g chanspec found xtop_reported = True") xtop_reported = True except: - print("Error reading xtop") + print("2g Error reading xtop") # ap information is passed with ap_row so all information needs to be contained in ap_row ap_row.append(str(channel_utilization)) - print("channel_utilization {channel_utilization}".format(channel_utilization=channel_utilization)) - print("ap_row {ap_row}".format(ap_row=ap_row)) + print("2g channel_utilization {channel_utilization}".format(channel_utilization=channel_utilization)) + print("2g ap_row {ap_row}".format(ap_row=ap_row)) ap_stats_2g_col_titles = ['Station Address','PHY Mbps','Data Mbps','Air Use','Data Use','Retries','bw','mcs','Nss','ofdma','mu-mimo','channel_utilization'] @@ -970,6 +1137,11 @@ class L3VariableTime(Realm): # At end of test if requested store upload and download stats if self.ap_scheduler_stats: + # get the (UL) Upload 6g scheduler statistics + self.ap_6g_umsched += self.ap_custom_cmd('wl -i wl2 dump umsched') + # get the (DL) Download 6g schduler staticstics + self.ap_6g_msched += self.ap_custom_cmd('wl -i wl2 dump msched') + # get the (UL) Upload 5g scheduler statistics self.ap_5g_umsched += self.ap_custom_cmd('wl -i wl1 dump umsched') # get the (DL) Download 5g schduler staticstics @@ -982,6 +1154,9 @@ class L3VariableTime(Realm): if self.ap_ofdma_stats: + # provide OFDMA stats 6GHz + self.ap_ofdma_6g += self.ap_custom_cmd('wl -i wl2 muinfo -v') + # provide OFDMA stats 5GHz self.ap_ofdma_5g += self.ap_custom_cmd('wl -i wl1 muinfo -v') @@ -989,8 +1164,8 @@ class L3VariableTime(Realm): self.ap_ofdma_24g += self.ap_custom_cmd('wl -i wl0 muinfo -v') # Stop connections. - self.cx_profile.stop_cx(); - self.multicast_profile.stop_mc(); + self.cx_profile.stop_cx() + self.multicast_profile.stop_mc() cur_time = datetime.datetime.now() @@ -1011,7 +1186,6 @@ class L3VariableTime(Realm): #print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) #print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) if len(ap_row) == len(self.ap_stats_col_titles): - i = 0 #print("ap_row {}".format(ap_row)) for col in ap_row: #print("col {}".format(col)) @@ -1265,10 +1439,13 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m parser.add_argument('--ap_read', help='--ap_read flag present enable reading ap', action='store_true') parser.add_argument('--ap_port', help='--ap_port \'/dev/ttyUSB0\'',default='/dev/ttyUSB0') parser.add_argument('--ap_baud', help='--ap_baud \'115200\'',default='115200') + # note wl2 is the 6G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection (default may be eth8) + parser.add_argument('--ap_cmd_6g', help='ap_cmd_5g \'wl -i wl2 bs_data\'', default="wl -i wl2 bs_data") # note wl1 is the 5G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection (default may be eth7) parser.add_argument('--ap_cmd_5g', help='ap_cmd_5g \'wl -i wl1 bs_data\'', default="wl -i wl1 bs_data") - # note wl1 is the 2.4G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection + # note wl1 is the 2.4G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection (default may be eth6) parser.add_argument('--ap_cmd_2g', help='ap_cmd_2g \'wl -i wl0 bs_data\'', default="wl -i wl0 bs_data") + parser.add_argument('--ap_chanim_cmd_6g', help='ap_chanim_cmd_6g \'wl -i wl2 chanim_stats\'', default="wl -i wl2 chanim_stats") parser.add_argument('--ap_chanim_cmd_5g', help='ap_chanim_cmd_5g \'wl -i wl1 chanim_stats\'', default="wl -i wl1 chanim_stats") parser.add_argument('--ap_chanim_cmd_2g', help='ap_chanim_cmd_2g \'w1 -i wl0 chanim_stats\'', default="wl -i wl0 chanim_stats") parser.add_argument('--ap_scheduler_stats', help='--ap_scheduler_stats flag to clear stats run test then dump ul and dl stats to file', action='store_true') @@ -1334,12 +1511,18 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m if args.ap_baud: ap_baud = args.ap_baud + if args.ap_cmd_6g: + ap_cmd_6g = args.ap_cmd_6g + if args.ap_cmd_5g: ap_cmd_5g = args.ap_cmd_5g if args.ap_cmd_2g: ap_cmd_2g = args.ap_cmd_2g + if args.ap_chanim_cmd_6g: + ap_chanim_cmd_6g = args.ap_chanim_cmd_6g + if args.ap_chanim_cmd_5g: ap_chanim_cmd_5g = args.ap_chanim_cmd_5g @@ -1516,8 +1699,10 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m ap_read=ap_read, ap_port=ap_port, ap_baud=ap_baud, + ap_cmd_6g=ap_cmd_6g, ap_cmd_5g=ap_cmd_5g, ap_cmd_2g=ap_cmd_2g, + ap_chanim_cmd_6g=ap_chanim_cmd_6g, ap_chanim_cmd_5g=ap_chanim_cmd_5g, ap_chanim_cmd_2g=ap_chanim_cmd_2g, ap_test_mode=ap_test_mode) @@ -1558,6 +1743,20 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m print("getting umsched and msched ap data and writing to a file") file_date = report.get_date() + ap_6g_umsched_data = ip_var_test.get_ap_6g_umsched() + ap_6g_umsched = "{}-{}".format(file_date,"ap_6g_umsched.txt") + ap_6g_umsched = report.file_add_path(ap_6g_umsched) + ap_6g_umsched_file = open(ap_6g_umsched, "w") + ap_6g_umsched_file.write(str(ap_6g_umsched_data)) + ap_6g_umsched_file.close() + + ap_6g_msched_data = ip_var_test.get_ap_6g_msched() + ap_6g_msched = "{}-{}".format(file_date,"ap_6g_msched.txt") + ap_6g_msched = report.file_add_path(ap_6g_msched) + ap_6g_msched_file = open(ap_6g_msched, "w") + ap_6g_msched_file.write(str(ap_6g_msched_data)) + ap_6g_msched_file.close() + ap_5g_umsched_data = ip_var_test.get_ap_5g_umsched() ap_5g_umsched = "{}-{}".format(file_date,"ap_5g_umsched.txt") ap_5g_umsched = report.file_add_path(ap_5g_umsched) @@ -1592,6 +1791,13 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m print("getting ofdma ap data and writing to a file") file_date = report.get_date() + ap_ofdma_6g_data = ip_var_test.get_ap_ofdma_6g() + ap_ofdma_6g = "{}-{}".format(file_date,"ap_ofdma_6g_data.txt") + ap_ofdma_6g = report.file_add_path(ap_ofdma_6g) + ap_ofdma_6g_data = open(ap_ofdma_6g, "w") + ap_ofdma_6g_data.write(str(ap_ofdma_6g_data)) + ap_ofdma_6g_data.close() + ap_ofdma_5g_data = ip_var_test.get_ap_ofdma_5g() ap_ofdma_5g = "{}-{}".format(file_date,"ap_ofdma_5g_data.txt") ap_ofdma_5g = report.file_add_path(ap_ofdma_5g) From 82b5d61de22039d4f9520028e9da5346ace52496 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Wed, 29 Sep 2021 16:30:45 -0700 Subject: [PATCH 047/731] rvr: Fix pulling to local directory. My earlier attempt missed passing in the cmd-line-arg to the code that actually used it. And, add more useful printout to the CV test mgr to show what it is pulling where. Signed-off-by: Ben Greear --- py-json/cv_test_manager.py | 5 +++-- py-scripts/lf_rvr_test.py | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index d4ad7adf..f9b3f34d 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -372,12 +372,13 @@ class cv_test(Realm): self.lf_report_dir = location if pull_report: try: - print(lf_host) + print("Pulling report to directory: %s from %s@%s/%s" % + (local_lf_report_dir, lf_user, lf_host, location)) report.pull_reports(hostname=lf_host, username=lf_user, password=lf_password, port=ssh_port, report_dir=local_lf_report_dir, report_location=location) except Exception as e: - print("SCP failed, user %s, password %s, dest %s", (lf_user, lf_password, lf_host)) + print("SCP failed, user %s, password %s, dest %s" % (lf_user, lf_password, lf_host)) raise e # Exception("Could not find Reports") break diff --git a/py-scripts/lf_rvr_test.py b/py-scripts/lf_rvr_test.py index 9b53ab2c..1f14225c 100755 --- a/py-scripts/lf_rvr_test.py +++ b/py-scripts/lf_rvr_test.py @@ -242,6 +242,24 @@ def main(): --influx_bucket ben \\ --influx_tag testbed Ferndale-Mesh + ./lf_rvr_test.py --mgr localhost --port 8080 --lf_user lanforge --lf_password lanforge \\ + --instance_name rvr-instance --config_name test_con --upstream 1.1.eth1 \\ + --dut RootAP --duration 15s --station 1.1.wlan0 \\ + --download_speed 85% --upload_speed 56Kbps \\ + --raw_line 'pkts: MTU' \\ + --raw_line 'directions: DUT Transmit' \\ + --raw_line 'traffic_types: TCP' \\ + --test_rig Ferndale-Mesh-01 --pull_report \\ + --raw_line 'attenuator: 1.1.1040' \\ + --raw_line 'attenuations: 0..+50..950' \\ + --raw_line 'attenuator_mod: 3' \\ + --pull_report \\ + --local_lf_report_dir /tmp/rvr-report \\ + --raw_line 'notes0: my rvr notes' \\ + --raw_line 'notes1: are here.' \\ + --raw_line 'rvr_bringup_wait: 30000' \\ + --raw_line 'first_byte_wait: 30000' + """ ) @@ -276,6 +294,7 @@ def main(): config_name=args.config_name, upstream=args.upstream, pull_report=args.pull_report, + local_lf_report_dir = args.local_lf_report_dir, load_old_cfg=args.load_old_cfg, download_speed=args.download_speed, upload_speed=args.upload_speed, From 41200068fd6cceacb80704c5101b4b857f8190d9 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Wed, 29 Sep 2021 16:38:58 -0700 Subject: [PATCH 048/731] ap-auto: Fix help output formatting. Signed-off-by: Ben Greear --- py-scripts/lf_ap_auto_test.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/py-scripts/lf_ap_auto_test.py b/py-scripts/lf_ap_auto_test.py index 2b21d55e..a991e1e2 100755 --- a/py-scripts/lf_ap_auto_test.py +++ b/py-scripts/lf_ap_auto_test.py @@ -302,22 +302,22 @@ def main(): Open this file in an editor and read the top notes for more details. Example: - ./lf_ap_auto_test.py --mgr localhost --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ - --dut5_0 'linksys-8450 Default-SSID-5gl c4:41:1e:f5:3f:25 (2)' \ - --dut2_0 'linksys-8450 Default-SSID-2g c4:41:1e:f5:3f:24 (1)' \ - --max_stations_2 100 --max_stations_5 100 --max_stations_dual 200 \ - --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 \ - --radio5 1.1.wiphy1 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 \ - --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7 \ - --set 'Basic Client Connectivity' 1 --set 'Multi Band Performance' 1 \ - --set 'Skip 2.4Ghz Tests' 1 --set 'Skip 5Ghz Tests' 1 \ - --set 'Throughput vs Pkt Size' 0 --set 'Capacity' 0 --set 'Stability' 0 --set 'Band-Steering' 0 \ - --set 'Multi-Station Throughput vs Pkt Size' 0 --set 'Long-Term' 0 \ - --test_rig Testbed-01 --test_tag ATH10K --pull_report \ - --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ - --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ - --influx_bucket ben \ + ./lf_ap_auto_test.py --mgr localhost --port 8080 --lf_user lanforge --lf_password lanforge \\ + --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \\ + --dut5_0 'linksys-8450 Default-SSID-5gl c4:41:1e:f5:3f:25 (2)' \\ + --dut2_0 'linksys-8450 Default-SSID-2g c4:41:1e:f5:3f:24 (1)' \\ + --max_stations_2 100 --max_stations_5 100 --max_stations_dual 200 \\ + --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 \\ + --radio5 1.1.wiphy1 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 \\ + --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7 \\ + --set 'Basic Client Connectivity' 1 --set 'Multi Band Performance' 1 \\ + --set 'Skip 2.4Ghz Tests' 1 --set 'Skip 5Ghz Tests' 1 \\ + --set 'Throughput vs Pkt Size' 0 --set 'Capacity' 0 --set 'Stability' 0 --set 'Band-Steering' 0 \\ + --set 'Multi-Station Throughput vs Pkt Size' 0 --set 'Long-Term' 0 \\ + --test_rig Testbed-01 --test_tag ATH10K --pull_report \\ + --influx_host c7-graphana --influx_port 8086 --influx_org Candela \\ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \\ + --influx_bucket ben \\ --influx_tag testbed Ferndale-01 """ ) From dcfb3f385a213d6fe94bdc137f3320f6a0ed9b0b Mon Sep 17 00:00:00 2001 From: karthikaeyetea Date: Thu, 30 Sep 2021 23:20:37 +0530 Subject: [PATCH 049/731] added max_speed in If block of create() --- py-json/http_profile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-json/http_profile.py b/py-json/http_profile.py index 09982d24..cc4032b2 100644 --- a/py-json/http_profile.py +++ b/py-json/http_profile.py @@ -166,7 +166,8 @@ class HTTPProfile(LFCliBase): "url_rate": self.requests_per_ten, "url": url, "proxy_auth_type": 0x200, - "quiesce_after": self.quiesce_after + "quiesce_after": self.quiesce_after, + "max_speed": self.max_speed } else: endp_data = { From 4744bc488ae0d30b02b0ed881e31ba7bd7b5b9f2 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 30 Sep 2021 13:25:07 -0600 Subject: [PATCH 050/731] lfcli_base.py : changed from pprint import pprint to import pprint Signed-off-by: Chuck SmileyRekiere --- py-json/LANforge/lfcli_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 6f250046..62a6f0f0 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -4,7 +4,7 @@ import os import importlib import traceback # Extend this class to use common set of debug and request features for your script -from pprint import pprint +import pprint import time import random import string From b6013003efde628f7b8e6ba1c38cbcb45db3faf6 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 30 Sep 2021 12:55:03 -0700 Subject: [PATCH 051/731] Fixing regression_test problems Signed-off-by: Matthew Stidham --- py-scripts/create_qvlan.py | 4 +-- py-scripts/regression_test.sh | 43 ++++++++++++++----------- py-scripts/test_l3_powersave_traffic.py | 16 ++++----- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/py-scripts/create_qvlan.py b/py-scripts/create_qvlan.py index aa6ac8a1..7eaeb90d 100755 --- a/py-scripts/create_qvlan.py +++ b/py-scripts/create_qvlan.py @@ -114,7 +114,7 @@ def main(): and args.qvlan_parent in args.first_port: start_num = int(args.first_port[args.first_port.index('#') + 1:]) num_ports = int(args.num_ports) - port_list = LFUtils.port_name_series(prefix=args.qvlan_parent + "#", start_id=start_num, + port_list = LFUtils.port_name_series(prefix=str(args.qvlan_parent) + "#", start_id=start_num, end_id=start_num + num_ports - 1, padding_number=10000, radio=args.radio) print(2) @@ -125,7 +125,7 @@ def main(): else: if args.use_ports is None: num_ports = int(args.num_ports) - port_list = LFUtils.port_name_series(prefix=args.qvlan_parent + "#", start_id=1, + port_list = LFUtils.port_name_series(prefix=str(args.qvlan_parent) + "#", start_id=1, end_id=num_ports, padding_number=10000, radio=args.radio) print(3) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index a37a099c..56c7dae5 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -19,7 +19,7 @@ Help() echo "If using the help flag, put the H flag at the end of the command after other flags." } -while getopts ":h:s:p:w:m:A:r:F:B:U:H:" option; do +while getopts ":h:s:p:w:m:A:r:F:B:U:D:H:" option; do case "${option}" in h) # display Help Help @@ -52,6 +52,10 @@ while getopts ":h:s:p:w:m:A:r:F:B:U:H:" option; do U) UPSTREAM=${OPTARG} ;; + D) + DUT5=${OPTARG} + DUT2=${OPTARG} + ;; H) HELP=1 ;; @@ -103,6 +107,10 @@ TEST_HTTP_IP=${TEST_HTTP_IP:-10.40.0.1} MGRLEN=${#MGR} COL_NAMES="name,tx_bytes,rx_bytes,dropped" +if [[ ${#DUT2} -eq 0 ]]; then + DUT5="linksys-8450 Default-SSID-5gl c4:41:1e:f5:3f:25" + DUT2="linksys-8450 Default-SSID-2g c4:41:1e:f5:3f:24" +fi #CURR_TEST_NUM=0 CURR_TEST_NAME="BLANK" @@ -231,16 +239,19 @@ elif [[ $MGRLEN -gt 0 ]]; then testCommands=( #"./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" #"./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug --mgr $MGR" - "./create_chamberview.py -m $MGR -cs \"regression_test\" --line \"Resource=1.1 Profile=STA-AC Amount=1 Uses-1 $RADIO_USED Freq=-1 DUT=TEST DUT_RADIO=$RADIO_USED Traffic=http\" --line \"Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=Test DUT_RADIO=$RADIO_USED Traffic=http\"" + "./create_chamberview.py -m $MGR -cs \"regression_test\" \ + --line \"Resource=1.1 Profile=STA-AC Amount=1 Uses-1 $RADIO_USED Freq=-1 DUT=TEST DUT_RADIO=$RADIO_USED Traffic=http\" \ + --line \"Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=Test DUT_RADIO=$RADIO_USED Traffic=http\"" "./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ --ssid \"ssid_idx=0 ssid=\"$SSID_USED\" security=\"$SECURITY\" password=\"$PASSWD_USED\" bssid=04:f0:21:2c:41:84\"" - "./create_l3.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR" + "./create_l3.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR --endp_a wiphy0 --endp_b wiphy1" + #"./create_l3_stations.py --mgr $MGR --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug" #"./create_l4.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR" #"./create_macvlan.py --radio 1.$RADIO_USED --macvlan_parent eth1 --debug --mgr $MGR" #"./create_qvlan.py --first_qvlan_ip 192.168.1.50 --mgr $MGR" #"./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./create_vap.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - "./create_vr.py --vr_name 2.vr0 --ports 2.br0,2.vap2 --services 1.br0=dhcp,nat --services 1.vr0=radvd" + "./create_vr.py --mgr $MGR --vr_name 2.vr0 --ports 2.br0,2.vap2 --services 1.br0=dhcp,nat --services 1.vr0=radvd --debug" #./create_wanlink #./csv_convert #./csv_processor @@ -262,19 +273,13 @@ elif [[ $MGRLEN -gt 0 ]]; then #./layer4_test --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY "./lf_ap_auto_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ - --dut5_0 \"linksys-8450 Default-SSID-5gl c4:41:1e:f5:3f:25 (2)\" \ - --dut2_0 \"linksys-8450 Default-SSID-2g c4:41:1e:f5:3f:24 (1)\" \ - --max_stations_2 100 --max_stations_5 100 --max_stations_dual 200 \ - --radio2 1.1.wiphy0 --radio2 1.1.wiphy1 \ - --set \"Basic Client Connectivity\" 1 --set \"Multi Band Performance\" 1 \ - --set \"Skip 2.4Ghz Tests\" 1 --set \"Skip 5Ghz Tests\" 1 \ - --set \"Throughput vs Pkt Size\" 0 --set 'Capacity' 0 --set 'Stability' 0 --set 'Band-Steering' 0 \ - --set \"Multi-Station Throughput vs Pkt Size\" 0 --set \"Long-Term\" 0 \ - --pull_report \ - --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ + --dut5_0 \"$DUT5 (2)\" --dut2_0 \"$DUT2 (1)\" --max_stations_2 100 --max_stations_5 100 --max_stations_dual 200 \ + --radio2 1.1.wiphy0 --radio2 1.1.wiphy1 --set \"Basic Client Connectivity\" 1 --set \"Multi Band Performance\" 1 \ + --set \"Skip 2.4Ghz Tests\" 1 --set \"Skip 5Ghz Tests\" 1 --set \"Throughput vs Pkt Size\" 0 --set 'Capacity' 0 \ + --set 'Stability' 0 --set 'Band-Steering' 0 --set \"Multi-Station Throughput vs Pkt Size\" 0 \ + --set \"Long-Term\" 0 --pull_report --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ - --influx_bucket ben \ - --influx_tag testbed Ferndale-01" + --influx_bucket ben --influx_tag testbed Ferndale-01" #./lf_atten_mod_test #./lf_csv #./lf_dataplane_config @@ -291,10 +296,10 @@ elif [[ $MGRLEN -gt 0 ]]; then #./lf_dut_sta_vap_test #"./lf_ftp.py --mgr $MGR --mgr_port 8080 --upstream_port $UPSTREAM --ssid $SSID --security $SECURITY --passwd $PASSWD_USED \ # --ap_name WAC505 --ap_ip 192.168.213.90 --bands Both --directions Download --twog_radio wiphy1 --fiveg_radio wiphy0 --file_size 2MB --num_stations 40 --Both_duration 1 --traffic_duration 2 --ssh_port 22_" - "./lf_ftp_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --bands 5G --direction Download \ - --file_size 2MB --num_stations 2" + #"./lf_ftp.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --bands 5G --direction Download \ + # --file_size 2MB --num_stations 2" "./lf_graph.py --mgr $MGR" - #"./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line 'selected_dut2 RootAP wactest $BSSID'" + "./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line 'selected_dut2 RootAP wactest $BSSID'" #./lf_multipsk #./lf_report #./lf_report_test diff --git a/py-scripts/test_l3_powersave_traffic.py b/py-scripts/test_l3_powersave_traffic.py index bb10c4de..554cdb56 100755 --- a/py-scripts/test_l3_powersave_traffic.py +++ b/py-scripts/test_l3_powersave_traffic.py @@ -62,7 +62,7 @@ class L3PowersaveTraffic(LFCliBase): self.new_monitor = realm.WifiMonitor(self.lfclient_url, self.local_realm, debug_=_debug_on) def build(self): - self.station_profile.use_security("open", ssid=self.ssid, passwd=self.password) + self.station_profile.use_security(self.security, ssid=self.ssid, passwd=self.password) self.station_profile.set_number_template(self.prefix) self.station_profile.set_command_flag("add_sta", "create_admin_down", 1) self.station_profile.set_command_param("set_port", "report_timer", 1500) @@ -155,7 +155,7 @@ class L3PowersaveTraffic(LFCliBase): def main(): - parser = argparse.ArgumentParser( + parser = Realm.create_basic_argparse( prog='test_l3_powersave_traffic.py', formatter_class=argparse.RawTextHelpFormatter, epilog='''\ @@ -165,15 +165,13 @@ def main(): description='''\ Example of creating traffic on an l3 connection ''') - #args = parser.parse_args() - add this line if adding arguments - parser.parse_args() + args = parser.parse_args() - lfjson_host = "localhost" + lfjson_host = args.mgr lfjson_port = 8080 - # station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=4, padding_number_=10000) - station_list = ["sta0000", "sta0001", "sta0002", "sta0003"] - ip_powersave_test = L3PowersaveTraffic(lfjson_host, lfjson_port, ssid="j-open-36", security="open", - password="[BLANK]", station_list=station_list, side_a_min_rate=2000, + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=4, padding_number_=10000) + ip_powersave_test = L3PowersaveTraffic(lfjson_host, lfjson_port, ssid=args.ssid, security=args.security, + password=args.passwd, station_list=station_list, side_a_min_rate=2000, side_b_min_rate=2000, side_a_max_rate=0, side_b_max_rate=0, prefix="00000", test_duration="30s", _debug_on=False, _exit_on_error=True, _exit_on_fail=True) From e790d487b1fed0a30e6c593c3e99e0e9734d8226 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 30 Sep 2021 14:03:33 -0700 Subject: [PATCH 052/731] Make it so VAP profile works with Realm again Signed-off-by: Matthew Stidham --- py-json/realm.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/py-json/realm.py b/py-json/realm.py index e19f01be..e7fd8290 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -60,7 +60,8 @@ port_utils = importlib.import_module("py-json.port_utils") PortUtils = port_utils.PortUtils lfdata = importlib.import_module("py-json.lfdata") LFDataCollection = lfdata.LFDataCollection - +vr_profile2 = importlib.import_module("py-json.vr_profile2") +VRProfile = vr_profile2.VRProfile def wpa_ent_list(): return [ @@ -932,12 +933,10 @@ class Realm(LFCliBase): # debug_=self.debug) return vap_prof - def new_vr_profile(self, ver=2): - if ver == 2: - from vr_profile2 import VRProfile - vap_prof = VRProfile(local_realm=self, - debug=self.debug) - return vap_prof + def new_vr_profile(self): + vr_prof = VRProfile(local_realm=self, + debug=self.debug) + return vr_prof def new_http_profile(self, ver = 1): if ver == 1: From 055b1a9b0a8fe79b1005dab16acc0563e4870d79 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 30 Sep 2021 15:11:02 -0600 Subject: [PATCH 053/731] l3_cxprofile.py , multicast_profile.py : updated pprint.pprint Signed-off-by: Chuck SmileyRekiere --- py-json/l3_cxprofile.py | 2 +- py-json/multicast_profile.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/py-json/l3_cxprofile.py b/py-json/l3_cxprofile.py index 524820fb..949ae247 100644 --- a/py-json/l3_cxprofile.py +++ b/py-json/l3_cxprofile.py @@ -2,7 +2,7 @@ import sys import os import importlib -from pprint import pprint +import pprint import csv import pandas as pd import time diff --git a/py-json/multicast_profile.py b/py-json/multicast_profile.py index faf43ad4..f3c18f8a 100644 --- a/py-json/multicast_profile.py +++ b/py-json/multicast_profile.py @@ -2,7 +2,7 @@ import sys import os import importlib -from pprint import pprint +import pprint sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) From 519985122584e2e3dbdf08098ad0c643b0e5f446 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Thu, 30 Sep 2021 22:02:50 -0700 Subject: [PATCH 054/731] example of how to monitor attenuator values for Nasir Makkiya Signed-off-by: Jed Reynolds --- py-scripts/sandbox/attenuator_mon.py | 198 +++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100755 py-scripts/sandbox/attenuator_mon.py diff --git a/py-scripts/sandbox/attenuator_mon.py b/py-scripts/sandbox/attenuator_mon.py new file mode 100755 index 00000000..de34207c --- /dev/null +++ b/py-scripts/sandbox/attenuator_mon.py @@ -0,0 +1,198 @@ +#!/usr/bin/env python3 +""" +NAME: attenuator_mon.py + +PURPOSE: example of a monitoring loop that notices when attenator values change + +EXAMPLE: + +NOTES: + + +""" +import sys + +if sys.version_info[0] != 3: + print("This script requires Python3") + exit() + +sys.path.insert(1, "../../py-json") +import argparse +import importlib +import os +from os.path import exists +import pprint +from time import sleep + + +sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) +lfcli_base = importlib.import_module('py-json.LANforge.lfcli_base') +LFCliBase = lfcli_base.LFCliBase +LFUtils = importlib.import_module('py-json.LANforge.LFUtils') +realm = importlib.import_module('py-json.realm') +Realm = realm.Realm + +lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") +LFCliBase = lfcli_base.LFCliBase + + +class AttenuatorMonitor(Realm): + def __init__(self, + host=None, + port=None, + action=None, + action_every_channel=False, + attenuator=None, + interval_sec: float = 1.0, + stop_file=None, + _deep_clean=False, + _debug_on=False, + _exit_on_error=False, + _exit_on_fail=False): + super().__init__(host, + port, + debug_=_debug_on, + _exit_on_fail=_exit_on_fail) + self.action = action + self.action_every_channel = action_every_channel + self.attenuator = attenuator + self.interval_sec = interval_sec + self.stop_file = stop_file + + self.prev_values = { + "module 1": 0.0, + "module 2": 0.0, + "module 3": 0.0, + "module 4": 0.0, + "module 5": 0.0, + "module 6": 0.0, + "module 7": 0.0, + "module 8": 0.0, + } + # check for attenuator + + response = self.json_get("/atten/list") + if "attenuator" not in response: + if "attenuators" not in response: + print("Unable to retrieve list of attenuators. Is a LANforge GUI at %s:%s ?" + % (host, port)) + exit(1) + + found = False + if "attenuator" in response: + if response["attenuator"]["entity id"] != self.attenuator: + print("Unable to find attenuator %s" % self.attenuator) + pprint.pprint(("reponse", response)) + exit(1) + else: + found = True + elif "attenuators" in response: + atten_list = response["attenuators"] + for atten_o in atten_list: + for key_1 in atten_o.keys(): + if atten_o[key_1]["entity id"] == self.attenuator: + found = True + else: + print("No attenators on system.") + exit(1) + if not found: + print("No matching attenuators found.") + exit(1) + + self.attenuator_url = "/atten/" + self.attenuator + + def run(self): + if self.stop_file is not None: + if exists(self.stop_file): + print("Stop File [%s] already exists. Remove file before starting script." % self.stop_file) + exit(0) + else: + print("No stop file provided. Stop this script with ctrl-c or kill") + + counter = 0; + while(True): + sleep(self.interval_sec) + if exists(self.stop_file): + return + num_changes = 0 + changes = {} + attenuator_values = self.json_get(self.attenuator_url) + z_old: float + z_new: float + + for key in self.prev_values.keys(): + + if key not in attenuator_values["attenuator"]: + pprint.pprint(attenuator_values["attenuator"]) + raise ValueError("Unexpected lack of keys for attenuator record:") + if self.debug: + print("I see: %s -> %s" % (self.prev_values[key], attenuator_values["attenuator"][key])) + + if "" == attenuator_values["attenuator"][key]: + continue + + z_old = float(self.prev_values[key]) + z_new = float(attenuator_values["attenuator"][key]) + + changes[key] = 0 + if z_old != z_new: + if (counter > 0) and self.action_every_channel: + self.do_cmd(channel=key, value=z_new) + else: + changes[key] = str(z_new) + num_changes += 1 + self.prev_values[key] = z_new + + if (counter > 0) and (num_changes > 0) and (not self.action_every_channel): + self.do_cmd(channel="all", + value=",".join(changes.values())) + if exists(self.stop_file): + return + counter += 1 + + def do_cmd(self, + channel=None, + value=None): + if not channel: + raise ValueError("do_cmd not given channel") + if not value: + raise ValueError("do_cmd not given value") + if not self.action: + raise ValueError("do_cmd lost self.action") + + pprint.pprint([("channel", channel), + ("values", value)]) + os.system(self.action) + +def main(): + parser = LFCliBase.create_bare_argparse( + prog=__file__, + formatter_class=argparse.RawTextHelpFormatter, + description=""" +""") + parser.add_argument('--action', help="command to execute when attenuator changes levels") + parser.add_argument('--action_every_channel', help="When True, do an action for every channel that changes") + parser.add_argument('--attenuator', help="attenuator entity id to watch; E.G.: 1.1.323") + parser.add_argument('--interval_sec', type=float, help="wait between checking") + parser.add_argument('--stop_file', help="when this file appears, exit; E.G.: /tmp/stop-monitoring") + + args = parser.parse_args() + + if (not args.action) or ("" == args.action): + print("--action is required; how about 'echo hi' ?") + exit(1) + attenuator_mon = AttenuatorMonitor(args.mgr, + args.mgr_port, + attenuator=args.attenuator, + action=args.action, + action_every_channel=args.action_every_channel, + interval_sec=args.interval_sec, + stop_file=args.stop_file, + _debug_on=False, + _exit_on_error=False, + _exit_on_fail=False) + attenuator_mon.run() + + +if __name__ == "__main__": + main() From 7e33f05fff79944acf9337af8d95feed2f589feb Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Fri, 1 Oct 2021 00:05:35 -0700 Subject: [PATCH 055/731] monitor_rvr.py created to demonstrate polling the status area at the bottom of a CV report Signed-off-by: Jed Reynolds --- py-scripts/sandbox/monitor_rvr.py | 244 ++++++++++++++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100755 py-scripts/sandbox/monitor_rvr.py diff --git a/py-scripts/sandbox/monitor_rvr.py b/py-scripts/sandbox/monitor_rvr.py new file mode 100755 index 00000000..2d1dd125 --- /dev/null +++ b/py-scripts/sandbox/monitor_rvr.py @@ -0,0 +1,244 @@ +#!/usr/bin/env python3 +# This script will set the LANforge to a BLANK database then it will load the specified database +# and start a graphical report +import sys +import os +import importlib +import argparse +from time import sleep +import pprint + +if sys.version_info[0] != 3: + print("This script requires Python 3") + exit(1) + + +sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) + +LFUtils = importlib.import_module("py-json.LANforge.LFUtils") +lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") +LFCliBase = lfcli_base.LFCliBase +realm = importlib.import_module("py-json.realm") +Realm = realm.Realm + +""" + cvScenario.scenario_db = args.scenario_db + if args.cv_test is not None: + cvScenario.cv_test = args.cv_test + if args.test_scenario is not None: + cvScenario.test_scenario = args.test_scenario +""" + +class RunCvScenario(LFCliBase): + def __init__(self, lfhost="localhost", lfport=8080, debug_=False, lanforge_db_=None, cv_scenario_=None, cv_test_=None, test_scenario_=None): + super().__init__( _lfjson_host=lfhost, _lfjson_port=lfport, _debug=debug_, _exit_on_error=True, _exit_on_fail=True) + self.lanforge_db = lanforge_db_ + self.cv_scenario = cv_scenario_ + self.cv_test = cv_test_ + self.test_profile = test_scenario_ + self.localrealm = Realm(lfclient_host=lfhost, lfclient_port=lfport, debug_=debug_) + self.report_name = None + + def get_report_file_name(self): + return self.report_name + + def build(self): + data = { + "name": "BLANK", + "action":"overwrite", + "clean_dut":"yes", + "clean_chambers": "yes" + } + self.json_post("/cli-json/load", data) + sleep(1) + port_counter = 0; + attempts = 6 + while (attempts > 0) and (port_counter > 0): + sleep(1) + attempts -= 1 + print("looking for ports like vap+") + port_list = self.localrealm.find_ports_like("vap+") + alias_map = LFUtils.portListToAliasMap(port_list) + port_counter = len(alias_map) + + port_list = self.localrealm.find_ports_like("sta+") + alias_map = LFUtils.portListToAliasMap(port_list) + port_counter += len(alias_map) + if port_counter == 0: + break + + if (port_counter != 0) and (attempts == 0): + print("There appears to be a vAP in this database, quitting.") + pprint(alias_map); + exit(1) + + data = { + "name": self.lanforge_db, + "action":"overwrite", + "clean_dut":"yes", + "clean_chambers": "yes" + } + self.json_post("/cli-json/load", data) + sleep(1) + self._pass("Loaded scenario %s" % self.lanforge_db, True) + return True + + def start(self, debug_=False): + # /gui_cli takes commands keyed on 'cmd', so we create an array of commands + commands = [ + "sleep 4", + "cv sync", + "sleep 4", + "cv apply '%s'" % self.cv_scenario, + "sleep 4", + "cv build", + "sleep 10", + "cv is_built", + "sleep 1", + "cv sync", + "sleep 5", + "cv create '%s' 'test_ref' 'true'" % self.cv_test, + "sleep 5", + "cv load test_ref '%s'" % self.test_profile, + "sleep 5", + "cv click test_ref 'Auto Save Report'", + "sleep 1", + "cv click test_ref Start", + "sleep 2", + "cv get test_ref progress_area", + "sleep 2", + "cv get test_ref progress_area", + "sleep 2", + "cv get test_ref progress_area", + "sleep 2", + "cv get test_ref progress_area", + "sleep 2", + "cv get test_ref progress_area", + "sleep 2", + "cv get test_ref progress_area", + "sleep 2", + "cv get test_ref progress_area", + "sleep 2", + "cv get test_ref progress_area", + "sleep 2", + "cv get test_ref progress_area", + "sleep 2", + "cv get test_ref progress_area", + "sleep 2", + "cv get test_ref progress_area", + "cv get test_ref 'Report Location:'", + "sleep 5", + #"cv click test_ref 'Save HTML'", + "cv click test_ref 'Close'", + "sleep 1", + "cv click test_ref Cancel", + "sleep 1", + "exit" + ] + response_json = [] + for command in commands: + data = { + "cmd": command + } + try: + debug_par = "" + if debug_: + debug_par="?_debug=1" + if command.endswith("is_built"): + print("Waiting for scenario to build...", end='') + self.localrealm.wait_while_building(debug_=False) + print("...proceeding") + elif command.startswith("sleep "): + nap = int(command.split(" ")[1]) + print("sleeping %d..." % nap) + sleep(nap) + print("...proceeding") + else: + response_json = [] + print("running %s..." % command, end='') + response = self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, response_json_list_=response_json) + if debug_ or command.startswith("cv get "): + LFUtils.debug_printer.pprint(response_json) + print("...proceeding") + + + except Exception as x: + print(x) + + self._pass("report finished", print_=True) + + + def stop(self): + pass + + def cleanup(self): + pass + + +def main(): + lfjson_host = "localhost" + lfjson_port = 8080 + parser = argparse.ArgumentParser( + prog="run_cv_scenario.py", + formatter_class=argparse.RawTextHelpFormatter, + description="""LANforge Reporting Script: Load a scenario and run a RvR report + Example: + ./load_ap_scenario.py --lfmgr 127.0.0.1 --scenario_db 'handsets' --cv_test --test_scenario 'test-20' + """) + parser.add_argument("-m", "--lfmgr", type=str, help="address of the LANforge GUI machine (localhost is default)") + parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") + parser.add_argument("-d", "--lanforge_db", type=str, help="Name of test scenario database (see Status Tab)") + parser.add_argument("-c", "--cv_scenario", type=str, help="Name of Chamber View test scenario (see CV Manage Scenarios)") + parser.add_argument("-n", "--cv_test", type=str, help="Chamber View test") + parser.add_argument("-s", "--test_profile", type=str, help="Name of the saved CV test profile") + parser.add_argument("--debug", help='Enable debugging', default=False, action="store_true") + + args = parser.parse_args() + if args.lfmgr is not None: + lfjson_host = args.lfmgr + if args.port is not None: + lfjson_port = args.port + debug = False + if args.debug is not None: + debug = args.debug + run_cv_scenario = RunCvScenario(lfjson_host, lfjson_port, debug_=debug) + + if args.lanforge_db is not None: + run_cv_scenario.lanforge_db = args.lanforge_db + if args.cv_scenario is not None: + run_cv_scenario.cv_scenario = args.cv_scenario + if args.cv_test is not None: + run_cv_scenario.cv_test = args.cv_test + if args.test_profile is not None: + run_cv_scenario.test_profile = args.test_profile + + if (run_cv_scenario.lanforge_db is None) or (run_cv_scenario.lanforge_db == ""): + raise ValueError("Please specificy scenario database name with --scenario_db") + + if not (run_cv_scenario.build() and run_cv_scenario.passes()): + print("scenario failed to build.") + print(run_cv_scenario.get_fail_message()) + exit(1) + + if not (run_cv_scenario.start() and run_cv_scenario.passes()): + print("scenario failed to start.") + print(run_cv_scenario.get_fail_message()) + exit(1) + + if not (run_cv_scenario.stop() and run_cv_scenario.passes()): + print("scenario failed to stop:") + print(run_cv_scenario.get_fail_message()) + exit(1) + + if not (run_cv_scenario.cleanup() and run_cv_scenario.passes()): + print("scenario failed to clean up:") + print(run_cv_scenario.get_fail_message()) + exit(1) + + report_file = run_cv_scenario.get_report_file_name() + print("Report file saved to "+report_file) +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +if __name__ == "__main__": + main() From 2bae23156cc4e1e7d1557d6e515a8533a20deb33 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 30 Sep 2021 17:15:52 -0600 Subject: [PATCH 056/731] lf_check.py : fixed funtion calls to loading databases Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 0d6e3269..3aab41e5 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -877,23 +877,23 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) if str(self.test_dict[test]['load_db']).lower() != "none" and str( self.test_dict[test]['load_db']).lower() != "skip": try: - self.load_custom_db(self.test_dict[test]['load_db']) + self.load_custom_database(self.test_dict[test]['load_db']) except: self.logger.info("custom database failed to load check existance and location: {}".format( self.test_dict[test]['load_db'])) else: self.logger.info("no load_db present in dictionary, load db normally") if self.use_factory_default_db == "TRUE": - self.load_factory_default_db() + self.load_FACTORY_DFLT_database() sleep(3) self.logger.info("FACTORY_DFLT loaded between tests with scenario.py --load FACTORY_DFLT") if self.use_blank_db == "TRUE": - self.load_blank_db() + self.load_BLANK_database() sleep(1) self.logger.info("BLANK loaded between tests with scenario.py --load BLANK") if self.use_custom_db == "TRUE": try: - self.load_custom_db(self.custom_db) + self.load_custom_database(self.custom_db) sleep(1) self.logger.info("{} loaded between tests with scenario.py --load {}".format(self.custom_db, self.custom_db)) From 556045bb2beacaf5024903bb7b177230b93cfc18 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 1 Oct 2021 08:34:57 -0600 Subject: [PATCH 057/731] lf_check.py : save logs and gather data on Timeout condition if possible Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 95 ++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 3aab41e5..5bda08d5 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -957,58 +957,59 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) # If collect meta data is set meta_data_path = "" - if self.test_result != "TIMEOUT": - stdout_log_size = os.path.getsize(stdout_log_txt) - if stdout_log_size > 0: - stdout_log_fd = open(stdout_log_txt) - #"Report Location:::/home/lanforge/html-reports/wifi-capacity-2021-08-17-04-02-56" - # - for line in stdout_log_fd: - if "Report Location" in line: - meta_data_path = line.replace('"','') - meta_data_path = meta_data_path.replace('Report Location:::','') - meta_data_path = meta_data_path.split('/')[-1] - meta_data_path = meta_data_path.strip() - meta_data_path = self.report_path + '/' + meta_data_path + '/meta.txt' - break - stdout_log_fd.close() - if meta_data_path != "": - meta_data_fd = open(meta_data_path,'w+') - meta_data_fd.write('$ Generated by Candela Technologies LANforge network testing tool\n') - meta_data_fd.write('$ meta.txt file location\n') - meta_data_fd.write("file {path}\n".format(path=meta_data_path)) - meta_data_fd.write('$ LANforge SERVER\n') - meta_data_fd.write('server_version: {server_version} \n'.format(server_version=self.lanforge_server_version)) - meta_data_fd.write('$ LANforge command\n') - meta_data_fd.write("command {command}\n".format(command=command)) - # split command at test-tag , at rest of string once at the actual test-tag value - test_tag = command.split('test_tag',maxsplit=1)[-1].split(maxsplit=1)[0] - test_tag = test_tag.replace("'","") - meta_data_fd.write('$ LANforge test_tag\n') - meta_data_fd.write("test_tag {test_tag}\n".format(test_tag=test_tag)) - # LANforge information is a list thus [0] - meta_data_fd.write('$ LANforge Information\n') - meta_data_fd.write("lanforge_system_node {lanforge_system_node}\n".format(lanforge_system_node=self.lanforge_system_node_version[0])) - meta_data_fd.write("lanforge_kernel_version {lanforge_kernel_version}\n".format(lanforge_kernel_version=self.lanforge_kernel_version[0])) - meta_data_fd.write("lanforge_server_version_full {lanforge_server_version_full}\n".format(lanforge_server_version_full=self.lanforge_server_version_full[0])) - meta_data_fd.close() + # Will gather data even on a TIMEOUT condition as there is some results on longer tests + stdout_log_size = os.path.getsize(stdout_log_txt) + if stdout_log_size > 0: + stdout_log_fd = open(stdout_log_txt) + #"Report Location:::/home/lanforge/html-reports/wifi-capacity-2021-08-17-04-02-56" + # + for line in stdout_log_fd: + if "Report Location" in line: + meta_data_path = line.replace('"','') + meta_data_path = meta_data_path.replace('Report Location:::','') + meta_data_path = meta_data_path.split('/')[-1] + meta_data_path = meta_data_path.strip() + meta_data_path = self.report_path + '/' + meta_data_path + '/meta.txt' + break + stdout_log_fd.close() + if meta_data_path != "": + meta_data_fd = open(meta_data_path,'w+') + meta_data_fd.write('$ Generated by Candela Technologies LANforge network testing tool\n') + meta_data_fd.write('$ meta.txt file location\n') + meta_data_fd.write("file {path}\n".format(path=meta_data_path)) + meta_data_fd.write('$ LANforge SERVER\n') + meta_data_fd.write('server_version: {server_version} \n'.format(server_version=self.lanforge_server_version)) + meta_data_fd.write('$ LANforge command\n') + meta_data_fd.write("command {command}\n".format(command=command)) + # split command at test-tag , at rest of string once at the actual test-tag value + test_tag = command.split('test_tag',maxsplit=1)[-1].split(maxsplit=1)[0] + test_tag = test_tag.replace("'","") + meta_data_fd.write('$ LANforge test_tag\n') + meta_data_fd.write("test_tag {test_tag}\n".format(test_tag=test_tag)) + # LANforge information is a list thus [0] + meta_data_fd.write('$ LANforge Information\n') + meta_data_fd.write("lanforge_system_node {lanforge_system_node}\n".format(lanforge_system_node=self.lanforge_system_node_version[0])) + meta_data_fd.write("lanforge_kernel_version {lanforge_kernel_version}\n".format(lanforge_kernel_version=self.lanforge_kernel_version[0])) + meta_data_fd.write("lanforge_server_version_full {lanforge_server_version_full}\n".format(lanforge_server_version_full=self.lanforge_server_version_full[0])) + meta_data_fd.close() - if self.test_result != "TIMEOUT": - stderr_log_size = os.path.getsize(stderr_log_txt) - if stderr_log_size > 0: - self.logger.info("File: {} is not empty: {}".format(stderr_log_txt, str(stderr_log_size))) - text = open(stderr_log_txt).read() - if 'Error' in text: - self.text_result = "Failure" - background = self.background_red - else: - self.test_result = "Success" - background = self.background_green + stderr_log_size = os.path.getsize(stderr_log_txt) + if stderr_log_size > 0: + self.logger.info("File: {} is not empty: {}".format(stderr_log_txt, str(stderr_log_size))) + text = open(stderr_log_txt).read() + if 'Error' in text: + self.text_result = "Failure" + background = self.background_red else: - self.logger.info("File: {} is empty: {}".format(stderr_log_txt, str(stderr_log_size))) self.test_result = "Success" background = self.background_green else: + self.logger.info("File: {} is empty: {}".format(stderr_log_txt, str(stderr_log_size))) + self.test_result = "Success" + background = self.background_green + + # if there was a + if self.test_result == "TIMEOUT": self.logger.info("TIMEOUT FAILURE, Check LANforge Radios") self.test_result = "Time Out" background = self.background_purple From d8fc439bd3fc5410c780ed60fc602a8ac0c6bd5e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 1 Oct 2021 08:54:09 -0700 Subject: [PATCH 058/731] regression test improvements Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 65 +++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 56c7dae5..8cb3715b 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -237,19 +237,19 @@ if [[ $HELP -eq 1 ]]; then ) elif [[ $MGRLEN -gt 0 ]]; then testCommands=( - #"./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" - #"./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug --mgr $MGR" + "./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" + "./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug --mgr $MGR" "./create_chamberview.py -m $MGR -cs \"regression_test\" \ --line \"Resource=1.1 Profile=STA-AC Amount=1 Uses-1 $RADIO_USED Freq=-1 DUT=TEST DUT_RADIO=$RADIO_USED Traffic=http\" \ --line \"Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=Test DUT_RADIO=$RADIO_USED Traffic=http\"" "./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ --ssid \"ssid_idx=0 ssid=\"$SSID_USED\" security=\"$SECURITY\" password=\"$PASSWD_USED\" bssid=04:f0:21:2c:41:84\"" "./create_l3.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR --endp_a wiphy0 --endp_b wiphy1" - #"./create_l3_stations.py --mgr $MGR --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug" - #"./create_l4.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - #"./create_macvlan.py --radio 1.$RADIO_USED --macvlan_parent eth1 --debug --mgr $MGR" - #"./create_qvlan.py --first_qvlan_ip 192.168.1.50 --mgr $MGR" - #"./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" + "./create_l3_stations.py --mgr $MGR --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug" + "./create_l4.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR" + "./create_macvlan.py --radio 1.$RADIO_USED --macvlan_parent eth1 --debug --mgr $MGR" + "./create_qvlan.py --first_qvlan_ip 192.168.1.50 --mgr $MGR" + "./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./create_vap.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./create_vr.py --mgr $MGR --vr_name 2.vr0 --ports 2.br0,2.vap2 --services 1.br0=dhcp,nat --services 1.vr0=radvd --debug" #./create_wanlink @@ -269,8 +269,8 @@ elif [[ $MGRLEN -gt 0 ]]; then #./grafana_profile #./html_template #./influx - #./layer3_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY - #./layer4_test --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY + "./layer3_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" + "./layer4_test --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" "./lf_ap_auto_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ --dut5_0 \"$DUT5 (2)\" --dut2_0 \"$DUT2 (1)\" --max_stations_2 100 --max_stations_5 100 --max_stations_dual 200 \ @@ -280,7 +280,7 @@ elif [[ $MGRLEN -gt 0 ]]; then --set \"Long-Term\" 0 --pull_report --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ --influx_bucket ben --influx_tag testbed Ferndale-01" - #./lf_atten_mod_test + "./lf_atten_mod_test.py -hst $MGR --debug" #./lf_csv #./lf_dataplane_config "./lf_dataplane_test.py --mgr $MGR --lf_user lanforge --lf_password lanforge \ @@ -293,19 +293,40 @@ elif [[ $MGRLEN -gt 0 ]]; then --influx_bucket ben \ --influx_tag testbed Ferndale-01" #./lf_dfs_test - #./lf_dut_sta_vap_test + #"./lf_dut_sta_vap_test.py " #"./lf_ftp.py --mgr $MGR --mgr_port 8080 --upstream_port $UPSTREAM --ssid $SSID --security $SECURITY --passwd $PASSWD_USED \ # --ap_name WAC505 --ap_ip 192.168.213.90 --bands Both --directions Download --twog_radio wiphy1 --fiveg_radio wiphy0 --file_size 2MB --num_stations 40 --Both_duration 1 --traffic_duration 2 --ssh_port 22_" #"./lf_ftp.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --bands 5G --direction Download \ # --file_size 2MB --num_stations 2" "./lf_graph.py --mgr $MGR" - "./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line 'selected_dut2 RootAP wactest $BSSID'" - #./lf_multipsk - #./lf_report - #./lf_report_test - #./lf_rvr_test - #./lf_rx_sensitivity_test.py - #./lf_sniff_radio + "./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line 'selected_dut2 RootAP wactest $BSSID' --debug" + #"./lf_multipsk.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --debug" + "./lf_report.py" + "./lf_report_test.py" + "./lf_rvr_test.py" + "./lf_rx_sensitivity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ + --instance_name rx-sensitivity-instance --config_name test_con --upstream 1.1.eth2 \ + --dut linksys-8450 --duration 15s --station 1.1.sta01500 \ + --download_speed 85% --upload_speed 0 \ + --raw_line 'txo_preamble: VHT' \ + --raw_line 'txo_mcs: 4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT' \ + --raw_line 'spatial_streams: 3' \ + --raw_line 'bandw_options: 80' \ + --raw_line 'txo_sgi: ON' \ + --raw_line 'txo_retries: No Retry' \ + --raw_line 'txo_txpower: 17' \ + --test_rig Testbed-01 --pull_report \ + --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ + --influx_bucket ben \ + --influx_tag testbed Ferndale-01" + "lf_sniff_radio.py + --mgr $MGR + --mgr_port 8080 + --outfile /home/lanforge/test_sniff.pcap + --duration 20 + --channel 52 + --radio_mode AUTO" #./lf_snp_test "./lf_tr398_test.py --mgr $MGR" #./lf_webpage @@ -334,10 +355,10 @@ elif [[ $MGRLEN -gt 0 ]]; then #test_1k_clients_jedtest.py #test_client_admission.py "./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 --test_duration 30s --mgr $MGR" # Better tested on Kelly, where VRF is turned off - "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug --mgr $MGR" - "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security $SECURITY --debug --mgr $MGR" - "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type iperf3 --debug --mgr $MGR" - "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfcurl --dest $TEST_HTTP_IP --file_output ${HOMEPATH}/Documents/lfcurl_output.txt --debug --mgr $MGR" + #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug --mgr $MGR" + #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security $SECURITY --debug --mgr $MGR" + #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type iperf3 --debug --mgr $MGR" + #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfcurl --dest $TEST_HTTP_IP --file_output ${HOMEPATH}/Documents/lfcurl_output.txt --debug --mgr $MGR" "./testgroup.py --group_name group1 --add_group --list_groups --debug --mgr $MGR" #testgroup_list_groups #testgroup_list_connections From b3cabba91348c3a087ea747afc79f4f4a5cf2836 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 1 Oct 2021 11:48:32 -0600 Subject: [PATCH 059/731] lf_report_test.py : added --help so import test would not produce output Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_report_test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/py-scripts/lf_report_test.py b/py-scripts/lf_report_test.py index 0923f1e9..15c1b597 100755 --- a/py-scripts/lf_report_test.py +++ b/py-scripts/lf_report_test.py @@ -26,6 +26,7 @@ import numpy as np import pandas as pd import pdfkit import random +import argparse sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) @@ -42,6 +43,17 @@ lf_horizontal_stacked_graph = lf_graph.lf_horizontal_stacked_graph # Unit Test if __name__ == "__main__": # Testing: generate data frame + + parser = argparse.ArgumentParser( + prog="lf_report_test.py", + formatter_class=argparse.RawTextHelpFormatter, + description="Tests reporting library") + parser.add_argument('--lfmgr', help='sample argument: where LANforge GUI is running', default='localhost') + # the args parser is not really used , this is so the report is not generated when testing + # the imports with --help + args = parser.parse_args() + print("LANforge manager {lfmgr}".format(lfmgr=args.lfmgr)) + dataframe = pd.DataFrame({ 'product': ['CT521a-264-1ac-1n', 'CT521a-1ac-1ax', 'CT522-264-1ac2-1n', 'CT523c-2ac2-db-10g-cu', 'CT523c-3ac2-db-10g-cu', 'CT523c-8ax-ac10g-cu', 'CT523c-192-2ac2-1ac-10g'], From 2ddf6e10a95fc22af62f2ca7e6e514c100b6376f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 1 Oct 2021 11:54:51 -0600 Subject: [PATCH 060/731] lf_report.py : added args parser so the import test with --help will not produce output Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_report.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/py-scripts/lf_report.py b/py-scripts/lf_report.py index 182c2efa..d717ad2a 100755 --- a/py-scripts/lf_report.py +++ b/py-scripts/lf_report.py @@ -31,6 +31,7 @@ import datetime import pandas as pd import pdfkit +import argparse # internal candela references included during intial phases, to be deleted at future date # https://candelatech.atlassian.net/wiki/spaces/LANFORGE/pages/372703360/Scripting+Data+Collection+March+2021 @@ -41,14 +42,14 @@ class lf_report(): _path = "/home/lanforge/html-reports", _alt_path = "", _date = "", - _title="LANForge Test Run Heading", + _title="LANForge Unit Test Run Heading", _table_title="LANForge Table Heading", _graph_title="LANForge Graph Title", _obj = "", _obj_title = "", _output_html="outfile.html", _output_pdf="outfile.pdf", - _results_dir_name = "LANforge_Test_Results", + _results_dir_name = "LANforge_Test_Results_Unit_Test", _output_format = 'html', # pass in on the write functionality, current not used _dataframe="", _path_date_time="", @@ -559,6 +560,16 @@ function copyTextToClipboard(ele) { # Unit Test if __name__ == "__main__": + parser = argparse.ArgumentParser( + prog="lf_report.py", + formatter_class=argparse.RawTextHelpFormatter, + description="Reporting library Unit Test") + parser.add_argument('--lfmgr', help='sample argument: where LANforge GUI is running', default='localhost') + # the args parser is not really used , this is so the report is not generated when testing + # the imports with --help + args = parser.parse_args() + print("LANforge manager {lfmgr}".format(lfmgr=args.lfmgr)) + # Testing: generate data frame dataframe = pd.DataFrame({ From ad188af0ba7d31ab075f81ed3ce3140a7cd0ccd8 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Fri, 1 Oct 2021 15:23:35 -0700 Subject: [PATCH 061/731] run_cv_scenario.py: adds more timing and refresh logic Use the refresh() method between loading databases to force updates of text blobs, DUTs and profiles. Look for last-updated times so as to not wait overly long for text blobs to update. Adds more cv sync calls to make sure that CV has gotten refreshed. Signed-off-by: Jed Reynolds --- py-scripts/run_cv_scenario.py | 107 ++++++++++++++++++++++++++++++---- 1 file changed, 96 insertions(+), 11 deletions(-) diff --git a/py-scripts/run_cv_scenario.py b/py-scripts/run_cv_scenario.py index 5e931b6a..d87345fd 100755 --- a/py-scripts/run_cv_scenario.py +++ b/py-scripts/run_cv_scenario.py @@ -1,12 +1,13 @@ #!/usr/bin/env python3 # This script will set the LANforge to a BLANK database then it will load the specified database # and start a graphical report -import sys -import os -import importlib import argparse -from time import sleep +import importlib +import os import pprint +import sys +import time +from time import sleep if sys.version_info[0] != 3: print("This script requires Python 3") @@ -38,6 +39,7 @@ class RunCvScenario(LFCliBase): self.test_profile = test_scenario_ self.localrealm = Realm(lfclient_host=lfhost, lfclient_port=lfport, debug_=debug_) self.report_name = None + self.load_timeout_sec = 2 * 60 def get_report_file_name(self): return self.report_name @@ -50,7 +52,8 @@ class RunCvScenario(LFCliBase): "clean_chambers": "yes" } self.json_post("/cli-json/load", data) - sleep(1) + self.refresh() + port_counter = 0; attempts = 6 while (attempts > 0) and (port_counter > 0): @@ -79,25 +82,107 @@ class RunCvScenario(LFCliBase): "clean_chambers": "yes" } self.json_post("/cli-json/load", data) - sleep(1) + self.refresh() self._pass("Loaded scenario %s" % self.lanforge_db, True) return True + def refresh(self): + events_response = self.json_get("/events/last") + if "event" not in events_response: + raise ValueError("Unable to find last event") + if "id" not in events_response["event"]: + pprint.pprint(events_response["event"]) + raise ValueError("bad event format") + previous_event_id = events_response["event"]["id"] + + # check for scenario (db) load message + begin_time: int = round(time.time() * 1000) + load_completed = False + while not load_completed: + if time.time() > (begin_time + self.load_timeout_sec): + print("Unable to load database within %d sec" % self.load_timeout_sec) + exit(1) + events_response = self.json_get("/events/since/%s" % previous_event_id) + if "events" not in events_response: + pprint.pprint(("events response", events_response)) + raise ValueError("incorrect events response") + for event_o in events_response["events"]: + if load_completed: + break + for (key, record) in event_o.items(): + if "event description" not in record: + continue + if not record["event description"]: + continue + if record["event description"].startswith("LOAD COMPLETED at "): + print("load completed: %s " % record["event description"]) + load_completed = True + break + if not load_completed: + sleep(1) + + blobs_last_updated = begin_time + status_response = self.json_get("/") + if "text_records_last_updated_ms" in status_response: + blobs_last_updated = int(status_response["text_records_last_updated_ms"]) + #print("*** blobs updated at %d" % blobs_last_updated) + else: + begin_time = round(time.time() * 1000) + print("no text_records_last_updated_ms, using %d " % begin_time) + # next we will want to sync our text blobs up + self.json_post("/cli-json/show_text_blob", { + "type": "ALL", + "name": "ALL" + }) + + load_completed = False + while not load_completed: + sleep(1) + if time.time() > (begin_time + (6 * 1000)): + print("waited %d sec for text blobs to update" % self.load_timeout_sec) + load_completed = True + break + status_response = self.json_get("/") + if "text_records_last_updated_ms" in status_response: + updated = int(status_response["text_records_last_updated_ms"]) + print(", , , , , , , , , updated at %d" % updated) + if updated > blobs_last_updated: + load_completed = True + break + else: + pprint.pprint(status_response) + self.json_post("/cli-json/show_text_blob", { + "type": "ALL", + "name": "ALL" + }) + delta: int = (time.time() * 1000) - begin_time + print("blobs loaded in %d ms" % delta) + + # next show duts + self.json_post("/cli-json/show_dut", {"name": "ALL"}) + self.json_post("/cli-json/show_profile", {"name": "ALL"}) + self.json_post("/cli-json/show_traffic_profile", {"name": "ALL"}) + sleep(5) + + def start(self, debug_=False): # /gui_cli takes commands keyed on 'cmd', so we create an array of commands commands = [ + "cv sync", + "sleep 4", "cv apply '%s'" % self.cv_scenario, + "sleep 4", "cv build", "sleep 4", "cv is_built", "cv sync", - "sleep 2", + "sleep 4", "cv create '%s' 'test_ref' 'true'" % self.cv_test, - "sleep 2", - "cv load test_ref '%s'" % self.test_profile, - "sleep 1", - "cv click test_ref 'Auto Save Report'", "sleep 5", + "cv load test_ref '%s'" % self.test_profile, + "sleep 5", + "cv click test_ref 'Auto Save Report'", + "sleep 1", "cv click test_ref Start", "sleep 60", "cv get test_ref 'Report Location:'", From 6ca62926cbc00123b0456757214dc5a26e387555 Mon Sep 17 00:00:00 2001 From: erinnerim Date: Sun, 3 Oct 2021 16:06:26 -0700 Subject: [PATCH 062/731] delete old (extra) py-scripts/create_wanlink.py --- py-scripts/create_wanlink.py | 314 ----------------------------------- 1 file changed, 314 deletions(-) delete mode 100755 py-scripts/create_wanlink.py diff --git a/py-scripts/create_wanlink.py b/py-scripts/create_wanlink.py deleted file mode 100755 index 40c20e3e..00000000 --- a/py-scripts/create_wanlink.py +++ /dev/null @@ -1,314 +0,0 @@ -#!/usr/bin/python3 -""" - - 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: Erin Grimes - -""" -import sys - -if sys.version_info[0] != 3: - print("This script requires Python 3") - exit(1) - - - - -from time import sleep -import urllib -import pprint - -sys.path.append("../py-json") -from LANforge import LFRequest -from LANforge import LFUtils -from LANforge.lfcli_base import LFCliBase - -j_printer = pprint.PrettyPrinter(indent=2) -# todo: this needs to change -resource_id = 1 - - -def main(): - parser = LFCliBase.create_basic_argparse() - args = parser.parse_args() - base_url = 'http://%s:%s' % (args.mgr, args.mgr_port) - print(base_url) - json_post = "" - json_response = "" - num_wanlinks = -1 - - # force a refresh on the ports and wanlinks - lf_r = LFRequest.LFRequest(base_url+"/cli-json/nc_show_ports", debug_=True) - lf_r.addPostData({ - "shelf": 1, - "resource": 1, - "port": "all", - }) - json_response = lf_r.jsonPost(debug=True) - - lf_r = LFRequest.LFRequest(base_url+"/cli-json/nc_show_endpoints", debug_=True) - lf_r.addPostData({ - "endpoint": "all" - }) - json_response = lf_r.jsonPost(debug=True) - - sleep(1) - - # see if there are old wanlinks to remove - lf_r = LFRequest.LFRequest(base_url+"/wl_ep/list", debug_=True) - json_reponse = lf_r.get_as_json() - - endpA = args['name']+"-A" - endpB = args['name']+"-B" - - # count the number of wanlink endpoints - if "endpoint" in json_response: - endpoint_map = LFUtils.list_to_alias_map(json_list=json_reponse, from_element="endpoint") - if endpA in endpoint_map: - num_wanlinks += 1 - if endpB in endpoint_map: - num_wanlinks += 1 - - # remove old wanlinks - if (num_wanlinks > 0): - print("Removing old wanlinks...") - lf_r = LFRequest.LFRequest(base_url+"/cli-json/rm_cx", debug_=True) - lf_r.addPostData({ - 'test_mgr': 'all', - 'cx_name': args['name'] - }) - lf_r.jsonPost() - - lf_r = LFRequest.LFRequest(base_url+"/cli-json/rm_endp", debug_=True) - lf_r.addPostData({ - 'endp_name': endpA - }) - lf_r.jsonPost() - - lf_r = LFRequest.LFRequest(base_url+"/cli-json/rm_endp", debug_=True) - lf_r.addPostData({ - 'endp_name': endpB - }) - lf_r.jsonPost() - sleep(1) - - # check to see if we have ports - lf_r = LFRequest.LFRequest(base_url+"/ports/1/1/list", debug_=True) - port_response = lf_r.getAsJson() - - if "interfaces" not in port_response: - print("No interfaces in port_response!") - pprint.pprint(port_response) - exit(1) - - if "interfaces" in port_response: - port_map = LFUtils.list_to_alias_map(json_list=port_response, from_element="interfaces") - ports_created = 0 - if args["port_A"] not in port_map: - lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_rdd", debug_=True) - lf_r.addPostData({ - "shelf": 1, - "resource": 1, - "port": args["port_A"], - "peer_ifname": args["port_A"]+"b", - }) - json_reponse = lf_r.jsonPost(debug=True) - if not json_response: - print("could not create port "+args["port_A"]) - exit(1) - sleep(0.1) - ports_created += 1 - if args["port_B"] not in port_map: - lf_r.addPostData({ - "shelf": 1, - "resource": 1, - "port": args["port_B"], - "peer_ifname": args["port_B"]+"b", - }) - json_reponse = lf_r.jsonPost(debug=True) - if not json_response: - print("could not create port " + args["port_B"]) - exit(1) - ports_created += 1 - sleep(0.1) - if ports_created > 0: - LFUtils.wait_until_ports_appear(base_url=base_url, - port_list=(args["port_A"], args["port_B"]), - debug=True) - print("Created {} ports".format(ports_created)) - - # create wanlink endpoint A - print("Adding WL Endpoints...", end='') - lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_wl_endp", debug_=True) - lf_r.addPostData({ - 'alias': endpA, - 'shelf': 1, - 'resource': '1', - 'port': args['port_A'], - 'latency': args['latency_A'], - 'max_rate': args['rate_A'], - }) - json_response = lf_r.jsonPost(debug=True) - if not json_response: - print("Unable to create "+endpA) - else: - print("A, ", end='') - # create wanlink endpoint B - lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_wl_endp", debug_=True) - lf_r.addPostData({ - 'alias': endpB, - 'shelf': 1, - 'resource': '1', - 'port': args['port_B'], - 'latency': args['latency_B'], - 'max_rate': args['rate_B'], - }) - json_response = lf_r.jsonPost() - if not json_response: - print("Unable to create "+endpB) - else: - print("B") - sleep(1) - - # create cx - lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_cx", debug_=True) - lf_r.addPostData({ - 'alias': args['name'], - 'test_mgr': 'default_tm', - 'tx_endp': endpA, - 'rx_endp': endpB - }) - lf_r.jsonPost(debug=True) - sleep(0.5) - - # modify wanlink endpoint A - lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_wanlink_info", debug_=True) - lf_r.addPostData({ - 'name': endpA, - 'max_jitter': args['jitter_A'], - 'jitter_freq': args['jitter_freq_A'], - 'drop_freq': args['drop_A'] - }) - lf_r.jsonPost(debug=True) - - # modify wanlink endpoint B - lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_wanlink_info", debug_=True) - lf_r.addPostData({ - 'name': endpB, - 'max_jitter': args['jitter_B'], - 'jitter_freq': args['jitter_freq_B'], - 'drop_freq': args['drop_B'] - }) - lf_r.jsonPost() - - # start wanlink once we see it - seen = 0 - print("Looking for {} and {}: ".format(endpA, endpB), end='') - while (seen < 2): - sleep(1) - lf_r = LFRequest.LFRequest(base_url+"/wl_ep/list?fields=name,eid") - try: - json_response = lf_r.getAsJson() - if json_response is None: - print(".", end="") - continue - LFUtils.debug_printer.pprint(json_response) - if "endpoint" not in json_response: - print("-", end="") - continue - - endpoint_map = LFUtils.list_to_alias_map(json_list=json_response["endpoint"], - from_element="endpoint") - if endpA in endpoint_map: - seen += 1 - print("+", end="") - if endpB in endpoint_map: - seen += 1 - print("+", end="") - - except urllib.error.HTTPError as error: - print("Error code {}".format(error.code)) - continue - print("") - print("Starting wanlink:") - # print("the latency is {laten}".format(laten=latency)) - lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state") - lf_r.addPostData({ - 'test_mgr': 'all', - 'cx_name': args['name'], - 'cx_state': 'RUNNING' - }) - lf_r.jsonPost() - - running = 0 - while (running < 1): - sleep(1) - lf_r = LFRequest.LFRequest(base_url+"/wl/"+args['name']+"?fields=name,state,_links") - try: - json_response = lf_r.getAsJson() - if (json_response is None): - continue - for key, value in json_response.items(): - if (isinstance(value, dict)): - if ("_links" in value): - if (value["name"] == args['name']): - if (value["state"].startswith("Run")): - LFUtils.debug_printer.pprint(json_response) - running = 1 - - except urllib.error.HTTPError as error: - print("Error code {}".format(error.code)) - continue - - print("Wanlink is running") - - # stop wanlink - lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state") - lf_r.addPostData({ - 'test_mgr': 'all', - 'cx_name': args['name'], - 'cx_state': 'STOPPED' - }) - lf_r.jsonPost() - running = 1 - while (running > 0): - sleep(1) - lf_r = LFRequest.LFRequest(base_url+"/wl/"+args['name']+"?fields=name,eid,state,_links") - LFUtils.debug_printer.pprint(json_response) - try: - json_response = lf_r.getAsJson() - if (json_response is None): - continue - for key, value in json_response.items(): - if (isinstance(value, dict)): - if ("_links" in value): - if (value["name"] == args['name']): - if (value["state"].startswith("Stop")): - LFUtils.debug_printer.pprint(json_response) - running = 0 - - except urllib.error.HTTPError as error: - print("Error code {}".format(error.code)) - continue - - print("Wanlink is stopped.") - - # print("Wanlink info:") - # lf_r = LFRequest.LFRequest(base_url+"/wl/wl_eg1") - # json_response = lf_r.getAsJson() - # LFUtils.debug_printer.pprint(json_response) - - # lf_r = LFRequest.LFRequest(base_url+"/wl_ep/wl_eg1-A") - # json_response = lf_r.getAsJson() - # LFUtils.debug_printer.pprint(json_response) - - # lf_r = LFRequest.LFRequest(base_url+"/wl_ep/wl_eg1-B") - # json_response = lf_r.getAsJson() - # LFUtils.debug_printer.pprint(json_response) - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -if __name__ == '__main__': - main() From c222700775c905ac84604a9e9a25a207617e0d45 Mon Sep 17 00:00:00 2001 From: erinnerim Date: Sun, 3 Oct 2021 16:33:10 -0700 Subject: [PATCH 063/731] implement CLI for create_wanlink.py --- py-json/create_wanlink.py | 77 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/py-json/create_wanlink.py b/py-json/create_wanlink.py index fab6c0bb..def24bef 100755 --- a/py-json/create_wanlink.py +++ b/py-json/create_wanlink.py @@ -2,6 +2,12 @@ # 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: Erin Grimes + +""" +sample command: +./test_wanlink.py --name my_wanlink4 --latency_A 20 --latency_B 69 --rate 1000 --jitter_A 53 --jitter_B 73 --jitter_freq 6 --drop_A 12 --drop_B 11 +""" + import sys import urllib import importlib @@ -13,19 +19,23 @@ import os from time import sleep from urllib import error import pprint +import argparse sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFRequest = importlib.import_module("py-json.LANforge.LFRequest") LFUtils = importlib.import_module("py-json.LANforge.LFUtils") +lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") +LFCliBase = lfcli_base.LFCliBase j_printer = pprint.PrettyPrinter(indent=2) # todo: this needs to change resource_id = 1 -def main(base_url, args={}): +def main(args={}): + base_url = 'http://'+args['host']+':8080' print(base_url) json_post = "" json_response = "" @@ -235,4 +245,67 @@ def main(base_url, args={}): if __name__ == '__main__': - main() + parser = LFCliBase.create_basic_argparse( + prog='test_wanlink.py', + formatter_class=argparse.RawTextHelpFormatter) + for group in parser._action_groups: + if group.title == "required arguments": + required_args = group + break + + optional_args = None + for group in parser._action_groups: + if group.title == "optional arguments": + optional_args = group + break + if optional_args is not None: + optional_args.add_argument('--host', help='The resource IP address', default="localhost") + optional_args.add_argument('--port_A', help='Endpoint A', default="eth1") + optional_args.add_argument('--port_B', help='Endpoint B', default="eth2") + optional_args.add_argument('--name', help='The name of the wanlink', default="wl_eg1") + optional_args.add_argument('--rate', help='The maximum rate of transfer at both endpoints (bits/s)', default=1000000) + optional_args.add_argument('--rate_A', help='The max rate of transfer at endpoint A (bits/s)', default=None) + optional_args.add_argument('--rate_B', help='The maximum rate of transfer (bits/s)', default=None) + optional_args.add_argument('--latency', help='The delay of both ports', default=20) + optional_args.add_argument('--latency_A', help='The delay of port A', default=None) + optional_args.add_argument('--latency_B', help='The delay of port B', default=None) + optional_args.add_argument('--jitter', help='The max jitter of both ports (ms)', default=None) + optional_args.add_argument('--jitter_A', help='The max jitter of port A (ms)', default=None) + optional_args.add_argument('--jitter_B', help='The max jitter of port B (ms)', default=None) + optional_args.add_argument('--jitter_freq', help='The jitter frequency of both ports (%%)', default=None) + optional_args.add_argument('--jitter_freq_A', help='The jitter frequency of port A (%%)', default=None) + optional_args.add_argument('--jitter_freq_B', help='The jitter frequency of port B (%%)', default=None) + optional_args.add_argument('--drop', help='The drop frequency of both ports (%%)', default=None) + optional_args.add_argument('--drop_A', help='The drop frequency of port A (%%)', default=None) + optional_args.add_argument('--drop_B', help='The drop frequency of port B (%%)', default=None) + # todo: packet loss A and B + # todo: jitter A and B + for group in parser._action_groups: + if group.title == "optional arguments": + optional_args = group + break + parseargs = parser.parse_args() + args = { + "host": parseargs.mgr, + "port": parseargs.mgr_port, + "name": parseargs.name, + "port_A": parseargs.port_A, + "port_B": parseargs.port_B, + "latency": parseargs.latency, + "latency_A": (parseargs.latency_A if parseargs.latency_A is not None else parseargs.latency), + "latency_B": (parseargs.latency_B if parseargs.latency_B is not None else parseargs.latency), + "rate": (parseargs.rate), + "rate_A": (parseargs.rate_A if parseargs.rate_A is not None else parseargs.rate), + "rate_B": (parseargs.rate_B if parseargs.rate_B is not None else parseargs.rate), + "jitter": (parseargs.jitter), + "jitter_A": (parseargs.jitter_A if parseargs.jitter_A is not None else parseargs.jitter), + "jitter_B": (parseargs.jitter_B if parseargs.jitter_B is not None else parseargs.jitter), + "jitter_freq": (parseargs.jitter), + "jitter_freq_A": (parseargs.jitter_freq_A if parseargs.jitter_freq_A is not None else parseargs.jitter_freq), + "jitter_freq_B": (parseargs.jitter_freq_B if parseargs.jitter_freq_B is not None else parseargs.jitter_freq), + "drop": (parseargs.drop), + "drop_A": (parseargs.drop_A if parseargs.drop_A is not None else parseargs.drop), + "drop_B": (parseargs.drop_B if parseargs.drop_B is not None else parseargs.drop), + } + + main(args) From d3d3af77f53ef7ca190b345eac1c05499c348f5d Mon Sep 17 00:00:00 2001 From: erinnerim Date: Sun, 3 Oct 2021 16:36:20 -0700 Subject: [PATCH 064/731] create_wanlink.py typo in parser: prog --- py-json/create_wanlink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/create_wanlink.py b/py-json/create_wanlink.py index def24bef..d53a1a1d 100755 --- a/py-json/create_wanlink.py +++ b/py-json/create_wanlink.py @@ -246,7 +246,7 @@ def main(args={}): if __name__ == '__main__': parser = LFCliBase.create_basic_argparse( - prog='test_wanlink.py', + prog='create_wanlink.py', formatter_class=argparse.RawTextHelpFormatter) for group in parser._action_groups: if group.title == "required arguments": From 8f2fa4bf8c82c6040170dd2acee1a9fb8b57c7d9 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 4 Oct 2021 11:48:42 -0700 Subject: [PATCH 065/731] * We don't need to import LFUtils in lfcli_base * local_realm in lf_attenmod is unused. * local_realm in attenuator_profile is unused, because I'm switching to inheritance as part of my work eliminating redundancy. Signed-off-by: Matthew Stidham --- py-json/LANforge/lfcli_base.py | 6 +++--- py-json/lf_attenmod.py | 25 +++++++++++++------------ py-json/qvlan_profile.py | 1 + py-json/realm.py | 4 +++- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 62a6f0f0..5f901716 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -19,7 +19,7 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) -LFUtils = importlib.import_module("py-json.LANforge.LFUtils") +debug_printer = pprint.PrettyPrinter(indent=2) LFRequest = importlib.import_module("py-json.LANforge.LFRequest") @@ -205,7 +205,7 @@ class LFCliBase: lf_r.addPostData(_data) if debug_: - LFUtils.debug_printer.pprint(_data) + debug_printer.pprint(_data) json_response = lf_r.json_post(show_error=debug_, debug=debug_, response_json_list_=response_json_list_, @@ -243,7 +243,7 @@ class LFCliBase: die_on_error_=self.exit_on_error) lf_r.addPostData(_data) if debug_: - LFUtils.debug_printer.pprint(_data) + debug_printer.pprint(_data) json_response = lf_r.json_put(show_error=self.debug, debug=debug_, response_json_list_=response_json_list_, diff --git a/py-json/lf_attenmod.py b/py-json/lf_attenmod.py index c0b5bb1c..f9652453 100644 --- a/py-json/lf_attenmod.py +++ b/py-json/lf_attenmod.py @@ -14,9 +14,8 @@ LFUtils = importlib.import_module("py-json.LANforge.LFUtils") class ATTENUATORProfile(LFCliBase): - def __init__(self, lfclient_host, lfclient_port, local_realm, debug_=False): + def __init__(self, lfclient_host, lfclient_port, debug_=False): super().__init__(lfclient_host, lfclient_port, debug_) - self.local_realm = local_realm self.lfclient_host = lfclient_host self.COMMANDS = ["show_attenuators", "set_attenuator"] self.atten_serno = "" @@ -34,6 +33,7 @@ class ATTENUATORProfile(LFCliBase): "pulse_count": None, "pulse_time_ms": None } + self.debug = debug_ def set_command_param(self, command_name, param_name, param_value): # we have to check what the param name is @@ -46,7 +46,7 @@ class ATTENUATORProfile(LFCliBase): if command_name == "set_attenuator": self.atten_data[param_name] = param_value - def show(self, debug=False): + def show(self): print("Show Attenuators.........") response = self.json_get("/attenuators/") time.sleep(0.01) @@ -54,25 +54,26 @@ class ATTENUATORProfile(LFCliBase): print(response) raise ValueError("Cannot find any endpoints") else: - attenuator_resp = response["attenuator"] - for key, val in attenuator_resp.items(): - if key == "entity id": - serial_num = val.split(".") - print("Serial-num : %s" % serial_num[-1]) + attenuator_resp = response["attenuators"] + for attenuator in attenuator_resp: + for key, val in attenuator.items(): + if key == "entity id": + serial_num = val.split(".") + print("Serial-num : %s" % serial_num[-1]) print("%s : %s" % (key, val)) print("\n") - def create(self, debug=False): - if len(self.atten_serno) == 0 or len(self.atten_idx) == 0 or len(self.atten_val) == 0: + def create(self): + if type(self.atten_serno) == str or len(self.atten_idx) == 0 or type(self.atten_val) == str: print("ERROR: Must specify atten_serno, atten_idx, and atten_val when setting attenuator.\n") print("Setting Attenuator...") self.set_command_param("set_attenuator", "serno", self.atten_serno) self.set_command_param("set_attenuator", "atten_idx", self.atten_idx) self.set_command_param("set_attenuator", "val", self.atten_val) - set_attenuators = LFRequest.LFRequest(self.lfclient_url + "/cli-json/set_attenuator", debug_=debug) + set_attenuators = LFRequest.LFRequest(self.lfclient_url + "/cli-json/set_attenuator", debug_=self.debug) set_attenuators.addPostData(self.atten_data) time.sleep(0.01) - json_response = set_attenuators.jsonPost(debug) + json_response = set_attenuators.jsonPost(self.debug) time.sleep(10) print("\n") diff --git a/py-json/qvlan_profile.py b/py-json/qvlan_profile.py index e2b8bbe6..0f344591 100644 --- a/py-json/qvlan_profile.py +++ b/py-json/qvlan_profile.py @@ -12,6 +12,7 @@ lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") LFCliBase = lfcli_base.LFCliBase LFRequest = importlib.import_module("py-json.LANforge.LFRequest") LFUtils = importlib.import_module("py-json.LANforge.LFUtils") +set_port = importlib.import_module("py-json.LANforge.set_port") class QVLANProfile(LFCliBase): diff --git a/py-json/realm.py b/py-json/realm.py index e7fd8290..2d67ef3a 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -447,6 +447,8 @@ class Realm(LFCliBase): return not wait_more + #def wait_until_database_loaded(self): + # Returns map of all stations with port+type == WIFI-STATION # Key is the EID, value is the map of key/values for the port values. def station_map(self): @@ -893,7 +895,7 @@ class Realm(LFCliBase): return cx_prof def new_attenuator_profile(self, ver=1): if ver == 1: - atten_prof = ATTENUATORProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) + atten_prof = ATTENUATORProfile(self.lfclient_host, self.lfclient_port, debug_=self.debug) return atten_prof def new_generic_endp_profile(self, ver=1): if ver == 1 : From 097d2f42f55401b7420e995ef465bad8ba84161f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 4 Oct 2021 11:51:02 -0700 Subject: [PATCH 066/731] Improving py-scripts files to fix errors with regression test updating to_pip.sh Signed-off-by: Matthew Stidham --- py-scripts/create_qvlan.py | 2 +- py-scripts/layer3_test.py | 48 +++---- py-scripts/lf_atten_mod_test.py | 11 +- py-scripts/lf_multipsk.py | 63 +++++---- py-scripts/lf_rx_sensitivity_test.py | 0 py-scripts/regression_test.sh | 144 +++++---------------- py-scripts/rvr_scenario.py | 2 +- py-scripts/scenario.py | 186 ++++++++++++++++++++------- py-scripts/tools/lf_check.py | 2 +- to_pip.sh | 6 +- 10 files changed, 235 insertions(+), 229 deletions(-) mode change 100644 => 100755 py-scripts/lf_rx_sensitivity_test.py diff --git a/py-scripts/create_qvlan.py b/py-scripts/create_qvlan.py index 7eaeb90d..771a02ea 100755 --- a/py-scripts/create_qvlan.py +++ b/py-scripts/create_qvlan.py @@ -68,7 +68,7 @@ def main(): --------------------- Generic command ''') parser.add_argument('--radio', help='radio EID, e.g: 1.wiphy2') - parser.add_argument('--qvlan_parent', help='specifies parent port for qvlan creation', default=None) + parser.add_argument('--qvlan_parent', help='specifies parent port for qvlan creation', default=None, required=True) parser.add_argument('--first_port', help='specifies name of first port to be used', default=None) parser.add_argument('--num_ports', help='number of ports to create', default=1) parser.add_argument('--first_qvlan_ip', help='specifies first static ip address to be used or dhcp', default=None) diff --git a/py-scripts/layer3_test.py b/py-scripts/layer3_test.py index 6199babf..89df5101 100755 --- a/py-scripts/layer3_test.py +++ b/py-scripts/layer3_test.py @@ -14,18 +14,20 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") -lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") -LFCliBase = lfcli_base.LFCliBase realm = importlib.import_module("py-json.realm") Realm = realm.Realm -class Layer3Test(LFCliBase): +class Layer3Test(Realm): def __init__(self, lfclient_host="localhost", lfclient_port=8080, radio="wiphy1", sta_prefix="sta", start_id=0, num_sta=2, dut_ssid="lexusdut", dut_security="open", dut_passwd="[BLANK]", upstream="eth1", name_prefix="L3Test", - traffic_type="lf_udp",side_a_speed="0M", side_b_speed="10M", session_id="Layer3Test", duration="1m",_debug_on=False, _exit_on_error=False, _exit_on_fail=False): - super().__init__(lfclient_host, lfclient_port, _debug=_debug_on, _exit_on_fail=_exit_on_fail) + traffic_type="lf_udp", + side_a_min_rate=256000, side_a_max_rate=0, + side_b_min_rate=256000, side_b_max_rate=0, + session_id="Layer3Test", duration="1m", + _debug_on=False, _exit_on_error=False, _exit_on_fail=False): + super().__init__(lfclient_host=lfclient_host, lfclient_port=lfclient_port, debug_=_debug_on, _exit_on_fail=_exit_on_fail) print("Test is about to start") self.host = lfclient_host self.port = lfclient_port @@ -42,29 +44,27 @@ class Layer3Test(LFCliBase): self.password = dut_passwd self.session_id = session_id self.traffic_type = traffic_type - self.side_a_speed = side_a_speed - self.side_b_speed = side_b_speed - self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port) - self.station_profile = self.local_realm.new_station_profile() - self.cx_profile = self.local_realm.new_l3_cx_profile() + self.station_profile = self.new_station_profile() + self.cx_profile = self.new_l3_cx_profile() self.cx_profile.host = self.host self.cx_profile.port = self.port self.cx_profile.name_prefix = self.name_prefix - self.cx_profile.side_a_min_bps = self.local_realm.parse_speed(self.side_a_speed) - self.cx_profile.side_a_max_bps = self.local_realm.parse_speed(self.side_a_speed) - self.cx_profile.side_b_min_bps = self.local_realm.parse_speed(self.side_b_speed) - self.cx_profile.side_b_max_bps = self.local_realm.parse_speed(self.side_b_speed) + 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_b_min_bps = side_b_min_rate + self.cx_profile.side_b_max_bps = side_b_max_rate print("Test is Initialized") def precleanup(self): print("precleanup started") - self.station_list = LFUtils.portNameSeries(prefix_=self.sta_prefix, start_id_=self.sta_start_id, end_id_=self.num_sta - 1, padding_number_=10000, radio=self.radio) + self.station_list = LFUtils.portNameSeries(prefix_=self.sta_prefix, start_id_=self.sta_start_id, + end_id_=self.num_sta - 1, padding_number_=10000, radio=self.radio) self.cx_profile.cleanup_prefix() for sta in self.station_list: - self.local_realm.rm_port(sta, check_exists=True) + self.rm_port(sta, check_exists=True) time.sleep(1) self.cx_profile.cleanup() @@ -81,8 +81,9 @@ class Layer3Test(LFCliBase): 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=self.radio, sta_names_=self.station_list, debug=self.debug) - self.local_realm.wait_until_ports_appear(sta_list=self.station_list) - self.cx_profile.create(endp_type=self.traffic_type, side_a=self.station_profile.station_names, side_b=self.upstream, sleep_time=0) + self.wait_until_ports_appear(sta_list=self.station_list) + self.cx_profile.create(endp_type=self.traffic_type, side_a=self.station_profile.station_names, + side_b=self.upstream, sleep_time=0) print("Test Build done") pass @@ -92,7 +93,7 @@ class Layer3Test(LFCliBase): self.station_profile.admin_up() temp_stas = self.station_profile.station_names.copy() temp_stas.append(self.upstream) - if (self.local_realm.wait_for_ip(temp_stas)): + if self.wait_for_ip(temp_stas): self._pass("All stations got IPs", print_pass) else: self._fail("Stations failed to get IPs", print_fail) @@ -101,13 +102,13 @@ class Layer3Test(LFCliBase): try: for i in self.cx_profile.get_cx_names(): self.cx_names.append(i) - while self.local_realm.json_get("/cx/" + i).get(i).get('state') != 'Run': + while self.json_get("/cx/" + i).get(i).get('state') != 'Run': continue except Exception as e: pass print("Test Started") self.cur_time = datetime.datetime.now() - self.end_time = self.local_realm.parse_time(self.test_duration) + self.cur_time + self.end_time = self.parse_time(self.test_duration) + self.cur_time print(self.end_time-self.cur_time) self.start_monitor() pass @@ -137,7 +138,7 @@ class Layer3Test(LFCliBase): def main(): # This has --mgr, --mgr_port and --debug - parser = LFCliBase.create_basic_argparse( + parser = Realm.create_basic_argparse( prog="layer3_test.py", formatter_class=argparse.RawTextHelpFormatter, epilog="About This Script") @@ -156,7 +157,8 @@ def main(): obj = Layer3Test(lfclient_host=args.mgr, lfclient_port=args.mgr_port, duration=args.test_duration, session_id=args.session_id, traffic_type=args.traffic_type, - dut_ssid=args.ssid, dut_passwd=args.passwd, dut_security=args.security, num_sta=args.num_client, side_a_speed=args.side_a_min_speed, side_b_speed=args.side_b_min_speed, radio=args.radio) + dut_ssid=args.ssid, dut_passwd=args.passwd, dut_security=args.security, num_sta=args.num_client, + side_a_min_rate=args.side_a_min_speed, side_b_min_rate=args.side_b_min_speed, radio=args.radio,_debug_on=args.debug) obj.precleanup() obj.build() obj.start() diff --git a/py-scripts/lf_atten_mod_test.py b/py-scripts/lf_atten_mod_test.py index 9a7e91d5..d6badd26 100755 --- a/py-scripts/lf_atten_mod_test.py +++ b/py-scripts/lf_atten_mod_test.py @@ -30,25 +30,22 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) -lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") -LFCliBase = lfcli_base.LFCliBase -LFUtils = importlib.import_module("py-json.LANforge.LFUtils") realm = importlib.import_module("py-json.realm") Realm = realm.Realm -class CreateAttenuator(LFCliBase): +class CreateAttenuator(Realm): def __init__(self, host, port, serno, idx, val, _debug_on=False, _exit_on_error=False, _exit_on_fail=False): - super().__init__(host, port, _local_realm=realm.Realm(host, port), _debug=_debug_on, _exit_on_fail=_exit_on_fail) + super().__init__(host, port, debug_=_debug_on, _exit_on_fail=_exit_on_fail) self.host = host self.port = port self.serno = serno self.idx = idx self.val = val - self.attenuator_profile = self.local_realm.new_attenuator_profile() + self.attenuator_profile = self.new_attenuator_profile() self.attenuator_profile.atten_idx = self.idx self.attenuator_profile.atten_val = self.val self.attenuator_profile.atten_serno = self.serno @@ -58,7 +55,7 @@ class CreateAttenuator(LFCliBase): self.attenuator_profile.show() def main(): - parser = LFCliBase.create_basic_argparse( + parser = Realm.create_basic_argparse( prog='lf_atten_mod_test.py', formatter_class=argparse.RawTextHelpFormatter, epilog=None, diff --git a/py-scripts/lf_multipsk.py b/py-scripts/lf_multipsk.py index 298247e8..accf11c4 100755 --- a/py-scripts/lf_multipsk.py +++ b/py-scripts/lf_multipsk.py @@ -45,7 +45,7 @@ Realm = realm.Realm class MultiPsk(Realm): def __init__(self, host=None, - port=None, + port=8080, ssid=None, input=None, security=None, @@ -57,8 +57,10 @@ class MultiPsk(Realm): sta_prefix="sta", debug_=False, ): - self.host = host - self.port = port + super().__init__(lfclient_host=host, + lfclient_port=port), + self.lfclient_host = host + self.lfclient_port = port self.ssid = ssid self.input = input self.security = security @@ -69,8 +71,7 @@ class MultiPsk(Realm): self.resource = resource self.sta_prefix = sta_prefix self.debug = debug_ - self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port) - self.station_profile = self.local_realm.new_station_profile() + self.station_profile = self.new_station_profile() def build(self): station_list = [] @@ -84,30 +85,30 @@ class MultiPsk(Realm): else: station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=self.start_id, end_id_=input['num_station'] - 1, padding_number_=100, - radio=input['radio']) + radio=self.radio) # implementation for non vlan pending **** print("creating stations") - self.station_profile.use_security(self.security, self.ssid, str(input['password'])) + self.station_profile.use_security(self.security, self.ssid, self.passwd) 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=input['radio'], sta_names_=station_list, debug=self.local_realm.debug) - self.local_realm.wait_until_ports_appear(sta_list=station_list) + self.station_profile.create(radio=self.radio, sta_names_=station_list, debug=self.debug) + self.wait_until_ports_appear(sta_list=station_list) self.station_profile.admin_up() - if self.local_realm.wait_for_ip(station_list, timeout_sec=120): + if self.wait_for_ip(station_list, timeout_sec=120): print("All stations got IPs") else: print("Stations failed to get IPs") print("create udp endp") - self.cx_profile_udp = self.local_realm.new_l3_cx_profile() + self.cx_profile_udp = self.new_l3_cx_profile() self.cx_profile_udp.side_a_min_bps = 128000 self.cx_profile_udp.side_b_min_bps = 128000 self.cx_profile_udp.side_a_min_pdu = 1200 self.cx_profile_udp.side_b_min_pdu = 1500 self.cx_profile_udp.report_timer = 1000 self.cx_profile_udp.name_prefix = "udp" - port_list = list(self.local_realm.find_ports_like("%s+" % self.sta_prefix)) + port_list = list(self.find_ports_like("%s+" % self.sta_prefix)) # print("port list", port_list) if (port_list is None) or (len(port_list) < 1): raise ValueError("Unable to find ports named '%s'+" % self.sta_prefix) @@ -118,13 +119,13 @@ class MultiPsk(Realm): # Create TCP endpoints print("create tcp endp") - self.l3_tcp_profile = self.local_realm.new_l3_cx_profile() + self.l3_tcp_profile = self.new_l3_cx_profile() self.l3_tcp_profile.side_a_min_bps = 128000 self.l3_tcp_profile.side_b_min_bps = 56000 self.l3_tcp_profile.name_prefix = "tcp" self.l3_tcp_profile.report_timer = 1000 self.l3_tcp_profile.create(endp_type="lf_tcp", - side_a=list(self.local_realm.find_ports_like("%s+" % self.sta_prefix)), + side_a=list(self.find_ports_like("%s+" % self.sta_prefix)), side_b="%d.%s" % (self.resource, input['upstream']), suppress_related_commands=True) @@ -140,7 +141,7 @@ class MultiPsk(Realm): if "." in i['upstream']: # print(str(i['upstream']) + " is a vlan upstream port") print("checking its ip ..") - data = self.local_realm.json_get("ports/list?fields=IP") + data = self.json_get("ports/list?fields=IP") for val in data["interfaces"]: for j in val: if "1." + str(self.resource) + "." + str(i['upstream']) == j: @@ -157,7 +158,7 @@ class MultiPsk(Realm): if "." not in i['upstream']: # print(str(i['upstream']) + " is not an vlan upstream port") print("checking its ip ..") - data = self.local_realm.json_get("ports/list?fields=IP") + data = self.json_get("ports/list?fields=IP") for val in data["interfaces"]: for j in val: if "1." + str(self.resource) + "." + str(i['upstream']) == j: @@ -168,11 +169,8 @@ class MultiPsk(Realm): return non_vlan_ips def get_sta_ip(self): - # this function gives station ip dict eg{'eth2.100': '172.17.0.100'} - # self.input = [{'password': 'lanforge1', 'upstream': 'eth2.100', 'mac': '', 'num_station': 1, 'radio': 'wiphy4'}, {'password': 'lanforge2', 'upstream': 'eth2.200', 'mac': '', 'num_station': 1, 'radio': 'wiphy4'}, {'password': 'lanforge3', 'upstream': 'eth2', 'mac': '', 'num_station': 1, 'radio': 'wiphy0'}] - # port_list = ['1.1.sta200', '1.1.sta00', '1.1.sta100'] station_ip = {} - port_list = list(self.local_realm.find_ports_like("%s+" % self.sta_prefix)) + port_list = list(self.find_ports_like("%s+" % self.sta_prefix)) # print("port list", port_list) # port list ['1.1.sta200', '1.1.sta00', '1.1.sta100'] for name, id in zip(port_list, self.input): @@ -182,7 +180,7 @@ class MultiPsk(Realm): # print(x) if name == "1." + str(self.resource) + ".sta" + str(x): - data = self.local_realm.json_get("ports/list?fields=IP") + data = self.json_get("ports/list?fields=IP") for i in data["interfaces"]: # print(i) for j in i: @@ -227,7 +225,7 @@ class MultiPsk(Realm): # print(x) if name == "1." + str(self.resource) + ".sta" + str(x): - data = self.local_realm.json_get("ports/list?fields=IP") + data = self.json_get("ports/list?fields=IP") for i in data["interfaces"]: # print(i) for j in i: @@ -241,7 +239,7 @@ class MultiPsk(Realm): def get_non_vlan_sta_ip(self): station_nonvlan_ip = {} x = "" - port_list = list(self.local_realm.find_ports_like("%s+" % self.sta_prefix)) + port_list = list(self.find_ports_like("%s+" % self.sta_prefix)) # print("port list", port_list) for id in self.input: if "." not in id['upstream']: @@ -249,7 +247,7 @@ class MultiPsk(Realm): # print(x) for name in port_list: if name == "1.1.sta00": - data = self.local_realm.json_get("ports/list?fields=IP") + data = self.json_get("ports/list?fields=IP") for i in data["interfaces"]: # print(i) for j in i: @@ -312,27 +310,21 @@ class MultiPsk(Realm): self.cx_profile_udp.cleanup() self.l3_tcp_profile.cleanup() self.station_profile.cleanup() - LFUtils.wait_until_ports_disappear(base_url=self.local_realm.lfclient_url, port_list=self.station_profile.station_names, + LFUtils.wait_until_ports_disappear(base_url=self.lfclient_host, port_list=self.station_profile.station_names, debug=self.debug) print("Test Completed") def main(): - parser = argparse.ArgumentParser( + parser = Realm.create_basic_argparse( prog="lf_multipsk.py", formatter_class=argparse.RawTextHelpFormatter, description="lanforge webpage download Test Script") - parser.add_argument('--mgr', help='hostname for where LANforge GUI is running', default='localhost') - parser.add_argument('--mgr_port', help='port LANforge GUI HTTP service is running on', default=8080) - parser.add_argument('--ssid', help='WiFi SSID for client to associate to') - parser.add_argument('--security', help='WiFi Security protocol: {open|wep|wpa2|wpa3', default="wpa2") - parser.add_argument('--mode', help="specify mode of ap eg BRIDGE or NAT", default="BRIDGE") parser.add_argument('--n_vlan', help="type number of vlan using in test eg 1 or 2", default=1) - # parser.add_argument('--input', nargs="+", help="specify list of parameters like passwords,upstream,mac address, number of clients and radio as input, eg password@123,eth2.100,"",1,wiphy0 lanforge@123,eth2.100,"",1,wiphy1") args = parser.parse_args() input_data = [{ - "password": "lanforge1", + "password": args.passwd, "upstream": "eth2.100", "mac": "", "num_station": 1, @@ -364,8 +356,11 @@ def main(): multi_obj = MultiPsk(host=args.mgr, port=args.mgr_port, ssid=args.ssid, + passwd=args.passwd, input=input_data, - security=args.security) + security=args.security, + debug_=args.debug, + radio=args.radio) multi_obj.build() multi_obj.start() diff --git a/py-scripts/lf_rx_sensitivity_test.py b/py-scripts/lf_rx_sensitivity_test.py old mode 100644 new mode 100755 diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 8cb3715b..9fe96ec4 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -57,7 +57,7 @@ while getopts ":h:s:p:w:m:A:r:F:B:U:D:H:" option; do DUT2=${OPTARG} ;; H) - HELP=1 + ./lf_help_check.bash ;; *) @@ -142,100 +142,8 @@ function testgroup_delete_group() { ./testgroup.py --group_name group1 --add_group --add_cx cx0000,cx0001,cx0002 --remove_cx cx0003 ./testgroup.py --group_name group1--del_group --debug --mgr "$MGR" } -if [[ $HELP -eq 1 ]]; then - testCommands=( - "./create_bond.py --help --mgr $MGR" - "./create_bridge.py --help --mgr $MGR" - "./create_chamberview.py --help -m $MGR" - "./create_chamberview_dut.py --help --lfmgr $MGR" - "./create_l3.py --help --mgr $MGR" - "./create_l4.py --help --mgr $MGR" - "./create_macvlan.py --help --mgr $MGR" - "./create_qvlan.py --help --mgr $MGR" - "./create_station.py --help --mgr $MGR" - "./create_vap.py --help --mgr $MGR" - "./create_vr.py --help --mgr $MGR" - "./create_wanlink.py --help --mgr $MGR" - "./csv_convert.py --help --mgr $MGR" - "./csv_processor.py --help --mgr $MGR" - "./csv_to_grafana.py --help --mgr $MGR" - "./csv_to_influx.py --help --mgr $MGR" - "./cv_manager.py --help --mgr $MGR" - "./cv_to_grafana.py --help --mgr $MGR" - "./docstrings.py --help --mgr $MGR" - "./event_breaker --help --mgr $MGR" - "./event_flood --help --mgr $MGR" - "./example_security_connection.py --help --mgr $MGR" - "./ftp_html.py --help --mgr $MGR" - "./ghost_profile.py --help --mgr $MGR" - "./grafana_profile.py --help --mgr $MGR" - "./html_template.py --help --mgr $MGR" - "./influx.py --help --mgr $MGR" - "./layer3_test.py --help --mgr $MGR" - "./layer4_test.py --help --mgr $MGR" - "./lf_ap_auto_test.py --help --mgr $MGR" - "./lf_atten_mod_test.py --help --mgr $MGR" - "./lf_csv.py --help --mgr $MGR" - "./lf_dataplane_config.py --help --mgr $MGR" - "./lf_dataplane_test.py --help --mgr $MGR" - "./lf_dfs_test.py --help --mgr $MGR" - "./lf_dut_sta_vap_test.py --help --mgr $MGR" - "./lf_ftp.py --help --mgr $MGR" - "./lf_ftp_test.py --help --mgr $MGR" - "./lf_graph.py --help --mgr $MGR" - "./lf_mesh_test.py --help --mgr $MGR" - "./lf_multipsk.py --help --mgr $MGR" - "./lf_report.py --help --mgr $MGR" - "./lf_report_test.py --help --mgr $MGR" - "./lf_rvr_test.py --help --mgr $MGR" - "./lf_rx_sensitivity_test.py --help --mgr $MGR" - "./lf_sniff_radio.py --help --mgr $MGR" - "./lf_snp_test.py -0-help --mgr $MGR" - "./lf_tr398_test.py --help --mgr $MGR" - "./lf_webpage.py --help --mgr $MGR" - "./lf_wifi_capacity_test.py --help --mgr $MGR" - "./measure_station_time_up.py --help --mgr $MGR" - "./modify_station.py --help --mgr $MGR" - "./modify_vap.py --help --mgr $MGR" - "./recordinflux.py --help --mgr $MGR" - "./run_cv_scenario.py --help --mgr $MGR" - "./rvr_scenario.py --help --mgr $MGR" - "./scenario.py --help --mgr $MGR" - "./sta_connect.py --help --mgr $MGR" - "./sta_connect2.py --help --mgr $MGR" - "./sta_connect_bssid_mac.py --help --mgr $MGR" - "./sta_connect_example.py --help --mgr $MGR" - "./sta_connect_multi_example.py --help --mgr $MGR" - "./sta_scan_test.py --help --mgr $MGR" - "./station_layer3.py --help --mgr $MGR" - "./stations_connected.py --help --mgr $MGR" - "./test_1k_clients_jedtest.py --help --mgr $MGR" - "./test_client_admission.py --help --mgr $MGR" - "./test_fileio.py --help --mgr $MGR" - "./test_generic.py --help --mgr $MGR" - "./test_ip_connection.py --help --mgr $MGR" - "./test_ip_variable_time.py --help --mgr $MGR" - "./test_ipv4_ps.py --help --mgr $MGR" - "./test_ipv4_ttls.py --help --mgr $MGR" - "./test_l3_WAN_LAN.py --help --mgr $MGR" - "./test_l3_longevity.py --help --mgr $MGR" - "./test_l3_scenario_throughput.py -h -m $MGR" - "./test_l3_unicast_traffic_gen.py --help --mgr $MGR" - "./test_l4.py --help --mgr $MGR" - "./test_status_msg.py --help --mgr $MGR" - "./test_wanlink.py --help --mgr $MGR" - "./test_wpa_passphrases.py --help --mgr $MGR" - "./testgroup.py --help --mgr $MGR" - "./testgroup2.py --help --mgr $MGR" - "./testgroup_delete_group --mgr $MGR" - "./testgroup_list_connections --help --mgr $MGR" - "./testgroup_list_groups.py --help --mgr $MGR" - "./tip_station_powersave.py --help --mgr $MGR" - "./video_rates.py --help --mgr $MGR" - "./wlan_capacity_calculator.py -h --mgr $MGR" - "./ws_generic_monitor_test.py --help --mgr $MGR" - ) -elif [[ $MGRLEN -gt 0 ]]; then + +if [[ $MGRLEN -gt 0 ]]; then testCommands=( "./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" "./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug --mgr $MGR" @@ -248,7 +156,7 @@ elif [[ $MGRLEN -gt 0 ]]; then "./create_l3_stations.py --mgr $MGR --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug" "./create_l4.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./create_macvlan.py --radio 1.$RADIO_USED --macvlan_parent eth1 --debug --mgr $MGR" - "./create_qvlan.py --first_qvlan_ip 192.168.1.50 --mgr $MGR" + "./create_qvlan.py --first_qvlan_ip 192.168.1.50 --mgr $MGR --qvlan_parent eth1" "./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./create_vap.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./create_vr.py --mgr $MGR --vr_name 2.vr0 --ports 2.br0,2.vap2 --services 1.br0=dhcp,nat --services 1.vr0=radvd --debug" @@ -270,7 +178,7 @@ elif [[ $MGRLEN -gt 0 ]]; then #./html_template #./influx "./layer3_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" - "./layer4_test --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" + "./layer4_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" "./lf_ap_auto_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ --dut5_0 \"$DUT5 (2)\" --dut2_0 \"$DUT2 (1)\" --max_stations_2 100 --max_stations_5 100 --max_stations_dual 200 \ @@ -299,7 +207,7 @@ elif [[ $MGRLEN -gt 0 ]]; then #"./lf_ftp.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --bands 5G --direction Download \ # --file_size 2MB --num_stations 2" "./lf_graph.py --mgr $MGR" - "./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line 'selected_dut2 RootAP wactest $BSSID' --debug" + "./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line 'selected_dut2 RootAP wactest $BSSID'" #"./lf_multipsk.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --debug" "./lf_report.py" "./lf_report_test.py" @@ -320,7 +228,7 @@ elif [[ $MGRLEN -gt 0 ]]; then --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ --influx_bucket ben \ --influx_tag testbed Ferndale-01" - "lf_sniff_radio.py + "./lf_sniff_radio.py --mgr $MGR --mgr_port 8080 --outfile /home/lanforge/test_sniff.pcap @@ -337,22 +245,40 @@ elif [[ $MGRLEN -gt 0 ]]; then #--influx_host c7-graphana --influx_port 8086 --influx_org Candela \ #--influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ #--influx_bucket ben \ - #measure_station_time_up.py - #modify_station.py - #modify_vap.py + #"./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --debug --report_file measure_station_time_up.txt" + "./modify_station.py + --radio $RADIO_USED + --station 1.1.sta0000 + --security $SECURITY + --ssid $SSID_USED + --passwd $PASSWD_USED + --enable_flag osen_enable + --disable_flag ht160_enable + --debug" + "./modify_vap.py --radio $RADIO_USED --vap 1.1.vap0000 --security $SECURITY -ssid $SSID_USED \ + --passwd $PASSWD_USED --enable_flag osen_enable --disable_flag ht160_enable --debug" #recordinflux.py - #run_cv_scenario.py - #rvr_scenario.py + "./load_ap_scenario.py --lfmgr $MGR --scenario_db 'handsets' --cv_test --test_scenario 'test-20'" + "./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test --test_scenario 'test-20'" #scenario.py - #sta_connect2.py - #sta_connect_bssid_mac.py + #"./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C" + #./sta_connect_bssid_mac.py #sta_connect_example.py #sta_connect_multi_example.py #sta_connect.py - #sta_scan_test.py + "./sta_scan_test.py --ssid $SSID --security $SECURITY --passwd $PASSWD_USED --radio $RADIO_USED" #station_layer3.py #stations_connected.py - #test_1k_clients_jedtest.py + #"./test_1k_clients_jedtest.py + # --mgr $MGR + # --mgr_port 8080 + # --sta_per_radio 300 + # --test_duration 3m + # --a_min 1000 + # --b_min 1000 + # --a_max 0 + # --b_max 0 + # --debug" #test_client_admission.py "./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 --test_duration 30s --mgr $MGR" # Better tested on Kelly, where VRF is turned off #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug --mgr $MGR" @@ -369,7 +295,7 @@ elif [[ $MGRLEN -gt 0 ]]; then #"./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" "./test_ip_connection.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --ipv6" #"./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" - #./test_ipv4_ps + "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" #./test_ipv4_ttls "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_udp lf_tcp' --upstream_port 1.1.$UPSTREAM \ --radio \"radio==1.1.wiphy0 stations==10 ssid==ASUS_70 ssid_pw==[BLANK] security==open\" \ diff --git a/py-scripts/rvr_scenario.py b/py-scripts/rvr_scenario.py index 45d09daa..80b666af 100755 --- a/py-scripts/rvr_scenario.py +++ b/py-scripts/rvr_scenario.py @@ -163,7 +163,7 @@ def main(): formatter_class=argparse.RawTextHelpFormatter, description="""LANforge Reporting Script: Load a scenario and run a RvR report Example: -./load_ap_scenario.py --lfmgr 127.0.0.1 --lanforge_db 'handsets' --cv_test --test_scenario 'test-20' +./rvr_scenario.py --lfmgr 127.0.0.1 --lanforge_db 'handsets' --cv_test --test_scenario 'test-20' """) parser.add_argument("-m", "--lfmgr", type=str, help="address of the LANforge GUI machine (localhost is default)") diff --git a/py-scripts/scenario.py b/py-scripts/scenario.py index 418de7a8..c1df589d 100755 --- a/py-scripts/scenario.py +++ b/py-scripts/scenario.py @@ -3,12 +3,12 @@ import sys import os import importlib import argparse +import time if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -18,63 +18,151 @@ realm = importlib.import_module("py-json.realm") Realm = realm.Realm -parser = LFCliBase.create_bare_argparse( - prog='scenario.py', - formatter_class=argparse.RawTextHelpFormatter, - epilog='''Load a database file and control test groups\n''', - description='''scenario.py --------------------- -Generic command example: -scenario.py --load db1 --action overwrite --clean_dut --clean_chambers +def get_events(event_log, value): + results = [] + for event in event_log: + try: + results.append(list(event.values())[0][value]) + except: + pass + return results -scenario.py --start test_group1 -scenario.py --quiesce test_group1 +def find_new_events(original, new): + new_times = list() + new_events = list() + original_times = get_events(original['events'], 'time-stamp') + current_times = get_events(new['events'], 'time-stamp') + for x in current_times: + if x not in original_times: + new_times.append(x) + for x in new['events']: + if list(x.values())[0]['time-stamp'] in new_times: + new_events.append(x) + return new_events -scenario.py --stop test_group1 -''') -group = parser.add_mutually_exclusive_group() +class LoadScenario(Realm): + def __init__(self, + mgr='localhost', + mgr_port=8080, + scenario=None, + action='overwrite', + clean_dut=True, + clean_chambers=True, + start=None, + stop=None, + quiesce=None, + timeout=120, + debug=False): + super().__init__(lfclient_host=mgr, + lfclient_port=mgr_port, + debug_=debug) + self.mgr = mgr + self.scenario = scenario + self.action = action + self.clean_dut = clean_dut + self.clean_chambers = clean_chambers + self.start = start + self.stop = stop + self.quiesce = quiesce + self.timeout = timeout -parser.add_argument('--load', help='name of database to load', default=None) + starting_events = self.json_get('/events/since=time/1h') -parser.add_argument('--action', help='action to take with database {overwrite | append}', default="overwrite") + if self.scenario is not None: + data = { + "name": self.scenario, + "action": self.action, + "clean_dut": "no", + "clean_chambers": "no" + } + if self.clean_dut: + data['clean_dut'] = "yes" + if self.clean_chambers: + data['clean_chambers'] = "yes" + print("Loading database %s" % self.scenario) + self.json_post("/cli-json/load", data) -parser.add_argument('--clean_dut', - help='use to cleanup DUT will be when overwrite is selected, otherwise they will be kept', - action="store_true") -parser.add_argument('--clean_chambers', - help='use to cleanup Chambers will be when overwrite is selected, otherwise they will be kept', - action="store_true") + elif self.start is not None: + print("Starting test group %s..." % self.start) + self.json_post("/cli-json/start_group", {"name": self.start}) + elif self.stop is not None: + print("Stopping test group %s..." % self.stop) + self.json_post("/cli-json/stop_group", {"name": self.stop}) + elif self.quiesce is not None: + print("Quiescing test group %s..." % self.quiesce) + self.json_post("/cli-json/quiesce_group", {"name": self.quiesce}) -group.add_argument('--start', help='name of test group to start', default=None) -group.add_argument('--quiesce', help='name of test group to quiesce', default=None) -group.add_argument('--stop', help='name of test group to stop', default=None) -args = parser.parse_args() + completed = False + timer = 0 + while not completed: + current_events = self.json_get('/events/since=time/1h') + new_events = find_new_events(starting_events, current_events) + if 'LOAD-DB: Load attempt has been completed.' in get_events(new_events, 'event description'): + completed = True + print('Scenario %s fully loaded after %s seconds' % (self.scenario, timer)) + else: + timer += 1 + time.sleep(1) + if timer > self.timeout: + completed = True + print('Scenario failed to load after 120 seconds') + else: + print('Waiting %s out of %s seconds to load scenario %s' % (timer, self.timeout, self.scenario)) -local_realm = realm.Realm(lfclient_host=args.mgr, lfclient_port=args.mgr_port, debug_=args.debug) -if args.load is not None: - data = { - "name": args.load, - "action": args.action, - "clean_dut": "no", - "clean_chambers": "no" - } - if args.clean_dut: - data['clean_dut'] = "yes" - if args.clean_chambers: - data['clean_chambers'] = "yes" - print("Loading database %s" % args.load) - local_realm.json_post("/cli-json/load", data) +def main(): + parser = LFCliBase.create_bare_argparse( + prog='scenario.py', + formatter_class=argparse.RawTextHelpFormatter, + epilog='''Load a database file and control test groups\n''', + description='''scenario.py + -------------------- + Generic command example: + scenario.py --load db1 --action overwrite --clean_dut --clean_chambers + + scenario.py --start test_group1 + + scenario.py --quiesce test_group1 + + scenario.py --stop test_group1 + ''') -elif args.start is not None: - print("Starting test group %s..." % args.start) - local_realm.json_post("/cli-json/start_group", {"name": args.start}) -elif args.stop is not None: - print("Stopping test group %s..." % args.stop) - local_realm.json_post("/cli-json/stop_group", {"name": args.stop}) -elif args.quiesce is not None: - print("Quiescing test group %s..." % args.quiesce) - local_realm.json_post("/cli-json/quiesce_group", {"name": args.quiesce}) + group = parser.add_mutually_exclusive_group() + + parser.add_argument('--load', help='name of database to load', default=None) + + parser.add_argument('--action', help='action to take with database {overwrite | append}', default="overwrite") + + parser.add_argument('--clean_dut', + help='use to cleanup DUT will be when overwrite is selected, otherwise they will be kept', + action="store_true") + + parser.add_argument('--clean_chambers', + help='use to cleanup Chambers will be when overwrite is selected, otherwise they will be kept', + action="store_true") + + group.add_argument('--start', help='name of test group to start', default=None) + group.add_argument('--quiesce', help='name of test group to quiesce', default=None) + group.add_argument('--stop', help='name of test group to stop', default=None) + parser.add_argument('--timeout', help='Stop trying to load scenario after this many seconds', default=120) + args = parser.parse_args() + + LoadScenario(mgr=args.mgr, + scenario=args.load, + action=args.action, + clean_dut=args.clean_dut, + clean_chambers=args.clean_chambers, + start=args.start, + stop=args.stop, + quiesce=args.quiesce, + timeout=args.timeout, + debug=args.debug) + + # LoadScenario.scenario() + + +if __name__ == '__main__': + main() diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 5bda08d5..6f0e6b36 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -715,7 +715,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) # no spaces after FACTORY_DFLT command = "./{} {}".format("scenario.py", "--load FACTORY_DFLT") - process = subprocess.Popen((command).split(' '), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + process = subprocess.Popen(command.split(' '), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) # wait for the process to terminate out, err = process.communicate() diff --git a/to_pip.sh b/to_pip.sh index 6dca63d4..f2c4aced 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -92,11 +92,9 @@ from .csv_convert import CSVParcer from .csv_processor import L3CSVParcer from .csv_to_influx import CSVtoInflux from .csv_to_grafana import UseGrafana -from .download_test import DownloadTest from .event_breaker import EventBreaker from .event_flood import EventBreaker as EventFlood from .example_security_connection import IPv4Test -from .ghost_profile import UseGhost from .grafana_profile import UseGrafana from .influx import RecordInflux from .layer3_test import Layer3Test @@ -107,7 +105,6 @@ from .lf_csv import lf_csv, lf_kpi_csv from .lf_dataplane_test import DataplaneTest from .lf_dfs_test import FileAdapter, CreateCtlr, L3VariableTime from .lf_dut_sta_vap_test import Login_DUT, LoadScenario, CreateSTA_CX -from .lf_ftp_test import ftp_test from .lf_ftp import FtpTest from .lf_graph import lf_bar_graph, lf_stacked_graph, lf_horizontal_stacked_graph, lf_scatter_graph, lf_line_graph from .lf_mesh_test import MeshTest @@ -320,6 +317,7 @@ sed -i -- 's/PortUtils = port_utils.PortUtils/ /g' *.py sed -i -- 's/LFCliBase = lfcli_base.LFCliBase/ /g' *.py sed -i -- 's/pandas_extensions = importlib.import_module("py-json.LANforge.pandas_extensions")/from .LANforge.pandas_extensions import pandas_extensions/g' *.py sed -i -- 's/pandas_extensions.pandas_extensions/pandas_extensions/g' *.py +sed -i -- 's/vr_profile2 = importlib.import_module("py-json.vr_profile2")/from ..py_json import vr_profile2/g' *.py # fix py_dashboard files sed -i -- 's/from GrafanaRequest/from ..py_dashboard.GrafanaRequest/g' *.py @@ -370,7 +368,7 @@ cd LANforge echo " from .add_dut import dut_params, dut_flags from .add_file_endp import fe_fstype, fe_payload_list, fe_fio_flags, fe_base_endpoint_types -from .lf_json_autogen import LFJsonGet, LFJsonPost +#from .lf_json_autogen import LFJsonGet, LFJsonPost from .lfcli_base import LFCliBase from .LFRequest import LFRequest from .LFUtils import * From 8d8585fa3126f26b8308daa915304358e06a0337 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 4 Oct 2021 14:43:21 -0600 Subject: [PATCH 067/731] lf_check.py : making the relationship between the json and test parameters better understood. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_002_AX12_dut.json | 22 +- py-scripts/tools/ct_003_AX88U_dut.json | 22 +- py-scripts/tools/ct_003_LANforge_dut.json | 22 +- py-scripts/tools/ct_004_AX88U_dut.json | 22 +- py-scripts/tools/ct_us_001_rig.json | 54 ++--- py-scripts/tools/ct_us_002_rig.json | 46 ++--- py-scripts/tools/ct_us_003_rig.json | 44 ++-- py-scripts/tools/ct_us_004_rig.json | 54 ++--- py-scripts/tools/lf_check.py | 239 +++++++++++----------- 9 files changed, 259 insertions(+), 266 deletions(-) diff --git a/py-scripts/tools/ct_002_AX12_dut.json b/py-scripts/tools/ct_002_AX12_dut.json index 37acb095..43b34e73 100644 --- a/py-scripts/tools/ct_002_AX12_dut.json +++ b/py-scripts/tools/ct_002_AX12_dut.json @@ -12,17 +12,17 @@ ] }, "test_dut":{ - "dut_set_name": "DUT_NAME Netgear-AX12", - "dut_name": "Netgear-AX12", - "dut_bssid_2g": "94:a6:7e:54:d4:31", - "dut_bssid_5g": "94:a6:7e:54:d4:33", - "dut_sw": "3.0.0.4.386_44266", - "ssid_2g_used": "NETGEAR59", - "ssid_2g_pw_used": "crispynest798", - "security_2g_used": "wpa2", - "ssid_5g_used": "NETGEAR59-5G", - "ssid_5g_pw_used": "crispynest798", - "security_5g_used": "wpa2" + "DUT_SET_NAME": "DUT_NAME Netgear-AX12", + "DUT_NAME": "Netgear-AX12", + "DUT_BSSID_2G": "94:a6:7e:54:d4:31", + "DUT_BSSID_5G": "94:a6:7e:54:d4:33", + "DUT_SW": "3.0.0.4.386_44266", + "SSID_2G_USED": "NETGEAR59", + "SSID_2G_PW_USED": "crispynest798", + "SECURITY_2G_USED": "wpa2", + "SSID_5G_USED": "NETGEAR59-5G", + "SSID_5G_PW_USED": "crispynest798", + "SECURITY_5G_USED": "wpa2" } } \ No newline at end of file diff --git a/py-scripts/tools/ct_003_AX88U_dut.json b/py-scripts/tools/ct_003_AX88U_dut.json index 56165911..2ec3c1ff 100644 --- a/py-scripts/tools/ct_003_AX88U_dut.json +++ b/py-scripts/tools/ct_003_AX88U_dut.json @@ -10,17 +10,17 @@ ] }, "test_dut":{ - "dut_set_name": "DUT_NAME ASUSRT-AX88U", - "dut_name": "ASUSRT-AX88U", - "dut_bssid_2g": "d4:5d:64:a0:7f:78", - "dut_bssid_5g": "d4:5d:64:a0:7f:7c", - "dut_sw": "3.0.0.4.386_44266", - "ssid_5g_used": "asus11ax-5", - "ssid_5g_pw_used": "hello123", - "security_5g_used": "wpa2", - "ssid_2g_used": "asus11ax-2", - "ssid_2g_pw_used": "hello123", - "security_2g_used": "wpa2" + "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", + "DUT_NAME": "ASUSRT-AX88U", + "DUT_BSSID_2G": "d4:5d:64:a0:7f:78", + "DUT_BSSID_5G": "d4:5d:64:a0:7f:7c", + "DUT_SW": "3.0.0.4.386_44266", + "SSID_5G_USED": "asus11ax-5", + "SSID_5G_PW_USED": "hello123", + "SECURITY_5G_USED": "wpa2", + "SSID_2G_USED": "asus11ax-2", + "SSID_2G_PW_USED": "hello123", + "SECURITY_2G_USED": "wpa2" } } \ No newline at end of file diff --git a/py-scripts/tools/ct_003_LANforge_dut.json b/py-scripts/tools/ct_003_LANforge_dut.json index b72a7293..f3c9f201 100644 --- a/py-scripts/tools/ct_003_LANforge_dut.json +++ b/py-scripts/tools/ct_003_LANforge_dut.json @@ -10,17 +10,17 @@ ] }, "test_dut":{ - "dut_set_name": "DUT_NAME lanforge-dut", - "dut_name": "lanforge", - "dut_bssid_2g": "94:a6:7e:54:d4:31", - "dut_bssid_5g": "94:a6:7e:54:d4:33", - "dut_sw": "lanforge_GUI", - "ssid_5g_used": "ct-us-003-r3-5g", - "ssid_5g_pw_used": "ct-us-003-r3-5g", - "security_5g_used": "wpa2", - "ssid_2g_used": "ct-us-003-r3-2g", - "ssid_2g_pw_used": "ct-us-003-r3-2g", - "security_2g_used": "wpa2" + "DUT_SET_NAME": "DUT_NAME lanforge-dut", + "DUT_NAME": "lanforge", + "DUT_BSSID_2G": "94:a6:7e:54:d4:31", + "DUT_BSSID_5G": "94:a6:7e:54:d4:33", + "DUT_SW": "lanforge_GUI", + "SSID_5G_USED": "ct-us-003-r3-5g", + "SSID_5G_PW_USED": "ct-us-003-r3-5g", + "SECURITY_5G_USED": "wpa2", + "SSID_2G_USED": "ct-us-003-r3-2g", + "SSID_2G_PW_USED": "ct-us-003-r3-2g", + "SECURITY_2G_USED": "wpa2" } } \ No newline at end of file diff --git a/py-scripts/tools/ct_004_AX88U_dut.json b/py-scripts/tools/ct_004_AX88U_dut.json index 56165911..2ec3c1ff 100644 --- a/py-scripts/tools/ct_004_AX88U_dut.json +++ b/py-scripts/tools/ct_004_AX88U_dut.json @@ -10,17 +10,17 @@ ] }, "test_dut":{ - "dut_set_name": "DUT_NAME ASUSRT-AX88U", - "dut_name": "ASUSRT-AX88U", - "dut_bssid_2g": "d4:5d:64:a0:7f:78", - "dut_bssid_5g": "d4:5d:64:a0:7f:7c", - "dut_sw": "3.0.0.4.386_44266", - "ssid_5g_used": "asus11ax-5", - "ssid_5g_pw_used": "hello123", - "security_5g_used": "wpa2", - "ssid_2g_used": "asus11ax-2", - "ssid_2g_pw_used": "hello123", - "security_2g_used": "wpa2" + "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", + "DUT_NAME": "ASUSRT-AX88U", + "DUT_BSSID_2G": "d4:5d:64:a0:7f:78", + "DUT_BSSID_5G": "d4:5d:64:a0:7f:7c", + "DUT_SW": "3.0.0.4.386_44266", + "SSID_5G_USED": "asus11ax-5", + "SSID_5G_PW_USED": "hello123", + "SECURITY_5G_USED": "wpa2", + "SSID_2G_USED": "asus11ax-2", + "SSID_2G_PW_USED": "hello123", + "SECURITY_2G_USED": "wpa2" } } \ No newline at end of file diff --git a/py-scripts/tools/ct_us_001_rig.json b/py-scripts/tools/ct_us_001_rig.json index fc4163b4..bab64d27 100644 --- a/py-scripts/tools/ct_us_001_rig.json +++ b/py-scripts/tools/ct_us_001_rig.json @@ -10,39 +10,29 @@ ] }, "test_rig_parameters":{ - "test_bed": "CT-US-001", - "test_rig": "CT-US-001", - "database_sqlite": "qa_001_test_db", - "lf_mgr_ip": "192.168.100.116", - "lf_mgr_port": "8080", - "lf_mgr_user": "lanforge", - "lf_mgr_pass": "lanforge", - "upstream_port":"1.1.eth2", - "test_timeout": 600, - "load_blank_db": false, - "load_factory_default_db": false, - "load_custom_db": false, - "custom_db": "DFLT_ETH1_GEN", - "email_list_production": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", - "host_ip_production": "192.168.95.6", - "email_list_test": "chuck.rekiere@candelatech.com", - "host_ip_test": "192.168.95.6", - "email_title_txt": "Lanforge QA Testing CT-US-001", - "email_txt": "Lanforge QA Testing CT-US-001 " + "TEST_BED": "CT-US-001", + "TEST_RIG": "CT-US-001", + "DATABASE_SQLITE": "qa_001_test_db", + "LF_MGR_IP": "192.168.100.116", + "LF_MGR_PORT": "8080", + "LF_MGR_USER": "lanforge", + "LF_MGR_PASS": "lanforge", + "UPSTREAM_PORT":"1.1.eth2", + "TEST_TIMEOUT": 600, + "LOAD_BLANK_DB": false, + "LOAD_FACTORY_DEFAULT_DB": false, + "LOAD_CUSTOM_DB": false, + "CUSTOM_DB": "DFLT_ETH1_GEN", + "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", + "HOST_IP_PRODUCTION": "192.168.95.6", + "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", + "HOST_IP_TEST": "192.168.95.6", + "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-001", + "EMAIL_TXT": "Lanforge QA Testing CT-US-001 " }, "test_network":{ - "http_test_ip": "192.168.50.1", - "ftp_test_ip": "192.168.50.1", - "test_ip": "192.168.50.1" - }, - "radio_dict":{ - "1.1.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"ath10k(9984)","CAPABILITIES":"802.11bgn-AC","MAX_STA":"128","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy1":{"KEY":"1.1.wiphy1","RADIO":"1.1.wiphy1","DRIVER":"ath10k(9984)","CAPABILITIES":"802.11an-AC","MAX_STA":"128","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy2":{"KEY":"1.1.wiphy2","RADIO":"1.1.wiphy2","DRIVER":"ath9k()","CAPABILITIES":"802.11abgn","MAX_STA":"2048","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy3":{"KEY":"1.1.wiphy3","RADIO":"1.1.wiphy3","DRIVER":"ath10k(998x)","CAPABILITIES":"802.11abgn-AC","MAX_STA":"127","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy4":{"KEY":"1.1.wiphy4","RADIO":"1.1.wiphy4","DRIVER":"iwlwifi(AX200)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.1.wiphy5":{"KEY":"1.1.wiphy5","RADIO":"1.1.wiphy5","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.1.wiphy6":{"KEY":"1.1.wiphy6","RADIO":"1.1.wiphy6","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.1.wiphy7":{"KEY":"1.1.wiphy7","RADIO":"1.1.wiphy7","DRIVER":"mt7915e()","CAPABILITIES":"802.11abgn-AX","MAX_STA":"19","MAX_VAP":"16","MAX_VIFS":"19"} + "HTTP_TEST_IP": "192.168.50.1", + "FTP_TEST_IP": "192.168.50.1", + "TEST_IP": "192.168.50.1" } } \ No newline at end of file diff --git a/py-scripts/tools/ct_us_002_rig.json b/py-scripts/tools/ct_us_002_rig.json index d0d8e822..707330f8 100644 --- a/py-scripts/tools/ct_us_002_rig.json +++ b/py-scripts/tools/ct_us_002_rig.json @@ -10,31 +10,31 @@ ] }, "test_rig_parameters":{ - "test_bed": "CT-US-002", - "test_rig": "CT-US-002", - "database_sqlite": "qa_002_test_db", - "lf_mgr_ip": "192.168.100.200", - "lf_mgr_port": "8080", - "lf_mgr_user": "lanforge", - "lf_mgr_pass": "lanforge", - "upstream_port": "1.1.eth2", - "dut_set_name": "DUT_NAME NETGEAR59-5G", - "test_timeout": 600, - "load_blank_db": false, - "load_factory_default_db": true, - "load_custom_db": false, - "custom_db": "DFLT_ETH1_GEN", - "email_list_production": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", - "host_ip_production": "192.168.100.153", - "email_list_test": "chuck.rekiere@candelatech.com", - "host_ip_test": "192.168.100.153", - "email_title_txt": "Lanforge QA Testing CT-US-002", - "email_txt": "Lanforge QA Testing CT-US-002" + "TEST_BED": "CT-US-002", + "TEST_RIG": "CT-US-002", + "DATABASE_SQLITE": "qa_002_test_db", + "LF_MGR_IP": "192.168.100.200", + "LF_MGR_PORT": "8080", + "LF_MGR_USER": "lanforge", + "LF_MGR_PASS": "lanforge", + "UPSTREAM_PORT": "1.1.eth2", + "DUT_SET_NAME": "DUT_NAME NETGEAR59-5G", + "TEST_TIMEOUT": 600, + "LOAD_BLANK_DB": false, + "LOAD_FACTORY_DEFAULT_DB": true, + "LOAD_CUSTOM_DB": false, + "CUSTOM_DB": "DFLT_ETH1_GEN", + "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", + "HOST_IP_PRODUCTION": "192.168.100.153", + "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", + "HOST_IP_TEST": "192.168.100.153", + "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-002", + "EMAIL_TXT": "Lanforge QA Testing CT-US-002" }, "test_network":{ - "http_test_ip": "10.40.0.10", - "ftp_test_ip": "10.40.0.10", - "test_ip": "192.168.0.104" + "HTTP_TEST_IP": "10.40.0.10", + "FTP_TEST_IP": "10.40.0.10", + "TEST_IP": "192.168.0.104" }, "radio_dict":{ "1.1.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"ath10k(9984)","CAPABILITIES":"802.11an-AC","MAX_STA":"128","MAX_VAP":"24","MAX_VIFS":"64"}, diff --git a/py-scripts/tools/ct_us_003_rig.json b/py-scripts/tools/ct_us_003_rig.json index 7796d9ce..10e5fabd 100644 --- a/py-scripts/tools/ct_us_003_rig.json +++ b/py-scripts/tools/ct_us_003_rig.json @@ -10,30 +10,30 @@ ] }, "test_rig_parameters":{ - "test_bed": "CT-US-003", - "test_rig": "CT-US-003", - "database_sqlite": "qa_003_test_db", - "lf_mgr_ip": "192.168.100.233", - "lf_mgr_port": "8080", - "lf_mgr_user": "lanforge", - "lf_mgr_pass": "lanforge", - "upstream_port":"1.1.eth1", - "test_timeout": 600, - "load_blank_db": false, - "load_factory_default_db": false, - "load_custom_db": false, - "custom_db": "DFLT_ETH1_GEN", - "email_list_production": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", - "host_ip_production": "192.168.95.6", - "email_list_test": "chuck.rekiere@candelatech.com", - "host_ip_test": "192.168.95.6", - "email_title_txt": "Lanforge QA Testing CT-US-003", - "email_txt": "Lanforge QA Testing CT-US-003" + "TEST_BED": "CT-US-003", + "TEST_RIG": "CT-US-003", + "DATABASE_SQLITE": "qa_003_test_db", + "LF_MGR_IP": "192.168.100.233", + "LF_MGR_PORT": "8080", + "LF_MGR_USER": "lanforge", + "LF_MGR_PASS": "lanforge", + "UPSTREAM_PORT":"1.1.eth1", + "TEST_TIMEOUT": 600, + "LOAD_BLANK_DB": false, + "LOAD_FACTORY_DEFAULT_DB": false, + "LOAD_CUSTOM_DB": false, + "CUSTOM_DB": "DFLT_ETH1_GEN", + "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", + "HOST_IP_PRODUCTION": "192.168.95.6", + "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", + "HOST_IP_TEST": "192.168.95.6", + "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-003", + "EMAIL_TXT": "Lanforge QA Testing CT-US-003" }, "test_network":{ - "http_test_ip": "192.168.50.1", - "ftp_test_ip": "192.168.50.1", - "test_ip": "192.168.50.1" + "HTTP_TEST_IP": "192.168.50.1", + "FTP_TEST_IP": "192.168.50.1", + "TEST_IP": "192.168.50.1" }, "radio_dict":{ "1.1.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, diff --git a/py-scripts/tools/ct_us_004_rig.json b/py-scripts/tools/ct_us_004_rig.json index ad21eb36..488e396c 100644 --- a/py-scripts/tools/ct_us_004_rig.json +++ b/py-scripts/tools/ct_us_004_rig.json @@ -10,35 +10,35 @@ ] }, "test_rig_parameters":{ - "test_bed": "CT-US-004", - "test_rig": "CT-US-004", - "database_sqlite": "qa_004_test_db", - "lf_mgr_ip": "192.168.100.194", - "lf_mgr_port": "8080", - "lf_mgr_user": "lanforge", - "lf_mgr_pass": "lanforge", - "upstream_port": "1.1.eth2", - "dut_set_name": "DUT_NAME Asus-RT-AX88U", - "dut_name": "Asus-RT-AX88U", - "dut_bssid_2g": "d4:5d:64:a0:7f:78", - "dut_bssid_5g": "d4:5d:64:a0:7f:7c", - "dut_sw": "3.0.0.4.386_44266", - "test_timeout": 300, - "load_blank_db": false, - "load_factory_default_db": true, - "load_custom_db": false, - "custom_db": "DFLT_ETH1_GEN", - "email_list_production": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", - "host_ip_production": "192.168.100.201", - "email_list_test": "chuck.rekiere@candelatech.com", - "host_ip_test": "192.168.100.201", - "email_title_txt": "Lanforge QA Testing CT-US-004", - "email_txt": "Lanforge QA Testing CT-US-004 " + "TEST_BED": "CT-US-004", + "TEST_RIG": "CT-US-004", + "DATABASE_SQLITE": "qa_004_test_db", + "LF_MGR_IP": "192.168.100.194", + "LF_MGR_PORT": "8080", + "LF_MGR_USER": "lanforge", + "LF_MGR_PASS": "lanforge", + "UPSTREAM_PORT": "1.1.eth2", + "DUT_SET_NAME": "DUT_NAME Asus-RT-AX88U", + "DUT_NAME": "Asus-RT-AX88U", + "DUT_BSSID_2G": "d4:5d:64:a0:7f:78", + "DUT_BSSID_5G": "d4:5d:64:a0:7f:7c", + "DUT_SW": "3.0.0.4.386_44266", + "TEST_TIMEOUT": 300, + "LOAD_BLANK_DB": false, + "LOAD_FACTORY_DEFAULT_DB": true, + "LOAD_CUSTOM_DB": false, + "CUSTOM_DB": "DFLT_ETH1_GEN", + "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", + "HOST_IP_PRODUCTION": "192.168.100.201", + "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", + "HOST_IP_TEST": "192.168.100.201", + "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-004", + "EMAIL_TXT": "Lanforge QA Testing CT-US-004 " }, "test_network":{ - "http_test_ip": "10.40.0.10", - "ftp_test_ip": "10.40.0.10", - "test_ip": "192.168.0.104" + "HTTP_TEST_IP": "10.40.0.10", + "FTP_TEST_IP": "10.40.0.10", + "TEST_IP": "192.168.0.104" }, "radio_dict":{ "1.1.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"ath10k(9984)","CAPABILITIES":"802.11bgn-AC","MAX_STA":"128","MAX_VAP":"24","MAX_VIFS":"64"}, diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 6f0e6b36..cfdc8b3c 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -465,6 +465,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.read_test_rig_parameters() else: self.logger.info("EXITING test_rig_parameters not in json {}".format(self.json_rig)) + self.logger.info("EXITING ERROR test_rig_parameters not in rig json") exit(1) if "test_network" in self.json_rig: @@ -473,6 +474,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.read_test_network() else: self.logger.info("EXITING test_network not in json {}".format(self.json_rig)) + self.logger.info("EXITING ERROR test_network not in rig json") exit(1) if "radio_dict" in self.json_rig: @@ -490,6 +492,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.read_dut_parameters() else: self.logger.info("EXITING test_dut not in json {}".format(self.json_dut)) + self.logger.info("EXITING ERROR test_dut not in dug json {}") exit(1) # Top Level for reading the tests to run @@ -501,208 +504,208 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.test_dict = self.json_test["test_suites"][self.test_suite] # self.logger.info("self.test_dict {}".format(self.test_dict)) else: - self.logger.info("EXITING test_suite {} Not Present in json test_suites: {}".format(self.test_suite, - self.json_test[ - "test_suites"])) + self.logger.info("EXITING test_suite {} Not Present in json test_suites: {}".format(self.test_suite, self.json_test["test_suites"])) + self.logger.info("EXITING ERROR test_suite {} Not Present in json test_suites".format(self.test_suite)) exit(1) else: self.logger.info("EXITING test_suites not in json {}".format(self.json_test)) + self.logger.info("EXITING ERROR test_suites not in json test") exit(1) #TODO change code so if parameter is not present then implied to be false def read_test_rig_parameters(self): - if "test_rig" in self.json_rig["test_rig_parameters"]: - self.test_rig = self.json_rig["test_rig_parameters"]["test_rig"] + if "TEST_RIG" in self.json_rig["test_rig_parameters"]: + self.test_rig = self.json_rig["test_rig_parameters"]["TEST_RIG"] else: self.logger.info("test_rig not in test_rig_parameters json") - if "database_sqlite" in self.json_rig["test_rig_parameters"]: - self.database_sqlite = self.json_rig["test_rig_parameters"]["database_sqlite"] + if "DATABASE_SQLITE" in self.json_rig["test_rig_parameters"]: + self.database_sqlite = self.json_rig["test_rig_parameters"]["DATABASE_SQLITE"] else: - self.logger.info("database_sqlite not in test_rig_parameters json") - if "lf_mgr_ip" in self.json_rig["test_rig_parameters"]: - self.lf_mgr_ip = self.json_rig["test_rig_parameters"]["lf_mgr_ip"] + self.logger.info("DATABASE_SQLITE not in test_rig_parameters json") + if "LF_MGR_IP" in self.json_rig["test_rig_parameters"]: + self.lf_mgr_ip = self.json_rig["test_rig_parameters"]["LF_MGR_IP"] else: self.logger.info("lf_mgr_ip not in test_rig_parameters json") - if "lf_mgr_port" in self.json_rig["test_rig_parameters"]: - self.lf_mgr_port = self.json_rig["test_rig_parameters"]["lf_mgr_port"] + if "LF_MGR_PORT" in self.json_rig["test_rig_parameters"]: + self.lf_mgr_port = self.json_rig["test_rig_parameters"]["LF_MGR_PORT"] else: - self.logger.info("lf_mgr_port not in test_rig_parameters json") - if "lf_mgr_user" in self.json_rig["test_rig_parameters"]: - self.lf_mgr_user = self.json_rig["test_rig_parameters"]["lf_mgr_user"] + self.logger.info("LF_MGR_PORT not in test_rig_parameters json") + if "LF_MGR_USER" in self.json_rig["test_rig_parameters"]: + self.lf_mgr_user = self.json_rig["test_rig_parameters"]["LF_MGR_USER"] else: - self.logger.info("lf_mgr_user not in test_rig_parameters json") - if "lf_mgr_pass" in self.json_rig["test_rig_parameters"]: - self.lf_mgr_pass = self.json_rig["test_rig_parameters"]["lf_mgr_pass"] + self.logger.info("LF_MGR_USER not in test_rig_parameters json") + if "LF_MGR_PASS" in self.json_rig["test_rig_parameters"]: + self.lf_mgr_pass = self.json_rig["test_rig_parameters"]["LF_MGR_PASS"] else: - self.logger.info("lf_mgr_pass not in test_rig_parameters json") - if "upstream_port" in self.json_rig["test_rig_parameters"]: - self.upstream_port = self.json_rig["test_rig_parameters"]["upstream_port"] + self.logger.info("LF_MGR_PASS not in test_rig_parameters json") + if "UPSTREAM_PORT" in self.json_rig["test_rig_parameters"]: + self.upstream_port = self.json_rig["test_rig_parameters"]["UPSTREAM_PORT"] else: - self.logger.info("upstream_port not in test_rig_parameters json") - if "test_timeout" in self.json_rig["test_rig_parameters"]: - self.test_timeout = self.json_rig["test_rig_parameters"]["test_timeout"] + self.logger.info("UPSTREAM_PORT not in test_rig_parameters json") + if "TEST_TIMEOUT" in self.json_rig["test_rig_parameters"]: + self.test_timeout = self.json_rig["test_rig_parameters"]["TEST_TIMEOUT"] self.test_timeout_default = self.test_timeout else: - self.logger.info("test_timeout not in test_rig_parameters json") + self.logger.info("TEST_TIMEOUT not in test_rig_parameters json") exit(1) - if "load_blank_db" in self.json_rig["test_rig_parameters"]: - self.load_blank_db = self.json_rig["test_rig_parameters"]["load_blank_db"] + if "LOAD_BLANK_DB" in self.json_rig["test_rig_parameters"]: + self.load_blank_db = self.json_rig["test_rig_parameters"]["LOAD_BLANK_DB"] else: - self.logger.info("load_blank_db not in test_rig_parameters json") + self.logger.info("LOAD_BLANK_DB not in test_rig_parameters json") exit(1) - if "load_factory_default_db" in self.json_rig["test_rig_parameters"]: - self.load_factory_default_db = self.json_rig["test_rig_parameters"]["load_factory_default_db"] + if "LOAD_FACTORY_DEFAULT_DB" in self.json_rig["test_rig_parameters"]: + self.load_factory_default_db = self.json_rig["test_rig_parameters"]["LOAD_FACTORY_DEFAULT_DB"] else: - self.logger.info("load_factory_default_db not in test_rig_parameters json") + self.logger.info("LOAD_FACTORY_DEFAULT_DB not in test_rig_parameters json") exit(1) - if "load_custom_db" in self.json_rig["test_rig_parameters"]: - self.load_custom_db = self.json_rig["test_rig_parameters"]["load_custom_db"] + if "LOAD_CUSTOM_DB" in self.json_rig["test_rig_parameters"]: + self.load_custom_db = self.json_rig["test_rig_parameters"]["LOAD_CUSTOM_DB"] else: - self.logger.info("load_custom_db not in test_rig_parameters json") + self.logger.info("LOAD_CUSTOM_DB not in test_rig_parameters json") exit(1) - if "custom_db" in self.json_rig["test_rig_parameters"]: - self.custom_db = self.json_rig["test_rig_parameters"]["custom_db"] + if "CUSTOM_DB" in self.json_rig["test_rig_parameters"]: + self.custom_db = self.json_rig["test_rig_parameters"]["CUSTOM_DB"] else: - self.logger.info("custom_db not in test_rig_parameters json, if not using custom_db just put in a name") + self.logger.info("CUSTOM_DB not in test_rig_parameters json, if not using custom_db just put in a name") exit(1) - if "email_list_production" in self.json_rig["test_rig_parameters"]: - self.email_list_production = self.json_rig["test_rig_parameters"]["email_list_production"] + if "EMAIL_LIST_PRODUCTION" in self.json_rig["test_rig_parameters"]: + self.email_list_production = self.json_rig["test_rig_parameters"]["EMAIL_LIST_PRODUCTION"] else: - self.logger.info("email_list_production not in test_rig_parameters json") + self.logger.info("EMAIL_LIST_PRODUCTION not in test_rig_parameters json") exit(1) - if "host_ip_production" in self.json_rig["test_rig_parameters"]: - self.host_ip_production = self.json_rig["test_rig_parameters"]["host_ip_production"] + if "HOST_IP_PRODUCTION" in self.json_rig["test_rig_parameters"]: + self.host_ip_production = self.json_rig["test_rig_parameters"]["HOST_IP_PRODUCTION"] else: - self.logger.info("host_ip_production not in test_rig_parameters json") + self.logger.info("HOST_IP_PRODUCTION not in test_rig_parameters json") exit(1) - if "email_list_test" in self.json_rig["test_rig_parameters"]: - self.email_list_test = self.json_rig["test_rig_parameters"]["email_list_test"] + if "EMAIL_LIST_TEST" in self.json_rig["test_rig_parameters"]: + self.email_list_test = self.json_rig["test_rig_parameters"]["EMAIL_LIST_TEST"] print(self.email_list_test) else: - self.logger.info("email_list_test not in test_rig_parameters json") + self.logger.info("EMAIL_LIST_TEST not in test_rig_parameters json") exit(1) - if "host_ip_test" in self.json_rig["test_rig_parameters"]: - self.host_ip_test = self.json_rig["test_rig_parameters"]["host_ip_test"] + if "HOST_IP_TEST" in self.json_rig["test_rig_parameters"]: + self.host_ip_test = self.json_rig["test_rig_parameters"]["HOST_IP_TEST"] else: - self.logger.info("host_ip_test not in test_rig_parameters json") + self.logger.info("HOST_IP_TEST not in test_rig_parameters json") exit(1) - if "email_title_txt" in self.json_rig["test_rig_parameters"]: - self.email_title_txt = self.json_rig["test_rig_parameters"]["email_title_txt"] + if "EMAIL_TITLE_TXT" in self.json_rig["test_rig_parameters"]: + self.email_title_txt = self.json_rig["test_rig_parameters"]["EMAIL_TITLE_TXT"] else: - self.logger.info("email_title_txt not in test_rig_parameters json") - if "email_txt" in self.json_rig["test_rig_parameters"]: - self.email_txt = self.json_rig["test_rig_parameters"]["email_txt"] + self.logger.info("EMAIL_TITLE_TXT not in test_rig_parameters json") + if "EMAIL_TXT" in self.json_rig["test_rig_parameters"]: + self.email_txt = self.json_rig["test_rig_parameters"]["EMAIL_TXT"] else: - self.logger.info("email_txt not in test_rig_parameters json") + self.logger.info("EMAIL_TXT not in test_rig_parameters json") # dut_set_name selectes the DUT to test against , it is different then dut_name # this value gets set in the test def read_dut_parameters(self): - if "dut_set_name" in self.json_dut["test_dut"]: - self.dut_set_name = self.json_dut["test_dut"]["dut_set_name"] + if "DUT_SET_NAME" in self.json_dut["test_dut"]: + self.dut_set_name = self.json_dut["test_dut"]["DUT_SET_NAME"] else: - self.logger.info("dut_set_name not in test_dut json") + self.logger.info("DUT_SET_NAME not in test_dut json") # dut name will set a chamberview scenerio for a DUT which can be selected with dut_set_name - if "dut_name" in self.json_dut["test_dut"]: - self.dut_name = self.json_dut["test_dut"]["dut_name"] + if "DUT_NAME" in self.json_dut["test_dut"]: + self.dut_name = self.json_dut["test_dut"]["DUT_NAME"] else: - self.logger.info("dut_name not in test_dut json") + self.logger.info("DUT_NAME not in test_dut json") - if "dut_hw" in self.json_dut["test_dut"]: - self.dut_hw = self.json_dut["test_dut"]["dut_hw"] + if "DUT_HW" in self.json_dut["test_dut"]: + self.dut_hw = self.json_dut["test_dut"]["DUT_HW"] else: - self.logger.info("dut_hw not in test_dut json") + self.logger.info("DUT_HW not in test_dut json") - if "dut_sw" in self.json_dut["test_dut"]: - self.dut_sw = self.json_dut["test_dut"]["dut_sw"] + if "DUT_SW" in self.json_dut["test_dut"]: + self.dut_sw = self.json_dut["test_dut"]["DUT_SW"] else: - self.logger.info("dut_sw not in test_dut json") + self.logger.info("DUT_SW not in test_dut json") - if "dut_model" in self.json_dut["test_dut"]: - self.dut_model = self.json_dut["test_dut"]["dut_model"] + if "DUT_MODEL" in self.json_dut["test_dut"]: + self.dut_model = self.json_dut["test_dut"]["DUT_MODEL"] else: - self.logger.info("dut_model not in test_dut json") + self.logger.info("DUT_MODEL not in test_dut json") - if "dut_serial" in self.json_dut["test_dut"]: - self.dut_serial = self.json_dut["test_dut"]["dut_serial"] + if "DUT_SERIAL" in self.json_dut["test_dut"]: + self.dut_serial = self.json_dut["test_dut"]["DUT_SERIAL"] else: - self.logger.info("dut_serial not in test_dut json") + self.logger.info("DUT_SERIAL not in test_dut json") - if "dut_bssid_2g" in self.json_dut["test_dut"]: - self.dut_bssid_2g = self.json_dut["test_dut"]["dut_bssid_2g"] + if "DUT_BSSID_2G" in self.json_dut["test_dut"]: + self.dut_bssid_2g = self.json_dut["test_dut"]["DUT_BSSID_2G"] else: - self.logger.info("dut_bssid_2G not in test_dut json") + self.logger.info("DUT_BSSID_2G not in test_dut json") - if "dut_bssid_5g" in self.json_dut["test_dut"]: - self.dut_bssid_5g = self.json_dut["test_dut"]["dut_bssid_5g"] + if "DUT_BSSID_5G" in self.json_dut["test_dut"]: + self.dut_bssid_5g = self.json_dut["test_dut"]["DUT_BSSID_5G"] else: - self.logger.info("dut_bssid_5g not in test_dut json") + self.logger.info("DUT_BSSID_5G not in test_dut json") - if "dut_bssid_6g" in self.json_dut["test_dut"]: - self.dut_bssid_6g = self.json_dut["test_dut"]["dut_bssid_6g"] + if "DUT_BSSID_6G" in self.json_dut["test_dut"]: + self.dut_bssid_6g = self.json_dut["test_dut"]["DUT_BSSID_6G"] else: - self.logger.info("dut_bssid_6g not in test_dut json") + self.logger.info("DUT_BSSID_6G not in test_dut json") - if "ssid_6g_used" in self.json_dut["test_dut"]: - self.ssid_6g = self.json_dut["test_dut"]["ssid_6g_used"] + if "SSID_6G_USED" in self.json_dut["test_dut"]: + self.ssid_6g = self.json_dut["test_dut"]["SSID_6G_USED"] else: - self.logger.info("ssid_6g_used not in test_dut json") + self.logger.info("SSID_6G_USED not in test_dut json") - if "ssid_6g_pw_used" in self.json_dut["test_dut"]: - self.ssid_6g_pw = self.json_dut["test_dut"]["ssid_6g_pw_used"] + if "SSID_6G_PW_USED" in self.json_dut["test_dut"]: + self.ssid_6g_pw = self.json_dut["test_dut"]["SSID_6G_PW_USED"] else: - self.logger.info("ssid_6g_pw_used not in test_dut json") + self.logger.info("SSID_6G_PW_USED not in test_dut json") - if "security_6g_used" in self.json_dut["test_dut"]: - self.security_6g = self.json_dut["test_dut"]["security_6g_used"] + if "SECURITY_6G_USED" in self.json_dut["test_dut"]: + self.security_6g = self.json_dut["test_dut"]["SECURITY_6G_USED"] else: - self.logger.info("security_6g_used not in test_dut json") + self.logger.info("SECURITY_6G_USED not in test_dut json") - if "ssid_5g_used" in self.json_dut["test_dut"]: - self.ssid_5g = self.json_dut["test_dut"]["ssid_5g_used"] + if "SSID_5G_USED" in self.json_dut["test_dut"]: + self.ssid_5g = self.json_dut["test_dut"]["SSID_5G_USED"] else: - self.logger.info("ssid_5g_used not in test_dut json") + self.logger.info("SSID_5G_USED not in test_dut json") - if "ssid_5g_pw_used" in self.json_dut["test_dut"]: - self.ssid_5g_pw = self.json_dut["test_dut"]["ssid_5g_pw_used"] + if "SSID_5G_PW_USED" in self.json_dut["test_dut"]: + self.ssid_5g_pw = self.json_dut["test_dut"]["SSID_5G_PW_USED"] else: - self.logger.info("ssid_5g_pw_used not in test_dut json") + self.logger.info("SSID_5G_PW_USED not in test_dut json") - if "security_5g_used" in self.json_dut["test_dut"]: - self.security_5g = self.json_dut["test_dut"]["security_5g_used"] + if "SECURITY_5G_USED" in self.json_dut["test_dut"]: + self.security_5g = self.json_dut["test_dut"]["SECURITY_5G_USED"] else: - self.logger.info("security_5g_used not in test_dut json") + self.logger.info("SECURITY_5G_USED not in test_dut json") - if "ssid_2g_used" in self.json_dut["test_dut"]: - self.ssid_2g = self.json_dut["test_dut"]["ssid_2g_used"] + if "SSID_2G_USED" in self.json_dut["test_dut"]: + self.ssid_2g = self.json_dut["test_dut"]["SSID_2G_USED"] else: - self.logger.info("ssid_2g_used not in test_dut json") + self.logger.info("SSID_2G_USED not in test_dut json") - if "ssid_2g_pw_used" in self.json_dut["test_dut"]: - self.ssid_2g_pw = self.json_dut["test_dut"]["ssid_2g_pw_used"] + if "SSID_2G_PW_USED" in self.json_dut["test_dut"]: + self.ssid_2g_pw = self.json_dut["test_dut"]["SSID_2G_PW_USED"] else: - self.logger.info("ssid_2g_pw_used not in test_dut json") + self.logger.info("SSID_2G_PW_USED not in test_dut json") - if "security_2g_used" in self.json_dut["test_dut"]: - self.security_2g = self.json_dut["test_dut"]["security_2g_used"] + if "SECURITY_2G_USED" in self.json_dut["test_dut"]: + self.security_2g = self.json_dut["test_dut"]["SECURITY_2G_USED"] else: - self.logger.info("security_2g_used not in test_dut json") + self.logger.info("SECURITY_2G_USED not in test_dut json") def read_test_network(self): - if "http_test_ip" in self.json_rig["test_network"]: - self.http_test_ip = self.json_rig["test_network"]["http_test_ip"] + if "HTTP_TEST_IP" in self.json_rig["test_network"]: + self.http_test_ip = self.json_rig["test_network"]["HTTP_TEST_IP"] else: - self.logger.info("http_test_ip not in test_network json") + self.logger.info("HTTP_TEST_IP not in test_network json") exit(1) - if "ftp_test_ip" in self.json_rig["test_network"]: - self.ftp_test_ip = self.json_rig["test_network"]["ftp_test_ip"] + if "FTP_TEST_IP" in self.json_rig["test_network"]: + self.ftp_test_ip = self.json_rig["test_network"]["FTP_TEST_IP"] else: - self.logger.info("ftp_test_ip not in test_network json") + self.logger.info("FTP_TEST_IP not in test_network json") exit(1) - if "test_ip" in self.json_rig["test_network"]: - self.ftp_test_ip = self.json_rig["test_network"]["test_ip"] + if "TEST_IP" in self.json_rig["test_network"]: + self.ftp_test_ip = self.json_rig["test_network"]["TEST_IP"] else: - self.logger.info("test_ip not in test_network json") + self.logger.info("TEST_IP not in test_network json") exit(1) def load_FACTORY_DFLT_database(self): From 1ea61f07eedbec43e473c00c1f3dd6388665f72b Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 5 Oct 2021 07:03:47 -0600 Subject: [PATCH 068/731] lf_check.py : exit if there are exceptions reading the radio data. No radio data indicates that the LANforge GUI may not be running Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index cfdc8b3c..cbbc4421 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -141,6 +141,7 @@ class lf_check(): self.production_run = _production self.report_path = _report_path self.log_path = _log_path + self.ssid_dict = {} self.radio_dict = {} self.test_dict = {} path_parent = os.path.dirname(os.getcwd()) @@ -1279,7 +1280,8 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a print("print_exc(): {error}".format(error=error)) traceback.print_exc(file=sys.stdout) lf_radio_df = pd.DataFrame() - print("get_lanforge_radio_json exception, no radio data") + print("get_lanforge_radio_json exception, no radio data, check for LANforge GUI running") + exit(1) # LANforge and scripts config for results lf_test_setup = pd.DataFrame() From e22c7c0eb8be31c74f0768995c07512a594f45bd Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 5 Oct 2021 07:28:57 -0600 Subject: [PATCH 069/731] ct_001_AX88U_dut.json : updated for having upper case in test configuration match the configuration of the DUT Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_001_AX88U_dut.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/py-scripts/tools/ct_001_AX88U_dut.json b/py-scripts/tools/ct_001_AX88U_dut.json index e08f6fcd..539f3760 100644 --- a/py-scripts/tools/ct_001_AX88U_dut.json +++ b/py-scripts/tools/ct_001_AX88U_dut.json @@ -10,17 +10,17 @@ ] }, "test_dut":{ - "dut_set_name": "DUT_NAME ASUSRT-AX88U", - "dut_name": "ASUSRT-AX88U", - "dut_bssid_2g": "3c:7c:3f:55:4d:60", - "dut_bssid_5g": "3c:7c:3f:55:4d:64", - "dut_sw": "3.0.0.4.386_44266", - "ssid_5g_used": "asus11ax-5", - "ssid_5g_pw_used": "hello123", - "security_5g_used": "wpa2", - "ssid_2g_used": "asus11ax-2", - "ssid_2g_pw_used": "hello123", - "security_2g_used": "wpa2" + "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", + "DUT_NAME": "ASUSRT-AX88U", + "DUT_BSSID_2G": "3c:7c:3f:55:4d:60", + "DUT_BSSID_5G": "3c:7c:3f:55:4d:64", + "DUT_SW": "3.0.0.4.386_44266", + "SSID_5G_USED": "asus11ax-5", + "SSID_5G_PW_USED": "hello123", + "SECURITY_5G_USED": "wpa2", + "SSID_2G_USED": "asus11ax-2", + "SSID_2G_PW_USED": "hello123", + "SECURITY_2G_USED": "wpa2" } } \ No newline at end of file From df78928b626c1df960e5482e8a214253ae577760 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 5 Oct 2021 09:37:34 -0700 Subject: [PATCH 070/731] run_cv_scenario.py: renames method from refresh() to wait_for_db_load_and_sync() Signed-off-by: Jed Reynolds --- py-scripts/run_cv_scenario.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/run_cv_scenario.py b/py-scripts/run_cv_scenario.py index d87345fd..902a7d0e 100755 --- a/py-scripts/run_cv_scenario.py +++ b/py-scripts/run_cv_scenario.py @@ -52,7 +52,7 @@ class RunCvScenario(LFCliBase): "clean_chambers": "yes" } self.json_post("/cli-json/load", data) - self.refresh() + self.wait_for_db_load_and_sync() port_counter = 0; attempts = 6 @@ -82,11 +82,11 @@ class RunCvScenario(LFCliBase): "clean_chambers": "yes" } self.json_post("/cli-json/load", data) - self.refresh() + self.wait_for_db_load_and_sync() self._pass("Loaded scenario %s" % self.lanforge_db, True) return True - def refresh(self): + def wait_for_db_load_and_sync(self): events_response = self.json_get("/events/last") if "event" not in events_response: raise ValueError("Unable to find last event") From 2093d68a91443b0cf1f66f259013664f974afae7 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Tue, 5 Oct 2021 12:37:35 -0700 Subject: [PATCH 071/731] mesh: Improve --help output. Use double-backslash to fix missing newlines when viewing --help output. Signed-off-by: Ben Greear --- py-scripts/lf_mesh_test.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/py-scripts/lf_mesh_test.py b/py-scripts/lf_mesh_test.py index c927920e..2ccaf11c 100755 --- a/py-scripts/lf_mesh_test.py +++ b/py-scripts/lf_mesh_test.py @@ -225,14 +225,14 @@ def main(): Open this file in an editor and read the top notes for more details. Example: - ./lf_mesh_test.py --mgr localhost --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name mesh-instance --config_name test_con --upstream 1.1.eth1 \ - --raw_line 'selected_dut2: RootAP wactest 08:36:c9:19:47:40 (1)' \ - --raw_line 'selected_dut5: RootAP wactest 08:36:c9:19:47:50 (2)' \ - --duration 15s \ - --download_speed 85% --upload_speed 56Kbps \ - --raw_line 'velocity: 100' \ - --raw_lines_file example-configs/mesh-ferndale-cfg.txt \ + ./lf_mesh_test.py --mgr localhost --port 8080 --lf_user lanforge --lf_password lanforge \\ + --instance_name mesh-instance --config_name test_con --upstream 1.1.eth1 \\ + --raw_line 'selected_dut2: RootAP wactest 08:36:c9:19:47:40 (1)' \\ + --raw_line 'selected_dut5: RootAP wactest 08:36:c9:19:47:50 (2)' \\ + --duration 15s \\ + --download_speed 85% --upload_speed 56Kbps \\ + --raw_line 'velocity: 100' \\ + --raw_lines_file example-configs/mesh-ferndale-cfg.txt \\ --test_rig Ferndale-Mesh-01 --pull_report NOTE: There is quite a lot of config needed, see example-configs/mesh-ferndale-cfg.txt From daabc352f851ee59c93304bfa69c1b6599d0cb42 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 5 Oct 2021 15:25:42 -0600 Subject: [PATCH 072/731] lf_check.py : updating code to work with wireless network configuration upto endless number of network configurations . Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_001_AX88U_dut.json | 6 ++- py-scripts/tools/ct_004_AX88U_dut.json | 9 +++- py-scripts/tools/ct_us_001_tests.json | 40 +++++++++--------- py-scripts/tools/lf_check.py | 57 +++++++++++++++++++++----- 4 files changed, 79 insertions(+), 33 deletions(-) diff --git a/py-scripts/tools/ct_001_AX88U_dut.json b/py-scripts/tools/ct_001_AX88U_dut.json index 539f3760..69bf4a2d 100644 --- a/py-scripts/tools/ct_001_AX88U_dut.json +++ b/py-scripts/tools/ct_001_AX88U_dut.json @@ -20,7 +20,11 @@ "SECURITY_5G_USED": "wpa2", "SSID_2G_USED": "asus11ax-2", "SSID_2G_PW_USED": "hello123", - "SECURITY_2G_USED": "wpa2" + "SECURITY_2G_USED": "wpa2", + "wireless_network_dict":{ + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} + } } } \ No newline at end of file diff --git a/py-scripts/tools/ct_004_AX88U_dut.json b/py-scripts/tools/ct_004_AX88U_dut.json index 2ec3c1ff..e07c7f4e 100644 --- a/py-scripts/tools/ct_004_AX88U_dut.json +++ b/py-scripts/tools/ct_004_AX88U_dut.json @@ -20,7 +20,14 @@ "SECURITY_5G_USED": "wpa2", "SSID_2G_USED": "asus11ax-2", "SSID_2G_PW_USED": "hello123", - "SECURITY_2G_USED": "wpa2" + "SECURITY_2G_USED": "wpa2", + "wireless_network":{ + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"aux11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:78","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"aux11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:7c","SECURITY_USED":"wpa2"} + } } } + + + \ No newline at end of file diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 616d3e9d..a9e369d3 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -56,8 +56,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -95,8 +95,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -157,8 +157,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -196,8 +196,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -238,8 +238,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -276,8 +276,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -317,8 +317,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -356,8 +356,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -397,8 +397,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-001_create_chamberview_ap":{ @@ -459,8 +459,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-001_create_chamberview_ap":{ diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index cbbc4421..47a0ba5d 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -141,7 +141,6 @@ class lf_check(): self.production_run = _production self.report_path = _report_path self.log_path = _log_path - self.ssid_dict = {} self.radio_dict = {} self.test_dict = {} path_parent = os.path.dirname(os.getcwd()) @@ -199,6 +198,9 @@ class lf_check(): self.dut_sw = "DUT_SW_NA" self.dut_model = "DUT_MODEL_NA" self.dut_serial = "DUT_SERIAL_NA" + + self.dut_wireless_network_dict = {} + self.dut_bssid_2g = "BSSID_2G_NA" # "3c:7c:3f:55:4d:64" - this is the mac for the 2.4G radio this may be seen with a scan self.dut_bssid_5g = "BSSID_5G_NA" # "3c:7c:3f:55:4d:64" - this is the mac for the 5G radio this may be seen with a scan self.dut_bssid_6g = "BSSID_6G_NA" # "3c:7c:3f:55:4d:64" - this is the mac for the 6G radio this may be seen with a scan @@ -493,7 +495,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.read_dut_parameters() else: self.logger.info("EXITING test_dut not in json {}".format(self.json_dut)) - self.logger.info("EXITING ERROR test_dut not in dug json {}") + self.logger.info("EXITING ERROR test_dut not in dut json {}") exit(1) # Top Level for reading the tests to run @@ -632,10 +634,12 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) else: self.logger.info("DUT_SERIAL not in test_dut json") - if "DUT_BSSID_2G" in self.json_dut["test_dut"]: - self.dut_bssid_2g = self.json_dut["test_dut"]["DUT_BSSID_2G"] + if "wireless_network_dict" in self.json_dut["test_dut"]: + self.wireless_network_dict = self.json_dut["test_dut"]["wireless_network_dict"] + self.logger.info("self.wireless_network_dict {}".format(self.wireless_network_dict)) else: - self.logger.info("DUT_BSSID_2G not in test_dut json") + self.logger.info("wireless_network_ict not in test_dut json") + exit(1) if "DUT_BSSID_5G" in self.json_dut["test_dut"]: self.dut_bssid_5g = self.json_dut["test_dut"]["DUT_BSSID_5G"] @@ -761,7 +765,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) def run_script_test(self): self.start_html_results() self.start_csv_results() - print(self.test_dict) + #print(self.test_dict) # loop through radios (For future functionality based on radio) if self.radio_dict: @@ -788,14 +792,37 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) for iteration in range(self.test_iterations): iteration += 1 - # if args key has a value of an empty string then need to manipulate the args_list to args - # list does not have replace only stings do to args_list will be joined and converted to a string and placed - # in args. Then the replace below will work. + # The network arguments need to be changed when in a list + for index, args_list_element in enumerate(self.test_dict[test]['args_list']): + if 'ssid_idx=' in args_list_element: + #print("args_list_element {}".format(args_list_element)) + # get ssid_idx used in the test as an index for the dictionary + ssid_idx_number = args_list_element.split('ssid_idx=')[-1].split()[0] + print("ssid_idx_number: {}".format(ssid_idx_number)) + idx = "ssid_idx={}".format(ssid_idx_number) # index into the DUT network index + print("idx: {}".format(idx)) + if 'SSID_USED' in args_list_element: + #args_list_element = args_list_element.replace('SSID_USED', self.wireless_network_dict[idx]['SSID_USED']) + self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('SSID_USED', self.wireless_network_dict[idx]['SSID_USED']) + if 'SECURITY_USED' in args_list_element: + #args_list_element = args_list_element.replace('SECURITY_USED', self.wireless_network_dict[idx]['SECURITY_USED']) + self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('SECURITY_USED', self.wireless_network_dict[idx]['SECURITY_USED']) + if 'SSID_PW_USED' in args_list_element: + #args_list_element = args_list_element.replace('SSID_PW_USED', self.wireless_network_dict[idx]['SSID_PW_USED']) + self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('SSID_PW_USED', self.wireless_network_dict[idx]['SSID_PW_USED']) + if 'BSSID' in args_list_element: + #args_list_element = args_list_element.replace('BSSID', self.wireless_network_dict[idx]['BSSID']) + self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('BSSID', self.wireless_network_dict[idx]['BSSID']) + + #print("args_list_element: {}".format(args_list_element)) + #print("self.test_dict[test]['args_list']: {}".format(self.test_dict[test]['args_list'])) + + + # Walk all the args in the args list then construct the arguments if self.test_dict[test]['args'] == "": self.test_dict[test]['args'] = self.test_dict[test]['args'].replace(self.test_dict[test]['args'], ''.join(self.test_dict[test][ 'args_list'])) - if 'DATABASE_SQLITE' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_SQLITE', self.database_sqlite) if 'HTTP_TEST_IP' in self.test_dict[test]['args']: @@ -868,6 +895,14 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.dut_set_name) if 'TEST_RIG' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('TEST_RIG', self.test_rig) + + + # END of command line arg processing + if self.test_dict[test]['args'] == "": + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace(self.test_dict[test]['args'], + ''.join(self.test_dict[test][ + 'args_list'])) + # end of database configuration if 'timeout' in self.test_dict[test]: @@ -936,7 +971,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) start_time = datetime.datetime.now() try: process = subprocess.Popen(command_to_run, shell=False, stdout=stdout_log, stderr=stderr_log, - universal_newlines=True) + universal_newlines=True) # if there is a better solution please propose, the TIMEOUT Result is different then FAIL try: if int(self.test_timeout != 0): From 23bd27d9acefde31d15b25882cead971681e94b0 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 5 Oct 2021 17:34:40 -0600 Subject: [PATCH 073/731] ct_ - QA information updated for using the wireless_network configuration for tests. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_001_AX88U_dut.json | 9 ----- py-scripts/tools/ct_002_AX12_dut.json | 16 +++------ py-scripts/tools/ct_003_AX88U_dut.json | 14 +++----- py-scripts/tools/ct_004_AX88U_dut.json | 17 ++------- py-scripts/tools/ct_us_002_tests.json | 28 +++++++-------- py-scripts/tools/ct_us_003_tests.json | 50 +++++++++++++------------- py-scripts/tools/ct_us_004_tests.json | 48 ++++++++++++------------- 7 files changed, 75 insertions(+), 107 deletions(-) diff --git a/py-scripts/tools/ct_001_AX88U_dut.json b/py-scripts/tools/ct_001_AX88U_dut.json index 69bf4a2d..77bd1a56 100644 --- a/py-scripts/tools/ct_001_AX88U_dut.json +++ b/py-scripts/tools/ct_001_AX88U_dut.json @@ -12,15 +12,6 @@ "test_dut":{ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "DUT_NAME": "ASUSRT-AX88U", - "DUT_BSSID_2G": "3c:7c:3f:55:4d:60", - "DUT_BSSID_5G": "3c:7c:3f:55:4d:64", - "DUT_SW": "3.0.0.4.386_44266", - "SSID_5G_USED": "asus11ax-5", - "SSID_5G_PW_USED": "hello123", - "SECURITY_5G_USED": "wpa2", - "SSID_2G_USED": "asus11ax-2", - "SSID_2G_PW_USED": "hello123", - "SECURITY_2G_USED": "wpa2", "wireless_network_dict":{ "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} diff --git a/py-scripts/tools/ct_002_AX12_dut.json b/py-scripts/tools/ct_002_AX12_dut.json index 43b34e73..b11cc0f6 100644 --- a/py-scripts/tools/ct_002_AX12_dut.json +++ b/py-scripts/tools/ct_002_AX12_dut.json @@ -3,9 +3,6 @@ "Notes":[ "This json file is used as an input to the ./lf_check.py file", "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code.", "The dut related configuration is contained in this file", "NOTE: create_chamberview_dut starts ssid-idx at 0 ", "NOTE: create_chamberview starts counting at Radio-1 which is dut ssid-idx 0" @@ -14,15 +11,12 @@ "test_dut":{ "DUT_SET_NAME": "DUT_NAME Netgear-AX12", "DUT_NAME": "Netgear-AX12", - "DUT_BSSID_2G": "94:a6:7e:54:d4:31", - "DUT_BSSID_5G": "94:a6:7e:54:d4:33", "DUT_SW": "3.0.0.4.386_44266", - "SSID_2G_USED": "NETGEAR59", - "SSID_2G_PW_USED": "crispynest798", - "SECURITY_2G_USED": "wpa2", - "SSID_5G_USED": "NETGEAR59-5G", - "SSID_5G_PW_USED": "crispynest798", - "SECURITY_5G_USED": "wpa2" + "wireless_network":{ + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"NETGEAR59","SSID_PW_USED":"crispynest798","BSSID_USED":"94:a6:7e:54:d4:31","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"NETGEAR59-5G","SSID_PW_USED":"crispynest798","BSSID_USED":"94:a6:7e:54:d4:33","SECURITY_USED":"wpa2"} + } + } } \ No newline at end of file diff --git a/py-scripts/tools/ct_003_AX88U_dut.json b/py-scripts/tools/ct_003_AX88U_dut.json index 2ec3c1ff..c3acc7da 100644 --- a/py-scripts/tools/ct_003_AX88U_dut.json +++ b/py-scripts/tools/ct_003_AX88U_dut.json @@ -12,15 +12,11 @@ "test_dut":{ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "DUT_NAME": "ASUSRT-AX88U", - "DUT_BSSID_2G": "d4:5d:64:a0:7f:78", - "DUT_BSSID_5G": "d4:5d:64:a0:7f:7c", - "DUT_SW": "3.0.0.4.386_44266", - "SSID_5G_USED": "asus11ax-5", - "SSID_5G_PW_USED": "hello123", - "SECURITY_5G_USED": "wpa2", - "SSID_2G_USED": "asus11ax-2", - "SSID_2G_PW_USED": "hello123", - "SECURITY_2G_USED": "wpa2" + "wireless_network":{ + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"0c:9d:92:02:42:e0","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"0c:9d:92:02:42:e4","SECURITY_USED":"wpa2"} + } + } } \ No newline at end of file diff --git a/py-scripts/tools/ct_004_AX88U_dut.json b/py-scripts/tools/ct_004_AX88U_dut.json index e07c7f4e..75d2cfa5 100644 --- a/py-scripts/tools/ct_004_AX88U_dut.json +++ b/py-scripts/tools/ct_004_AX88U_dut.json @@ -2,28 +2,15 @@ "ct_AX88U_dut":{ "Notes":[ "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code.", "The dut related configuration is contained in this file" ] }, "test_dut":{ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "DUT_NAME": "ASUSRT-AX88U", - "DUT_BSSID_2G": "d4:5d:64:a0:7f:78", - "DUT_BSSID_5G": "d4:5d:64:a0:7f:7c", - "DUT_SW": "3.0.0.4.386_44266", - "SSID_5G_USED": "asus11ax-5", - "SSID_5G_PW_USED": "hello123", - "SECURITY_5G_USED": "wpa2", - "SSID_2G_USED": "asus11ax-2", - "SSID_2G_PW_USED": "hello123", - "SECURITY_2G_USED": "wpa2", "wireless_network":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"aux11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:78","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"aux11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:7c","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:78","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:7c","SECURITY_USED":"wpa2"} } } } diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 3284c3ef..600d5111 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -35,8 +35,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-002_create_chamberview_1":{ @@ -60,7 +60,7 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS", " --instance_name ap-auto-instance --config_name test_con --upstream UPSTREAM_PORT", - " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (1)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_5G (1)'", + " --dut5_0 'DUT_NAME lanforge BSSID (1)' --dut2_0 'DUT_NAME lanforge BSSID (1)'", " --max_stations_2 32 --max_stations_5 32 --max_stations_dual 100 --radio2 1.1.wiphy1", " --radio5 1.1.wiphy2 --set 'Basic Client Connectivity' 1", " --set 'Multi Band Performance' 0 --set 'Stability' 0 --set 'Multi-Station Throughput vs Pkt Size' 0,", @@ -88,8 +88,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-002_create_chamberview_ATH10k_sta64":{ @@ -125,8 +125,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-002_create_chamberview_ATH10k_wan1":{ @@ -163,8 +163,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-002_create_chamberview_AX200_sta1":{ @@ -199,8 +199,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-002_create_chamberview_AX200_wan1":{ @@ -237,8 +237,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=NETGEAR59 security=WPA2 password=crispynest798 bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=NETGEAR59-5G security=WPA2 password=crispynest798 bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=NETGEAR59 security=WPA2 password=crispynest798 bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=NETGEAR59-5G security=WPA2 password=crispynest798 bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-002_create_chamberview_auto":{ @@ -262,7 +262,7 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap-auto-instance --config_name test_con --upstream eth2", - " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", + " --dut5_0 'DUT_NAME lanforge BSSID (2)' --dut2_0 'DUT_NAME lanforge BSSID (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy0 --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index f8ef385a..94a2315f 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -18,8 +18,8 @@ "args_list": [ " --mgr LF_MGR_IP", " --resource 1", - " --ssid SSID_5G_USED", - " --password SSID_5G_PW_USED", + " --ssid SSID_USED", + " --password SSID_PW_USED", " --security wpa2", " --radio wiphy1", " --upstream_port UPSTREAM_PORT", @@ -33,7 +33,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2 ", - " --radio 'radio==wiphy1,stations==4,ssid==SSID_5G_USED,ssid_pw==SSID_5G_PW_USED,security==SECURITY_5G_USED' ", + " --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000" ] }, @@ -56,8 +56,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -95,8 +95,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -148,8 +148,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -187,8 +187,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -229,8 +229,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -267,8 +267,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -308,8 +308,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -347,8 +347,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -388,8 +388,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-003_create_chamberview_ap":{ @@ -414,7 +414,7 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap-auto-instance --config_name test_con --upstream eth2", - " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", + " --dut5_0 'DUT_NAME lanforge BSSID (2)' --dut2_0 'DUT_NAME lanforge BSSID (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", @@ -450,8 +450,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-003_create_chamberview_ap":{ @@ -476,7 +476,7 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap-auto-instance --config_name test_con --upstream eth2", - " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", + " --dut5_0 'DUT_NAME lanforge BSSID (2)' --dut2_0 'DUT_NAME lanforge BSSID (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index c0772e3b..f5a2bd69 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -18,7 +18,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2 ", - " --radio 'radio==wiphy1,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' ", + " --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000" ] } @@ -31,7 +31,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2 ", - " --radio 'radio==wiphy1,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' ", + " --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", " --ap_read --ap_test_mode" ] @@ -45,8 +45,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", - " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -122,8 +122,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", - " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -161,8 +161,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", - " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -212,8 +212,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", - " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -251,8 +251,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", - " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -311,8 +311,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", - " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -379,8 +379,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", - " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -434,8 +434,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", - " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, @@ -502,8 +502,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_2G_USED security=SECURITY_2G_USED password=SSID_2G_PW_USED bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=SSID_5G_USED security=SECURITY_5G_USED password=SSID_5G_PW_USED bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-004_create_chamberview_ap":{ @@ -528,7 +528,7 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap-auto-instance --config_name test_con --upstream eth2", - " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", + " --dut5_0 'DUT_NAME lanforge BSSID (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", @@ -565,8 +565,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=asus11ax-2 security=WPA2 password=hello123 bssid=DUT_BSSID_2G'", - " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=DUT_BSSID_2G'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "CT-US-004_create_chamberview_ap":{ @@ -591,7 +591,7 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap-auto-instance --config_name test_con --upstream UPSTREAM_PORT", - " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (1)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", + " --dut5_0 'DUT_NAME lanforge BSSID (1)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", " --max_stations_2 4 --max_stations_5 2 --max_stations_dual 100 --radio2 1.1.wiphy0", " --radio5 1.1.wiphy1 --set 'Basic Client Connectivity' 1", " --set 'Multi Band Performance' 0 --set 'Stability' 0 --set 'Multi-Station Throughput vs Pkt Size' 0,", From b5cad4a698c687f063dcc79917be69e481ad1e9c Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 5 Oct 2021 17:45:44 -0600 Subject: [PATCH 074/731] ct_ QA fixed network dictionary typo Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_002_AX12_dut.json | 2 +- py-scripts/tools/ct_003_AX88U_dut.json | 2 +- py-scripts/tools/ct_004_AX88U_dut.json | 2 +- py-scripts/tools/lf_check.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/tools/ct_002_AX12_dut.json b/py-scripts/tools/ct_002_AX12_dut.json index b11cc0f6..36410192 100644 --- a/py-scripts/tools/ct_002_AX12_dut.json +++ b/py-scripts/tools/ct_002_AX12_dut.json @@ -12,7 +12,7 @@ "DUT_SET_NAME": "DUT_NAME Netgear-AX12", "DUT_NAME": "Netgear-AX12", "DUT_SW": "3.0.0.4.386_44266", - "wireless_network":{ + "wireless_network_dict":{ "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"NETGEAR59","SSID_PW_USED":"crispynest798","BSSID_USED":"94:a6:7e:54:d4:31","SECURITY_USED":"wpa2"}, "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"NETGEAR59-5G","SSID_PW_USED":"crispynest798","BSSID_USED":"94:a6:7e:54:d4:33","SECURITY_USED":"wpa2"} } diff --git a/py-scripts/tools/ct_003_AX88U_dut.json b/py-scripts/tools/ct_003_AX88U_dut.json index c3acc7da..083ebc9e 100644 --- a/py-scripts/tools/ct_003_AX88U_dut.json +++ b/py-scripts/tools/ct_003_AX88U_dut.json @@ -12,7 +12,7 @@ "test_dut":{ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "DUT_NAME": "ASUSRT-AX88U", - "wireless_network":{ + "wireless_network_dict":{ "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"0c:9d:92:02:42:e0","SECURITY_USED":"wpa2"}, "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"0c:9d:92:02:42:e4","SECURITY_USED":"wpa2"} } diff --git a/py-scripts/tools/ct_004_AX88U_dut.json b/py-scripts/tools/ct_004_AX88U_dut.json index 75d2cfa5..ce798b1c 100644 --- a/py-scripts/tools/ct_004_AX88U_dut.json +++ b/py-scripts/tools/ct_004_AX88U_dut.json @@ -8,7 +8,7 @@ "test_dut":{ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "DUT_NAME": "ASUSRT-AX88U", - "wireless_network":{ + "wireless_network_dict":{ "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:78","SECURITY_USED":"wpa2"}, "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:7c","SECURITY_USED":"wpa2"} } diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 47a0ba5d..cf786e23 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -638,7 +638,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.wireless_network_dict = self.json_dut["test_dut"]["wireless_network_dict"] self.logger.info("self.wireless_network_dict {}".format(self.wireless_network_dict)) else: - self.logger.info("wireless_network_ict not in test_dut json") + self.logger.info("wireless_network_dict not in test_dut json") exit(1) if "DUT_BSSID_5G" in self.json_dut["test_dut"]: From d6e9c300831fd3dc04a932be80b52148d3c73c58 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 5 Oct 2021 17:51:38 -0600 Subject: [PATCH 075/731] ct QA json update Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_002_AX12_dut.json | 4 ++-- py-scripts/tools/ct_003_AX88U_dut.json | 4 ++-- py-scripts/tools/ct_004_AX88U_dut.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/py-scripts/tools/ct_002_AX12_dut.json b/py-scripts/tools/ct_002_AX12_dut.json index 36410192..aff16371 100644 --- a/py-scripts/tools/ct_002_AX12_dut.json +++ b/py-scripts/tools/ct_002_AX12_dut.json @@ -13,8 +13,8 @@ "DUT_NAME": "Netgear-AX12", "DUT_SW": "3.0.0.4.386_44266", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"NETGEAR59","SSID_PW_USED":"crispynest798","BSSID_USED":"94:a6:7e:54:d4:31","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"NETGEAR59-5G","SSID_PW_USED":"crispynest798","BSSID_USED":"94:a6:7e:54:d4:33","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"NETGEAR59","SSID_PW_USED":"crispynest798","BSSID":"94:a6:7e:54:d4:31","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"NETGEAR59-5G","SSID_PW_USED":"crispynest798","BSSID":"94:a6:7e:54:d4:33","SECURITY_USED":"wpa2"} } } diff --git a/py-scripts/tools/ct_003_AX88U_dut.json b/py-scripts/tools/ct_003_AX88U_dut.json index 083ebc9e..262ffc41 100644 --- a/py-scripts/tools/ct_003_AX88U_dut.json +++ b/py-scripts/tools/ct_003_AX88U_dut.json @@ -13,8 +13,8 @@ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "DUT_NAME": "ASUSRT-AX88U", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"0c:9d:92:02:42:e0","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"0c:9d:92:02:42:e4","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID":"0c:9d:92:02:42:e0","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID":"0c:9d:92:02:42:e4","SECURITY_USED":"wpa2"} } } diff --git a/py-scripts/tools/ct_004_AX88U_dut.json b/py-scripts/tools/ct_004_AX88U_dut.json index ce798b1c..08e1c4ac 100644 --- a/py-scripts/tools/ct_004_AX88U_dut.json +++ b/py-scripts/tools/ct_004_AX88U_dut.json @@ -9,8 +9,8 @@ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "DUT_NAME": "ASUSRT-AX88U", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:78","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:7c","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID":"d4:5d:64:a0:7f:78","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID":"d4:5d:64:a0:7f:7c","SECURITY_USED":"wpa2"} } } } From bcfdb1063fd553fa04fb7d062ada57b4a8785d3a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 5 Oct 2021 21:15:31 -0600 Subject: [PATCH 076/731] lf_check.py : look for error in stdout Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index cf786e23..d523f0e2 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1040,13 +1040,27 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.text_result = "Failure" background = self.background_red else: - self.test_result = "Success" + self.text_result = "Success" background = self.background_green else: self.logger.info("File: {} is empty: {}".format(stderr_log_txt, str(stderr_log_size))) self.test_result = "Success" background = self.background_green + # Check to see if there is an error in stdout_log + if stdout_log_size > 0: + text = open(stdout_log_txt).read() + if 'error' in text.lower(): + self.test_result = "Failure" + background = self.background_red + else: + self.test_result = "Success" + background = self.background_green + else: + # if stdout empty that is a failure also + self.test_resut = "Failure" + background = self.background_red + # if there was a if self.test_result == "TIMEOUT": self.logger.info("TIMEOUT FAILURE, Check LANforge Radios") From 31734eaac43052e2d644cbab787d2a99099d7e39 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 06:06:50 -0600 Subject: [PATCH 077/731] lf_check.py : look in stdout for test failure Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index d523f0e2..2fdcd075 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1051,7 +1051,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) if stdout_log_size > 0: text = open(stdout_log_txt).read() if 'error' in text.lower(): - self.test_result = "Failure" + self.test_result = "Test Failure" background = self.background_red else: self.test_result = "Success" From 5e44fa72e07513db531ff66515b9a8cc14a99e41 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 06:17:21 -0600 Subject: [PATCH 078/731] lf_check.py : account for 5.4.3 , ERROR: Could not find component: TestTag this is still considered a pass Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 2fdcd075..2bff1191 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -154,6 +154,7 @@ class lf_check(): self.html_results = "" self.background_green = "background-color:green" self.background_red = "background-color:red" + self.background_orange = "background-color:orange" self.background_purple = "background-color:purple" self.background_blue = "background-color:blue" @@ -1050,9 +1051,13 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) # Check to see if there is an error in stdout_log if stdout_log_size > 0: text = open(stdout_log_txt).read() - if 'error' in text.lower(): - self.test_result = "Test Failure" - background = self.background_red + # for 5.4.3 only TestTag was not present + if 'ERROR: Could not find component: TestTag' in text: + self.test_result = "Success" + background = self.background_green + elif 'error' in text.lower(): + self.test_result = "Test Fail" + background = self.background_orange else: self.test_result = "Success" background = self.background_green From 2e9e6013c9c0c91eff3aaeeaf58e1bad9664e741 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 06:42:42 -0600 Subject: [PATCH 079/731] lf_check.py : use_ssid_idx= for any script that does not directly use ssid_idx= which is passed to LANforge. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 4 ++-- py-scripts/tools/lf_check.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index a9e369d3..e3d1c262 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -29,7 +29,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2 ", - " --radio 'radio==wiphy1,stations==4,ssid==SSID_5G_USED,ssid_pw==SSID_5G_PW_USED,security==SECURITY_5G_USED' ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000" ] } @@ -42,7 +42,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2 ", - " --radio 'radio==wiphy1,stations==4,ssid==SSID_5G_USED,ssid_pw==SSID_5G_PW_USED,security==SECURITY_5G_USED' ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", " --ap_read --ap_test_mode" ] diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 2bff1191..e9777959 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -815,8 +815,14 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) #args_list_element = args_list_element.replace('BSSID', self.wireless_network_dict[idx]['BSSID']) self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('BSSID', self.wireless_network_dict[idx]['BSSID']) + # use_ssid_idx is ephemeral and used only for variable replacement , remove + tmp_idx = "use_ssid_idx={}".format(ssid_idx_number) + if tmp_idx in args_list_element: + self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace(tmp_idx,'') + + # leave in for checking the command line arguments #print("args_list_element: {}".format(args_list_element)) - #print("self.test_dict[test]['args_list']: {}".format(self.test_dict[test]['args_list'])) + print("self.test_dict[test]['args_list']: {}".format(self.test_dict[test]['args_list'])) # Walk all the args in the args list then construct the arguments From 7519d18b56dd9f809a8c98091ca3e6e0e53a67e7 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 06:52:43 -0600 Subject: [PATCH 080/731] lf_check.py : removed unused code for individual 2G, 5G and 6G configuration which si replaced by wireless_network_dict Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 108 ----------------------------------- 1 file changed, 108 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index e9777959..13539bfe 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -202,22 +202,6 @@ class lf_check(): self.dut_wireless_network_dict = {} - self.dut_bssid_2g = "BSSID_2G_NA" # "3c:7c:3f:55:4d:64" - this is the mac for the 2.4G radio this may be seen with a scan - self.dut_bssid_5g = "BSSID_5G_NA" # "3c:7c:3f:55:4d:64" - this is the mac for the 5G radio this may be seen with a scan - self.dut_bssid_6g = "BSSID_6G_NA" # "3c:7c:3f:55:4d:64" - this is the mac for the 6G radio this may be seen with a scan - - self.ssid_2g = "" - self.ssid_2g_pw = "" - self.security_2g = "" - - self.ssid_5g = "" - self.ssid_5g_pw = "" - self.security_5g = "" - - self.ssid_6g = "" - self.ssid_6g_pw = "" - self.security_6g = "" - self.csv_results = _csv_results self.csv_results_file = "" self.csv_results_writer = "" @@ -642,61 +626,6 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.logger.info("wireless_network_dict not in test_dut json") exit(1) - if "DUT_BSSID_5G" in self.json_dut["test_dut"]: - self.dut_bssid_5g = self.json_dut["test_dut"]["DUT_BSSID_5G"] - else: - self.logger.info("DUT_BSSID_5G not in test_dut json") - - if "DUT_BSSID_6G" in self.json_dut["test_dut"]: - self.dut_bssid_6g = self.json_dut["test_dut"]["DUT_BSSID_6G"] - else: - self.logger.info("DUT_BSSID_6G not in test_dut json") - - if "SSID_6G_USED" in self.json_dut["test_dut"]: - self.ssid_6g = self.json_dut["test_dut"]["SSID_6G_USED"] - else: - self.logger.info("SSID_6G_USED not in test_dut json") - - if "SSID_6G_PW_USED" in self.json_dut["test_dut"]: - self.ssid_6g_pw = self.json_dut["test_dut"]["SSID_6G_PW_USED"] - else: - self.logger.info("SSID_6G_PW_USED not in test_dut json") - - if "SECURITY_6G_USED" in self.json_dut["test_dut"]: - self.security_6g = self.json_dut["test_dut"]["SECURITY_6G_USED"] - else: - self.logger.info("SECURITY_6G_USED not in test_dut json") - - if "SSID_5G_USED" in self.json_dut["test_dut"]: - self.ssid_5g = self.json_dut["test_dut"]["SSID_5G_USED"] - else: - self.logger.info("SSID_5G_USED not in test_dut json") - - if "SSID_5G_PW_USED" in self.json_dut["test_dut"]: - self.ssid_5g_pw = self.json_dut["test_dut"]["SSID_5G_PW_USED"] - else: - self.logger.info("SSID_5G_PW_USED not in test_dut json") - - if "SECURITY_5G_USED" in self.json_dut["test_dut"]: - self.security_5g = self.json_dut["test_dut"]["SECURITY_5G_USED"] - else: - self.logger.info("SECURITY_5G_USED not in test_dut json") - - if "SSID_2G_USED" in self.json_dut["test_dut"]: - self.ssid_2g = self.json_dut["test_dut"]["SSID_2G_USED"] - else: - self.logger.info("SSID_2G_USED not in test_dut json") - - if "SSID_2G_PW_USED" in self.json_dut["test_dut"]: - self.ssid_2g_pw = self.json_dut["test_dut"]["SSID_2G_PW_USED"] - else: - self.logger.info("SSID_2G_PW_USED not in test_dut json") - - if "SECURITY_2G_USED" in self.json_dut["test_dut"]: - self.security_2g = self.json_dut["test_dut"]["SECURITY_2G_USED"] - else: - self.logger.info("SECURITY_2G_USED not in test_dut json") - def read_test_network(self): if "HTTP_TEST_IP" in self.json_rig["test_network"]: self.http_test_ip = self.json_rig["test_network"]["HTTP_TEST_IP"] @@ -803,16 +732,12 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) idx = "ssid_idx={}".format(ssid_idx_number) # index into the DUT network index print("idx: {}".format(idx)) if 'SSID_USED' in args_list_element: - #args_list_element = args_list_element.replace('SSID_USED', self.wireless_network_dict[idx]['SSID_USED']) self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('SSID_USED', self.wireless_network_dict[idx]['SSID_USED']) if 'SECURITY_USED' in args_list_element: - #args_list_element = args_list_element.replace('SECURITY_USED', self.wireless_network_dict[idx]['SECURITY_USED']) self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('SECURITY_USED', self.wireless_network_dict[idx]['SECURITY_USED']) if 'SSID_PW_USED' in args_list_element: - #args_list_element = args_list_element.replace('SSID_PW_USED', self.wireless_network_dict[idx]['SSID_PW_USED']) self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('SSID_PW_USED', self.wireless_network_dict[idx]['SSID_PW_USED']) if 'BSSID' in args_list_element: - #args_list_element = args_list_element.replace('BSSID', self.wireless_network_dict[idx]['BSSID']) self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('BSSID', self.wireless_network_dict[idx]['BSSID']) # use_ssid_idx is ephemeral and used only for variable replacement , remove @@ -821,7 +746,6 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace(tmp_idx,'') # leave in for checking the command line arguments - #print("args_list_element: {}".format(args_list_element)) print("self.test_dict[test]['args_list']: {}".format(self.test_dict[test]['args_list'])) @@ -861,33 +785,6 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) if 'DUT_SERIAL' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_SERIAL', self.dut_serial) - if 'DUT_BSSID_2G' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_BSSID_2G', self.dut_bssid_2g) - if 'SSID_2G_USED' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SSID_2G_USED', self.ssid_2g) - if 'SSID_2G_PW_USED' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SSID_2G_PW_USED', self.ssid_2g_pw) - if 'SECURITY_2G_USED' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SECURITY_2G_USED', self.security_2g) - - if 'DUT_BSSID_5G' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_BSSID_5G', self.dut_bssid_5g) - if 'SSID_5G_USED' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SSID_5G_USED', self.ssid_5g) - if 'SSID_5G_PW_USED' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SSID_5G_PW_USED', self.ssid_5g_pw) - if 'SECURITY_5G_USED' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SECURITY_5G_USED', self.security_5g) - - if 'DUT_BSSID_6G' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_BSSID_6G', self.dut_bssid_6g) - if 'SSID_6G_USED' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SSID_6G_USED', self.ssid_6g) - if 'SSID_6G_PW_USED' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SSID_6G_PW_USED', self.ssid_6g_pw) - if 'SECURITY_6G_USED' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SECURITY_6G_USED', self.security_6g) - if 'UPSTREAM_PORT' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('UPSTREAM_PORT', self.upstream_port) @@ -896,22 +793,18 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) if 'REPORT_PATH' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('REPORT_PATH', self.report_path) - # The TEST_BED is the database tag if 'DUT_SET_NAME' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_SET_NAME', self.dut_set_name) if 'TEST_RIG' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('TEST_RIG', self.test_rig) - # END of command line arg processing if self.test_dict[test]['args'] == "": self.test_dict[test]['args'] = self.test_dict[test]['args'].replace(self.test_dict[test]['args'], ''.join(self.test_dict[test][ 'args_list'])) - # end of database configuration - if 'timeout' in self.test_dict[test]: self.logger.info("timeout : {}".format(self.test_dict[test]['timeout'])) self.test_timeout = int(self.test_dict[test]['timeout']) @@ -1088,7 +981,6 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.qa_report_html = self.qa_report_html.replace('html report: ','') - # stdout_log_link is used for the email reporting to have the corrected path stdout_log_link = str(stdout_log_txt).replace('/home/lanforge', '') stderr_log_link = str(stderr_log_txt).replace('/home/lanforge', '') From f278640d637e3f56e6c0d6a0296ec6fee596fb82 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 07:06:42 -0600 Subject: [PATCH 081/731] lf_csv.py , removed the kpi functionality form csv common library lf_kpi_csv.py added this file for kpi functionality , This file will be the start of a kpi.csv generating library to maintain format for other scripts Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_csv.py | 38 +++-------------------- py-scripts/lf_kpi_csv.py | 65 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 34 deletions(-) mode change 100644 => 100755 py-scripts/lf_csv.py create mode 100644 py-scripts/lf_kpi_csv.py diff --git a/py-scripts/lf_csv.py b/py-scripts/lf_csv.py old mode 100644 new mode 100755 index 01a90ad3..747b1017 --- a/py-scripts/lf_csv.py +++ b/py-scripts/lf_csv.py @@ -42,39 +42,9 @@ class lf_csv: print(csv_df) csv_df.to_csv(self.filename, index=False, encoding='utf-8', na_rep='NA', float_format='%.2f') -# this layout may need to change -''' -kpi.csv : specific file that is used for the database, dashboard and blog post -A blank entry is a valid entry in some cases. - - Date: date of run - test-rig : testbed that the tests are run on for example ct_us_001 - test-tag : test specific information to differenciate the test, LANforge radios used, security modes (wpa2 , open) - dut-hw-version : hardware version of the device under test - dut-sw-version : software version of the device under test - dut-model-num : model number / name of the device under test - test-priority : test-priority is arbitrary number, choosing under 95 means it goes down at bottom of blog report, and higher priority goes at top. - test-id : script or test name , AP Auto, wifi capacity, data plane, dfs - short-description : short description of the test - pass/fail : set blank for performance tests - numeric-score : this is the value for the y-axis (x-axis is a timestamp), numeric value of what was measured - test-details : what was measured in the numeric-score, e.g. bits per second, bytes per second, upload speed, minimum cx time (ms) - Units : units used for the numeric-scort - Graph-Group - For the dashboard the graph / panel to put the resutls in . Currently the dashboard is Grafana - -''' -class lf_kpi_csv: - def __init__(self, - _kpi_headers = ['Date','test-rig','test-tag','dut-hw-version','dut-sw-version','dut-model-num', - 'test-priority','test-id','short-description','pass/fail','numberic-score' - 'test details','Units','Graph-Group','Subtest-Pass','Subtest-Fail'], - _kpi_file='kpi.csv' #Currently this is the only file name accepted - ): - self.kpi_headers = _kpi_headers - self.kpi_rows = "" - self.kpi_filename = _kpi_file - - -if __name__ == "__main__": +def main(): test = lf_csv() test.generate_csv() + +if __name__ == "__main__": + main() diff --git a/py-scripts/lf_kpi_csv.py b/py-scripts/lf_kpi_csv.py new file mode 100644 index 00000000..f1abc4d5 --- /dev/null +++ b/py-scripts/lf_kpi_csv.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +''' +NAME: lf_kpi_csv.py + +PURPOSE: +Common Library for generating kpi csv for LANforge output +KPI - Key Performance Indicators + +SETUP: +/lanforge/html-reports directory needs to be present or output generated in local file + +EXAMPLE: +see: run any chamberview test to see what a generated kpi.csv + +COPYWRITE + Copyright 2021 Candela Technologies Inc + License: Free to distribute and modify. LANforge systems must be licensed. + +INCLUDE_IN_README +''' + +import pandas as pd + + +# this layout may need to change +''' +kpi.csv : specific file that is used for the database, dashboard and blog post +A blank entry is a valid entry in some cases. + + Date: date of run + test-rig : testbed that the tests are run on for example ct_us_001 + test-tag : test specific information to differenciate the test, LANforge radios used, security modes (wpa2 , open) + dut-hw-version : hardware version of the device under test + dut-sw-version : software version of the device under test + dut-model-num : model number / name of the device under test + test-priority : test-priority is arbitrary number, choosing under 95 means it goes down at bottom of blog report, and higher priority goes at top. + test-id : script or test name , AP Auto, wifi capacity, data plane, dfs + short-description : short description of the test + pass/fail : set blank for performance tests + numeric-score : this is the value for the y-axis (x-axis is a timestamp), numeric value of what was measured + test-details : what was measured in the numeric-score, e.g. bits per second, bytes per second, upload speed, minimum cx time (ms) + Units : units used for the numeric-scort + Graph-Group - For the lf_qa.py dashboard + +''' +class lf_kpi_csv: + def __init__(self, + _kpi_headers = ['Date','test-rig','test-tag','dut-hw-version','dut-sw-version','dut-model-num', + 'test-priority','test-id','short-description','pass/fail','numberic-score' + 'test details','Units','Graph-Group','Subtest-Pass','Subtest-Fail'], + _kpi_file='kpi.csv' #Currently this is the only file name accepted + ): + self.kpi_headers = _kpi_headers + self.kpi_rows = "" + self.kpi_filename = _kpi_file + + def generate_kpi_csv(self): + pass + +def main(): + test = lf_kpi_csv() + test.generate_kpi_csv() + +if __name__ == "__main__": + main() From 06beca75aa498b3ca2d3d905a8a13cefd8932f94 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 08:17:15 -0600 Subject: [PATCH 082/731] lf_qa.py removed dash components 1. removed the dash components as there will be a server for displaying results and 2. copyied lf_qa.py version prior to updates to sandbox/lf_qa_dash.py Signed-off-by: Chuck SmileyRekiere --- py-scripts/sandbox/lf_qa_dash.py | 607 +++++++++++++++++++++++++++++++ py-scripts/tools/lf_qa.py | 111 +----- 2 files changed, 615 insertions(+), 103 deletions(-) create mode 100755 py-scripts/sandbox/lf_qa_dash.py diff --git a/py-scripts/sandbox/lf_qa_dash.py b/py-scripts/sandbox/lf_qa_dash.py new file mode 100755 index 00000000..fa0464bb --- /dev/null +++ b/py-scripts/sandbox/lf_qa_dash.py @@ -0,0 +1,607 @@ +#!/usr/bin/env python3 +''' +File: read kpi.csv place in sql database, create png of historical kpi and present graph on dashboard +Usage: kpi_csv_sq.py --store --png --show --path --database +Example: kpi_csv_sq.py --show (show dashboard generated from database) +Example: kpi_csv_sq.py --store --png --show --path (read kpi.csv store to database, write png, show dashboard ) +''' +# visit http://127.0.0.1:8050/ in your web browser. +import sys +import os +import importlib +import dash +import dash_core_components as dcc +import dash_html_components as html +import plotly.express as px +import pandas as pd +import sqlite3 +import argparse +from pathlib import Path +import time + +sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) + +lf_report = importlib.import_module("py-scripts.lf_report") +lf_report = lf_report.lf_report + +# Any style components can be used +external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] +class csv_sqlite_dash(): + def __init__(self, + _path = '.', + _file = 'kpi.csv', + _database = 'qa_db', + _table = 'qa_table', + _server = 'http://192.168.95.6/', + _cut = '/home/lanforge/', + _png = False): + self.path = _path + self.file = _file + self.database = _database + self.table = _table + self.server = _server + self.cut = _cut + self.png = _png + self.png_generated = False + self.kpi_list = [] + self.html_list = [] + self.conn = None + self.df = pd.DataFrame() + self.plot_figure = [] + self.children_div = [] + self.html_results ="" + self.test_rig_list = [] + self.server_html_reports = self.server + 'html-reports/' #TODO : hard coded - is this needed? have server + self.server_started = False + self.dut_model_num_list = "NA" + self.dut_model_num = "NA" + self.dut_sw_version_list = "NA" + self.dut_sw_version = "NA" + self.dut_hw_version_list = "NA" + self.dut_hw_version = "NA" + self.dut_serial_num_list = "NA" + self.dut_serial_num = "NA" + + self.app = dash.Dash(__name__, external_stylesheets=external_stylesheets) + # https://community.plotly.com/t/putting-a-dash-instance-inside-a-class/6097/3 + #https://dash.plotly.com/dash-html-components/button + #self.app.callback(dash.dependencies.Output('container-button-basic', 'children'), + # [dash.dependencies.Input(component_id ='submit-val', component_property ='n_clicks')])(self.show) + + # Helper methods + def get_test_rig_list(self): + return self.test_rig_list + + def get_html_results(self): + return self.html_results + + def get_dut_info(self): + #try: + print("get_dut_info DUT: {DUT} SW:{SW} HW:{HW} SN:{SN}" + .format(DUT=self.dut_model_num,SW=self.dut_sw_version,HW=self.dut_hw_version,SN=self.dut_serial_num)) + + dut_dict = { + 'DUT':[self.dut_model_num], + 'SW version': [self.dut_sw_version], + 'HW version':[self.dut_hw_version], + 'SN':[self.dut_serial_num] + } + print('DUT dict: {dict}'.format(dict=dut_dict)) + dut_info_df = pd.DataFrame(dut_dict) + print("DUT df from dict: {df}".format(df=dut_info_df)) + + return dut_info_df + + def get_parent_path(self,_path): + parent_path = os.path.dirname(_path) + return parent_path + + def get_test_id_test_tag(self,_kpi_path): + test_id = "NA" + test_tag = "NA" + use_meta_test_tag = False + try: + kpi_df = pd.read_csv(_kpi_path, sep='\t') + test_id_list = list(kpi_df['test-id']) + test_id = list(set(test_id_list)) + test_id = test_id[-1] # done to get element of list + except: + print("exception reading test_id in csv _kpi_path {kpi_path}".format(kpi_path=_kpi_path)) + try: + test_tag_list = list(kpi_df['test-tag']) + test_tag = list(set(test_tag_list)) + test_tag = test_tag[-1] # done to get element of list + except: + print("exception reading test-tag in csv _kpi_path {kpi_path}, try meta.txt".format(kpi_path=_kpi_path)) + + #if test_tag still NA then try meta file + try: + if test_tag == "NA": + _kpi_path = _kpi_path.replace('kpi.csv','') + use_meta_test_tag, test_tag = self.get_test_tag_from_meta(_kpi_path) + except: + print("exception reading meta.txt _kpi_path: {kpi_path}".format(kpi_path=_kpi_path)) + if use_meta_test_tag: + print("test_tag from meta.txt _kpi_path: {kpi_path}".format(kpi_path=_kpi_path)) + return test_id , test_tag + + # could enter on the command line, except there may be other exceptions + # may need an exception file + def get_test_tag_from_meta(self,_kpi_path): + test_tag = "NA" + use_meta_test_tag = False + gui_version_5_4_3 = False + print("read meta path {_kpi_path}".format(_kpi_path=_kpi_path)) + try: + meta_data_path = _kpi_path + '/' + '/meta.txt' + meta_data_fd = open(meta_data_path, 'r') + for line in meta_data_fd: + if "gui_version:" in line: + gui_version = line.replace("gui_version:","") + gui_version = gui_version.strip() + if gui_version =='5.4.3': + gui_version_5_4_3 = True + use_meta_test_tag = True + print("meta_data_path: {meta_data_path} gui_version: {gui_version} 5.4.3: {gui_version_5_4_3}".format( + meta_data_path=meta_data_path,gui_version=gui_version,gui_version_5_4_3=gui_version_5_4_3)) + meta_data_fd.close() + if gui_version_5_4_3: + meta_data_fd = open(meta_data_path, 'r') + test_tag = 'NA' + for line in meta_data_fd: + if "test_tag" in line: + test_tag = line.replace("test_tag","") + test_tag = test_tag.strip() + print("meta_data_path {meta_data_path} test_tag {test_tag}".format(meta_data_path=meta_data_path,test_tag=test_tag)) + meta_data_fd.close() + except: + print("exception reading test_tag from {_kpi_path}".format(_kpi_path=_kpi_path)) + + return use_meta_test_tag, test_tag + + #TODO pass in list to lf_report + # + def get_suite_html(self): + suite_html_results = """ +
+ + + + + + + + + """ + + path = Path(self.path) + pdf_info_list= list(path.glob('**/*.pdf')) # Hard code for now + print("pdf_info_list {}".format(pdf_info_list)) + for pdf_info in pdf_info_list: + if "lf_qa" in str(pdf_info): + pass + else: + pdf_base_name = os.path.basename(pdf_info) + if "check" in str(pdf_base_name): + pass + else: + parent_path = os.path.dirname(pdf_info) + pdf_path = os.path.join(parent_path,pdf_base_name) + pdf_path = self.server + pdf_path.replace(self.cut,'') + html_path = os.path.join(parent_path,"index.html") + html_path = self.server + html_path.replace(self.cut,'') + kpi_path = os.path.join(parent_path,"kpi.csv") + test_id, test_tag = self.get_test_id_test_tag(kpi_path) + suite_html_results += """ + + + """.format(test_id=test_id,test_tag=test_tag,html_path=html_path,pdf_path=pdf_path) + suite_html_results += """ + +
TestTest_TagLinks
{test_id}{test_tag}html / pdf
+
+ """ + + return suite_html_results + + def get_kpi_chart_html(self): + kpi_chart_html = """ + + + """ + path = Path(self.path) + kpi_chart_list= list(path.glob('**/kpi-chart*.png')) # Hard code for now + table_index = 0 + for kpi_chart in kpi_chart_list: + parent_path = os.path.dirname(kpi_chart) + kpi_path = os.path.join(parent_path,"kpi.csv") + test_tag , test_id = self.get_test_id_test_tag(kpi_path) + kpi_chart = os.path.abspath(kpi_chart) # Path returns a list of objects + kpi_chart = self.server + kpi_chart.replace(self.cut,'') + if "print" in kpi_chart: + pass + else: + if (table_index %2) == 0: + kpi_chart_html += """""" + kpi_chart_html += """ + + + """.format(test_tag=test_tag,test_id=test_id,kpi_chart_0=kpi_chart,kpi_chart_1=kpi_chart,kpi_chart_2=kpi_chart) + table_index += 1 + if (table_index %2) == 0: + kpi_chart_html += """""" + if (table_index %2) != 0: + kpi_chart_html += """""" + kpi_chart_html += """
+ {test_tag} {test_id} + + + + +
""" + return kpi_chart_html + + # information on sqlite database + # https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_sql.html + def store(self): + print("reading kpi and storing in db {}".format(self.database)) + path = Path(self.path) + self.kpi_list = list(path.glob('**/kpi.csv')) # Hard code for now + + if not self.kpi_list: + print("WARNING: used --store , no new kpi.csv found, check input path or remove --store from command line") + + for kpi in self.kpi_list: #TODO note empty kpi.csv failed test + df_kpi_tmp = pd.read_csv(kpi, sep='\t') + _kpi_path = str(kpi).replace('kpi.csv','') # only store the path to the kpi.csv file + df_kpi_tmp['kpi_path'] = _kpi_path + use_meta_test_tag, test_tag = self.get_test_tag_from_meta(_kpi_path) + if use_meta_test_tag: + df_kpi_tmp['test-tag'] = test_tag + df_kpi_tmp = df_kpi_tmp.append(df_kpi_tmp, ignore_index=True) + self.df = self.df.append(df_kpi_tmp, ignore_index=True) + + self.conn = sqlite3.connect(self.database) + try: + self.df.to_sql(self.table,self.conn,if_exists='append') + except: + print("attempt to append to database with different column layout, caused an exception, input new name --database ") + print("Error attempt to append to database with different column layout, caused an exception, input new name --database ", file=sys.stderr) + exit(1) + self.conn.close() + + def generate_graph_png(self): + print("generate png and html to display, generate time: {}".format(time.time())) + + #https://datacarpentry.org/python-ecology-lesson/09-working-with-sql/index.html- + self.conn = sqlite3.connect(self.database) + df3 = pd.read_sql_query("SELECT * from {}".format(self.table) ,self.conn) #current connection is sqlite3 /TODO move to SQLAlchemy + # sort by date from oldest to newest. + try: + df3 = df3.sort_values(by='Date') + except: + print("Database empty: KeyError(key) when sorting by Date, check Database name, path to kpi, typo in path, exiting") + exit(1) + self.conn.close() + + # graph group and test-tag are used for detemining the graphs, can use any columns + # the following list manipulation removes the duplicates + graph_group_list = list(df3['Graph-Group']) + graph_group_list = list(set(graph_group_list)) + print("graph_group_list: {}".format(graph_group_list)) + + # prior to 5.4.3 there was not test-tag + #try: + print("dataframe df3 {df3}".format(df3=df3)) + test_tag_list = list(df3['test-tag']) + test_tag_list = list(set(test_tag_list)) + print("test_tag_list: {}".format(test_tag_list) ) + #except: + #test_tag_list = ['NO_TAG_PRE_5.4.4'] + #print("exception when creating test_tag_list: {}".format(test_tag_list) ) + #print("Check database, exception when creating test_tag_list: {}".format(test_tag_list) ) + + + + test_rig_list = list(df3['test-rig']) + test_rig_list = list(set(test_rig_list)) + self.test_rig_list = test_rig_list + print("test_rig_list: {}".format(test_rig_list) ) + + self.children_div.append(html.A('html_reports', href=self.server_html_reports, target='_blank')) + for test_rig in test_rig_list: + for test_tag in test_tag_list: + for group in graph_group_list: + df_tmp = df3.loc[(df3['test-rig'] == test_rig) & (df3['Graph-Group'] == str(group)) & (df3['test-tag'] == str(test_tag))] + if df_tmp.empty == False: + + df_tmp = df_tmp.sort_values(by='Date') + test_id_list = list(df_tmp['test-id']) + kpi_path_list = list(df_tmp['kpi_path']) + # get Device Under Test Information , + # the set reduces the redundency , list puts it back into a list + self.dut_model_num_list = list(set(list(df_tmp['dut-model-num']))) + print("in png self.dut_model_num_list {dut_model_num_list}".format(dut_model_num_list=self.dut_model_num_list)) + if self.dut_model_num_list[0] != None: + self.dut_model_num = self.dut_model_num_list[0] + self.dut_sw_version_list = list(set(list(df_tmp['dut-sw-version']))) + if self.dut_sw_version_list[0] != None: + self.dut_sw_version = self.dut_sw_version_list[0] + self.dut_hw_version_list = list(set(list(df_tmp['dut-hw-version']))) + if self.dut_hw_version_list[0] != None: + self.dut_hw_version = self.dut_hw_version_list[0] + self.dut_serial_num_list = list(set(list(df_tmp['dut-serial-num']))) + if self.dut_serial_num_list[0] != None: + self.dut_serial_num_ = self.dut_serial_num_list[0] + + print("In png DUT: {DUT} SW:{SW} HW:{HW} SN:{SN}" + .format(DUT=self.dut_model_num_list,SW=self.dut_sw_version_list,HW=self.dut_hw_version_list,SN=self.dut_serial_num_list)) + + units_list = list(df_tmp['Units']) + print("GRAPHING::: test-rig {} test-tag {} Graph-Group {}".format(test_rig,test_tag,group)) + kpi_fig = (px.scatter(df_tmp, x="Date", y="numeric-score", + color="short-description", hover_name="short-description", + size_max=60)).update_traces(mode='lines+markers') + + kpi_fig.update_layout( + title="{} : {} : {} : {}".format(test_id_list[-1], group, test_tag, test_rig), + xaxis_title="Time", + yaxis_title="{}".format(units_list[-1]), + xaxis = {'type' : 'date'} + ) + # save the figure - figures will be over written png + # for testing + png_server_img = '' + #TODO work out when to generate the png files + if self.png: + if self.png_generated: + pass + else: + print("generate png and kpi images from kpi kpi_path:{}".format(df_tmp['kpi_path'])) + # generate png img path + png_path = os.path.join(kpi_path_list[-1],"{}_{}_{}_kpi.png".format( group, test_tag, test_rig)) + png_path = png_path.replace(' ','') + # generate html graphics path + html_path = os.path.join(kpi_path_list[-1],"{}_{}_{}_kpi.html".format( group, test_tag, test_rig)) + html_path = html_path.replace(' ','') + # NOTE: html links to png do not like spaces + png_server_img = self.server + png_path.replace(self.cut,'') + # generate png image + try: + kpi_fig.write_image(png_path,scale=1,width=1200,height=350) + except: + print("ERROR: {database} Was correct database passed in, moved or duplicates of same name?".format(database=self.database)) + #https://plotly.com/python/interactive-html-export/ + # generate html image (interactive) + kpi_fig.write_html(html_path) + # generate link for dashboard + self.children_div.append(html.Img(src=png_server_img)) + #HERE add clickable link + img_kpi_html_path = self.server + html_path + img_kpi_html_path = img_kpi_html_path.replace(self.cut,'') + + self.html_results += """ + + + + """.format(img_kpi_html_path=img_kpi_html_path,png_server_img=png_server_img) + + # WARNING: DO NOT USE os.path.join will use the path for where the script is RUN which can be container. + # Constructed path to server manually. + # link to interactive results + kpi_html_path = self.server + html_path + kpi_html_path = kpi_html_path.replace(self.cut,'') + self.children_div.append(html.Br()) + #self.html_results +="""
""" + self.children_div.append(html.A('{test_id}_{group}_{test_tag}_{test_rig}_kpi.html' + .format(test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig), + href=kpi_html_path, target='_blank')) + + # link to full test results + report_index_html_path = self.server + kpi_path_list[-1] + "index.html" + report_index_html_path = report_index_html_path.replace(self.cut,'') + self.children_div.append(html.Br()) + #self.html_results +="""
""" + self.children_div.append(html.A('{test_id}_{group}_{test_tag}_{test_rig}_report.html' + .format(test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig), + href=report_index_html_path, target='_blank')) + self.html_results +="""{test_id}_{group}_{test_tag}_{test_rig}_Report + """.format(report_index_html_path=report_index_html_path,test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig) + self.children_div.append(html.Br()) + self.children_div.append(html.Br()) + self.children_div.append(html.Br()) + self.html_results +="""
""" + self.html_results +="""
""" + self.html_results +="""
""" + self.html_results +="""
""" + self.html_results +="""
""" + + # TODO see if this stops the regenration of the graphs each time + self.png_generated = True + + + # access from server + # https://stackoverflow.com/questions/61678129/how-to-access-a-plotly-dash-app-server-via-lan + #def show(self,n_clicks): + def show(self): + # gererate dash display + #print("refreshes: {}".format(n_clicks)) + self.generate_graph_png() + if not self.children_div: + print("NOTE: test-tag may not be present in the kpi thus no results generated") + print("show: {}".format(time.time())) + self.app.layout = html.Div([ + html.Div(id='my-output'), + html.H1(children= "LANforge Testing",className="lanforge", + style={'color':'green','text-align':'center'}), + #For dash refresh # html.Button('Submit Recalculate',id='submit-val', n_clicks=0), + #For dash refresh # html.Div(id='container-button-basic', children='to recalculate hit submit'), + html.H2(children= "Results",className="ts1", + style={'color':'#00361c','text-align':'left'}), + # images_div is already a list, children = a list of html components + # remove scrolling : html.Div(children= self.children_div, style={"maxHeight": "600px", "overflow": "scroll"} ), + html.Div(children= self.children_div ), + html.A('www.candelatech.com',href='http://www.candelatech.com', target='_blank', + style={'color':'#00361c','text-align':'left'}), + ]) + + # save as standalone files + #https://plotly.com/python/static-image-export/ + + if self.server_started: + print("refresh complete") + pass + else: + self.server_started = True + print("self.server_started {}".format(self.server_started)) + #NOTE: the server_started flag needs to be set prior to run_server (or you get to debug an infinite loop) + #NOTE: debug=False will prevent init going though twice, also stops auto reload when editing code + self.app.run_server(host= '0.0.0.0', debug=True) + # host = '0.0.0.0' allows for remote access, local debug host = '127.0.0.1' + # app.run_server(host= '0.0.0.0', debug=True) + +# Feature, Sum up the subtests passed/failed from the kpi files for each run, poke those into the database, and generate a kpi graph for them. +def main(): + + parser = argparse.ArgumentParser( + prog='lf_qa.py', + formatter_class=argparse.RawTextHelpFormatter, + epilog='''\ + read kpi.csv into sqlite database , save png of history and preset on dashboard + + ''', + description='''\ +File: read kpi.csv place in sql database, create png of historical kpi and present graph on dashboard +Usage: kpi_csv_sq.py --store --png --show --path --database +Example: kpi_csv_sq.py --show (show dashboard generated from database) +Example: kpi_csv_sq.py --store --png --show --path (read kpi.csv store to database, write png, show dashboard ) + + ''') + parser.add_argument('--path', help='--path top directory path to kpi if regererating database or png files',default='') + parser.add_argument('--file', help='--file kpi.csv default: kpi.csv',default='kpi.csv') #TODO is this needed + parser.add_argument('--database', help='--database qa_test_db default: qa_test_db',default='qa_test_db') + parser.add_argument('--table', help='--table qa_table default: qa_table',default='qa_table') + parser.add_argument('--server', help='--server http:/// default: http://192.168.95.6/',default='http://192.168.95.6/') + parser.add_argument('--cut', help='--cut /home/lanforge/ used to adjust server path default: /home/lanforge/',default='/home/lanforge/') + parser.add_argument('--store', help='--store , store kpi to db, action store_true',action='store_true') + parser.add_argument('--png', help='--png, generate png for kpi in path, generate display, action store_true',action='store_true') + parser.add_argument('--show', help='--show generate display and show dashboard, action store_true',action='store_true') + parser.add_argument('--dir', help="--dir default lf_qa", default="lf_qa") + + args = parser.parse_args() + + __path = args.path + __file = args.file + __database = args.database + __table = args.table + __server = args.server + __png = args.png + __dir = args.dir + __cut = args.cut + + # needed for refresh button + # n_clicks = 0 + + print("config: path:{} file:{} database:{} table:{} server:{} store:{} png:{} show:{} " + .format(__path,__file,__database,__table,__server,args.store, args.png,args.show)) + + if(__path == '' and args.store == True): + print("--path must be entered if --store , exiting") + exit(1) + + if(args.png == True and args.store == False): + print("if --png set to create png files then --store must also be set, exiting") + exit(1) + + if(args.png == True and args.show == True): + print("generating png files will effect initial display performance") + + if args.store == False and args.png == False and args.show == False: + print("Need to enter an action of --store --png --show ") + + # create report class for reporting + report = lf_report(_path = __path, + _results_dir_name =__dir, + _output_html="lf_qa.html", + _output_pdf="lf_qa.pdf" ) + + csv_dash = csv_sqlite_dash( + _path = __path, + _file = __file, + _database = __database, + _table = __table, + _server = __server, + _cut = __cut, + _png = __png) + if args.store: + csv_dash.store() + if args.png: + csv_dash.generate_graph_png() + + # generate output reports + report.set_title("LF QA: Verification Test Run") + report.build_banner_left() + report.start_content_div2() + report.set_obj_html("Objective", "QA Verification") + report.build_objective() + report.set_table_title("Device Under Test") + report.build_table_title() + dut_info_df = csv_dash.get_dut_info() + print("DUT Results: {}".format(dut_info_df)) + report.set_table_dataframe(dut_info_df) + report.build_table() + + test_rig_list = csv_dash.get_test_rig_list() + report.set_table_title("Test Rig: {} Links".format(test_rig_list[-1])) # keep the list, currently one test bed results + report.build_table_title() + + pdf_link_path = report.get_pdf_path() + pdf_link_path = __server + pdf_link_path.replace(__cut,'') + report.build_pdf_link("PDF_Report",pdf_link_path) + + report_path = report.get_path() + report_path = __server + report_path.replace(__cut,'') + report.build_link("Current Test Suite Results Directory",report_path) + + report_parent_path = report.get_parent_path() + report_parent_path = __server + report_parent_path.replace(__cut,'') + report.build_link("All Test-Rig Test Suites Results Directory",report_parent_path) + + # links table for tests TODO : can this be a table + report.set_table_title("Test Suite") + report.build_table_title() + suite_html = csv_dash.get_suite_html() + print("suite_html {}".format(suite_html)) + report.set_custom_html(suite_html) + report.build_custom() + + # png summary of test + report.set_table_title("Suite Summary") + report.build_table_title() + kpi_chart_html = csv_dash.get_kpi_chart_html() + report.set_custom_html(kpi_chart_html) + report.build_custom() + + + report.set_table_title("QA Test Results") + report.build_table_title() + # report.set_text("lanforge-scripts git sha: {}".format(git_sha)) + # report.build_text() + html_results = csv_dash.get_html_results() + report.set_custom_html(html_results) + report.build_custom() + report.build_footer() + html_report = report.write_html_with_timestamp() + print("html report: {}".format(html_report)) + try: + report.write_pdf_with_timestamp() + except: + print("exception write_pdf_with_timestamp()") + + if args.show: + #csv_dash.show(n_clicks) + csv_dash.show() + +if __name__ == '__main__': + main() + diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index fa0464bb..4ccf3f3f 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -1,17 +1,11 @@ #!/usr/bin/env python3 ''' File: read kpi.csv place in sql database, create png of historical kpi and present graph on dashboard -Usage: kpi_csv_sq.py --store --png --show --path --database -Example: kpi_csv_sq.py --show (show dashboard generated from database) -Example: kpi_csv_sq.py --store --png --show --path (read kpi.csv store to database, write png, show dashboard ) +Usage: lf_qa.py --store --png --show --path --database ''' -# visit http://127.0.0.1:8050/ in your web browser. import sys import os import importlib -import dash -import dash_core_components as dcc -import dash_html_components as html import plotly.express as px import pandas as pd import sqlite3 @@ -26,7 +20,7 @@ lf_report = lf_report.lf_report # Any style components can be used external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] -class csv_sqlite_dash(): +class csv_sql(): def __init__(self, _path = '.', _file = 'kpi.csv', @@ -48,10 +42,8 @@ class csv_sqlite_dash(): self.conn = None self.df = pd.DataFrame() self.plot_figure = [] - self.children_div = [] self.html_results ="" self.test_rig_list = [] - self.server_html_reports = self.server + 'html-reports/' #TODO : hard coded - is this needed? have server self.server_started = False self.dut_model_num_list = "NA" self.dut_model_num = "NA" @@ -62,12 +54,6 @@ class csv_sqlite_dash(): self.dut_serial_num_list = "NA" self.dut_serial_num = "NA" - self.app = dash.Dash(__name__, external_stylesheets=external_stylesheets) - # https://community.plotly.com/t/putting-a-dash-instance-inside-a-class/6097/3 - #https://dash.plotly.com/dash-html-components/button - #self.app.callback(dash.dependencies.Output('container-button-basic', 'children'), - # [dash.dependencies.Input(component_id ='submit-val', component_property ='n_clicks')])(self.show) - # Helper methods def get_test_rig_list(self): return self.test_rig_list @@ -125,8 +111,6 @@ class csv_sqlite_dash(): print("test_tag from meta.txt _kpi_path: {kpi_path}".format(kpi_path=_kpi_path)) return test_id , test_tag - # could enter on the command line, except there may be other exceptions - # may need an exception file def get_test_tag_from_meta(self,_kpi_path): test_tag = "NA" use_meta_test_tag = False @@ -159,8 +143,6 @@ class csv_sqlite_dash(): return use_meta_test_tag, test_tag - #TODO pass in list to lf_report - # def get_suite_html(self): suite_html_results = """
@@ -291,24 +273,16 @@ class csv_sqlite_dash(): print("graph_group_list: {}".format(graph_group_list)) # prior to 5.4.3 there was not test-tag - #try: - print("dataframe df3 {df3}".format(df3=df3)) + #print("dataframe df3 {df3}".format(df3=df3)) test_tag_list = list(df3['test-tag']) test_tag_list = list(set(test_tag_list)) - print("test_tag_list: {}".format(test_tag_list) ) - #except: - #test_tag_list = ['NO_TAG_PRE_5.4.4'] - #print("exception when creating test_tag_list: {}".format(test_tag_list) ) - #print("Check database, exception when creating test_tag_list: {}".format(test_tag_list) ) - - + #print("test_tag_list: {}".format(test_tag_list) ) test_rig_list = list(df3['test-rig']) test_rig_list = list(set(test_rig_list)) self.test_rig_list = test_rig_list print("test_rig_list: {}".format(test_rig_list) ) - self.children_div.append(html.A('html_reports', href=self.server_html_reports, target='_blank')) for test_rig in test_rig_list: for test_tag in test_tag_list: for group in graph_group_list: @@ -371,12 +345,8 @@ class csv_sqlite_dash(): kpi_fig.write_image(png_path,scale=1,width=1200,height=350) except: print("ERROR: {database} Was correct database passed in, moved or duplicates of same name?".format(database=self.database)) - #https://plotly.com/python/interactive-html-export/ # generate html image (interactive) kpi_fig.write_html(html_path) - # generate link for dashboard - self.children_div.append(html.Img(src=png_server_img)) - #HERE add clickable link img_kpi_html_path = self.server + html_path img_kpi_html_path = img_kpi_html_path.replace(self.cut,'') @@ -386,30 +356,15 @@ class csv_sqlite_dash(): """.format(img_kpi_html_path=img_kpi_html_path,png_server_img=png_server_img) - # WARNING: DO NOT USE os.path.join will use the path for where the script is RUN which can be container. - # Constructed path to server manually. # link to interactive results kpi_html_path = self.server + html_path kpi_html_path = kpi_html_path.replace(self.cut,'') - self.children_div.append(html.Br()) #self.html_results +="""
""" - self.children_div.append(html.A('{test_id}_{group}_{test_tag}_{test_rig}_kpi.html' - .format(test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig), - href=kpi_html_path, target='_blank')) - # link to full test results report_index_html_path = self.server + kpi_path_list[-1] + "index.html" report_index_html_path = report_index_html_path.replace(self.cut,'') - self.children_div.append(html.Br()) - #self.html_results +="""
""" - self.children_div.append(html.A('{test_id}_{group}_{test_tag}_{test_rig}_report.html' - .format(test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig), - href=report_index_html_path, target='_blank')) self.html_results +="""{test_id}_{group}_{test_tag}_{test_rig}_Report """.format(report_index_html_path=report_index_html_path,test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig) - self.children_div.append(html.Br()) - self.children_div.append(html.Br()) - self.children_div.append(html.Br()) self.html_results +="""
""" self.html_results +="""
""" self.html_results +="""
""" @@ -420,46 +375,6 @@ class csv_sqlite_dash(): self.png_generated = True - # access from server - # https://stackoverflow.com/questions/61678129/how-to-access-a-plotly-dash-app-server-via-lan - #def show(self,n_clicks): - def show(self): - # gererate dash display - #print("refreshes: {}".format(n_clicks)) - self.generate_graph_png() - if not self.children_div: - print("NOTE: test-tag may not be present in the kpi thus no results generated") - print("show: {}".format(time.time())) - self.app.layout = html.Div([ - html.Div(id='my-output'), - html.H1(children= "LANforge Testing",className="lanforge", - style={'color':'green','text-align':'center'}), - #For dash refresh # html.Button('Submit Recalculate',id='submit-val', n_clicks=0), - #For dash refresh # html.Div(id='container-button-basic', children='to recalculate hit submit'), - html.H2(children= "Results",className="ts1", - style={'color':'#00361c','text-align':'left'}), - # images_div is already a list, children = a list of html components - # remove scrolling : html.Div(children= self.children_div, style={"maxHeight": "600px", "overflow": "scroll"} ), - html.Div(children= self.children_div ), - html.A('www.candelatech.com',href='http://www.candelatech.com', target='_blank', - style={'color':'#00361c','text-align':'left'}), - ]) - - # save as standalone files - #https://plotly.com/python/static-image-export/ - - if self.server_started: - print("refresh complete") - pass - else: - self.server_started = True - print("self.server_started {}".format(self.server_started)) - #NOTE: the server_started flag needs to be set prior to run_server (or you get to debug an infinite loop) - #NOTE: debug=False will prevent init going though twice, also stops auto reload when editing code - self.app.run_server(host= '0.0.0.0', debug=True) - # host = '0.0.0.0' allows for remote access, local debug host = '127.0.0.1' - # app.run_server(host= '0.0.0.0', debug=True) - # Feature, Sum up the subtests passed/failed from the kpi files for each run, poke those into the database, and generate a kpi graph for them. def main(): @@ -472,9 +387,7 @@ def main(): ''', description='''\ File: read kpi.csv place in sql database, create png of historical kpi and present graph on dashboard -Usage: kpi_csv_sq.py --store --png --show --path --database -Example: kpi_csv_sq.py --show (show dashboard generated from database) -Example: kpi_csv_sq.py --store --png --show --path (read kpi.csv store to database, write png, show dashboard ) +Usage: lf_qa.py --store --png --path --database ''') parser.add_argument('--path', help='--path top directory path to kpi if regererating database or png files',default='') @@ -485,7 +398,6 @@ Example: kpi_csv_sq.py --store --png --show --path (read parser.add_argument('--cut', help='--cut /home/lanforge/ used to adjust server path default: /home/lanforge/',default='/home/lanforge/') parser.add_argument('--store', help='--store , store kpi to db, action store_true',action='store_true') parser.add_argument('--png', help='--png, generate png for kpi in path, generate display, action store_true',action='store_true') - parser.add_argument('--show', help='--show generate display and show dashboard, action store_true',action='store_true') parser.add_argument('--dir', help="--dir default lf_qa", default="lf_qa") args = parser.parse_args() @@ -499,11 +411,8 @@ Example: kpi_csv_sq.py --store --png --show --path (read __dir = args.dir __cut = args.cut - # needed for refresh button - # n_clicks = 0 - - print("config: path:{} file:{} database:{} table:{} server:{} store:{} png:{} show:{} " - .format(__path,__file,__database,__table,__server,args.store, args.png,args.show)) + print("config: path:{path} file:{file} database:{database} table:{table} server:{server} store:{store} png:{png}" + .format(path=__path,file=__file,database=__database,table=__table,server=__server,store=args.store,png=args.png)) if(__path == '' and args.store == True): print("--path must be entered if --store , exiting") @@ -525,7 +434,7 @@ Example: kpi_csv_sq.py --store --png --show --path (read _output_html="lf_qa.html", _output_pdf="lf_qa.pdf" ) - csv_dash = csv_sqlite_dash( + csv_dash = csv_sql( _path = __path, _file = __file, _database = __database, @@ -598,10 +507,6 @@ Example: kpi_csv_sq.py --store --png --show --path (read except: print("exception write_pdf_with_timestamp()") - if args.show: - #csv_dash.show(n_clicks) - csv_dash.show() - if __name__ == '__main__': main() From dc977e7b4564dd128e5f4c87c912131def2aba11 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 10:04:34 -0600 Subject: [PATCH 083/731] lf_qa.py : removed check for show as no longer supporting plotly dash Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_qa.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 4ccf3f3f..1c9e9065 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -44,7 +44,6 @@ class csv_sql(): self.plot_figure = [] self.html_results ="" self.test_rig_list = [] - self.server_started = False self.dut_model_num_list = "NA" self.dut_model_num = "NA" self.dut_sw_version_list = "NA" @@ -422,11 +421,8 @@ Usage: lf_qa.py --store --png --path --databas print("if --png set to create png files then --store must also be set, exiting") exit(1) - if(args.png == True and args.show == True): - print("generating png files will effect initial display performance") - - if args.store == False and args.png == False and args.show == False: - print("Need to enter an action of --store --png --show ") + if args.store == False and args.png == False: + print("Need to enter an action of --store --png ") # create report class for reporting report = lf_report(_path = __path, From b1050b74042e4e1a54bbe1452510a8b0c6585621 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 10:36:07 -0600 Subject: [PATCH 084/731] .. dut.json files updated for wireless network dict Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_001_AX88U_dut.json | 7 ++----- py-scripts/tools/ct_002_AX12_dut.json | 8 +++----- py-scripts/tools/ct_003_AX88U_dut.json | 7 ++----- py-scripts/tools/ct_003_LANforge_dut.json | 20 ++++++-------------- py-scripts/tools/ct_004_AX88U_dut.json | 3 ++- 5 files changed, 15 insertions(+), 30 deletions(-) diff --git a/py-scripts/tools/ct_001_AX88U_dut.json b/py-scripts/tools/ct_001_AX88U_dut.json index 77bd1a56..5ed1d62c 100644 --- a/py-scripts/tools/ct_001_AX88U_dut.json +++ b/py-scripts/tools/ct_001_AX88U_dut.json @@ -1,11 +1,8 @@ { "ct_AX88U_dut":{ "Notes":[ - "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code.", + "This json file describes the device undertest as input to ./lf_check.py", + "The variables that are capitalize are used for configuration", "The dut related configuration is contained in this file" ] }, diff --git a/py-scripts/tools/ct_002_AX12_dut.json b/py-scripts/tools/ct_002_AX12_dut.json index aff16371..20ce0f5f 100644 --- a/py-scripts/tools/ct_002_AX12_dut.json +++ b/py-scripts/tools/ct_002_AX12_dut.json @@ -1,11 +1,9 @@ { "ct_AX12_dut":{ "Notes":[ - "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "The dut related configuration is contained in this file", - "NOTE: create_chamberview_dut starts ssid-idx at 0 ", - "NOTE: create_chamberview starts counting at Radio-1 which is dut ssid-idx 0" + "This json file describes the device undertest as input to ./lf_check.py", + "The variables that are capitalize are used for configuration", + "The dut related configuration is contained in this file" ] }, "test_dut":{ diff --git a/py-scripts/tools/ct_003_AX88U_dut.json b/py-scripts/tools/ct_003_AX88U_dut.json index 262ffc41..955117e3 100644 --- a/py-scripts/tools/ct_003_AX88U_dut.json +++ b/py-scripts/tools/ct_003_AX88U_dut.json @@ -1,11 +1,8 @@ { "ct_AX88U_dut":{ "Notes":[ - "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code.", + "This json file describes the device undertest as input to ./lf_check.py", + "The variables that are capitalize are used for configuration", "The dut related configuration is contained in this file" ] }, diff --git a/py-scripts/tools/ct_003_LANforge_dut.json b/py-scripts/tools/ct_003_LANforge_dut.json index f3c9f201..eef520ef 100644 --- a/py-scripts/tools/ct_003_LANforge_dut.json +++ b/py-scripts/tools/ct_003_LANforge_dut.json @@ -1,26 +1,18 @@ { "ct_lanforge_dut":{ "Notes":[ - "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code.", + "This json file describes the device undertest as input to ./lf_check.py", + "The variables that are capitalize are used for configuration", "The dut related configuration is contained in this file" ] }, "test_dut":{ "DUT_SET_NAME": "DUT_NAME lanforge-dut", "DUT_NAME": "lanforge", - "DUT_BSSID_2G": "94:a6:7e:54:d4:31", - "DUT_BSSID_5G": "94:a6:7e:54:d4:33", - "DUT_SW": "lanforge_GUI", - "SSID_5G_USED": "ct-us-003-r3-5g", - "SSID_5G_PW_USED": "ct-us-003-r3-5g", - "SECURITY_5G_USED": "wpa2", - "SSID_2G_USED": "ct-us-003-r3-2g", - "SSID_2G_PW_USED": "ct-us-003-r3-2g", - "SECURITY_2G_USED": "wpa2" + "wireless_network_dict":{ + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"lf11ax-2","SSID_PW_USED":"hello123","BSSID":"0c:9d:92:02:42:e0","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"lf11ax-5","SSID_PW_USED":"hello123","BSSID":"0c:9d:92:02:42:e4","SECURITY_USED":"wpa2"} + } } } \ No newline at end of file diff --git a/py-scripts/tools/ct_004_AX88U_dut.json b/py-scripts/tools/ct_004_AX88U_dut.json index 08e1c4ac..82f82a5d 100644 --- a/py-scripts/tools/ct_004_AX88U_dut.json +++ b/py-scripts/tools/ct_004_AX88U_dut.json @@ -1,7 +1,8 @@ { "ct_AX88U_dut":{ "Notes":[ - "This json file is used as an input to the ./lf_check.py file", + "This json file describes the device undertest used as input to ./lf_check.py", + "The variables that are capitalize are used for configuration", "The dut related configuration is contained in this file" ] }, From 8d1268d825d733df0956e7521f71751722a5047a Mon Sep 17 00:00:00 2001 From: erinnerim Date: Tue, 5 Oct 2021 14:29:16 -0700 Subject: [PATCH 085/731] add quali lanforge-resource, .gitignore append *.zip and *.env --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 5fc2ef0e..3614bec9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ *.iml **/*.iml .idea +*.env +*.zip From 9cf309df78abbc7745782de85eb5f7ca8370d74c Mon Sep 17 00:00:00 2001 From: erinnerim Date: Tue, 5 Oct 2021 14:30:52 -0700 Subject: [PATCH 086/731] add quali lanforge-resource --- quali/lanforge-resource/.gitignore | 60 + .../TOSCA-Metadata/TOSCA.meta | 4 + .../canvil2-64x64-gray-yel-ico.png | Bin 0 -> 2401 bytes quali/lanforge-resource/deployment.xml | 53 + quali/lanforge-resource/docs/readme.rst | 3 + quali/lanforge-resource/shell-definition.yaml | 45 + quali/lanforge-resource/shell-icon.png | Bin 0 -> 461 bytes quali/lanforge-resource/src/data_model.py | 1029 +++++++++++++++++ quali/lanforge-resource/src/driver.py | 309 +++++ .../lanforge-resource/src/drivermetadata.xml | 73 ++ quali/lanforge-resource/src/importlib | 0 quali/lanforge-resource/src/requirements.txt | 25 + quali/lanforge-resource/src/sys | 0 quali/lanforge-resource/test_requirements.txt | 7 + quali/lanforge-resource/tests/__init__.py | 1 + .../tests/test_lanforge-resource.py | 27 + 16 files changed, 1636 insertions(+) create mode 100644 quali/lanforge-resource/.gitignore create mode 100644 quali/lanforge-resource/TOSCA-Metadata/TOSCA.meta create mode 100644 quali/lanforge-resource/canvil2-64x64-gray-yel-ico.png create mode 100644 quali/lanforge-resource/deployment.xml create mode 100644 quali/lanforge-resource/docs/readme.rst create mode 100644 quali/lanforge-resource/shell-definition.yaml create mode 100644 quali/lanforge-resource/shell-icon.png create mode 100644 quali/lanforge-resource/src/data_model.py create mode 100755 quali/lanforge-resource/src/driver.py create mode 100644 quali/lanforge-resource/src/drivermetadata.xml create mode 100644 quali/lanforge-resource/src/importlib create mode 100644 quali/lanforge-resource/src/requirements.txt create mode 100644 quali/lanforge-resource/src/sys create mode 100644 quali/lanforge-resource/test_requirements.txt create mode 100644 quali/lanforge-resource/tests/__init__.py create mode 100644 quali/lanforge-resource/tests/test_lanforge-resource.py diff --git a/quali/lanforge-resource/.gitignore b/quali/lanforge-resource/.gitignore new file mode 100644 index 00000000..1e1a44c7 --- /dev/null +++ b/quali/lanforge-resource/.gitignore @@ -0,0 +1,60 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ +cloudshell_config.yml diff --git a/quali/lanforge-resource/TOSCA-Metadata/TOSCA.meta b/quali/lanforge-resource/TOSCA-Metadata/TOSCA.meta new file mode 100644 index 00000000..5a9b442f --- /dev/null +++ b/quali/lanforge-resource/TOSCA-Metadata/TOSCA.meta @@ -0,0 +1,4 @@ +TOSCA-Meta-File-Version: 1.0 +CSAR-Version: 0.1.0 +Created-By: Anonymous +Entry-Definitions: shell-definition.yaml \ No newline at end of file diff --git a/quali/lanforge-resource/canvil2-64x64-gray-yel-ico.png b/quali/lanforge-resource/canvil2-64x64-gray-yel-ico.png new file mode 100644 index 0000000000000000000000000000000000000000..9abca2422cc4f57477eaa31797c20fe074fa9d7a GIT binary patch literal 2401 zcmV-n37+&2wr>_ZbN6vmdcqcJ!@3~_AZ05|h5w*uf5Vu!9E_;EKLQ47F&#VBNrgZ?X0^a~gBog%Z_alVh`0?Y|Y&L-Z0LP`2 ziO+-pnx@%+mvhAZ#m@}GU~Fs*RaI$fYFgg)l$7!>pIQMlO?wKs0GuxA(n4UG=4!+I zMoQW9sS!ZaG+)lr7XW*yHma(UOeP71LO7jH_Uze{U;lT)HK0q}=fuC3Bi(h^txO2U z#>TjM^(t1Y71K0vxm-N*$Rj9Ml-Gw%$Y2tJ`$!4=;vsrXqH^hBJ{M$L=pWDnhx~`MWW~r*G!Y~YUU8kqMhb5{U$gq7;({xGC-dX?t#6 zzY6%aYFyJaQ51zhAW#U1kw~NHHVgy5-;c-RA(cuoK0c1F z>&q>@9PdaeyUV@}YMR!Nv-HbApC?xH3R|y6h&cja*}8?dN*qq&oMMKgkcyZBY16XE%o*FG&VMp$z%wHLQG9ft;fCZgaIk#(Xv;B zIy*amec-@>mx`_IcDqqkmEPW7g25m?Jw1d%A#UHkjiM-2R#xJ4I`MkF2q6fE!-T_O z=H}+s>)v-l1Za>_nq?QDy}kXSVHnSMc6KhYvdiVdVzJQI*GF@6Gd(>$g=4CsD8%D& z!r?GCZrnf!u~};`aW23srMy+PnxLj>HNba(3qpuGA;bz72MQMM>+7SbsfqLF&oePG zK{y;Hl}fECHf#XTNGbok*2ZF;#82c3jbASHJWnW}iDk1{+S=NP$K&+&_R`+oj@Rog zXYTbkDdl79>0ntS@mGO20Ppf3X0cePtE;1`s*1tELFVV@>F(|(l}Z7SOeTrNV${~w zuBB45S$u!J9mHKo2Z1+%bIS?4-EQ1&Hy)3N>gwu3!eX^rxpe6gLI~`3d*Sq@C<^`k z{WLZ<;`jT@#$HOf?j>z0LHrc(1Jg9S^696?2xmH@+=lhxjo?D8|h>zE=U-L@gu~{Md3Fobw&1Q+kVk8m?u3Wi- z#bPOWPA^l?E6(`VFTjg0zW7a>&Gy^+`g--DhaRG?uCCzH#pmpNq)(^Q%+1Y_OeRSt zlf>h3=I7^86a__5sHv$b{UVD6tJPXg0d8(c03pQjy1F_wolX-DhZ!3i!!QgC!^qdo z$Ye5PGMR$)^Oi3rSL*xnC1AJP%PGM8Mmi}{%5Oy?k=>C<Sfv*7FTUoM7r_5h>-t zZCN*~p}V{LXYarN{`c}hF`La6?(9s{q`A47rlux_hldeDaOlvXO}#HS_UAX!S1pGC zk3atSYne>u;Y1>V5Q0P^!R+iTHk&PfRgDmWhK2@GsT3n4Bc*O}OCo=4URYQll}a%) zGsBG=H>jIC{@LK-cxk*49>ZU1xG~5`btlN;Def$tRyAo6Qyqoxxy` zn>TOr@y8z%3Eb#=K@G6PXR-Ds~SVMbzJ6&B}`2GI;E~DHR0^~$E2>drMLPtjj4u=C(Rf)x7 zOWOK;z76LCo4JH3s{lC>+JGy0_dj;*7ohkvZ$+B?PvDt#{rRr%kOlan+yHm<3!tHxM3)S}PquGi=M9&@4AVPq^SMm#AhMz5>R>k-9q z`mx1uqt8sOFAH-1PoytnvQ2pF_h+~{TT`69t&*pkTzK|f_U)c3%X~!D(YV4k;wNYS zh_@zL*bP?04`29G*~o8O3|N}U!H>^g!sAS?+V-VWf2F=|w(N7-RsjGM@rft6owx7U z=0MYR+8-X@p80SOpeQCkJ$nh4qqGQ5cMNTxS8itzT(N%}f;WHnJn^||6k+hx(P2(^ zen5p)-yZT+N8|TY0D#4;%D=8Y%wq>W-1c{WBEX>A-~olO?T@g79qeES4>JA_g#*$W TVq_4-00000NkvXXu0mjfMk1wL literal 0 HcmV?d00001 diff --git a/quali/lanforge-resource/deployment.xml b/quali/lanforge-resource/deployment.xml new file mode 100644 index 00000000..fa1f6a32 --- /dev/null +++ b/quali/lanforge-resource/deployment.xml @@ -0,0 +1,53 @@ + + + + + localhost + + + 8029 + + + YOUR_USERNAME + YOUR_PASSWORD + Global + + + dont_upload_me.xml + + + + + + + + + + src + + + LanforgeResourceDriver + + + + + + + \ No newline at end of file diff --git a/quali/lanforge-resource/docs/readme.rst b/quali/lanforge-resource/docs/readme.rst new file mode 100644 index 00000000..4dc0eb5d --- /dev/null +++ b/quali/lanforge-resource/docs/readme.rst @@ -0,0 +1,3 @@ +.. _readme: + +.. include:: ../README.rst diff --git a/quali/lanforge-resource/shell-definition.yaml b/quali/lanforge-resource/shell-definition.yaml new file mode 100644 index 00000000..2a0f9cbb --- /dev/null +++ b/quali/lanforge-resource/shell-definition.yaml @@ -0,0 +1,45 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 + +metadata: + template_name: Lanforge Resource + template_author: Anonymous + template_version: 0.1.0 + template_icon: shell-icon.png + +description: > + TOSCA based resource shell + +imports: + - cloudshell_standard: cloudshell_resource_standard_2_0_3.yaml + +node_types: + + vendor.resource.Lanforge Resource: + derived_from: cloudshell.nodes.GenericResource + #properties: + # my_property: + # type: string # optional values: string, integer, float, boolean, cloudshell.datatypes.Password + # default: fast + # description: Some attribute description + # constraints: + # - valid_values: [fast, slow] + capabilities: + auto_discovery_capability: + type: cloudshell.capabilities.AutoDiscovery + properties: + enable_auto_discovery: + type: boolean + default: true + auto_discovery_description: + type: string + default: Describe the auto discovery + inventory_description: + type: string + default: Describe the resource shell template + artifacts: + icon: + file: canvil2-64x64-gray-yel-ico.png + type: tosca.artifacts.File + driver: + file: LanforgeResourceDriver.zip + type: tosca.artifacts.File diff --git a/quali/lanforge-resource/shell-icon.png b/quali/lanforge-resource/shell-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..820b28fdffeccab4956e35c7be7d52d9249a9b58 GIT binary patch literal 461 zcmeAS@N?(olHy`uVBq!ia0vp^jv&mz1|<8wpL7LMoCO|{#S9GGLLkg|>2BR01_s7@ zPZ!6Kid%1QZ!A1yAad;E`IxK(;jjeZ-KVq9&14nNiL{9Cv4+|_6EvU`qBzI5yrV{TaI?=`I)0uBs} zECTy{cPmyl&D`siRpjF@xp?vwtLJ5t1#J#^ALRd)%cG=uenuiNldVJd%D-TpNa!V(gWASZ#{rLjOw zG++Xau;=&} zd^1UD*?vWix%TtC8YOCO+r0VzHbwKnoVEM*72WsvWw80uy>DeEYoGn+YvkD2dMaX; v)zY)J*AvPh7Ax8X>8~&4&$ztQ?FY+o_O>}!r+Hie#t(z1tDnm{r-UW|ETzMY literal 0 HcmV?d00001 diff --git a/quali/lanforge-resource/src/data_model.py b/quali/lanforge-resource/src/data_model.py new file mode 100644 index 00000000..329bdfbb --- /dev/null +++ b/quali/lanforge-resource/src/data_model.py @@ -0,0 +1,1029 @@ +from cloudshell.shell.core.driver_context import ResourceCommandContext, AutoLoadDetails, AutoLoadAttribute, \ + AutoLoadResource +from collections import defaultdict + + +class LegacyUtils(object): + def __init__(self): + self._datamodel_clss_dict = self.__generate_datamodel_classes_dict() + + def migrate_autoload_details(self, autoload_details, context): + model_name = context.resource.model + root_name = context.resource.name + root = self.__create_resource_from_datamodel(model_name, root_name) + attributes = self.__create_attributes_dict(autoload_details.attributes) + self.__attach_attributes_to_resource(attributes, '', root) + self.__build_sub_resoruces_hierarchy(root, autoload_details.resources, attributes) + return root + + def __create_resource_from_datamodel(self, model_name, res_name): + return self._datamodel_clss_dict[model_name](res_name) + + def __create_attributes_dict(self, attributes_lst): + d = defaultdict(list) + for attribute in attributes_lst: + d[attribute.relative_address].append(attribute) + return d + + def __build_sub_resoruces_hierarchy(self, root, sub_resources, attributes): + d = defaultdict(list) + for resource in sub_resources: + splitted = resource.relative_address.split('/') + parent = '' if len(splitted) == 1 else resource.relative_address.rsplit('/', 1)[0] + rank = len(splitted) + d[rank].append((parent, resource)) + + self.__set_models_hierarchy_recursively(d, 1, root, '', attributes) + + def __set_models_hierarchy_recursively(self, dict, rank, manipulated_resource, resource_relative_addr, attributes): + if rank not in dict: # validate if key exists + pass + + for (parent, resource) in dict[rank]: + if parent == resource_relative_addr: + sub_resource = self.__create_resource_from_datamodel( + resource.model.replace(' ', ''), + resource.name) + self.__attach_attributes_to_resource(attributes, resource.relative_address, sub_resource) + manipulated_resource.add_sub_resource( + self.__slice_parent_from_relative_path(parent, resource.relative_address), sub_resource) + self.__set_models_hierarchy_recursively( + dict, + rank + 1, + sub_resource, + resource.relative_address, + attributes) + + def __attach_attributes_to_resource(self, attributes, curr_relative_addr, resource): + for attribute in attributes[curr_relative_addr]: + setattr(resource, attribute.attribute_name.lower().replace(' ', '_'), attribute.attribute_value) + del attributes[curr_relative_addr] + + def __slice_parent_from_relative_path(self, parent, relative_addr): + if parent is '': + return relative_addr + return relative_addr[len(parent) + 1:] # + 1 because we want to remove the seperator also + + def __generate_datamodel_classes_dict(self): + return dict(self.__collect_generated_classes()) + + def __collect_generated_classes(self): + import sys, inspect + return inspect.getmembers(sys.modules[__name__], inspect.isclass) + + +class LanforgeResource(object): + def __init__(self, name): + """ + + """ + self.attributes = {} + self.resources = {} + self._cloudshell_model_name = 'Lanforge Resource' + self._name = name + + def add_sub_resource(self, relative_path, sub_resource): + self.resources[relative_path] = sub_resource + + @classmethod + def create_from_context(cls, context): + """ + Creates an instance of NXOS by given context + :param context: cloudshell.shell.core.driver_context.ResourceCommandContext + :type context: cloudshell.shell.core.driver_context.ResourceCommandContext + :return: + :rtype LanforgeResource + """ + result = LanforgeResource(name=context.resource.name) + for attr in context.resource.attributes: + result.attributes[attr] = context.resource.attributes[attr] + return result + + def create_autoload_details(self, relative_path=''): + """ + :param relative_path: + :type relative_path: str + :return + """ + resources = [AutoLoadResource(model=self.resources[r].cloudshell_model_name, + name=self.resources[r].name, + relative_address=self._get_relative_path(r, relative_path)) + for r in self.resources] + attributes = [AutoLoadAttribute(relative_path, a, self.attributes[a]) for a in self.attributes] + autoload_details = AutoLoadDetails(resources, attributes) + for r in self.resources: + curr_path = relative_path + '/' + r if relative_path else r + curr_auto_load_details = self.resources[r].create_autoload_details(curr_path) + autoload_details = self._merge_autoload_details(autoload_details, curr_auto_load_details) + return autoload_details + + def _get_relative_path(self, child_path, parent_path): + """ + Combines relative path + :param child_path: Path of a model within it parent model, i.e 1 + :type child_path: str + :param parent_path: Full path of parent model, i.e 1/1. Might be empty for root model + :type parent_path: str + :return: Combined path + :rtype str + """ + return parent_path + '/' + child_path if parent_path else child_path + + @staticmethod + def _merge_autoload_details(autoload_details1, autoload_details2): + """ + Merges two instances of AutoLoadDetails into the first one + :param autoload_details1: + :type autoload_details1: AutoLoadDetails + :param autoload_details2: + :type autoload_details2: AutoLoadDetails + :return: + :rtype AutoLoadDetails + """ + for attribute in autoload_details2.attributes: + autoload_details1.attributes.append(attribute) + for resource in autoload_details2.resources: + autoload_details1.resources.append(resource) + return autoload_details1 + + @property + def cloudshell_model_name(self): + """ + Returns the name of the Cloudshell model + :return: + """ + return 'LanforgeResource' + + @property + def user(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.User'] if 'Lanforge Resource.User' in self.attributes else None + + @user.setter + def user(self, value): + """ + User with administrative privileges + :type value: str + """ + self.attributes['Lanforge Resource.User'] = value + + @property + def password(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.Password'] if 'Lanforge Resource.Password' in self.attributes else None + + @password.setter + def password(self, value): + """ + + :type value: string + """ + self.attributes['Lanforge Resource.Password'] = value + + @property + def enable_password(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.Enable Password'] if 'Lanforge Resource.Enable Password' in self.attributes else None + + @enable_password.setter + def enable_password(self, value): + """ + The enable password is required by some CLI protocols such as Telnet and is required according to the device configuration. + :type value: string + """ + self.attributes['Lanforge Resource.Enable Password'] = value + + @property + def power_management(self): + """ + :rtype: bool + """ + return self.attributes['Lanforge Resource.Power Management'] if 'Lanforge Resource.Power Management' in self.attributes else None + + @power_management.setter + def power_management(self, value=True): + """ + Used by the power management orchestration, if enabled, to determine whether to automatically manage the device power status. Enabled by default. + :type value: bool + """ + self.attributes['Lanforge Resource.Power Management'] = value + + @property + def sessions_concurrency_limit(self): + """ + :rtype: float + """ + return self.attributes['Lanforge Resource.Sessions Concurrency Limit'] if 'Lanforge Resource.Sessions Concurrency Limit' in self.attributes else None + + @sessions_concurrency_limit.setter + def sessions_concurrency_limit(self, value='1'): + """ + The maximum number of concurrent sessions that the driver will open to the device. Default is 1 (no concurrency). + :type value: float + """ + self.attributes['Lanforge Resource.Sessions Concurrency Limit'] = value + + @property + def snmp_read_community(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.SNMP Read Community'] if 'Lanforge Resource.SNMP Read Community' in self.attributes else None + + @snmp_read_community.setter + def snmp_read_community(self, value): + """ + The SNMP Read-Only Community String is like a password. It is sent along with each SNMP Get-Request and allows (or denies) access to device. + :type value: string + """ + self.attributes['Lanforge Resource.SNMP Read Community'] = value + + @property + def snmp_write_community(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.SNMP Write Community'] if 'Lanforge Resource.SNMP Write Community' in self.attributes else None + + @snmp_write_community.setter + def snmp_write_community(self, value): + """ + The SNMP Write Community String is like a password. It is sent along with each SNMP Set-Request and allows (or denies) chaning MIBs values. + :type value: string + """ + self.attributes['Lanforge Resource.SNMP Write Community'] = value + + @property + def snmp_v3_user(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.SNMP V3 User'] if 'Lanforge Resource.SNMP V3 User' in self.attributes else None + + @snmp_v3_user.setter + def snmp_v3_user(self, value): + """ + Relevant only in case SNMP V3 is in use. + :type value: str + """ + self.attributes['Lanforge Resource.SNMP V3 User'] = value + + @property + def snmp_v3_password(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.SNMP V3 Password'] if 'Lanforge Resource.SNMP V3 Password' in self.attributes else None + + @snmp_v3_password.setter + def snmp_v3_password(self, value): + """ + Relevant only in case SNMP V3 is in use. + :type value: string + """ + self.attributes['Lanforge Resource.SNMP V3 Password'] = value + + @property + def snmp_v3_private_key(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.SNMP V3 Private Key'] if 'Lanforge Resource.SNMP V3 Private Key' in self.attributes else None + + @snmp_v3_private_key.setter + def snmp_v3_private_key(self, value): + """ + Relevant only in case SNMP V3 is in use. + :type value: str + """ + self.attributes['Lanforge Resource.SNMP V3 Private Key'] = value + + @property + def snmp_v3_authentication_protocol(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.SNMP V3 Authentication Protocol'] if 'Lanforge Resource.SNMP V3 Authentication Protocol' in self.attributes else None + + @snmp_v3_authentication_protocol.setter + def snmp_v3_authentication_protocol(self, value='No Authentication Protocol'): + """ + Relevant only in case SNMP V3 is in use. + :type value: str + """ + self.attributes['Lanforge Resource.SNMP V3 Authentication Protocol'] = value + + @property + def snmp_v3_privacy_protocol(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.SNMP V3 Privacy Protocol'] if 'Lanforge Resource.SNMP V3 Privacy Protocol' in self.attributes else None + + @snmp_v3_privacy_protocol.setter + def snmp_v3_privacy_protocol(self, value='No Privacy Protocol'): + """ + Relevant only in case SNMP V3 is in use. + :type value: str + """ + self.attributes['Lanforge Resource.SNMP V3 Privacy Protocol'] = value + + @property + def snmp_version(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.SNMP Version'] if 'Lanforge Resource.SNMP Version' in self.attributes else None + + @snmp_version.setter + def snmp_version(self, value=''): + """ + The version of SNMP to use. Possible values are v1, v2c and v3. + :type value: str + """ + self.attributes['Lanforge Resource.SNMP Version'] = value + + @property + def enable_snmp(self): + """ + :rtype: bool + """ + return self.attributes['Lanforge Resource.Enable SNMP'] if 'Lanforge Resource.Enable SNMP' in self.attributes else None + + @enable_snmp.setter + def enable_snmp(self, value=True): + """ + If set to True and SNMP isn???t enabled yet in the device the Shell will automatically enable SNMP in the device when Autoload command is called. SNMP must be enabled on the device for the Autoload command to run successfully. True by default. + :type value: bool + """ + self.attributes['Lanforge Resource.Enable SNMP'] = value + + @property + def disable_snmp(self): + """ + :rtype: bool + """ + return self.attributes['Lanforge Resource.Disable SNMP'] if 'Lanforge Resource.Disable SNMP' in self.attributes else None + + @disable_snmp.setter + def disable_snmp(self, value=False): + """ + If set to True SNMP will be disabled automatically by the Shell after the Autoload command execution is completed. False by default. + :type value: bool + """ + self.attributes['Lanforge Resource.Disable SNMP'] = value + + @property + def console_server_ip_address(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.Console Server IP Address'] if 'Lanforge Resource.Console Server IP Address' in self.attributes else None + + @console_server_ip_address.setter + def console_server_ip_address(self, value): + """ + The IP address of the console server, in IPv4 format. + :type value: str + """ + self.attributes['Lanforge Resource.Console Server IP Address'] = value + + @property + def console_user(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.Console User'] if 'Lanforge Resource.Console User' in self.attributes else None + + @console_user.setter + def console_user(self, value): + """ + + :type value: str + """ + self.attributes['Lanforge Resource.Console User'] = value + + @property + def console_port(self): + """ + :rtype: float + """ + return self.attributes['Lanforge Resource.Console Port'] if 'Lanforge Resource.Console Port' in self.attributes else None + + @console_port.setter + def console_port(self, value): + """ + The port on the console server, usually TCP port, which the device is associated with. + :type value: float + """ + self.attributes['Lanforge Resource.Console Port'] = value + + @property + def console_password(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.Console Password'] if 'Lanforge Resource.Console Password' in self.attributes else None + + @console_password.setter + def console_password(self, value): + """ + + :type value: string + """ + self.attributes['Lanforge Resource.Console Password'] = value + + @property + def cli_connection_type(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.CLI Connection Type'] if 'Lanforge Resource.CLI Connection Type' in self.attributes else None + + @cli_connection_type.setter + def cli_connection_type(self, value='Auto'): + """ + The CLI connection type that will be used by the driver. Possible values are Auto, Console, SSH, Telnet and TCP. If Auto is selected the driver will choose the available connection type automatically. Default value is Auto. + :type value: str + """ + self.attributes['Lanforge Resource.CLI Connection Type'] = value + + @property + def cli_tcp_port(self): + """ + :rtype: float + """ + return self.attributes['Lanforge Resource.CLI TCP Port'] if 'Lanforge Resource.CLI TCP Port' in self.attributes else None + + @cli_tcp_port.setter + def cli_tcp_port(self, value): + """ + TCP Port to user for CLI connection. If kept empty a default CLI port will be used based on the chosen protocol, for example Telnet will use port 23. + :type value: float + """ + self.attributes['Lanforge Resource.CLI TCP Port'] = value + + @property + def backup_location(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.Backup Location'] if 'Lanforge Resource.Backup Location' in self.attributes else None + + @backup_location.setter + def backup_location(self, value): + """ + Used by the save/restore orchestration to determine where backups should be saved. + :type value: str + """ + self.attributes['Lanforge Resource.Backup Location'] = value + + @property + def backup_type(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.Backup Type'] if 'Lanforge Resource.Backup Type' in self.attributes else None + + @backup_type.setter + def backup_type(self, value='File System'): + """ + Supported protocols for saving and restoring of configuration and firmware files. Possible values are 'File System' 'FTP' and 'TFTP'. Default value is 'File System'. + :type value: str + """ + self.attributes['Lanforge Resource.Backup Type'] = value + + @property + def backup_user(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.Backup User'] if 'Lanforge Resource.Backup User' in self.attributes else None + + @backup_user.setter + def backup_user(self, value): + """ + Username for the storage server used for saving and restoring of configuration and firmware files. + :type value: str + """ + self.attributes['Lanforge Resource.Backup User'] = value + + @property + def backup_password(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.Backup Password'] if 'Lanforge Resource.Backup Password' in self.attributes else None + + @backup_password.setter + def backup_password(self, value): + """ + Password for the storage server used for saving and restoring of configuration and firmware files. + :type value: string + """ + self.attributes['Lanforge Resource.Backup Password'] = value + + @property + def name(self): + """ + :rtype: str + """ + return self._name + + @name.setter + def name(self, value): + """ + + :type value: str + """ + self._name = value + + @property + def cloudshell_model_name(self): + """ + :rtype: str + """ + return self._cloudshell_model_name + + @cloudshell_model_name.setter + def cloudshell_model_name(self, value): + """ + + :type value: str + """ + self._cloudshell_model_name = value + + @property + def system_name(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.System Name'] if 'CS_GenericResource.System Name' in self.attributes else None + + @system_name.setter + def system_name(self, value): + """ + A unique identifier for the device, if exists in the device terminal/os. + :type value: str + """ + self.attributes['CS_GenericResource.System Name'] = value + + @property + def vendor(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.Vendor'] if 'CS_GenericResource.Vendor' in self.attributes else None + + @vendor.setter + def vendor(self, value=''): + """ + The name of the device manufacture. + :type value: str + """ + self.attributes['CS_GenericResource.Vendor'] = value + + @property + def contact_name(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.Contact Name'] if 'CS_GenericResource.Contact Name' in self.attributes else None + + @contact_name.setter + def contact_name(self, value): + """ + The name of a contact registered in the device. + :type value: str + """ + self.attributes['CS_GenericResource.Contact Name'] = value + + @property + def location(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.Location'] if 'CS_GenericResource.Location' in self.attributes else None + + @location.setter + def location(self, value=''): + """ + The device physical location identifier. For example Lab1/Floor2/Row5/Slot4. + :type value: str + """ + self.attributes['CS_GenericResource.Location'] = value + + @property + def model(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.Model'] if 'CS_GenericResource.Model' in self.attributes else None + + @model.setter + def model(self, value=''): + """ + The device model. This information is typically used for abstract resource filtering. + :type value: str + """ + self.attributes['CS_GenericResource.Model'] = value + + @property + def model_name(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.Model Name'] if 'CS_GenericResource.Model Name' in self.attributes else None + + @model_name.setter + def model_name(self, value=''): + """ + The catalog name of the device model. This attribute will be displayed in CloudShell instead of the CloudShell model. + :type value: str + """ + self.attributes['CS_GenericResource.Model Name'] = value + + +class ResourcePort(object): + def __init__(self, name): + """ + + """ + self.attributes = {} + self.resources = {} + self._cloudshell_model_name = 'Lanforge Resource.ResourcePort' + self._name = name + + def add_sub_resource(self, relative_path, sub_resource): + self.resources[relative_path] = sub_resource + + @classmethod + def create_from_context(cls, context): + """ + Creates an instance of NXOS by given context + :param context: cloudshell.shell.core.driver_context.ResourceCommandContext + :type context: cloudshell.shell.core.driver_context.ResourceCommandContext + :return: + :rtype ResourcePort + """ + result = ResourcePort(name=context.resource.name) + for attr in context.resource.attributes: + result.attributes[attr] = context.resource.attributes[attr] + return result + + def create_autoload_details(self, relative_path=''): + """ + :param relative_path: + :type relative_path: str + :return + """ + resources = [AutoLoadResource(model=self.resources[r].cloudshell_model_name, + name=self.resources[r].name, + relative_address=self._get_relative_path(r, relative_path)) + for r in self.resources] + attributes = [AutoLoadAttribute(relative_path, a, self.attributes[a]) for a in self.attributes] + autoload_details = AutoLoadDetails(resources, attributes) + for r in self.resources: + curr_path = relative_path + '/' + r if relative_path else r + curr_auto_load_details = self.resources[r].create_autoload_details(curr_path) + autoload_details = self._merge_autoload_details(autoload_details, curr_auto_load_details) + return autoload_details + + def _get_relative_path(self, child_path, parent_path): + """ + Combines relative path + :param child_path: Path of a model within it parent model, i.e 1 + :type child_path: str + :param parent_path: Full path of parent model, i.e 1/1. Might be empty for root model + :type parent_path: str + :return: Combined path + :rtype str + """ + return parent_path + '/' + child_path if parent_path else child_path + + @staticmethod + def _merge_autoload_details(autoload_details1, autoload_details2): + """ + Merges two instances of AutoLoadDetails into the first one + :param autoload_details1: + :type autoload_details1: AutoLoadDetails + :param autoload_details2: + :type autoload_details2: AutoLoadDetails + :return: + :rtype AutoLoadDetails + """ + for attribute in autoload_details2.attributes: + autoload_details1.attributes.append(attribute) + for resource in autoload_details2.resources: + autoload_details1.resources.append(resource) + return autoload_details1 + + @property + def cloudshell_model_name(self): + """ + Returns the name of the Cloudshell model + :return: + """ + return 'ResourcePort' + + @property + def mac_address(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.ResourcePort.MAC Address'] if 'Lanforge Resource.ResourcePort.MAC Address' in self.attributes else None + + @mac_address.setter + def mac_address(self, value=''): + """ + + :type value: str + """ + self.attributes['Lanforge Resource.ResourcePort.MAC Address'] = value + + @property + def ipv4_address(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.ResourcePort.IPv4 Address'] if 'Lanforge Resource.ResourcePort.IPv4 Address' in self.attributes else None + + @ipv4_address.setter + def ipv4_address(self, value): + """ + + :type value: str + """ + self.attributes['Lanforge Resource.ResourcePort.IPv4 Address'] = value + + @property + def ipv6_address(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.ResourcePort.IPv6 Address'] if 'Lanforge Resource.ResourcePort.IPv6 Address' in self.attributes else None + + @ipv6_address.setter + def ipv6_address(self, value): + """ + + :type value: str + """ + self.attributes['Lanforge Resource.ResourcePort.IPv6 Address'] = value + + @property + def port_speed(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.ResourcePort.Port Speed'] if 'Lanforge Resource.ResourcePort.Port Speed' in self.attributes else None + + @port_speed.setter + def port_speed(self, value): + """ + The port speed (e.g 10Gb/s, 40Gb/s, 100Mb/s) + :type value: str + """ + self.attributes['Lanforge Resource.ResourcePort.Port Speed'] = value + + @property + def name(self): + """ + :rtype: str + """ + return self._name + + @name.setter + def name(self, value): + """ + + :type value: str + """ + self._name = value + + @property + def cloudshell_model_name(self): + """ + :rtype: str + """ + return self._cloudshell_model_name + + @cloudshell_model_name.setter + def cloudshell_model_name(self, value): + """ + + :type value: str + """ + self._cloudshell_model_name = value + + @property + def model_name(self): + """ + :rtype: str + """ + return self.attributes['CS_Port.Model Name'] if 'CS_Port.Model Name' in self.attributes else None + + @model_name.setter + def model_name(self, value=''): + """ + The catalog name of the device model. This attribute will be displayed in CloudShell instead of the CloudShell model. + :type value: str + """ + self.attributes['CS_Port.Model Name'] = value + + +class GenericPowerPort(object): + def __init__(self, name): + """ + + """ + self.attributes = {} + self.resources = {} + self._cloudshell_model_name = 'Lanforge Resource.GenericPowerPort' + self._name = name + + def add_sub_resource(self, relative_path, sub_resource): + self.resources[relative_path] = sub_resource + + @classmethod + def create_from_context(cls, context): + """ + Creates an instance of NXOS by given context + :param context: cloudshell.shell.core.driver_context.ResourceCommandContext + :type context: cloudshell.shell.core.driver_context.ResourceCommandContext + :return: + :rtype GenericPowerPort + """ + result = GenericPowerPort(name=context.resource.name) + for attr in context.resource.attributes: + result.attributes[attr] = context.resource.attributes[attr] + return result + + def create_autoload_details(self, relative_path=''): + """ + :param relative_path: + :type relative_path: str + :return + """ + resources = [AutoLoadResource(model=self.resources[r].cloudshell_model_name, + name=self.resources[r].name, + relative_address=self._get_relative_path(r, relative_path)) + for r in self.resources] + attributes = [AutoLoadAttribute(relative_path, a, self.attributes[a]) for a in self.attributes] + autoload_details = AutoLoadDetails(resources, attributes) + for r in self.resources: + curr_path = relative_path + '/' + r if relative_path else r + curr_auto_load_details = self.resources[r].create_autoload_details(curr_path) + autoload_details = self._merge_autoload_details(autoload_details, curr_auto_load_details) + return autoload_details + + def _get_relative_path(self, child_path, parent_path): + """ + Combines relative path + :param child_path: Path of a model within it parent model, i.e 1 + :type child_path: str + :param parent_path: Full path of parent model, i.e 1/1. Might be empty for root model + :type parent_path: str + :return: Combined path + :rtype str + """ + return parent_path + '/' + child_path if parent_path else child_path + + @staticmethod + def _merge_autoload_details(autoload_details1, autoload_details2): + """ + Merges two instances of AutoLoadDetails into the first one + :param autoload_details1: + :type autoload_details1: AutoLoadDetails + :param autoload_details2: + :type autoload_details2: AutoLoadDetails + :return: + :rtype AutoLoadDetails + """ + for attribute in autoload_details2.attributes: + autoload_details1.attributes.append(attribute) + for resource in autoload_details2.resources: + autoload_details1.resources.append(resource) + return autoload_details1 + + @property + def cloudshell_model_name(self): + """ + Returns the name of the Cloudshell model + :return: + """ + return 'GenericPowerPort' + + @property + def model(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.GenericPowerPort.Model'] if 'Lanforge Resource.GenericPowerPort.Model' in self.attributes else None + + @model.setter + def model(self, value): + """ + The device model. This information is typically used for abstract resource filtering. + :type value: str + """ + self.attributes['Lanforge Resource.GenericPowerPort.Model'] = value + + @property + def serial_number(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.GenericPowerPort.Serial Number'] if 'Lanforge Resource.GenericPowerPort.Serial Number' in self.attributes else None + + @serial_number.setter + def serial_number(self, value): + """ + + :type value: str + """ + self.attributes['Lanforge Resource.GenericPowerPort.Serial Number'] = value + + @property + def version(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.GenericPowerPort.Version'] if 'Lanforge Resource.GenericPowerPort.Version' in self.attributes else None + + @version.setter + def version(self, value): + """ + The firmware version of the resource. + :type value: str + """ + self.attributes['Lanforge Resource.GenericPowerPort.Version'] = value + + @property + def port_description(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.GenericPowerPort.Port Description'] if 'Lanforge Resource.GenericPowerPort.Port Description' in self.attributes else None + + @port_description.setter + def port_description(self, value): + """ + The description of the port as configured in the device. + :type value: str + """ + self.attributes['Lanforge Resource.GenericPowerPort.Port Description'] = value + + @property + def name(self): + """ + :rtype: str + """ + return self._name + + @name.setter + def name(self, value): + """ + + :type value: str + """ + self._name = value + + @property + def cloudshell_model_name(self): + """ + :rtype: str + """ + return self._cloudshell_model_name + + @cloudshell_model_name.setter + def cloudshell_model_name(self, value): + """ + + :type value: str + """ + self._cloudshell_model_name = value + + @property + def model_name(self): + """ + :rtype: str + """ + return self.attributes['CS_PowerPort.Model Name'] if 'CS_PowerPort.Model Name' in self.attributes else None + + @model_name.setter + def model_name(self, value=''): + """ + The catalog name of the device model. This attribute will be displayed in CloudShell instead of the CloudShell model. + :type value: str + """ + self.attributes['CS_PowerPort.Model Name'] = value + + + diff --git a/quali/lanforge-resource/src/driver.py b/quali/lanforge-resource/src/driver.py new file mode 100755 index 00000000..25b6dd39 --- /dev/null +++ b/quali/lanforge-resource/src/driver.py @@ -0,0 +1,309 @@ +from cloudshell.shell.core.resource_driver_interface import ResourceDriverInterface +from cloudshell.shell.core.driver_context import InitCommandContext, ResourceCommandContext, AutoLoadResource, \ + AutoLoadAttribute, AutoLoadDetails, CancellationContext +from cloudshell.shell.core.session.cloudshell_session import CloudShellSessionContext +import mock +from data_model import * +# run 'shellfoundry generate' to generate data model classes +import subprocess +import sys +import os +import importlib +import paramiko + +# command = "./lanforge-scripts/py-scripts/update_dependencies.py" +# print("running:[{}]".format(command)) +# process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) +# outs, errs = process.communicate() +# print(outs) +# print(errs) + +# if 'lanforge-scripts' not in sys.path: +# sys.path.append('./lanforge-scripts') + +# create_wanlink = importlib.import_module("lanforge-scripts.py-json.create_wanlink") +# create_l3 = importlib.import_module("lanforge-scripts.py-scripts.create_l3") +# CreateL3 = create_l3.CreateL3 +class LanforgeResourceDriver (ResourceDriverInterface): + + def __init__(self): + """ + ctor must be without arguments, it is created with reflection at run time + """ + pass + + def initialize(self, context): + """ + Initialize the driver session, this function is called everytime a new instance of the driver is created + This is a good place to load and cache the driver configuration, initiate sessions etc. + :param InitCommandContext context: the context the command runs on + """ + pass + + def cleanup(self): + """ + Destroy the driver session, this function is called everytime a driver instance is destroyed + This is a good place to close any open sessions, finish writing to log files + """ + pass + + def get_inventory(self, context): + """ + Discovers the resource structure and attributes. + :param AutoLoadCommandContext context: the context the command runs on + :return Attribute and sub-resource information for the Shell resource you can return an AutoLoadDetails object + :rtype: AutoLoadDetails + """ + # See below some example code demonstrating how to return the resource structure and attributes + # In real life, this code will be preceded by SNMP/other calls to the resource details and will not be static + # run 'shellfoundry generate' in order to create classes that represent your data model + + ''' + resource = LanforgeResource.create_from_context(context) + resource.vendor = 'specify the shell vendor' + resource.model = 'specify the shell model' + + port1 = ResourcePort('Port 1') + port1.ipv4_address = '192.168.10.7' + resource.add_sub_resource('1', port1) + + return resource.create_autoload_details() + ''' + return AutoLoadDetails([], []) + + def orchestration_save(self, context, cancellation_context, mode, custom_params): + """ + Saves the Shell state and returns a description of the saved artifacts and information + This command is intended for API use only by sandbox orchestration scripts to implement + a save and restore workflow + :param ResourceCommandContext context: the context object containing resource and reservation info + :param CancellationContext cancellation_context: Object to signal a request for cancellation. Must be enabled in drivermetadata.xml as well + :param str mode: Snapshot save mode, can be one of two values 'shallow' (default) or 'deep' + :param str custom_params: Set of custom parameters for the save operation + :return: SavedResults serialized as JSON + :rtype: OrchestrationSaveResult + """ + + # See below an example implementation, here we use jsonpickle for serialization, + # to use this sample, you'll need to add jsonpickle to your requirements.txt file + # The JSON schema is defined at: + # https://github.com/QualiSystems/sandbox_orchestration_standard/blob/master/save%20%26%20restore/saved_artifact_info.schema.json + # You can find more information and examples examples in the spec document at + # https://github.com/QualiSystems/sandbox_orchestration_standard/blob/master/save%20%26%20restore/save%20%26%20restore%20standard.md + ''' + # By convention, all dates should be UTC + created_date = datetime.datetime.utcnow() + + # This can be any unique identifier which can later be used to retrieve the artifact + # such as filepath etc. + + # By convention, all dates should be UTC + created_date = datetime.datetime.utcnow() + + # This can be any unique identifier which can later be used to retrieve the artifact + # such as filepath etc. + identifier = created_date.strftime('%y_%m_%d %H_%M_%S_%f') + + orchestration_saved_artifact = OrchestrationSavedArtifact('REPLACE_WITH_ARTIFACT_TYPE', identifier) + + saved_artifacts_info = OrchestrationSavedArtifactInfo( + resource_name="some_resource", + created_date=created_date, + restore_rules=OrchestrationRestoreRules(requires_same_resource=True), + saved_artifact=orchestration_saved_artifact) + + return OrchestrationSaveResult(saved_artifacts_info) + ''' + pass + + def orchestration_restore(self, context, cancellation_context, saved_artifact_info, custom_params): + """ + Restores a saved artifact previously saved by this Shell driver using the orchestration_save function + :param ResourceCommandContext context: The context object for the command with resource and reservation info + :param CancellationContext cancellation_context: Object to signal a request for cancellation. Must be enabled in drivermetadata.xml as well + :param str saved_artifact_info: A JSON string representing the state to restore including saved artifacts and info + :param str custom_params: Set of custom parameters for the restore operation + :return: None + """ + ''' + # The saved_details JSON will be defined according to the JSON Schema and is the same object returned via the + # orchestration save function. + # Example input: + # { + # "saved_artifact": { + # "artifact_type": "REPLACE_WITH_ARTIFACT_TYPE", + # "identifier": "16_08_09 11_21_35_657000" + # }, + # "resource_name": "some_resource", + # "restore_rules": { + # "requires_same_resource": true + # }, + # "created_date": "2016-08-09T11:21:35.657000" + # } + + # The example code below just parses and prints the saved artifact identifier + saved_details_object = json.loads(saved_details) + return saved_details_object[u'saved_artifact'][u'identifier'] + ''' + pass + + def create_wanlink(self, context, name, latency, rate): + resource = LanforgeResource.create_from_context(context) + terminal_ip = context.resource.address + terminal_user = context.resource.attributes["{}User".format(shell_name)] = "lanforge" + terminal_pass = context.resource.attributes["{}Password".format(shell_name)] = "lanforge" + + print("Initializing SSH connection to {ip}, with user {user} and password {password}".format(ip=terminal_ip, user=terminal_user, password=terminal_pass)) + s = paramiko.SSHClient() + s.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + s.connect(hostname=terminal_ip, username=terminal_user, password=terminal_pass) + + command = "/home/lanforge/lanforge-scripts/py-json/create_wanlink.py --host {host} --port_A {port_A} --port_B {port_B} --name \"{name}\" --latency \"{latency}\" --latency_A \"{latency_A}\" --latency_B \"{latency_B}\" --rate {rate} --rate_A {rate_A} --rate_B {rate_B} --jitter {jitter} --jitter_A {jitter_A} --jitter_B {jitter_B} --jitter_freq_A {jitter_freq_A} --jitter_freq_B {jitter_freq_B} --drop_A {drop_A} --drop_B {drop_B}".format( + host="localhost", + port_A="eth1", + port_B="eth2", + name=name, + latency=latency, + latency_A=latency, + latency_B=latency, + rate=rate, + rate_A=rate, + rate_B=rate, + jitter="0", + jitter_A="0", + jitter_B="0", + jitter_freq_A="0", + jitter_freq_B="0", + drop_A="0", + drop_B="0" + ) + + (stdin, stdout, stderr) = s.exec_command(command) + output = '' + errors = '' + for line in stdout.readlines(): + output += line + for line in stderr.readlines(): + errors += line + print(errors) + # if errors != '': + print(errors) + # else: + print(output) + s.close() + + # print(args) + # command = "./lanforge-scripts/py-json/create_wanlink.py --host \"{host}\" --name my_wanlink4 --latency \"{latency}\" --rate \"{rate}\"".format( + # host = context.resource.address, + # name=args['name'], + # latency=args['latency'], + # rate=args['rate'] + # ) + # print("running:[{}]".format(command)) + # process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) + # outs, errs = process.communicate() + # print(outs) + # print(errs) + + def example_command(self, context): + """ + this is my example command + :param ResourceCommandContext context + :return: str + """ + resource = LanforgeResource.create_from_context(context) + msg = "My resource: " + resource.name + msg += ", at address: " + context.resource.address + return msg + + def create_l3(self, context, name, min_rate_a, min_rate_b, endp_a, endp_b): + # api_session = CloudShellSessionContext(context) + resource = LanforgeResource.create_from_context(context) + args = { + "host": context.resource.address, + "name_prefix": name, + "min_rate_a": min_rate_a, + "min_rate_b": min_rate_b, + "endp_a": endp_a, + "endp_b": endp_b + } + # ip_var_test = CreateL3( + # host=context.resource.address, + # name_prefix=name, + # endp_a=[endp_a], + # endp_b=endp_b, + # min_rate_a=min_rate_a, + # min_rate_b=min_rate_b + # ) + + print(args) + terminal_ip = context.resource.address + terminal_user = context.resource.attributes["{}.User".format(shell_name)] = "lanforge" + terminal_pass = context.resource.attributes["{}.Password".format(shell_name)] = "lanforge" + + print("Initializing SSH connection to {ip}, with user {user} and password {password}".format(ip=terminal_ip, user=terminal_user, password=terminal_pass)) + s = paramiko.SSHClient() + s.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + s.connect(hostname=terminal_ip, username=terminal_user, password=terminal_pass) + + command = "/home/lanforge/lanforge-scripts/py-scripts/create_l3.py --endp_a \"{endp_a}\" --endp_b \"{endp_b}\" --min_rate_a \"{min_rate_a}\" --min_rate_b \"{min_rate_b}\"".format( + endp_a=args['endp_a'], + endp_b=args['endp_b'], + min_rate_a=args['min_rate_a'], + min_rate_b=args['min_rate_b'] + ) + + (stdin, stdout, stderr) = s.exec_command(command) + output = '' + errors = '' + for line in stdout.readlines(): + output += line + for line in stderr.readlines(): + errors += line + print(errors) + if errors != '': + print(errors) + else: + print(output) + s.close() + + # print("running:[{}]".format(command)) + # process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) + # outs, errs = process.communicate() + # print(outs) + # print(errs) + + # num_sta = 2 + # ip_var_test.pre_cleanup() + # ip_var_test.build() + # if not ip_var_test.passes(): + # print(ip_var_test.get_fail_message()) + # ip_var_test.exit_fail() + # print('Created %s stations and connections' % num_sta) + +if __name__ == "__main__": + # setup for mock-debug environment + shell_name = "LanforgeResource" + cancellation_context = mock.create_autospec(CancellationContext) + context = mock.create_autospec(ResourceCommandContext) + context.resource = mock.MagicMock() + context.reservation = mock.MagicMock() + context.connectivity = mock.MagicMock() + context.reservation.reservation_id = "" + context.resource.address = "192.168.100.176" + context.resource.name = "Lanforge_Resource" + context.resource.attributes = dict() + context.resource.attributes["{}.User".format(shell_name)] = "lanforge" + context.resource.attributes["{}.Password".format(shell_name)] = "lanforge" + context.resource.attributes["{}.SNMP Read Community".format(shell_name)] = "" + + # add information for api connectivity + context.reservation.domain = "Global" + context.connectivity.server_address = "192.168.100.131" + driver = LanforgeResourceDriver() + # print driver.run_custom_command(context, custom_command="sh run", cancellation_context=cancellation_context) + # result = driver.example_command_with_api(context) + + driver.create_l3(context, "my_fire", "69000", "41000", "eth1", "eth2") + driver.create_wanlink(context, name="my_wanlin", latency="49", rate="6000") + print("done") diff --git a/quali/lanforge-resource/src/drivermetadata.xml b/quali/lanforge-resource/src/drivermetadata.xml new file mode 100644 index 00000000..59cbeb1c --- /dev/null +++ b/quali/lanforge-resource/src/drivermetadata.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/quali/lanforge-resource/src/importlib b/quali/lanforge-resource/src/importlib new file mode 100644 index 00000000..e69de29b diff --git a/quali/lanforge-resource/src/requirements.txt b/quali/lanforge-resource/src/requirements.txt new file mode 100644 index 00000000..8c1ba7fe --- /dev/null +++ b/quali/lanforge-resource/src/requirements.txt @@ -0,0 +1,25 @@ +mock +cloudshell-shell-core>=5.0.3,<6.0.0 +cloudshell-automation-api +pandas +plotly +numpy==1.16.6 +cryptography +paramiko +bokeh +streamlit==0.62.0 +cython +pyarrow==4.0.0 +websocket-client +xlsxwriter +pyshark +influxdb +influxdb-client +matplotlib +pdfkit +pip-search +pyserial +pexpect-serial +scp +dash +kaleido diff --git a/quali/lanforge-resource/src/sys b/quali/lanforge-resource/src/sys new file mode 100644 index 00000000..e69de29b diff --git a/quali/lanforge-resource/test_requirements.txt b/quali/lanforge-resource/test_requirements.txt new file mode 100644 index 00000000..7d963ba7 --- /dev/null +++ b/quali/lanforge-resource/test_requirements.txt @@ -0,0 +1,7 @@ +nose +coverage +unittest2 +mock +teamcity-messages +jsonpickle +nose-exclude \ No newline at end of file diff --git a/quali/lanforge-resource/tests/__init__.py b/quali/lanforge-resource/tests/__init__.py new file mode 100644 index 00000000..40a96afc --- /dev/null +++ b/quali/lanforge-resource/tests/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/quali/lanforge-resource/tests/test_lanforge-resource.py b/quali/lanforge-resource/tests/test_lanforge-resource.py new file mode 100644 index 00000000..de11d725 --- /dev/null +++ b/quali/lanforge-resource/tests/test_lanforge-resource.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +Tests for `LanforgeResourceDriver` +""" + +import unittest + +from driver import LanforgeResourceDriver + + +class TestLanforgeResourceDriver(unittest.TestCase): + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_000_something(self): + pass + + +if __name__ == '__main__': + import sys + sys.exit(unittest.main()) From eb6bd5d0754756c1e34c8d3cc68229105e58e6cb Mon Sep 17 00:00:00 2001 From: erinnerim Date: Wed, 6 Oct 2021 11:05:40 -0700 Subject: [PATCH 087/731] capitalize brand-name Quali directory --- quali/lanforge-resource/.gitignore | 60 - .../TOSCA-Metadata/TOSCA.meta | 4 - .../canvil2-64x64-gray-yel-ico.png | Bin 2401 -> 0 bytes quali/lanforge-resource/deployment.xml | 53 - quali/lanforge-resource/docs/readme.rst | 3 - quali/lanforge-resource/shell-definition.yaml | 45 - quali/lanforge-resource/shell-icon.png | Bin 461 -> 0 bytes quali/lanforge-resource/src/data_model.py | 1029 ----------------- quali/lanforge-resource/src/driver.py | 309 ----- .../lanforge-resource/src/drivermetadata.xml | 73 -- quali/lanforge-resource/src/importlib | 0 quali/lanforge-resource/src/requirements.txt | 25 - quali/lanforge-resource/src/sys | 0 quali/lanforge-resource/test_requirements.txt | 7 - quali/lanforge-resource/tests/__init__.py | 1 - .../tests/test_lanforge-resource.py | 27 - 16 files changed, 1636 deletions(-) delete mode 100644 quali/lanforge-resource/.gitignore delete mode 100644 quali/lanforge-resource/TOSCA-Metadata/TOSCA.meta delete mode 100644 quali/lanforge-resource/canvil2-64x64-gray-yel-ico.png delete mode 100644 quali/lanforge-resource/deployment.xml delete mode 100644 quali/lanforge-resource/docs/readme.rst delete mode 100644 quali/lanforge-resource/shell-definition.yaml delete mode 100644 quali/lanforge-resource/shell-icon.png delete mode 100644 quali/lanforge-resource/src/data_model.py delete mode 100755 quali/lanforge-resource/src/driver.py delete mode 100644 quali/lanforge-resource/src/drivermetadata.xml delete mode 100644 quali/lanforge-resource/src/importlib delete mode 100644 quali/lanforge-resource/src/requirements.txt delete mode 100644 quali/lanforge-resource/src/sys delete mode 100644 quali/lanforge-resource/test_requirements.txt delete mode 100644 quali/lanforge-resource/tests/__init__.py delete mode 100644 quali/lanforge-resource/tests/test_lanforge-resource.py diff --git a/quali/lanforge-resource/.gitignore b/quali/lanforge-resource/.gitignore deleted file mode 100644 index 1e1a44c7..00000000 --- a/quali/lanforge-resource/.gitignore +++ /dev/null @@ -1,60 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ -cloudshell_config.yml diff --git a/quali/lanforge-resource/TOSCA-Metadata/TOSCA.meta b/quali/lanforge-resource/TOSCA-Metadata/TOSCA.meta deleted file mode 100644 index 5a9b442f..00000000 --- a/quali/lanforge-resource/TOSCA-Metadata/TOSCA.meta +++ /dev/null @@ -1,4 +0,0 @@ -TOSCA-Meta-File-Version: 1.0 -CSAR-Version: 0.1.0 -Created-By: Anonymous -Entry-Definitions: shell-definition.yaml \ No newline at end of file diff --git a/quali/lanforge-resource/canvil2-64x64-gray-yel-ico.png b/quali/lanforge-resource/canvil2-64x64-gray-yel-ico.png deleted file mode 100644 index 9abca2422cc4f57477eaa31797c20fe074fa9d7a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2401 zcmV-n37+&2wr>_ZbN6vmdcqcJ!@3~_AZ05|h5w*uf5Vu!9E_;EKLQ47F&#VBNrgZ?X0^a~gBog%Z_alVh`0?Y|Y&L-Z0LP`2 ziO+-pnx@%+mvhAZ#m@}GU~Fs*RaI$fYFgg)l$7!>pIQMlO?wKs0GuxA(n4UG=4!+I zMoQW9sS!ZaG+)lr7XW*yHma(UOeP71LO7jH_Uze{U;lT)HK0q}=fuC3Bi(h^txO2U z#>TjM^(t1Y71K0vxm-N*$Rj9Ml-Gw%$Y2tJ`$!4=;vsrXqH^hBJ{M$L=pWDnhx~`MWW~r*G!Y~YUU8kqMhb5{U$gq7;({xGC-dX?t#6 zzY6%aYFyJaQ51zhAW#U1kw~NHHVgy5-;c-RA(cuoK0c1F z>&q>@9PdaeyUV@}YMR!Nv-HbApC?xH3R|y6h&cja*}8?dN*qq&oMMKgkcyZBY16XE%o*FG&VMp$z%wHLQG9ft;fCZgaIk#(Xv;B zIy*amec-@>mx`_IcDqqkmEPW7g25m?Jw1d%A#UHkjiM-2R#xJ4I`MkF2q6fE!-T_O z=H}+s>)v-l1Za>_nq?QDy}kXSVHnSMc6KhYvdiVdVzJQI*GF@6Gd(>$g=4CsD8%D& z!r?GCZrnf!u~};`aW23srMy+PnxLj>HNba(3qpuGA;bz72MQMM>+7SbsfqLF&oePG zK{y;Hl}fECHf#XTNGbok*2ZF;#82c3jbASHJWnW}iDk1{+S=NP$K&+&_R`+oj@Rog zXYTbkDdl79>0ntS@mGO20Ppf3X0cePtE;1`s*1tELFVV@>F(|(l}Z7SOeTrNV${~w zuBB45S$u!J9mHKo2Z1+%bIS?4-EQ1&Hy)3N>gwu3!eX^rxpe6gLI~`3d*Sq@C<^`k z{WLZ<;`jT@#$HOf?j>z0LHrc(1Jg9S^696?2xmH@+=lhxjo?D8|h>zE=U-L@gu~{Md3Fobw&1Q+kVk8m?u3Wi- z#bPOWPA^l?E6(`VFTjg0zW7a>&Gy^+`g--DhaRG?uCCzH#pmpNq)(^Q%+1Y_OeRSt zlf>h3=I7^86a__5sHv$b{UVD6tJPXg0d8(c03pQjy1F_wolX-DhZ!3i!!QgC!^qdo z$Ye5PGMR$)^Oi3rSL*xnC1AJP%PGM8Mmi}{%5Oy?k=>C<Sfv*7FTUoM7r_5h>-t zZCN*~p}V{LXYarN{`c}hF`La6?(9s{q`A47rlux_hldeDaOlvXO}#HS_UAX!S1pGC zk3atSYne>u;Y1>V5Q0P^!R+iTHk&PfRgDmWhK2@GsT3n4Bc*O}OCo=4URYQll}a%) zGsBG=H>jIC{@LK-cxk*49>ZU1xG~5`btlN;Def$tRyAo6Qyqoxxy` zn>TOr@y8z%3Eb#=K@G6PXR-Ds~SVMbzJ6&B}`2GI;E~DHR0^~$E2>drMLPtjj4u=C(Rf)x7 zOWOK;z76LCo4JH3s{lC>+JGy0_dj;*7ohkvZ$+B?PvDt#{rRr%kOlan+yHm<3!tHxM3)S}PquGi=M9&@4AVPq^SMm#AhMz5>R>k-9q z`mx1uqt8sOFAH-1PoytnvQ2pF_h+~{TT`69t&*pkTzK|f_U)c3%X~!D(YV4k;wNYS zh_@zL*bP?04`29G*~o8O3|N}U!H>^g!sAS?+V-VWf2F=|w(N7-RsjGM@rft6owx7U z=0MYR+8-X@p80SOpeQCkJ$nh4qqGQ5cMNTxS8itzT(N%}f;WHnJn^||6k+hx(P2(^ zen5p)-yZT+N8|TY0D#4;%D=8Y%wq>W-1c{WBEX>A-~olO?T@g79qeES4>JA_g#*$W TVq_4-00000NkvXXu0mjfMk1wL diff --git a/quali/lanforge-resource/deployment.xml b/quali/lanforge-resource/deployment.xml deleted file mode 100644 index fa1f6a32..00000000 --- a/quali/lanforge-resource/deployment.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - localhost - - - 8029 - - - YOUR_USERNAME - YOUR_PASSWORD - Global - - - dont_upload_me.xml - - - - - - - - - - src - - - LanforgeResourceDriver - - - - - - - \ No newline at end of file diff --git a/quali/lanforge-resource/docs/readme.rst b/quali/lanforge-resource/docs/readme.rst deleted file mode 100644 index 4dc0eb5d..00000000 --- a/quali/lanforge-resource/docs/readme.rst +++ /dev/null @@ -1,3 +0,0 @@ -.. _readme: - -.. include:: ../README.rst diff --git a/quali/lanforge-resource/shell-definition.yaml b/quali/lanforge-resource/shell-definition.yaml deleted file mode 100644 index 2a0f9cbb..00000000 --- a/quali/lanforge-resource/shell-definition.yaml +++ /dev/null @@ -1,45 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0 - -metadata: - template_name: Lanforge Resource - template_author: Anonymous - template_version: 0.1.0 - template_icon: shell-icon.png - -description: > - TOSCA based resource shell - -imports: - - cloudshell_standard: cloudshell_resource_standard_2_0_3.yaml - -node_types: - - vendor.resource.Lanforge Resource: - derived_from: cloudshell.nodes.GenericResource - #properties: - # my_property: - # type: string # optional values: string, integer, float, boolean, cloudshell.datatypes.Password - # default: fast - # description: Some attribute description - # constraints: - # - valid_values: [fast, slow] - capabilities: - auto_discovery_capability: - type: cloudshell.capabilities.AutoDiscovery - properties: - enable_auto_discovery: - type: boolean - default: true - auto_discovery_description: - type: string - default: Describe the auto discovery - inventory_description: - type: string - default: Describe the resource shell template - artifacts: - icon: - file: canvil2-64x64-gray-yel-ico.png - type: tosca.artifacts.File - driver: - file: LanforgeResourceDriver.zip - type: tosca.artifacts.File diff --git a/quali/lanforge-resource/shell-icon.png b/quali/lanforge-resource/shell-icon.png deleted file mode 100644 index 820b28fdffeccab4956e35c7be7d52d9249a9b58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 461 zcmeAS@N?(olHy`uVBq!ia0vp^jv&mz1|<8wpL7LMoCO|{#S9GGLLkg|>2BR01_s7@ zPZ!6Kid%1QZ!A1yAad;E`IxK(;jjeZ-KVq9&14nNiL{9Cv4+|_6EvU`qBzI5yrV{TaI?=`I)0uBs} zECTy{cPmyl&D`siRpjF@xp?vwtLJ5t1#J#^ALRd)%cG=uenuiNldVJd%D-TpNa!V(gWASZ#{rLjOw zG++Xau;=&} zd^1UD*?vWix%TtC8YOCO+r0VzHbwKnoVEM*72WsvWw80uy>DeEYoGn+YvkD2dMaX; v)zY)J*AvPh7Ax8X>8~&4&$ztQ?FY+o_O>}!r+Hie#t(z1tDnm{r-UW|ETzMY diff --git a/quali/lanforge-resource/src/data_model.py b/quali/lanforge-resource/src/data_model.py deleted file mode 100644 index 329bdfbb..00000000 --- a/quali/lanforge-resource/src/data_model.py +++ /dev/null @@ -1,1029 +0,0 @@ -from cloudshell.shell.core.driver_context import ResourceCommandContext, AutoLoadDetails, AutoLoadAttribute, \ - AutoLoadResource -from collections import defaultdict - - -class LegacyUtils(object): - def __init__(self): - self._datamodel_clss_dict = self.__generate_datamodel_classes_dict() - - def migrate_autoload_details(self, autoload_details, context): - model_name = context.resource.model - root_name = context.resource.name - root = self.__create_resource_from_datamodel(model_name, root_name) - attributes = self.__create_attributes_dict(autoload_details.attributes) - self.__attach_attributes_to_resource(attributes, '', root) - self.__build_sub_resoruces_hierarchy(root, autoload_details.resources, attributes) - return root - - def __create_resource_from_datamodel(self, model_name, res_name): - return self._datamodel_clss_dict[model_name](res_name) - - def __create_attributes_dict(self, attributes_lst): - d = defaultdict(list) - for attribute in attributes_lst: - d[attribute.relative_address].append(attribute) - return d - - def __build_sub_resoruces_hierarchy(self, root, sub_resources, attributes): - d = defaultdict(list) - for resource in sub_resources: - splitted = resource.relative_address.split('/') - parent = '' if len(splitted) == 1 else resource.relative_address.rsplit('/', 1)[0] - rank = len(splitted) - d[rank].append((parent, resource)) - - self.__set_models_hierarchy_recursively(d, 1, root, '', attributes) - - def __set_models_hierarchy_recursively(self, dict, rank, manipulated_resource, resource_relative_addr, attributes): - if rank not in dict: # validate if key exists - pass - - for (parent, resource) in dict[rank]: - if parent == resource_relative_addr: - sub_resource = self.__create_resource_from_datamodel( - resource.model.replace(' ', ''), - resource.name) - self.__attach_attributes_to_resource(attributes, resource.relative_address, sub_resource) - manipulated_resource.add_sub_resource( - self.__slice_parent_from_relative_path(parent, resource.relative_address), sub_resource) - self.__set_models_hierarchy_recursively( - dict, - rank + 1, - sub_resource, - resource.relative_address, - attributes) - - def __attach_attributes_to_resource(self, attributes, curr_relative_addr, resource): - for attribute in attributes[curr_relative_addr]: - setattr(resource, attribute.attribute_name.lower().replace(' ', '_'), attribute.attribute_value) - del attributes[curr_relative_addr] - - def __slice_parent_from_relative_path(self, parent, relative_addr): - if parent is '': - return relative_addr - return relative_addr[len(parent) + 1:] # + 1 because we want to remove the seperator also - - def __generate_datamodel_classes_dict(self): - return dict(self.__collect_generated_classes()) - - def __collect_generated_classes(self): - import sys, inspect - return inspect.getmembers(sys.modules[__name__], inspect.isclass) - - -class LanforgeResource(object): - def __init__(self, name): - """ - - """ - self.attributes = {} - self.resources = {} - self._cloudshell_model_name = 'Lanforge Resource' - self._name = name - - def add_sub_resource(self, relative_path, sub_resource): - self.resources[relative_path] = sub_resource - - @classmethod - def create_from_context(cls, context): - """ - Creates an instance of NXOS by given context - :param context: cloudshell.shell.core.driver_context.ResourceCommandContext - :type context: cloudshell.shell.core.driver_context.ResourceCommandContext - :return: - :rtype LanforgeResource - """ - result = LanforgeResource(name=context.resource.name) - for attr in context.resource.attributes: - result.attributes[attr] = context.resource.attributes[attr] - return result - - def create_autoload_details(self, relative_path=''): - """ - :param relative_path: - :type relative_path: str - :return - """ - resources = [AutoLoadResource(model=self.resources[r].cloudshell_model_name, - name=self.resources[r].name, - relative_address=self._get_relative_path(r, relative_path)) - for r in self.resources] - attributes = [AutoLoadAttribute(relative_path, a, self.attributes[a]) for a in self.attributes] - autoload_details = AutoLoadDetails(resources, attributes) - for r in self.resources: - curr_path = relative_path + '/' + r if relative_path else r - curr_auto_load_details = self.resources[r].create_autoload_details(curr_path) - autoload_details = self._merge_autoload_details(autoload_details, curr_auto_load_details) - return autoload_details - - def _get_relative_path(self, child_path, parent_path): - """ - Combines relative path - :param child_path: Path of a model within it parent model, i.e 1 - :type child_path: str - :param parent_path: Full path of parent model, i.e 1/1. Might be empty for root model - :type parent_path: str - :return: Combined path - :rtype str - """ - return parent_path + '/' + child_path if parent_path else child_path - - @staticmethod - def _merge_autoload_details(autoload_details1, autoload_details2): - """ - Merges two instances of AutoLoadDetails into the first one - :param autoload_details1: - :type autoload_details1: AutoLoadDetails - :param autoload_details2: - :type autoload_details2: AutoLoadDetails - :return: - :rtype AutoLoadDetails - """ - for attribute in autoload_details2.attributes: - autoload_details1.attributes.append(attribute) - for resource in autoload_details2.resources: - autoload_details1.resources.append(resource) - return autoload_details1 - - @property - def cloudshell_model_name(self): - """ - Returns the name of the Cloudshell model - :return: - """ - return 'LanforgeResource' - - @property - def user(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.User'] if 'Lanforge Resource.User' in self.attributes else None - - @user.setter - def user(self, value): - """ - User with administrative privileges - :type value: str - """ - self.attributes['Lanforge Resource.User'] = value - - @property - def password(self): - """ - :rtype: string - """ - return self.attributes['Lanforge Resource.Password'] if 'Lanforge Resource.Password' in self.attributes else None - - @password.setter - def password(self, value): - """ - - :type value: string - """ - self.attributes['Lanforge Resource.Password'] = value - - @property - def enable_password(self): - """ - :rtype: string - """ - return self.attributes['Lanforge Resource.Enable Password'] if 'Lanforge Resource.Enable Password' in self.attributes else None - - @enable_password.setter - def enable_password(self, value): - """ - The enable password is required by some CLI protocols such as Telnet and is required according to the device configuration. - :type value: string - """ - self.attributes['Lanforge Resource.Enable Password'] = value - - @property - def power_management(self): - """ - :rtype: bool - """ - return self.attributes['Lanforge Resource.Power Management'] if 'Lanforge Resource.Power Management' in self.attributes else None - - @power_management.setter - def power_management(self, value=True): - """ - Used by the power management orchestration, if enabled, to determine whether to automatically manage the device power status. Enabled by default. - :type value: bool - """ - self.attributes['Lanforge Resource.Power Management'] = value - - @property - def sessions_concurrency_limit(self): - """ - :rtype: float - """ - return self.attributes['Lanforge Resource.Sessions Concurrency Limit'] if 'Lanforge Resource.Sessions Concurrency Limit' in self.attributes else None - - @sessions_concurrency_limit.setter - def sessions_concurrency_limit(self, value='1'): - """ - The maximum number of concurrent sessions that the driver will open to the device. Default is 1 (no concurrency). - :type value: float - """ - self.attributes['Lanforge Resource.Sessions Concurrency Limit'] = value - - @property - def snmp_read_community(self): - """ - :rtype: string - """ - return self.attributes['Lanforge Resource.SNMP Read Community'] if 'Lanforge Resource.SNMP Read Community' in self.attributes else None - - @snmp_read_community.setter - def snmp_read_community(self, value): - """ - The SNMP Read-Only Community String is like a password. It is sent along with each SNMP Get-Request and allows (or denies) access to device. - :type value: string - """ - self.attributes['Lanforge Resource.SNMP Read Community'] = value - - @property - def snmp_write_community(self): - """ - :rtype: string - """ - return self.attributes['Lanforge Resource.SNMP Write Community'] if 'Lanforge Resource.SNMP Write Community' in self.attributes else None - - @snmp_write_community.setter - def snmp_write_community(self, value): - """ - The SNMP Write Community String is like a password. It is sent along with each SNMP Set-Request and allows (or denies) chaning MIBs values. - :type value: string - """ - self.attributes['Lanforge Resource.SNMP Write Community'] = value - - @property - def snmp_v3_user(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.SNMP V3 User'] if 'Lanforge Resource.SNMP V3 User' in self.attributes else None - - @snmp_v3_user.setter - def snmp_v3_user(self, value): - """ - Relevant only in case SNMP V3 is in use. - :type value: str - """ - self.attributes['Lanforge Resource.SNMP V3 User'] = value - - @property - def snmp_v3_password(self): - """ - :rtype: string - """ - return self.attributes['Lanforge Resource.SNMP V3 Password'] if 'Lanforge Resource.SNMP V3 Password' in self.attributes else None - - @snmp_v3_password.setter - def snmp_v3_password(self, value): - """ - Relevant only in case SNMP V3 is in use. - :type value: string - """ - self.attributes['Lanforge Resource.SNMP V3 Password'] = value - - @property - def snmp_v3_private_key(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.SNMP V3 Private Key'] if 'Lanforge Resource.SNMP V3 Private Key' in self.attributes else None - - @snmp_v3_private_key.setter - def snmp_v3_private_key(self, value): - """ - Relevant only in case SNMP V3 is in use. - :type value: str - """ - self.attributes['Lanforge Resource.SNMP V3 Private Key'] = value - - @property - def snmp_v3_authentication_protocol(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.SNMP V3 Authentication Protocol'] if 'Lanforge Resource.SNMP V3 Authentication Protocol' in self.attributes else None - - @snmp_v3_authentication_protocol.setter - def snmp_v3_authentication_protocol(self, value='No Authentication Protocol'): - """ - Relevant only in case SNMP V3 is in use. - :type value: str - """ - self.attributes['Lanforge Resource.SNMP V3 Authentication Protocol'] = value - - @property - def snmp_v3_privacy_protocol(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.SNMP V3 Privacy Protocol'] if 'Lanforge Resource.SNMP V3 Privacy Protocol' in self.attributes else None - - @snmp_v3_privacy_protocol.setter - def snmp_v3_privacy_protocol(self, value='No Privacy Protocol'): - """ - Relevant only in case SNMP V3 is in use. - :type value: str - """ - self.attributes['Lanforge Resource.SNMP V3 Privacy Protocol'] = value - - @property - def snmp_version(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.SNMP Version'] if 'Lanforge Resource.SNMP Version' in self.attributes else None - - @snmp_version.setter - def snmp_version(self, value=''): - """ - The version of SNMP to use. Possible values are v1, v2c and v3. - :type value: str - """ - self.attributes['Lanforge Resource.SNMP Version'] = value - - @property - def enable_snmp(self): - """ - :rtype: bool - """ - return self.attributes['Lanforge Resource.Enable SNMP'] if 'Lanforge Resource.Enable SNMP' in self.attributes else None - - @enable_snmp.setter - def enable_snmp(self, value=True): - """ - If set to True and SNMP isn???t enabled yet in the device the Shell will automatically enable SNMP in the device when Autoload command is called. SNMP must be enabled on the device for the Autoload command to run successfully. True by default. - :type value: bool - """ - self.attributes['Lanforge Resource.Enable SNMP'] = value - - @property - def disable_snmp(self): - """ - :rtype: bool - """ - return self.attributes['Lanforge Resource.Disable SNMP'] if 'Lanforge Resource.Disable SNMP' in self.attributes else None - - @disable_snmp.setter - def disable_snmp(self, value=False): - """ - If set to True SNMP will be disabled automatically by the Shell after the Autoload command execution is completed. False by default. - :type value: bool - """ - self.attributes['Lanforge Resource.Disable SNMP'] = value - - @property - def console_server_ip_address(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.Console Server IP Address'] if 'Lanforge Resource.Console Server IP Address' in self.attributes else None - - @console_server_ip_address.setter - def console_server_ip_address(self, value): - """ - The IP address of the console server, in IPv4 format. - :type value: str - """ - self.attributes['Lanforge Resource.Console Server IP Address'] = value - - @property - def console_user(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.Console User'] if 'Lanforge Resource.Console User' in self.attributes else None - - @console_user.setter - def console_user(self, value): - """ - - :type value: str - """ - self.attributes['Lanforge Resource.Console User'] = value - - @property - def console_port(self): - """ - :rtype: float - """ - return self.attributes['Lanforge Resource.Console Port'] if 'Lanforge Resource.Console Port' in self.attributes else None - - @console_port.setter - def console_port(self, value): - """ - The port on the console server, usually TCP port, which the device is associated with. - :type value: float - """ - self.attributes['Lanforge Resource.Console Port'] = value - - @property - def console_password(self): - """ - :rtype: string - """ - return self.attributes['Lanforge Resource.Console Password'] if 'Lanforge Resource.Console Password' in self.attributes else None - - @console_password.setter - def console_password(self, value): - """ - - :type value: string - """ - self.attributes['Lanforge Resource.Console Password'] = value - - @property - def cli_connection_type(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.CLI Connection Type'] if 'Lanforge Resource.CLI Connection Type' in self.attributes else None - - @cli_connection_type.setter - def cli_connection_type(self, value='Auto'): - """ - The CLI connection type that will be used by the driver. Possible values are Auto, Console, SSH, Telnet and TCP. If Auto is selected the driver will choose the available connection type automatically. Default value is Auto. - :type value: str - """ - self.attributes['Lanforge Resource.CLI Connection Type'] = value - - @property - def cli_tcp_port(self): - """ - :rtype: float - """ - return self.attributes['Lanforge Resource.CLI TCP Port'] if 'Lanforge Resource.CLI TCP Port' in self.attributes else None - - @cli_tcp_port.setter - def cli_tcp_port(self, value): - """ - TCP Port to user for CLI connection. If kept empty a default CLI port will be used based on the chosen protocol, for example Telnet will use port 23. - :type value: float - """ - self.attributes['Lanforge Resource.CLI TCP Port'] = value - - @property - def backup_location(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.Backup Location'] if 'Lanforge Resource.Backup Location' in self.attributes else None - - @backup_location.setter - def backup_location(self, value): - """ - Used by the save/restore orchestration to determine where backups should be saved. - :type value: str - """ - self.attributes['Lanforge Resource.Backup Location'] = value - - @property - def backup_type(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.Backup Type'] if 'Lanforge Resource.Backup Type' in self.attributes else None - - @backup_type.setter - def backup_type(self, value='File System'): - """ - Supported protocols for saving and restoring of configuration and firmware files. Possible values are 'File System' 'FTP' and 'TFTP'. Default value is 'File System'. - :type value: str - """ - self.attributes['Lanforge Resource.Backup Type'] = value - - @property - def backup_user(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.Backup User'] if 'Lanforge Resource.Backup User' in self.attributes else None - - @backup_user.setter - def backup_user(self, value): - """ - Username for the storage server used for saving and restoring of configuration and firmware files. - :type value: str - """ - self.attributes['Lanforge Resource.Backup User'] = value - - @property - def backup_password(self): - """ - :rtype: string - """ - return self.attributes['Lanforge Resource.Backup Password'] if 'Lanforge Resource.Backup Password' in self.attributes else None - - @backup_password.setter - def backup_password(self, value): - """ - Password for the storage server used for saving and restoring of configuration and firmware files. - :type value: string - """ - self.attributes['Lanforge Resource.Backup Password'] = value - - @property - def name(self): - """ - :rtype: str - """ - return self._name - - @name.setter - def name(self, value): - """ - - :type value: str - """ - self._name = value - - @property - def cloudshell_model_name(self): - """ - :rtype: str - """ - return self._cloudshell_model_name - - @cloudshell_model_name.setter - def cloudshell_model_name(self, value): - """ - - :type value: str - """ - self._cloudshell_model_name = value - - @property - def system_name(self): - """ - :rtype: str - """ - return self.attributes['CS_GenericResource.System Name'] if 'CS_GenericResource.System Name' in self.attributes else None - - @system_name.setter - def system_name(self, value): - """ - A unique identifier for the device, if exists in the device terminal/os. - :type value: str - """ - self.attributes['CS_GenericResource.System Name'] = value - - @property - def vendor(self): - """ - :rtype: str - """ - return self.attributes['CS_GenericResource.Vendor'] if 'CS_GenericResource.Vendor' in self.attributes else None - - @vendor.setter - def vendor(self, value=''): - """ - The name of the device manufacture. - :type value: str - """ - self.attributes['CS_GenericResource.Vendor'] = value - - @property - def contact_name(self): - """ - :rtype: str - """ - return self.attributes['CS_GenericResource.Contact Name'] if 'CS_GenericResource.Contact Name' in self.attributes else None - - @contact_name.setter - def contact_name(self, value): - """ - The name of a contact registered in the device. - :type value: str - """ - self.attributes['CS_GenericResource.Contact Name'] = value - - @property - def location(self): - """ - :rtype: str - """ - return self.attributes['CS_GenericResource.Location'] if 'CS_GenericResource.Location' in self.attributes else None - - @location.setter - def location(self, value=''): - """ - The device physical location identifier. For example Lab1/Floor2/Row5/Slot4. - :type value: str - """ - self.attributes['CS_GenericResource.Location'] = value - - @property - def model(self): - """ - :rtype: str - """ - return self.attributes['CS_GenericResource.Model'] if 'CS_GenericResource.Model' in self.attributes else None - - @model.setter - def model(self, value=''): - """ - The device model. This information is typically used for abstract resource filtering. - :type value: str - """ - self.attributes['CS_GenericResource.Model'] = value - - @property - def model_name(self): - """ - :rtype: str - """ - return self.attributes['CS_GenericResource.Model Name'] if 'CS_GenericResource.Model Name' in self.attributes else None - - @model_name.setter - def model_name(self, value=''): - """ - The catalog name of the device model. This attribute will be displayed in CloudShell instead of the CloudShell model. - :type value: str - """ - self.attributes['CS_GenericResource.Model Name'] = value - - -class ResourcePort(object): - def __init__(self, name): - """ - - """ - self.attributes = {} - self.resources = {} - self._cloudshell_model_name = 'Lanforge Resource.ResourcePort' - self._name = name - - def add_sub_resource(self, relative_path, sub_resource): - self.resources[relative_path] = sub_resource - - @classmethod - def create_from_context(cls, context): - """ - Creates an instance of NXOS by given context - :param context: cloudshell.shell.core.driver_context.ResourceCommandContext - :type context: cloudshell.shell.core.driver_context.ResourceCommandContext - :return: - :rtype ResourcePort - """ - result = ResourcePort(name=context.resource.name) - for attr in context.resource.attributes: - result.attributes[attr] = context.resource.attributes[attr] - return result - - def create_autoload_details(self, relative_path=''): - """ - :param relative_path: - :type relative_path: str - :return - """ - resources = [AutoLoadResource(model=self.resources[r].cloudshell_model_name, - name=self.resources[r].name, - relative_address=self._get_relative_path(r, relative_path)) - for r in self.resources] - attributes = [AutoLoadAttribute(relative_path, a, self.attributes[a]) for a in self.attributes] - autoload_details = AutoLoadDetails(resources, attributes) - for r in self.resources: - curr_path = relative_path + '/' + r if relative_path else r - curr_auto_load_details = self.resources[r].create_autoload_details(curr_path) - autoload_details = self._merge_autoload_details(autoload_details, curr_auto_load_details) - return autoload_details - - def _get_relative_path(self, child_path, parent_path): - """ - Combines relative path - :param child_path: Path of a model within it parent model, i.e 1 - :type child_path: str - :param parent_path: Full path of parent model, i.e 1/1. Might be empty for root model - :type parent_path: str - :return: Combined path - :rtype str - """ - return parent_path + '/' + child_path if parent_path else child_path - - @staticmethod - def _merge_autoload_details(autoload_details1, autoload_details2): - """ - Merges two instances of AutoLoadDetails into the first one - :param autoload_details1: - :type autoload_details1: AutoLoadDetails - :param autoload_details2: - :type autoload_details2: AutoLoadDetails - :return: - :rtype AutoLoadDetails - """ - for attribute in autoload_details2.attributes: - autoload_details1.attributes.append(attribute) - for resource in autoload_details2.resources: - autoload_details1.resources.append(resource) - return autoload_details1 - - @property - def cloudshell_model_name(self): - """ - Returns the name of the Cloudshell model - :return: - """ - return 'ResourcePort' - - @property - def mac_address(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.ResourcePort.MAC Address'] if 'Lanforge Resource.ResourcePort.MAC Address' in self.attributes else None - - @mac_address.setter - def mac_address(self, value=''): - """ - - :type value: str - """ - self.attributes['Lanforge Resource.ResourcePort.MAC Address'] = value - - @property - def ipv4_address(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.ResourcePort.IPv4 Address'] if 'Lanforge Resource.ResourcePort.IPv4 Address' in self.attributes else None - - @ipv4_address.setter - def ipv4_address(self, value): - """ - - :type value: str - """ - self.attributes['Lanforge Resource.ResourcePort.IPv4 Address'] = value - - @property - def ipv6_address(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.ResourcePort.IPv6 Address'] if 'Lanforge Resource.ResourcePort.IPv6 Address' in self.attributes else None - - @ipv6_address.setter - def ipv6_address(self, value): - """ - - :type value: str - """ - self.attributes['Lanforge Resource.ResourcePort.IPv6 Address'] = value - - @property - def port_speed(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.ResourcePort.Port Speed'] if 'Lanforge Resource.ResourcePort.Port Speed' in self.attributes else None - - @port_speed.setter - def port_speed(self, value): - """ - The port speed (e.g 10Gb/s, 40Gb/s, 100Mb/s) - :type value: str - """ - self.attributes['Lanforge Resource.ResourcePort.Port Speed'] = value - - @property - def name(self): - """ - :rtype: str - """ - return self._name - - @name.setter - def name(self, value): - """ - - :type value: str - """ - self._name = value - - @property - def cloudshell_model_name(self): - """ - :rtype: str - """ - return self._cloudshell_model_name - - @cloudshell_model_name.setter - def cloudshell_model_name(self, value): - """ - - :type value: str - """ - self._cloudshell_model_name = value - - @property - def model_name(self): - """ - :rtype: str - """ - return self.attributes['CS_Port.Model Name'] if 'CS_Port.Model Name' in self.attributes else None - - @model_name.setter - def model_name(self, value=''): - """ - The catalog name of the device model. This attribute will be displayed in CloudShell instead of the CloudShell model. - :type value: str - """ - self.attributes['CS_Port.Model Name'] = value - - -class GenericPowerPort(object): - def __init__(self, name): - """ - - """ - self.attributes = {} - self.resources = {} - self._cloudshell_model_name = 'Lanforge Resource.GenericPowerPort' - self._name = name - - def add_sub_resource(self, relative_path, sub_resource): - self.resources[relative_path] = sub_resource - - @classmethod - def create_from_context(cls, context): - """ - Creates an instance of NXOS by given context - :param context: cloudshell.shell.core.driver_context.ResourceCommandContext - :type context: cloudshell.shell.core.driver_context.ResourceCommandContext - :return: - :rtype GenericPowerPort - """ - result = GenericPowerPort(name=context.resource.name) - for attr in context.resource.attributes: - result.attributes[attr] = context.resource.attributes[attr] - return result - - def create_autoload_details(self, relative_path=''): - """ - :param relative_path: - :type relative_path: str - :return - """ - resources = [AutoLoadResource(model=self.resources[r].cloudshell_model_name, - name=self.resources[r].name, - relative_address=self._get_relative_path(r, relative_path)) - for r in self.resources] - attributes = [AutoLoadAttribute(relative_path, a, self.attributes[a]) for a in self.attributes] - autoload_details = AutoLoadDetails(resources, attributes) - for r in self.resources: - curr_path = relative_path + '/' + r if relative_path else r - curr_auto_load_details = self.resources[r].create_autoload_details(curr_path) - autoload_details = self._merge_autoload_details(autoload_details, curr_auto_load_details) - return autoload_details - - def _get_relative_path(self, child_path, parent_path): - """ - Combines relative path - :param child_path: Path of a model within it parent model, i.e 1 - :type child_path: str - :param parent_path: Full path of parent model, i.e 1/1. Might be empty for root model - :type parent_path: str - :return: Combined path - :rtype str - """ - return parent_path + '/' + child_path if parent_path else child_path - - @staticmethod - def _merge_autoload_details(autoload_details1, autoload_details2): - """ - Merges two instances of AutoLoadDetails into the first one - :param autoload_details1: - :type autoload_details1: AutoLoadDetails - :param autoload_details2: - :type autoload_details2: AutoLoadDetails - :return: - :rtype AutoLoadDetails - """ - for attribute in autoload_details2.attributes: - autoload_details1.attributes.append(attribute) - for resource in autoload_details2.resources: - autoload_details1.resources.append(resource) - return autoload_details1 - - @property - def cloudshell_model_name(self): - """ - Returns the name of the Cloudshell model - :return: - """ - return 'GenericPowerPort' - - @property - def model(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.GenericPowerPort.Model'] if 'Lanforge Resource.GenericPowerPort.Model' in self.attributes else None - - @model.setter - def model(self, value): - """ - The device model. This information is typically used for abstract resource filtering. - :type value: str - """ - self.attributes['Lanforge Resource.GenericPowerPort.Model'] = value - - @property - def serial_number(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.GenericPowerPort.Serial Number'] if 'Lanforge Resource.GenericPowerPort.Serial Number' in self.attributes else None - - @serial_number.setter - def serial_number(self, value): - """ - - :type value: str - """ - self.attributes['Lanforge Resource.GenericPowerPort.Serial Number'] = value - - @property - def version(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.GenericPowerPort.Version'] if 'Lanforge Resource.GenericPowerPort.Version' in self.attributes else None - - @version.setter - def version(self, value): - """ - The firmware version of the resource. - :type value: str - """ - self.attributes['Lanforge Resource.GenericPowerPort.Version'] = value - - @property - def port_description(self): - """ - :rtype: str - """ - return self.attributes['Lanforge Resource.GenericPowerPort.Port Description'] if 'Lanforge Resource.GenericPowerPort.Port Description' in self.attributes else None - - @port_description.setter - def port_description(self, value): - """ - The description of the port as configured in the device. - :type value: str - """ - self.attributes['Lanforge Resource.GenericPowerPort.Port Description'] = value - - @property - def name(self): - """ - :rtype: str - """ - return self._name - - @name.setter - def name(self, value): - """ - - :type value: str - """ - self._name = value - - @property - def cloudshell_model_name(self): - """ - :rtype: str - """ - return self._cloudshell_model_name - - @cloudshell_model_name.setter - def cloudshell_model_name(self, value): - """ - - :type value: str - """ - self._cloudshell_model_name = value - - @property - def model_name(self): - """ - :rtype: str - """ - return self.attributes['CS_PowerPort.Model Name'] if 'CS_PowerPort.Model Name' in self.attributes else None - - @model_name.setter - def model_name(self, value=''): - """ - The catalog name of the device model. This attribute will be displayed in CloudShell instead of the CloudShell model. - :type value: str - """ - self.attributes['CS_PowerPort.Model Name'] = value - - - diff --git a/quali/lanforge-resource/src/driver.py b/quali/lanforge-resource/src/driver.py deleted file mode 100755 index 25b6dd39..00000000 --- a/quali/lanforge-resource/src/driver.py +++ /dev/null @@ -1,309 +0,0 @@ -from cloudshell.shell.core.resource_driver_interface import ResourceDriverInterface -from cloudshell.shell.core.driver_context import InitCommandContext, ResourceCommandContext, AutoLoadResource, \ - AutoLoadAttribute, AutoLoadDetails, CancellationContext -from cloudshell.shell.core.session.cloudshell_session import CloudShellSessionContext -import mock -from data_model import * -# run 'shellfoundry generate' to generate data model classes -import subprocess -import sys -import os -import importlib -import paramiko - -# command = "./lanforge-scripts/py-scripts/update_dependencies.py" -# print("running:[{}]".format(command)) -# process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) -# outs, errs = process.communicate() -# print(outs) -# print(errs) - -# if 'lanforge-scripts' not in sys.path: -# sys.path.append('./lanforge-scripts') - -# create_wanlink = importlib.import_module("lanforge-scripts.py-json.create_wanlink") -# create_l3 = importlib.import_module("lanforge-scripts.py-scripts.create_l3") -# CreateL3 = create_l3.CreateL3 -class LanforgeResourceDriver (ResourceDriverInterface): - - def __init__(self): - """ - ctor must be without arguments, it is created with reflection at run time - """ - pass - - def initialize(self, context): - """ - Initialize the driver session, this function is called everytime a new instance of the driver is created - This is a good place to load and cache the driver configuration, initiate sessions etc. - :param InitCommandContext context: the context the command runs on - """ - pass - - def cleanup(self): - """ - Destroy the driver session, this function is called everytime a driver instance is destroyed - This is a good place to close any open sessions, finish writing to log files - """ - pass - - def get_inventory(self, context): - """ - Discovers the resource structure and attributes. - :param AutoLoadCommandContext context: the context the command runs on - :return Attribute and sub-resource information for the Shell resource you can return an AutoLoadDetails object - :rtype: AutoLoadDetails - """ - # See below some example code demonstrating how to return the resource structure and attributes - # In real life, this code will be preceded by SNMP/other calls to the resource details and will not be static - # run 'shellfoundry generate' in order to create classes that represent your data model - - ''' - resource = LanforgeResource.create_from_context(context) - resource.vendor = 'specify the shell vendor' - resource.model = 'specify the shell model' - - port1 = ResourcePort('Port 1') - port1.ipv4_address = '192.168.10.7' - resource.add_sub_resource('1', port1) - - return resource.create_autoload_details() - ''' - return AutoLoadDetails([], []) - - def orchestration_save(self, context, cancellation_context, mode, custom_params): - """ - Saves the Shell state and returns a description of the saved artifacts and information - This command is intended for API use only by sandbox orchestration scripts to implement - a save and restore workflow - :param ResourceCommandContext context: the context object containing resource and reservation info - :param CancellationContext cancellation_context: Object to signal a request for cancellation. Must be enabled in drivermetadata.xml as well - :param str mode: Snapshot save mode, can be one of two values 'shallow' (default) or 'deep' - :param str custom_params: Set of custom parameters for the save operation - :return: SavedResults serialized as JSON - :rtype: OrchestrationSaveResult - """ - - # See below an example implementation, here we use jsonpickle for serialization, - # to use this sample, you'll need to add jsonpickle to your requirements.txt file - # The JSON schema is defined at: - # https://github.com/QualiSystems/sandbox_orchestration_standard/blob/master/save%20%26%20restore/saved_artifact_info.schema.json - # You can find more information and examples examples in the spec document at - # https://github.com/QualiSystems/sandbox_orchestration_standard/blob/master/save%20%26%20restore/save%20%26%20restore%20standard.md - ''' - # By convention, all dates should be UTC - created_date = datetime.datetime.utcnow() - - # This can be any unique identifier which can later be used to retrieve the artifact - # such as filepath etc. - - # By convention, all dates should be UTC - created_date = datetime.datetime.utcnow() - - # This can be any unique identifier which can later be used to retrieve the artifact - # such as filepath etc. - identifier = created_date.strftime('%y_%m_%d %H_%M_%S_%f') - - orchestration_saved_artifact = OrchestrationSavedArtifact('REPLACE_WITH_ARTIFACT_TYPE', identifier) - - saved_artifacts_info = OrchestrationSavedArtifactInfo( - resource_name="some_resource", - created_date=created_date, - restore_rules=OrchestrationRestoreRules(requires_same_resource=True), - saved_artifact=orchestration_saved_artifact) - - return OrchestrationSaveResult(saved_artifacts_info) - ''' - pass - - def orchestration_restore(self, context, cancellation_context, saved_artifact_info, custom_params): - """ - Restores a saved artifact previously saved by this Shell driver using the orchestration_save function - :param ResourceCommandContext context: The context object for the command with resource and reservation info - :param CancellationContext cancellation_context: Object to signal a request for cancellation. Must be enabled in drivermetadata.xml as well - :param str saved_artifact_info: A JSON string representing the state to restore including saved artifacts and info - :param str custom_params: Set of custom parameters for the restore operation - :return: None - """ - ''' - # The saved_details JSON will be defined according to the JSON Schema and is the same object returned via the - # orchestration save function. - # Example input: - # { - # "saved_artifact": { - # "artifact_type": "REPLACE_WITH_ARTIFACT_TYPE", - # "identifier": "16_08_09 11_21_35_657000" - # }, - # "resource_name": "some_resource", - # "restore_rules": { - # "requires_same_resource": true - # }, - # "created_date": "2016-08-09T11:21:35.657000" - # } - - # The example code below just parses and prints the saved artifact identifier - saved_details_object = json.loads(saved_details) - return saved_details_object[u'saved_artifact'][u'identifier'] - ''' - pass - - def create_wanlink(self, context, name, latency, rate): - resource = LanforgeResource.create_from_context(context) - terminal_ip = context.resource.address - terminal_user = context.resource.attributes["{}User".format(shell_name)] = "lanforge" - terminal_pass = context.resource.attributes["{}Password".format(shell_name)] = "lanforge" - - print("Initializing SSH connection to {ip}, with user {user} and password {password}".format(ip=terminal_ip, user=terminal_user, password=terminal_pass)) - s = paramiko.SSHClient() - s.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - s.connect(hostname=terminal_ip, username=terminal_user, password=terminal_pass) - - command = "/home/lanforge/lanforge-scripts/py-json/create_wanlink.py --host {host} --port_A {port_A} --port_B {port_B} --name \"{name}\" --latency \"{latency}\" --latency_A \"{latency_A}\" --latency_B \"{latency_B}\" --rate {rate} --rate_A {rate_A} --rate_B {rate_B} --jitter {jitter} --jitter_A {jitter_A} --jitter_B {jitter_B} --jitter_freq_A {jitter_freq_A} --jitter_freq_B {jitter_freq_B} --drop_A {drop_A} --drop_B {drop_B}".format( - host="localhost", - port_A="eth1", - port_B="eth2", - name=name, - latency=latency, - latency_A=latency, - latency_B=latency, - rate=rate, - rate_A=rate, - rate_B=rate, - jitter="0", - jitter_A="0", - jitter_B="0", - jitter_freq_A="0", - jitter_freq_B="0", - drop_A="0", - drop_B="0" - ) - - (stdin, stdout, stderr) = s.exec_command(command) - output = '' - errors = '' - for line in stdout.readlines(): - output += line - for line in stderr.readlines(): - errors += line - print(errors) - # if errors != '': - print(errors) - # else: - print(output) - s.close() - - # print(args) - # command = "./lanforge-scripts/py-json/create_wanlink.py --host \"{host}\" --name my_wanlink4 --latency \"{latency}\" --rate \"{rate}\"".format( - # host = context.resource.address, - # name=args['name'], - # latency=args['latency'], - # rate=args['rate'] - # ) - # print("running:[{}]".format(command)) - # process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) - # outs, errs = process.communicate() - # print(outs) - # print(errs) - - def example_command(self, context): - """ - this is my example command - :param ResourceCommandContext context - :return: str - """ - resource = LanforgeResource.create_from_context(context) - msg = "My resource: " + resource.name - msg += ", at address: " + context.resource.address - return msg - - def create_l3(self, context, name, min_rate_a, min_rate_b, endp_a, endp_b): - # api_session = CloudShellSessionContext(context) - resource = LanforgeResource.create_from_context(context) - args = { - "host": context.resource.address, - "name_prefix": name, - "min_rate_a": min_rate_a, - "min_rate_b": min_rate_b, - "endp_a": endp_a, - "endp_b": endp_b - } - # ip_var_test = CreateL3( - # host=context.resource.address, - # name_prefix=name, - # endp_a=[endp_a], - # endp_b=endp_b, - # min_rate_a=min_rate_a, - # min_rate_b=min_rate_b - # ) - - print(args) - terminal_ip = context.resource.address - terminal_user = context.resource.attributes["{}.User".format(shell_name)] = "lanforge" - terminal_pass = context.resource.attributes["{}.Password".format(shell_name)] = "lanforge" - - print("Initializing SSH connection to {ip}, with user {user} and password {password}".format(ip=terminal_ip, user=terminal_user, password=terminal_pass)) - s = paramiko.SSHClient() - s.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - s.connect(hostname=terminal_ip, username=terminal_user, password=terminal_pass) - - command = "/home/lanforge/lanforge-scripts/py-scripts/create_l3.py --endp_a \"{endp_a}\" --endp_b \"{endp_b}\" --min_rate_a \"{min_rate_a}\" --min_rate_b \"{min_rate_b}\"".format( - endp_a=args['endp_a'], - endp_b=args['endp_b'], - min_rate_a=args['min_rate_a'], - min_rate_b=args['min_rate_b'] - ) - - (stdin, stdout, stderr) = s.exec_command(command) - output = '' - errors = '' - for line in stdout.readlines(): - output += line - for line in stderr.readlines(): - errors += line - print(errors) - if errors != '': - print(errors) - else: - print(output) - s.close() - - # print("running:[{}]".format(command)) - # process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) - # outs, errs = process.communicate() - # print(outs) - # print(errs) - - # num_sta = 2 - # ip_var_test.pre_cleanup() - # ip_var_test.build() - # if not ip_var_test.passes(): - # print(ip_var_test.get_fail_message()) - # ip_var_test.exit_fail() - # print('Created %s stations and connections' % num_sta) - -if __name__ == "__main__": - # setup for mock-debug environment - shell_name = "LanforgeResource" - cancellation_context = mock.create_autospec(CancellationContext) - context = mock.create_autospec(ResourceCommandContext) - context.resource = mock.MagicMock() - context.reservation = mock.MagicMock() - context.connectivity = mock.MagicMock() - context.reservation.reservation_id = "" - context.resource.address = "192.168.100.176" - context.resource.name = "Lanforge_Resource" - context.resource.attributes = dict() - context.resource.attributes["{}.User".format(shell_name)] = "lanforge" - context.resource.attributes["{}.Password".format(shell_name)] = "lanforge" - context.resource.attributes["{}.SNMP Read Community".format(shell_name)] = "" - - # add information for api connectivity - context.reservation.domain = "Global" - context.connectivity.server_address = "192.168.100.131" - driver = LanforgeResourceDriver() - # print driver.run_custom_command(context, custom_command="sh run", cancellation_context=cancellation_context) - # result = driver.example_command_with_api(context) - - driver.create_l3(context, "my_fire", "69000", "41000", "eth1", "eth2") - driver.create_wanlink(context, name="my_wanlin", latency="49", rate="6000") - print("done") diff --git a/quali/lanforge-resource/src/drivermetadata.xml b/quali/lanforge-resource/src/drivermetadata.xml deleted file mode 100644 index 59cbeb1c..00000000 --- a/quali/lanforge-resource/src/drivermetadata.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/quali/lanforge-resource/src/importlib b/quali/lanforge-resource/src/importlib deleted file mode 100644 index e69de29b..00000000 diff --git a/quali/lanforge-resource/src/requirements.txt b/quali/lanforge-resource/src/requirements.txt deleted file mode 100644 index 8c1ba7fe..00000000 --- a/quali/lanforge-resource/src/requirements.txt +++ /dev/null @@ -1,25 +0,0 @@ -mock -cloudshell-shell-core>=5.0.3,<6.0.0 -cloudshell-automation-api -pandas -plotly -numpy==1.16.6 -cryptography -paramiko -bokeh -streamlit==0.62.0 -cython -pyarrow==4.0.0 -websocket-client -xlsxwriter -pyshark -influxdb -influxdb-client -matplotlib -pdfkit -pip-search -pyserial -pexpect-serial -scp -dash -kaleido diff --git a/quali/lanforge-resource/src/sys b/quali/lanforge-resource/src/sys deleted file mode 100644 index e69de29b..00000000 diff --git a/quali/lanforge-resource/test_requirements.txt b/quali/lanforge-resource/test_requirements.txt deleted file mode 100644 index 7d963ba7..00000000 --- a/quali/lanforge-resource/test_requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -nose -coverage -unittest2 -mock -teamcity-messages -jsonpickle -nose-exclude \ No newline at end of file diff --git a/quali/lanforge-resource/tests/__init__.py b/quali/lanforge-resource/tests/__init__.py deleted file mode 100644 index 40a96afc..00000000 --- a/quali/lanforge-resource/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/quali/lanforge-resource/tests/test_lanforge-resource.py b/quali/lanforge-resource/tests/test_lanforge-resource.py deleted file mode 100644 index de11d725..00000000 --- a/quali/lanforge-resource/tests/test_lanforge-resource.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -Tests for `LanforgeResourceDriver` -""" - -import unittest - -from driver import LanforgeResourceDriver - - -class TestLanforgeResourceDriver(unittest.TestCase): - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_000_something(self): - pass - - -if __name__ == '__main__': - import sys - sys.exit(unittest.main()) From 8e05632b8a064f19e3b53b7c02e27844778aef56 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 11:52:38 -0600 Subject: [PATCH 088/731] cicd json clean up for unused parameters and naming Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_004_AX88U_dut.json | 1 + py-scripts/tools/ct_us_001_rig.json | 16 +- py-scripts/tools/ct_us_001_tests.json | 99 +++--- py-scripts/tools/ct_us_002_rig.json | 27 +- py-scripts/tools/ct_us_002_tests.json | 57 ++-- py-scripts/tools/ct_us_003_rig.json | 24 +- py-scripts/tools/ct_us_003_tests.json | 91 +++--- py-scripts/tools/ct_us_004_rig.json | 31 +- py-scripts/tools/ct_us_004_tests.json | 411 +++++++++---------------- py-scripts/tools/lf_check.py | 61 +--- 10 files changed, 281 insertions(+), 537 deletions(-) diff --git a/py-scripts/tools/ct_004_AX88U_dut.json b/py-scripts/tools/ct_004_AX88U_dut.json index 82f82a5d..6b829d1e 100644 --- a/py-scripts/tools/ct_004_AX88U_dut.json +++ b/py-scripts/tools/ct_004_AX88U_dut.json @@ -9,6 +9,7 @@ "test_dut":{ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "DUT_NAME": "ASUSRT-AX88U", + "DUT_SW": "3.0.0.4.386_44266", "wireless_network_dict":{ "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID":"d4:5d:64:a0:7f:78","SECURITY_USED":"wpa2"}, "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID":"d4:5d:64:a0:7f:7c","SECURITY_USED":"wpa2"} diff --git a/py-scripts/tools/ct_us_001_rig.json b/py-scripts/tools/ct_us_001_rig.json index bab64d27..37f9ced7 100644 --- a/py-scripts/tools/ct_us_001_rig.json +++ b/py-scripts/tools/ct_us_001_rig.json @@ -1,18 +1,13 @@ { "ct_us_001":{ "Notes":[ - "The json is used to orchastrate the tests to be run on testbed ct_us_001", - "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code." + "This json file describes LANforge system and test run configuration" ] }, "test_rig_parameters":{ "TEST_BED": "CT-US-001", "TEST_RIG": "CT-US-001", - "DATABASE_SQLITE": "qa_001_test_db", + "DATABASE_SQLITE": "./tools/qa_001_Oct.db", "LF_MGR_IP": "192.168.100.116", "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", @@ -24,15 +19,8 @@ "LOAD_CUSTOM_DB": false, "CUSTOM_DB": "DFLT_ETH1_GEN", "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", - "HOST_IP_PRODUCTION": "192.168.95.6", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", - "HOST_IP_TEST": "192.168.95.6", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-001", "EMAIL_TXT": "Lanforge QA Testing CT-US-001 " - }, - "test_network":{ - "HTTP_TEST_IP": "192.168.50.1", - "FTP_TEST_IP": "192.168.50.1", - "TEST_IP": "192.168.50.1" } } \ No newline at end of file diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index e3d1c262..c48c049f 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -1,17 +1,12 @@ { "ct_tests_001":{ "Notes":[ - "The json is used to orchastrate the tests to be run on testbed ct_us_001", - "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code." + "This json file describes tests to be run by LANforge system" ] }, "test_suites":{ "suite_hc":{ - "CT-US-001_lf_help_check":{ + "lf_help_check":{ "enabled":"TRUE", "load_db":"skip", "command":"lf_help_check.bash", @@ -49,7 +44,7 @@ } }, "suite_wc_dp_shorter":{ - "CT-US-001_create_chamberview_dut_0":{ + "create_chamberview_dut_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -61,19 +56,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-001_create_chamberview_mt7915e_sta19":{ + "create_chamberview_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-001-scenario ", + " --create_scenario mt7915e_wc", " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-001_wifi_capacity_mt7915e":{ + "wifi_capacity_mt7915e":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -88,7 +83,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-001_create_chamberview_dut_for_mt7915e_dp":{ + "create_chamberview_dut_mt7915e_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -100,19 +95,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-001_create_chamberview_mt7915e_sta1":{ + "create_chamberview_mt7915e_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-001-mt7915e-scenario ", + " --create_scenario mt7915e_dp", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-001_dataplane_mt7915e_sta1":{ + "dataplane_mt7915e":{ "enabled":"TRUE", "load_db":"skip", "iterations":"1", @@ -129,7 +124,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-001_QA":{ + "lf_qa":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", @@ -141,7 +136,7 @@ } }, "suite_wc_dp":{ - "CT-US-001_lf_help_check":{ + "lf_help_check":{ "enabled":"TRUE", "load_db":"skip", "command":"lf_help_check.bash", @@ -150,7 +145,7 @@ " " ] }, - "CT-US-001_create_chamberview_dut_for_ATH10K":{ + "create_chamberview_dut_ATH10K(9984)_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -162,7 +157,7 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-001_create_chamberview_ATH10K(9984)_sta50":{ + "create_chamberview_ATH10K(9984)_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", @@ -174,7 +169,7 @@ " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-001_wifi_capacity_ATH10K(9984)":{ + "wifi_capacity_ATH10K(9984)":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -189,7 +184,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-001_create_chamberview_dut_ATH10K":{ + "create_chamberview_dut_ATH10K(9984)_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -201,19 +196,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-001_create_chamberview_ATH10K(9984)_sta1":{ + "create_chamberview_ATH10K(9984)_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-001-ATH10K-scenario ", + " --create_scenario ATH10K(9984)_dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-001_dataplane_ATH10K(9984)_sta1":{ + "dataplane_ATH10K(9984)":{ "enabled":"TRUE", "load_db":"skip", "timeout":"600", @@ -231,7 +226,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-001_create_chamberview_dut_for_AX210":{ + "create_chamberview_dut_AX210_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -243,7 +238,7 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-001_create_chamberview_wiphy3_AX210_sta1":{ + "create_chamberview_AX210_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", @@ -255,10 +250,11 @@ " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\" " ] }, - "CT-US-001_wifi_capacity_wiphy3_AX210_sta1":{ + "wifi_capacity_AX210":{ "enabled":"TRUE", - "load_db":"skip", + "timeout":"600", "iterations":"1", + "load_db":"skip", "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ @@ -269,7 +265,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-001_create_chamberview_dut_for_AX210_dp":{ + "create_chamberview_dut_AX210_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -281,19 +277,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-001_create_chamberview_wiphy3_AX210_sta1_dp":{ + "create_chamberview_AX210_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-001-AX210-scenario ", + " --create_scenario AX210_dp", " --raw_line \"profile_link 1.1 STA-AX 1 'DUT: DUT_NAME Radio-2' NA wiphy3,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\" " ] }, - "CT-US-001_dataplane_wiphy3_AX210_sta1":{ + "dataplane_AX210":{ "enabled":"TRUE", "load_db":"skip", "iterations":"1", @@ -310,7 +306,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-001_create_chamberview_dut_for_mt7915e":{ + "create_chamberview_dut_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -322,7 +318,7 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-001_create_chamberview_mt7915e_sta19":{ + "create_chamberview_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", @@ -334,7 +330,7 @@ " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-001_wifi_capacity_mt7915e":{ + "wifi_capacity_mt7915e":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -349,7 +345,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-001_create_chamberview_dut_for_mt7915e_dp":{ + "create_chamberview_dut_mt7915e_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -361,19 +357,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-001_create_chamberview_mt7915e_sta1":{ + "create_chamberview_mt7915e_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-001-mt7915e-scenario ", + " --create_scenario mt7915e_dp", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-001_dataplane_mt7915e_sta1":{ + "dataplane_mt7915e":{ "enabled":"TRUE", "load_db":"skip", "iterations":"1", @@ -390,7 +386,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-001_create_chamberview_dut_2":{ + "create_chamberview_dut_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -401,7 +397,7 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-001_create_chamberview_ap":{ + "create_chamberview_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", @@ -414,7 +410,7 @@ " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " ] }, - "CT-US-001_lf_ap_auto_test": { + "ap_auto": { "enabled": "TRUE", "command": "lf_ap_auto_test.py", "timeout":"25200", @@ -440,7 +436,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-001_QA":{ + "lf_qa":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", @@ -452,7 +448,7 @@ } }, "suite_ap":{ - "CT-US-001_create_chamberview_dut_2":{ + "create_chamberview_dut_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -463,20 +459,20 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-001_create_chamberview_ap":{ + "create_chamberview_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ap-script ", + " --create_scenario ap-script", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " ] }, - "CT-US-001_lf_ap_auto_test": { + "ap_auto": { "enabled": "TRUE", "command": "lf_ap_auto_test.py", "timeout":"25200", @@ -502,7 +498,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-001_QA":{ + "lf_qa":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", @@ -513,10 +509,5 @@ ] } } - } -} - - - - \ No newline at end of file +} \ No newline at end of file diff --git a/py-scripts/tools/ct_us_002_rig.json b/py-scripts/tools/ct_us_002_rig.json index 707330f8..56586dcb 100644 --- a/py-scripts/tools/ct_us_002_rig.json +++ b/py-scripts/tools/ct_us_002_rig.json @@ -1,50 +1,27 @@ { "ct_us_002":{ "Notes":[ - "The json is used to orchastrate the tests to be run on testbed ct_us_002", - "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code." + "This json file describes LANforge system and test run configuration" ] }, "test_rig_parameters":{ "TEST_BED": "CT-US-002", "TEST_RIG": "CT-US-002", - "DATABASE_SQLITE": "qa_002_test_db", + "DATABASE_SQLITE": "./tools/qa_002_Oct.db", "LF_MGR_IP": "192.168.100.200", "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", "UPSTREAM_PORT": "1.1.eth2", - "DUT_SET_NAME": "DUT_NAME NETGEAR59-5G", "TEST_TIMEOUT": 600, "LOAD_BLANK_DB": false, "LOAD_FACTORY_DEFAULT_DB": true, "LOAD_CUSTOM_DB": false, "CUSTOM_DB": "DFLT_ETH1_GEN", "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", - "HOST_IP_PRODUCTION": "192.168.100.153", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", - "HOST_IP_TEST": "192.168.100.153", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-002", "EMAIL_TXT": "Lanforge QA Testing CT-US-002" - }, - "test_network":{ - "HTTP_TEST_IP": "10.40.0.10", - "FTP_TEST_IP": "10.40.0.10", - "TEST_IP": "192.168.0.104" - }, - "radio_dict":{ - "1.1.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"ath10k(9984)","CAPABILITIES":"802.11an-AC","MAX_STA":"128","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy1":{"KEY":"1.1.wiphy1","RADIO":"1.1.wiphy1","DRIVER":"ath10k(9984)","CAPABILITIES":"802.11an-AC","MAX_STA":"128","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy2":{"KEY":"1.1.wiphy2","RADIO":"1.1.wiphy2","DRIVER":"ath10k(9984)","CAPABILITIES":"802.11an-AC","MAX_STA":"128","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy3":{"KEY":"1.1.wiphy3","RADIO":"1.1.wiphy3","DRIVER":"ath10k(9984)","CAPABILITIES":"802.11an-AC","MAX_STA":"128","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy4":{"KEY":"1.1.wiphy4","RADIO":"1.1.wiphy4","DRIVER":"iwlwifi(AX200)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.1.wiphy5":{"KEY":"1.1.wiphy5","RADIO":"1.1.wiphy5","DRIVER":"iwlwifi(AX200)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.1.wiphy6":{"KEY":"1.1.wiphy6","RADIO":"1.1.wiphy6","DRIVER":"iwlwifi(AX200)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.1.wiphy7":{"KEY":"1.1.wiphy7","RADIO":"1.1.wiphy7","DRIVER":"iwlwifi(AX200)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"} } } diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 600d5111..62f362e5 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -1,4 +1,9 @@ { + "ct_tests_002":{ + "Notes":[ + "This json file describes tests to be run by LANforge system" + ] + }, "test_suites":{ "suite_l3":{ "test_l3_longevity":{ @@ -12,7 +17,7 @@ " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000" ] }, - "CT-US-002_QA":{ + "lf_qa":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", @@ -28,7 +33,7 @@ "test_l3_longevity":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"--test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT --radio 'radio==wiphy1,stations==4,ssid==ct523c-vap,ssid_pw==ct523c-vap,security==wpa2' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"} }, "auto_suite":{ - "CT-US-002_create_chamberview_dut_1":{ + "create_chamberview_dut_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -39,7 +44,7 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-002_create_chamberview_1":{ + "create_chamberview_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", @@ -52,7 +57,7 @@ " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, - "CT-US-002_lf_ap_auto_test": { + "ap_auto": { "enabled": "TRUE", "command": "lf_ap_auto_test.py", "timeout":"6000", @@ -69,7 +74,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-002_QA":{ + "lf_qa":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", @@ -81,7 +86,7 @@ } }, "suite_wc_dp":{ - "CT-US-002_create_chamberview_dut_1":{ + "create_chamberview_dut_ATH10k(9984)":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -92,20 +97,20 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-002_create_chamberview_ATH10k_sta64":{ + "create_chamberview_ATH10k(9984)":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ucentral-scenario ", + " --create_scenario ATH10K(9984)_wc", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, - "CT-US-002_wifi_capacity_ATH10k(9984)":{ + "wifi_capacity_ATH10k(9984)":{ "enabled":"TRUE", "load_db":"skip", "command":"lf_wifi_capacity_test.py", @@ -118,7 +123,7 @@ " --set DUT_SET_NAME " ] }, - "CT-US-002_create_chamberview_dut_ATH10K_wan1":{ + "create_chamberview_dut_ATH10K(9984)_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -129,19 +134,19 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-002_create_chamberview_ATH10k_wan1":{ + "create_chamberview_ATH10k(9984)_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ucentral-scenario ", + " --create_scenario ATH10k(9984)_dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, - "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{ + "dataplane_ATH10k(9984)":{ "enabled":"TRUE", "load_db":"skip", "command":"lf_dataplane_test.py", @@ -156,7 +161,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-002_create_chamberview_dut_2":{ + "create_chamberview_dut_AX200_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -167,20 +172,20 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-002_create_chamberview_AX200_sta1":{ + "create_chamberview_AX200_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ucentral-scenario ", + " --create_scenario AX200_wc", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, - "CT-US-002_wifi_capacity_AX200 CT-US-002":{ + "wifi_capacity_AX200":{ "enabled":"TRUE", "load_db":"skip", "command":"lf_wifi_capacity_test.py", @@ -192,7 +197,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-002_create_chamberview_dut_AX200_wan1":{ + "create_chamberview_dut_AX200_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -203,19 +208,19 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-002_create_chamberview_AX200_wan1":{ + "create_chamberview_AX200_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ucentral-scenario ", + " --create_scenario AX200_dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy4,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, - "CT-US-002_dataplane_AX200":{ + "dataplane_AX200":{ "enabled":"TRUE", "load_db":"skip", "command":"lf_dataplane_test.py", @@ -230,7 +235,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-002_create_chamberview_dut_auto":{ + "create_chamberview_dut_ap":{ "enabled":"", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -241,20 +246,20 @@ " --ssid 'ssid_idx=1 ssid=NETGEAR59-5G security=WPA2 password=crispynest798 bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-002_create_chamberview_auto":{ + "create_chamberview_ap":{ "enabled":"FALSE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ucentral-scenario ", + " --create_scenario ap_auto", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, - "CT-US-002_lf_ap_auto_test": { + "ap_auto": { "enabled": "TRUE", "command": "lf_ap_auto_test.py", "timeout": "25200", @@ -279,7 +284,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-002_QA":{ + "lf_qa":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", diff --git a/py-scripts/tools/ct_us_003_rig.json b/py-scripts/tools/ct_us_003_rig.json index 10e5fabd..37ef1d5e 100644 --- a/py-scripts/tools/ct_us_003_rig.json +++ b/py-scripts/tools/ct_us_003_rig.json @@ -1,18 +1,13 @@ { "ct_us_003":{ "Notes":[ - "The json is used to orchastrate the tests to be run on testbed ct_us_003", - "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code." + "This json file describes LANforge system and test run configuration" ] }, "test_rig_parameters":{ "TEST_BED": "CT-US-003", "TEST_RIG": "CT-US-003", - "DATABASE_SQLITE": "qa_003_test_db", + "DATABASE_SQLITE": "./tools/qa_003_Oct.db", "LF_MGR_IP": "192.168.100.233", "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", @@ -24,24 +19,9 @@ "LOAD_CUSTOM_DB": false, "CUSTOM_DB": "DFLT_ETH1_GEN", "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", - "HOST_IP_PRODUCTION": "192.168.95.6", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", - "HOST_IP_TEST": "192.168.95.6", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-003", "EMAIL_TXT": "Lanforge QA Testing CT-US-003" - }, - "test_network":{ - "HTTP_TEST_IP": "192.168.50.1", - "FTP_TEST_IP": "192.168.50.1", - "TEST_IP": "192.168.50.1" - }, - "radio_dict":{ - "1.1.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.1.wiphy1":{"KEY":"1.1.wiphy1","RADIO":"1.1.wiphy1","DRIVER":"mt7915e()","CAPABILITIES":"802.11abgn-AX","MAX_STA":"19","MAX_VAP":"16","MAX_VIFS":"19"}, - "1.2.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.2.wiphy1":{"KEY":"1.1.wiphy1","RADIO":"1.1.wiphy1","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.3.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.3.wiphy1":{"KEY":"1.1.wiphy1","RADIO":"1.1.wiphy1","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"} } } diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index 94a2315f..20c6521d 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -1,12 +1,7 @@ { "ct_tests_003":{ "Notes":[ - "The json is used to orchastrate the tests to be run on testbed ct_us_003", - "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code." + "This json file describes tests to be run by LANforge system" ] }, "test_suites": { @@ -49,7 +44,7 @@ } }, "suite_wc_dp_shorter":{ - "ct-us-003_create_chamberview_dut_0":{ + "create_chamberview_dut_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -61,19 +56,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "ct-us-003_create_chamberview_mt7915e_sta19":{ + "create_chamberview_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-003-scenario ", + " --create_scenario mt7915e_wc ", " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "ct-us-003_wifi_capacity_mt7915e":{ + "wifi_capacity_mt7915e":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -88,7 +83,7 @@ " --set DUT_SET_NAME" ] }, - "ct-us-003_create_chamberview_dut_for_mt7915e_dp":{ + "create_chamberview_dut_for_mt7915e_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -100,7 +95,7 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "ct-us-003_create_chamberview_mt7915e_sta1":{ + "create_chamberview_mt7915e_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", @@ -112,7 +107,7 @@ " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "ct-us-003_dataplane_mt7915e_sta1":{ + "dataplane_mt7915e":{ "enabled":"TRUE", "load_db":"skip", "iterations":"1", @@ -140,8 +135,8 @@ ] } }, - "suite_wc_dp":{ - "CT-US-003_create_chamberview_dut_for_ATH10K":{ + "suite_wc_dp_ap":{ + "create_chamberview_dut_ATH10K(9984)_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -153,19 +148,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-003_create_chamberview_ATH10K(9984)_sta50":{ + "create_chamberview_ATH10K(9984)_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-003-scenario ", + " --create_scenario ATH10K(9984)_wc ", " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-003_wifi_capacity_ATH10K(9984)":{ + "wifi_capacity_ATH10K(9984)":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -180,7 +175,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-003_create_chamberview_dut_ATH10K":{ + "create_chamberview_dut_ATH10K(9984)_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -192,19 +187,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-003_create_chamberview_ATH10K(9984)_sta1":{ + "create_chamberview_ATH10K(9984)_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-003-ATH10K-scenario ", + " --create_scenario ATH10K(9984)_dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-003_dataplane_ATH10K(9984)_sta1":{ + "dataplane_ATH10K(9984)":{ "enabled":"TRUE", "load_db":"skip", "timeout":"600", @@ -222,7 +217,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-003_create_chamberview_dut_for_AX210":{ + "create_chamberview_dut_AX210_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -234,19 +229,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-003_create_chamberview_wiphy3_AX210_sta1":{ + "create_chamberview_AX210_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-003-AX210-scenario ", + " --create_scenario AX210_wc", " --raw_line \"profile_link 1.1 STA-AX 1 'DUT: DUT_NAME Radio-2' NA wiphy3,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\" " ] }, - "CT-US-003_wifi_capacity_wiphy3_AX210_sta1":{ + "wifi_capacity_wiphy3_AX210":{ "enabled":"TRUE", "load_db":"skip", "iterations":"1", @@ -260,7 +255,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-003_create_chamberview_dut_for_AX210_dp":{ + "create_chamberview_dut_AX210_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -272,19 +267,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-003_create_chamberview_wiphy3_AX210_sta1_dp":{ + "create_chamberview_AX210_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-003-AX210-scenario ", + " --create_scenario AX210_dp ", " --raw_line \"profile_link 1.1 STA-AX 1 'DUT: DUT_NAME Radio-2' NA wiphy3,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\" " ] }, - "CT-US-003_dataplane_wiphy3_AX210_sta1":{ + "dataplane_AX210":{ "enabled":"TRUE", "load_db":"skip", "iterations":"1", @@ -301,7 +296,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-003_create_chamberview_dut_for_mt7915e":{ + "create_chamberview_dut_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -313,19 +308,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-003_create_chamberview_mt7915e_sta19":{ + "create_chamberview_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-003-mt7915e-scenario ", + " --create_scenario mt7915e_wc", " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-003_wifi_capacity_mt7915e":{ + "wifi_capacity_mt7915e":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -340,7 +335,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-003_create_chamberview_dut_for_mt7915e_dp":{ + "create_chamberview_dut_mt7915e_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -352,19 +347,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-003_create_chamberview_mt7915e_sta1":{ + "create_chamberview_mt7915e_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-003-mt7915e-scenario ", + " --create_scenario mt7915e_dp", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-003_dataplane_mt7915e_sta1":{ + "dataplane_mt7915e":{ "enabled":"TRUE", "load_db":"skip", "iterations":"1", @@ -381,7 +376,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-003_create_chamberview_dut_2":{ + "create_chamberview_dut_ap":{ "enabled":"FALSE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -392,7 +387,7 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-003_create_chamberview_ap":{ + "create_chamberview_ap":{ "enabled":"FALSE", "load_db":"skip", "command":"create_chamberview.py", @@ -405,7 +400,7 @@ " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " ] }, - "CT-US-003_lf_ap_auto_test": { + "ap_auto": { "enabled": "FALSE", "command": "lf_ap_auto_test.py", "timeout":"25200", @@ -431,7 +426,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-003_QA":{ + "lf_qa":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", @@ -443,7 +438,7 @@ } }, "suite_ap":{ - "CT-US-003_create_chamberview_dut_2":{ + "create_chamberview_dut_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -454,20 +449,20 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-003_create_chamberview_ap":{ + "create_chamberview_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ap-script ", + " --create_scenario ap-script", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " ] }, - "CT-US-003_lf_ap_auto_test": { + "ap_auto": { "enabled": "TRUE", "command": "lf_ap_auto_test.py", "timeout":"25200", @@ -493,7 +488,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-003_QA":{ + "lf_qa":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", @@ -511,4 +506,4 @@ - \ No newline at end of file + diff --git a/py-scripts/tools/ct_us_004_rig.json b/py-scripts/tools/ct_us_004_rig.json index 488e396c..e91d3eff 100644 --- a/py-scripts/tools/ct_us_004_rig.json +++ b/py-scripts/tools/ct_us_004_rig.json @@ -1,54 +1,27 @@ { "ct_us_004":{ "Notes":[ - "The json is used to orchastrate the tests to be run on testbed ct_us_004", - "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code." + "This json file describes LANforge system and test run configuration" ] }, "test_rig_parameters":{ "TEST_BED": "CT-US-004", "TEST_RIG": "CT-US-004", - "DATABASE_SQLITE": "qa_004_test_db", + "DATABASE_SQLITE": "./tools/qa_004_Oct.db", "LF_MGR_IP": "192.168.100.194", "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", "UPSTREAM_PORT": "1.1.eth2", - "DUT_SET_NAME": "DUT_NAME Asus-RT-AX88U", - "DUT_NAME": "Asus-RT-AX88U", - "DUT_BSSID_2G": "d4:5d:64:a0:7f:78", - "DUT_BSSID_5G": "d4:5d:64:a0:7f:7c", - "DUT_SW": "3.0.0.4.386_44266", "TEST_TIMEOUT": 300, "LOAD_BLANK_DB": false, "LOAD_FACTORY_DEFAULT_DB": true, "LOAD_CUSTOM_DB": false, "CUSTOM_DB": "DFLT_ETH1_GEN", "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", - "HOST_IP_PRODUCTION": "192.168.100.201", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", - "HOST_IP_TEST": "192.168.100.201", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-004", "EMAIL_TXT": "Lanforge QA Testing CT-US-004 " - }, - "test_network":{ - "HTTP_TEST_IP": "10.40.0.10", - "FTP_TEST_IP": "10.40.0.10", - "TEST_IP": "192.168.0.104" - }, - "radio_dict":{ - "1.1.wiphy0":{"KEY":"1.1.wiphy0","RADIO":"1.1.wiphy0","DRIVER":"ath10k(9984)","CAPABILITIES":"802.11bgn-AC","MAX_STA":"128","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy1":{"KEY":"1.1.wiphy1","RADIO":"1.1.wiphy1","DRIVER":"ath10k(9984)","CAPABILITIES":"802.11an-AC","MAX_STA":"128","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy2":{"KEY":"1.1.wiphy2","RADIO":"1.1.wiphy2","DRIVER":"ath9k()","CAPABILITIES":"802.11abgn","MAX_STA":"2048","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy3":{"KEY":"1.1.wiphy3","RADIO":"1.1.wiphy3","DRIVER":"ath10k(998x)","CAPABILITIES":"802.11abgn-AC","MAX_STA":"127","MAX_VAP":"24","MAX_VIFS":"64"}, - "1.1.wiphy4":{"KEY":"1.1.wiphy4","RADIO":"1.1.wiphy4","DRIVER":"iwlwifi(AX200)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.1.wiphy5":{"KEY":"1.1.wiphy5","RADIO":"1.1.wiphy5","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.1.wiphy6":{"KEY":"1.1.wiphy6","RADIO":"1.1.wiphy6","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, - "1.1.wiphy7":{"KEY":"1.1.wiphy7","RADIO":"1.1.wiphy7","DRIVER":"mt7915e()","CAPABILITIES":"802.11abgn-AX","MAX_STA":"19","MAX_VAP":"16","MAX_VIFS":"19"} } } diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index f5a2bd69..af7ed350 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -1,15 +1,21 @@ { "ct_tests_004":{ "Notes":[ - "The json is used to orchastrate the tests to be run on testbed ct_us_004", - "This json file is used as an input to the ./lf_check.py file", - "The variables that are all capitalized below are replaced with configuration", - "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", - "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code." + "This json file describes tests to be run by LANforge system" ] }, "test_suites":{ + "suite_hc":{ + "lf_help_check":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"lf_help_check.bash", + "args":"", + "args_list":[ + " " + ] + } + }, "suite_l3":{ "test_l3_longevity":{ "enabled":"TRUE", @@ -18,7 +24,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2 ", - " --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000" ] } @@ -31,14 +37,14 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2 ", - " --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", " --ap_read --ap_test_mode" ] } }, - "suite_wc_dp_mt":{ - "CT-US-004_create_chamberview_dut_0":{ + "suite_wc_dp_shorter":{ + "create_chamberview_dut_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -50,240 +56,75 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-004_create_chamberview_mt7915e_sta19":{ + "create_chamberview_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-004-scenario ", + " --create_scenario mt7915e_wc", " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-004_wifi_capacity_mt7915e":{ + "wifi_capacity_mt7915e":{ "enabled":"TRUE", "timeout":"600", + "iterations":"1", "load_db":"skip", "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", - " --upstream 1.1.eth2 --batch_size 1,5,25 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name wc_m57915e", + " --upstream UPSTREAM_PORT --batch_size 1,10,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] }, - "CT-US-004_create_chamberview_mt7915e_sta1":{ + "create_chamberview_dut_mt7915e_dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "create_chamberview_mt7915e_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-004-scenario ", - " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", + " --create_scenario mt7915e_dp", + " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-004_dataplane_ATH10K_mt7915e_sta1":{ + "dataplane_mt7915e":{ "enabled":"TRUE", "load_db":"skip", + "iterations":"1", "command":"lf_dataplane_test.py", "args":"", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan7", - " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' ", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", + " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e' ", - " --test_rig TEST_RIG --set 'DUT_NAME" - ] - }, - "CT-US-004_QA":{ - "enabled":"TRUE", - "timeout":"600", - "load_db":"skip", - "command":"./tools/lf_qa.py", - "args":"", - "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" - ] - } - - }, - "suite_wc_dp_shorter":{ - "CT-US-004_create_chamberview_dut_for_ATH10K":{ - "enabled":"TRUE", - "load_db":"skip", - "command":"create_chamberview_dut.py", - "args":"", - "args_list":[ - " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" - ] - }, - "CT-US-004_create_chamberview_ATH10K(9984)_sta50":{ - "enabled":"TRUE", - "load_db":"skip", - "command":"create_chamberview.py", - "args":"", - "args_list":[ - " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-004-scenario ", - " --raw_line \"profile_link 1.1 STA-AC 50 'DUT: DUT_NAME Radio-1' NA wiphy1,AUTO -1 NA\" ", - " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" - ] - }, - "CT-US-004_wifi_capacity_ATH10K(9984)":{ - "enabled":"FALSE", - "timeout":"600", - "iterations":"1", - "load_db":"skip", - "command":"lf_wifi_capacity_test.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", - " --upstream 1.1.eth2 --batch_size 1,5,25 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", - " --test_rig TEST_RIG ", - " --set DUT_SET_NAME" - ] - }, - "CT-US-004_create_chamberview_dut_0":{ - "enabled":"TRUE", - "load_db":"skip", - "command":"create_chamberview_dut.py", - "args":"", - "args_list":[ - " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" - ] - }, - "CT-US-004_create_chamberview_mt7915e_sta19":{ - "enabled":"TRUE", - "load_db":"skip", - "command":"create_chamberview.py", - "args":"", - "args_list":[ - " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-004-scenario ", - " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", - " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" - ] - }, - "CT-US-004_wifi_capacity_mt7915e":{ - "enabled":"TRUE", - "timeout":"600", - "iterations":"1", - "load_db":"skip", - "command":"lf_wifi_capacity_test.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", - " --upstream 1.1.eth2 --batch_size 1,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] }, - "CT-US-004_QA":{ - "enabled":"TRUE", - "timeout":"600", - "load_db":"skip", - "command":"./tools/lf_qa.py", - "args":"", - "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" - ] - } - }, - "suite_wc_dp_short":{ - "CT-US-004_create_chamberview_dut_for_ATH10K":{ - "enabled":"TRUE", - "load_db":"skip", - "command":"create_chamberview_dut.py", - "args":"", - "args_list":[ - " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" - ] - }, - "CT-US-004_create_chamberview_ATH10K(9984)_sta50":{ - "enabled":"TRUE", - "load_db":"skip", - "command":"create_chamberview.py", - "args":"", - "args_list":[ - " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-004-scenario ", - " --raw_line \"profile_link 1.1 STA-AC 50 'DUT: DUT_NAME Radio-1' NA wiphy1,AUTO -1 NA\" ", - " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" - ] - }, - "CT-US-004_wifi_capacity_ATH10K(9984)":{ - "enabled":"TRUE", - "timeout":"600", - "iterations":"1", - "load_db":"skip", - "command":"lf_wifi_capacity_test.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", - " --upstream 1.1.eth2 --batch_size 1,5,25 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", - " --test_rig TEST_RIG ", - " --set DUT_SET_NAME" - ] - }, - "CT-US-004_create_chamberview_dut_0":{ - "enabled":"TRUE", - "load_db":"skip", - "command":"create_chamberview_dut.py", - "args":"", - "args_list":[ - " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" - ] - }, - "CT-US-004_create_chamberview_mt7915e_sta19":{ - "enabled":"TRUE", - "load_db":"skip", - "command":"create_chamberview.py", - "args":"", - "args_list":[ - " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-004-scenario ", - " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", - " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" - ] - }, - "CT-US-004_wifi_capacity_mt7915e":{ - "enabled":"TRUE", - "timeout":"600", - "iterations":"1", - "load_db":"skip", - "command":"lf_wifi_capacity_test.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", - " --upstream 1.1.eth2 --batch_size 1,5,10,15,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", - " --test_rig TEST_RIG", - " --set DUT_SET_NAME" - ] - }, - "CT-US-004_QA":{ + "lf_qa":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", @@ -295,7 +136,7 @@ } }, "suite_wc_dp":{ - "CT-US-004_lf_help_check":{ + "lf_help_check":{ "enabled":"TRUE", "load_db":"skip", "command":"lf_help_check.bash", @@ -304,7 +145,7 @@ " " ] }, - "CT-US-004_create_chamberview_dut_for_ATH10K":{ + "create_chamberview_dut_ATH10K(9984)_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -316,19 +157,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-004_create_chamberview_ATH10K(9984)_sta50":{ + "create_chamberview_ATH10K(9984)_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-004-ATH10K-scenario ", - " --raw_line \"profile_link 1.1 STA-AC 50 'DUT: DUT_NAME Radio-1' NA wiphy1,AUTO -1 NA\" ", + " --create_scenario ct-us-001-scenario ", + " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-004_wifi_capacity_ATH10K(9984)":{ + "wifi_capacity_ATH10K(9984)":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -336,28 +177,41 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", - " --upstream 1.1.eth2 --batch_size 1,5,25 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name wc_ATH10K", + " --upstream 1.1.eth2 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", " --test_rig TEST_RIG ", " --set DUT_SET_NAME" ] }, - "CT-US-004_create_chamberview_ATH10K(9984)_sta1":{ + "create_chamberview_dut_ATH10K(9984)_dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "create_chamberview_ATH10K(9984)_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-004-ATH10K_dp_scenario ", - " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-1' NA wiphy1,AUTO -1 NA\" ", + " --create_scenario ATH10K(9984)_dp", + " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-004_dataplane_ATH10K(9984)_sta1":{ + "dataplane_ATH10K(9984)":{ "enabled":"TRUE", "load_db":"skip", + "timeout":"600", "iterations":"1", "command":"lf_dataplane_test.py", "args":"", @@ -369,10 +223,10 @@ " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)' ", " --test_rig TEST_RIG", - " --set DUT_SET_NAME" + " --set DUT_SET_NAME" ] }, - "CT-US-004_create_chamberview_dut_for_AX210":{ + "create_chamberview_dut_AX210_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -384,33 +238,58 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-004_create_chamberview_wiphy3_AX210_sta1":{ + "create_chamberview_AX210_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-004-AX210-scenario ", - " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-1' NA wiphy3,AUTO -1 NA\" ", + " --create_scenario ct-us-001-AX210-scenario ", + " --raw_line \"profile_link 1.1 STA-AX 1 'DUT: DUT_NAME Radio-2' NA wiphy3,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\" " ] }, - "CT-US-004_wifi_capacity_wiphy3_AX210_sta1":{ + "wifi_capacity_AX210":{ "enabled":"TRUE", - "load_db":"skip", + "timeout":"600", "iterations":"1", + "load_db":"skip", "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", - " --upstream 1.1.eth2 --batch_size 1,5,25 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", + " --upstream 1.1.eth2 --batch_size 1 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --stations 1.1.wlan3 --test_tag 'AX210'", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] }, - "CT-US-004_dataplane_wiphy3_AX210_sta1":{ + "create_chamberview_dut_AX210_dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "create_chamberview_AX210_dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario AX210_dp", + " --raw_line \"profile_link 1.1 STA-AX 1 'DUT: DUT_NAME Radio-2' NA wiphy3,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\" " + ] + }, + "dataplane_AX210":{ "enabled":"TRUE", "load_db":"skip", "iterations":"1", @@ -427,7 +306,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-004_create_chamberview_dut_for_mt7915e":{ + "create_chamberview_dut_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -439,19 +318,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "CT-US-004_create_chamberview_mt7915e_sta19":{ + "create_chamberview_mt7915e_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-004-mt7915e-scenario ", - " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", + " --create_scenario ct-us-001-mt7915e-scenario ", + " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-004_wifi_capacity_mt7915e":{ + "wifi_capacity_mt7915e":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -463,22 +342,34 @@ " --upstream 1.1.eth2 --batch_size 1,5,10,15,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", " --test_rig TEST_RIG", - " --set DUT_SET_NAME" + " --set DUT_SET_NAME" ] }, - "CT-US-004_create_chamberview_mt7915e_sta1":{ + "create_chamberview_dut_mt7915e_dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "create_chamberview_mt7915e_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-004-mt7915e-scenario ", - " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", + " --create_scenario mt7915e_dp", + " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "CT-US-004_dataplane_ATH10K_mt7915e_sta1":{ + "dataplane_mt7915e":{ "enabled":"TRUE", "load_db":"skip", "iterations":"1", @@ -495,7 +386,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-004_create_chamberview_dut_2":{ + "create_chamberview_dut_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -506,7 +397,7 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-004_create_chamberview_ap":{ + "create_chamberview_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", @@ -519,7 +410,7 @@ " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " ] }, - "CT-US-004_lf_ap_auto_test": { + "ap_auto": { "enabled": "TRUE", "command": "lf_ap_auto_test.py", "timeout":"25200", @@ -528,7 +419,7 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap-auto-instance --config_name test_con --upstream eth2", - " --dut5_0 'DUT_NAME lanforge BSSID (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", + " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", @@ -545,7 +436,7 @@ " --set DUT_SET_NAME" ] }, - "CT-US-004_QA":{ + "lf_qa":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", @@ -555,34 +446,33 @@ " --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } - }, "suite_ap":{ - "CT-US-004_create_chamberview_dut_2":{ + "create_chamberview_dut_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=DUT_BSSID_2G'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "CT-US-004_create_chamberview_ap":{ + "create_chamberview_ap":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ap-004 ", - " --raw_line \"profile_link 1.1 STA-abgn-AC 4 'DUT: DUT_NAME Radio-0' NA wiphy1,AUTO -1 NA\" ", - " --raw_line \"profile_link 1.1 STA-AC 2 'DUT: DUT_NAME Radio-1' NA wiphy4,AUTO -1 NA\" ", - " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " + " --create_scenario ap-script", + " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " ] }, - "CT-US-004_lf_ap_auto_test": { + "ap_auto": { "enabled": "TRUE", "command": "lf_ap_auto_test.py", "timeout":"25200", @@ -590,18 +480,25 @@ "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", - " --instance_name ap-auto-instance --config_name test_con --upstream UPSTREAM_PORT", - " --dut5_0 'DUT_NAME lanforge BSSID (1)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", - " --max_stations_2 4 --max_stations_5 2 --max_stations_dual 100 --radio2 1.1.wiphy0", - " --radio5 1.1.wiphy1 --set 'Basic Client Connectivity' 1", - " --set 'Multi Band Performance' 0 --set 'Stability' 0 --set 'Multi-Station Throughput vs Pkt Size' 0,", - " --set 'Throughput vs Pkt Size' 0 --set 'Capacity' 0 --set 'Band-Steering' 0 --set 'Skip 2.4 Ghz Tests' 1", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", + " --instance_name ap-auto-instance --config_name test_con --upstream eth2", + " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", + " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", + " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", + " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", + " --set 'Basic Client Connectivity' 1", + " --set 'Multi Band Performance' 1", + " --set 'Stability' 0", + " --set 'Multi-Station Throughput vs Pkt Size' 0,", + " --set 'Throughput vs Pkt Size' 0", + " --set 'Capacity' 0", + " --set 'Band-Steering' 0", + " --set 'Skip 2.4 Ghz Tests' 1", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] }, - "CT-US-004_QA":{ + "lf_qa":{ "enabled":"TRUE", "timeout":"600", "load_db":"skip", @@ -613,8 +510,4 @@ } } } -} - - - - \ No newline at end of file +} \ No newline at end of file diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 13539bfe..f987a420 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -141,7 +141,6 @@ class lf_check(): self.production_run = _production self.report_path = _report_path self.log_path = _log_path - self.radio_dict = {} self.test_dict = {} path_parent = os.path.dirname(os.getcwd()) os.chdir(path_parent) @@ -192,8 +191,6 @@ class lf_check(): # section DUT # dut selection self.dut_set_name = 'DUT_NAME ASUSRT-AX88U' # note the name will be set as --set DUT_NAME ASUSRT-AX88U, this is not dut_name (see above) - - # dut configuration self.dut_name = "DUT_NAME_NA" # "ASUSRT-AX88U" note this is not dut_set_name self.dut_hw = "DUT_HW_NA" self.dut_sw = "DUT_SW_NA" @@ -214,9 +211,7 @@ class lf_check(): self.use_factory_default_db = "FALSE" self.use_custom_db = "FALSE" self.email_list_production = "" - self.host_ip_production = None self.email_list_test = "" - self.host_ip_test = None self.email_title_txt = "" self.email_txt = "" @@ -379,7 +374,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) mail_subject = "Regression Test [{hostname}] {date}".format(hostname=hostname, date=datetime.datetime.now()) try: if self.production_run == True: - msg = message_txt.format(ip=self.host_ip_production) + msg = message_txt.format(ip=ip) # for postfix from command line echo "My message" | mail -s subject user@candelatech.com command = "echo \"{message}\" | mail -s \"{subject}\" {address}".format( message=msg, @@ -456,23 +451,6 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.logger.info("EXITING ERROR test_rig_parameters not in rig json") exit(1) - if "test_network" in self.json_rig: - self.logger.info("json: read test_network") - # self.logger.info("test_network {}".format(self.json_rig["test_network"])) - self.read_test_network() - else: - self.logger.info("EXITING test_network not in json {}".format(self.json_rig)) - self.logger.info("EXITING ERROR test_network not in rig json") - exit(1) - - if "radio_dict" in self.json_rig: - self.logger.info("json: read radio_dict") - # self.logger.info("radio_dict {}".format(self.json_rig["radio_dict"])) - self.radio_dict = self.json_rig["radio_dict"] - self.logger.info("self.radio_dict {}".format(self.radio_dict)) - else: - self.logger.info("radio_dict not in json {}".format(self.json_rig)) - # read dut configuration def read_json_dut(self): if "test_dut" in self.json_dut: @@ -561,22 +539,12 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) else: self.logger.info("EMAIL_LIST_PRODUCTION not in test_rig_parameters json") exit(1) - if "HOST_IP_PRODUCTION" in self.json_rig["test_rig_parameters"]: - self.host_ip_production = self.json_rig["test_rig_parameters"]["HOST_IP_PRODUCTION"] - else: - self.logger.info("HOST_IP_PRODUCTION not in test_rig_parameters json") - exit(1) if "EMAIL_LIST_TEST" in self.json_rig["test_rig_parameters"]: self.email_list_test = self.json_rig["test_rig_parameters"]["EMAIL_LIST_TEST"] print(self.email_list_test) else: self.logger.info("EMAIL_LIST_TEST not in test_rig_parameters json") exit(1) - if "HOST_IP_TEST" in self.json_rig["test_rig_parameters"]: - self.host_ip_test = self.json_rig["test_rig_parameters"]["HOST_IP_TEST"] - else: - self.logger.info("HOST_IP_TEST not in test_rig_parameters json") - exit(1) if "EMAIL_TITLE_TXT" in self.json_rig["test_rig_parameters"]: self.email_title_txt = self.json_rig["test_rig_parameters"]["EMAIL_TITLE_TXT"] else: @@ -626,23 +594,6 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.logger.info("wireless_network_dict not in test_dut json") exit(1) - def read_test_network(self): - if "HTTP_TEST_IP" in self.json_rig["test_network"]: - self.http_test_ip = self.json_rig["test_network"]["HTTP_TEST_IP"] - else: - self.logger.info("HTTP_TEST_IP not in test_network json") - exit(1) - if "FTP_TEST_IP" in self.json_rig["test_network"]: - self.ftp_test_ip = self.json_rig["test_network"]["FTP_TEST_IP"] - else: - self.logger.info("FTP_TEST_IP not in test_network json") - exit(1) - if "TEST_IP" in self.json_rig["test_network"]: - self.ftp_test_ip = self.json_rig["test_network"]["TEST_IP"] - else: - self.logger.info("TEST_IP not in test_network json") - exit(1) - def load_FACTORY_DFLT_database(self): # self.logger.info("file_wd {}".format(self.scripts_wd)) try: @@ -695,16 +646,6 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) def run_script_test(self): self.start_html_results() self.start_csv_results() - #print(self.test_dict) - - # loop through radios (For future functionality based on radio) - if self.radio_dict: - for radio in self.radio_dict: - # This has been changed to reflect the Radio configuriaton of LANforge, for now print - print("rig json config: RADIO: {radio} DRIVER: {driver} CAPABILITIES {cap} MAX_STA {max_sta} MAX_VAP {max_vap} MAX_VIFS {max_vif}".format( - radio=self.radio_dict[radio]['RADIO'],driver=self.radio_dict[radio]['DRIVER'],cap=self.radio_dict[radio]['CAPABILITIES'], - max_sta=self.radio_dict[radio]['MAX_STA'],max_vap=self.radio_dict[radio]['MAX_VAP'],max_vif=self.radio_dict[radio]['MAX_VIFS'])) - # Configure Tests for test in self.test_dict: if self.test_dict[test]['enabled'] == "FALSE": From 80b3612647cf9a037c96c8b881a3880d1a603a37 Mon Sep 17 00:00:00 2001 From: erinnerim Date: Wed, 6 Oct 2021 11:52:35 -0700 Subject: [PATCH 089/731] rename lanforge-resource to lanforge_resource --- Quali/lanforge_resource/.gitignore | 60 + .../TOSCA-Metadata/TOSCA.meta | 4 + .../canvil2-64x64-gray-yel-ico.png | Bin 0 -> 2401 bytes Quali/lanforge_resource/deployment.xml | 53 + Quali/lanforge_resource/docs/readme.rst | 3 + Quali/lanforge_resource/shell-definition.yaml | 45 + Quali/lanforge_resource/shell-icon.png | Bin 0 -> 461 bytes Quali/lanforge_resource/src/data_model.py | 1029 +++++++++++++++++ Quali/lanforge_resource/src/driver.py | 309 +++++ .../lanforge_resource/src/drivermetadata.xml | 73 ++ Quali/lanforge_resource/src/importlib | 0 Quali/lanforge_resource/src/requirements.txt | 25 + Quali/lanforge_resource/src/sys | 0 Quali/lanforge_resource/test_requirements.txt | 7 + Quali/lanforge_resource/tests/__init__.py | 1 + .../tests/test_lanforge-resource.py | 27 + 16 files changed, 1636 insertions(+) create mode 100644 Quali/lanforge_resource/.gitignore create mode 100644 Quali/lanforge_resource/TOSCA-Metadata/TOSCA.meta create mode 100644 Quali/lanforge_resource/canvil2-64x64-gray-yel-ico.png create mode 100644 Quali/lanforge_resource/deployment.xml create mode 100644 Quali/lanforge_resource/docs/readme.rst create mode 100644 Quali/lanforge_resource/shell-definition.yaml create mode 100644 Quali/lanforge_resource/shell-icon.png create mode 100644 Quali/lanforge_resource/src/data_model.py create mode 100755 Quali/lanforge_resource/src/driver.py create mode 100644 Quali/lanforge_resource/src/drivermetadata.xml create mode 100644 Quali/lanforge_resource/src/importlib create mode 100644 Quali/lanforge_resource/src/requirements.txt create mode 100644 Quali/lanforge_resource/src/sys create mode 100644 Quali/lanforge_resource/test_requirements.txt create mode 100644 Quali/lanforge_resource/tests/__init__.py create mode 100644 Quali/lanforge_resource/tests/test_lanforge-resource.py diff --git a/Quali/lanforge_resource/.gitignore b/Quali/lanforge_resource/.gitignore new file mode 100644 index 00000000..1e1a44c7 --- /dev/null +++ b/Quali/lanforge_resource/.gitignore @@ -0,0 +1,60 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ +cloudshell_config.yml diff --git a/Quali/lanforge_resource/TOSCA-Metadata/TOSCA.meta b/Quali/lanforge_resource/TOSCA-Metadata/TOSCA.meta new file mode 100644 index 00000000..5a9b442f --- /dev/null +++ b/Quali/lanforge_resource/TOSCA-Metadata/TOSCA.meta @@ -0,0 +1,4 @@ +TOSCA-Meta-File-Version: 1.0 +CSAR-Version: 0.1.0 +Created-By: Anonymous +Entry-Definitions: shell-definition.yaml \ No newline at end of file diff --git a/Quali/lanforge_resource/canvil2-64x64-gray-yel-ico.png b/Quali/lanforge_resource/canvil2-64x64-gray-yel-ico.png new file mode 100644 index 0000000000000000000000000000000000000000..9abca2422cc4f57477eaa31797c20fe074fa9d7a GIT binary patch literal 2401 zcmV-n37+&2wr>_ZbN6vmdcqcJ!@3~_AZ05|h5w*uf5Vu!9E_;EKLQ47F&#VBNrgZ?X0^a~gBog%Z_alVh`0?Y|Y&L-Z0LP`2 ziO+-pnx@%+mvhAZ#m@}GU~Fs*RaI$fYFgg)l$7!>pIQMlO?wKs0GuxA(n4UG=4!+I zMoQW9sS!ZaG+)lr7XW*yHma(UOeP71LO7jH_Uze{U;lT)HK0q}=fuC3Bi(h^txO2U z#>TjM^(t1Y71K0vxm-N*$Rj9Ml-Gw%$Y2tJ`$!4=;vsrXqH^hBJ{M$L=pWDnhx~`MWW~r*G!Y~YUU8kqMhb5{U$gq7;({xGC-dX?t#6 zzY6%aYFyJaQ51zhAW#U1kw~NHHVgy5-;c-RA(cuoK0c1F z>&q>@9PdaeyUV@}YMR!Nv-HbApC?xH3R|y6h&cja*}8?dN*qq&oMMKgkcyZBY16XE%o*FG&VMp$z%wHLQG9ft;fCZgaIk#(Xv;B zIy*amec-@>mx`_IcDqqkmEPW7g25m?Jw1d%A#UHkjiM-2R#xJ4I`MkF2q6fE!-T_O z=H}+s>)v-l1Za>_nq?QDy}kXSVHnSMc6KhYvdiVdVzJQI*GF@6Gd(>$g=4CsD8%D& z!r?GCZrnf!u~};`aW23srMy+PnxLj>HNba(3qpuGA;bz72MQMM>+7SbsfqLF&oePG zK{y;Hl}fECHf#XTNGbok*2ZF;#82c3jbASHJWnW}iDk1{+S=NP$K&+&_R`+oj@Rog zXYTbkDdl79>0ntS@mGO20Ppf3X0cePtE;1`s*1tELFVV@>F(|(l}Z7SOeTrNV${~w zuBB45S$u!J9mHKo2Z1+%bIS?4-EQ1&Hy)3N>gwu3!eX^rxpe6gLI~`3d*Sq@C<^`k z{WLZ<;`jT@#$HOf?j>z0LHrc(1Jg9S^696?2xmH@+=lhxjo?D8|h>zE=U-L@gu~{Md3Fobw&1Q+kVk8m?u3Wi- z#bPOWPA^l?E6(`VFTjg0zW7a>&Gy^+`g--DhaRG?uCCzH#pmpNq)(^Q%+1Y_OeRSt zlf>h3=I7^86a__5sHv$b{UVD6tJPXg0d8(c03pQjy1F_wolX-DhZ!3i!!QgC!^qdo z$Ye5PGMR$)^Oi3rSL*xnC1AJP%PGM8Mmi}{%5Oy?k=>C<Sfv*7FTUoM7r_5h>-t zZCN*~p}V{LXYarN{`c}hF`La6?(9s{q`A47rlux_hldeDaOlvXO}#HS_UAX!S1pGC zk3atSYne>u;Y1>V5Q0P^!R+iTHk&PfRgDmWhK2@GsT3n4Bc*O}OCo=4URYQll}a%) zGsBG=H>jIC{@LK-cxk*49>ZU1xG~5`btlN;Def$tRyAo6Qyqoxxy` zn>TOr@y8z%3Eb#=K@G6PXR-Ds~SVMbzJ6&B}`2GI;E~DHR0^~$E2>drMLPtjj4u=C(Rf)x7 zOWOK;z76LCo4JH3s{lC>+JGy0_dj;*7ohkvZ$+B?PvDt#{rRr%kOlan+yHm<3!tHxM3)S}PquGi=M9&@4AVPq^SMm#AhMz5>R>k-9q z`mx1uqt8sOFAH-1PoytnvQ2pF_h+~{TT`69t&*pkTzK|f_U)c3%X~!D(YV4k;wNYS zh_@zL*bP?04`29G*~o8O3|N}U!H>^g!sAS?+V-VWf2F=|w(N7-RsjGM@rft6owx7U z=0MYR+8-X@p80SOpeQCkJ$nh4qqGQ5cMNTxS8itzT(N%}f;WHnJn^||6k+hx(P2(^ zen5p)-yZT+N8|TY0D#4;%D=8Y%wq>W-1c{WBEX>A-~olO?T@g79qeES4>JA_g#*$W TVq_4-00000NkvXXu0mjfMk1wL literal 0 HcmV?d00001 diff --git a/Quali/lanforge_resource/deployment.xml b/Quali/lanforge_resource/deployment.xml new file mode 100644 index 00000000..fa1f6a32 --- /dev/null +++ b/Quali/lanforge_resource/deployment.xml @@ -0,0 +1,53 @@ + + + + + localhost + + + 8029 + + + YOUR_USERNAME + YOUR_PASSWORD + Global + + + dont_upload_me.xml + + + + + + + + + + src + + + LanforgeResourceDriver + + + + + + + \ No newline at end of file diff --git a/Quali/lanforge_resource/docs/readme.rst b/Quali/lanforge_resource/docs/readme.rst new file mode 100644 index 00000000..4dc0eb5d --- /dev/null +++ b/Quali/lanforge_resource/docs/readme.rst @@ -0,0 +1,3 @@ +.. _readme: + +.. include:: ../README.rst diff --git a/Quali/lanforge_resource/shell-definition.yaml b/Quali/lanforge_resource/shell-definition.yaml new file mode 100644 index 00000000..2a0f9cbb --- /dev/null +++ b/Quali/lanforge_resource/shell-definition.yaml @@ -0,0 +1,45 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 + +metadata: + template_name: Lanforge Resource + template_author: Anonymous + template_version: 0.1.0 + template_icon: shell-icon.png + +description: > + TOSCA based resource shell + +imports: + - cloudshell_standard: cloudshell_resource_standard_2_0_3.yaml + +node_types: + + vendor.resource.Lanforge Resource: + derived_from: cloudshell.nodes.GenericResource + #properties: + # my_property: + # type: string # optional values: string, integer, float, boolean, cloudshell.datatypes.Password + # default: fast + # description: Some attribute description + # constraints: + # - valid_values: [fast, slow] + capabilities: + auto_discovery_capability: + type: cloudshell.capabilities.AutoDiscovery + properties: + enable_auto_discovery: + type: boolean + default: true + auto_discovery_description: + type: string + default: Describe the auto discovery + inventory_description: + type: string + default: Describe the resource shell template + artifacts: + icon: + file: canvil2-64x64-gray-yel-ico.png + type: tosca.artifacts.File + driver: + file: LanforgeResourceDriver.zip + type: tosca.artifacts.File diff --git a/Quali/lanforge_resource/shell-icon.png b/Quali/lanforge_resource/shell-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..820b28fdffeccab4956e35c7be7d52d9249a9b58 GIT binary patch literal 461 zcmeAS@N?(olHy`uVBq!ia0vp^jv&mz1|<8wpL7LMoCO|{#S9GGLLkg|>2BR01_s7@ zPZ!6Kid%1QZ!A1yAad;E`IxK(;jjeZ-KVq9&14nNiL{9Cv4+|_6EvU`qBzI5yrV{TaI?=`I)0uBs} zECTy{cPmyl&D`siRpjF@xp?vwtLJ5t1#J#^ALRd)%cG=uenuiNldVJd%D-TpNa!V(gWASZ#{rLjOw zG++Xau;=&} zd^1UD*?vWix%TtC8YOCO+r0VzHbwKnoVEM*72WsvWw80uy>DeEYoGn+YvkD2dMaX; v)zY)J*AvPh7Ax8X>8~&4&$ztQ?FY+o_O>}!r+Hie#t(z1tDnm{r-UW|ETzMY literal 0 HcmV?d00001 diff --git a/Quali/lanforge_resource/src/data_model.py b/Quali/lanforge_resource/src/data_model.py new file mode 100644 index 00000000..329bdfbb --- /dev/null +++ b/Quali/lanforge_resource/src/data_model.py @@ -0,0 +1,1029 @@ +from cloudshell.shell.core.driver_context import ResourceCommandContext, AutoLoadDetails, AutoLoadAttribute, \ + AutoLoadResource +from collections import defaultdict + + +class LegacyUtils(object): + def __init__(self): + self._datamodel_clss_dict = self.__generate_datamodel_classes_dict() + + def migrate_autoload_details(self, autoload_details, context): + model_name = context.resource.model + root_name = context.resource.name + root = self.__create_resource_from_datamodel(model_name, root_name) + attributes = self.__create_attributes_dict(autoload_details.attributes) + self.__attach_attributes_to_resource(attributes, '', root) + self.__build_sub_resoruces_hierarchy(root, autoload_details.resources, attributes) + return root + + def __create_resource_from_datamodel(self, model_name, res_name): + return self._datamodel_clss_dict[model_name](res_name) + + def __create_attributes_dict(self, attributes_lst): + d = defaultdict(list) + for attribute in attributes_lst: + d[attribute.relative_address].append(attribute) + return d + + def __build_sub_resoruces_hierarchy(self, root, sub_resources, attributes): + d = defaultdict(list) + for resource in sub_resources: + splitted = resource.relative_address.split('/') + parent = '' if len(splitted) == 1 else resource.relative_address.rsplit('/', 1)[0] + rank = len(splitted) + d[rank].append((parent, resource)) + + self.__set_models_hierarchy_recursively(d, 1, root, '', attributes) + + def __set_models_hierarchy_recursively(self, dict, rank, manipulated_resource, resource_relative_addr, attributes): + if rank not in dict: # validate if key exists + pass + + for (parent, resource) in dict[rank]: + if parent == resource_relative_addr: + sub_resource = self.__create_resource_from_datamodel( + resource.model.replace(' ', ''), + resource.name) + self.__attach_attributes_to_resource(attributes, resource.relative_address, sub_resource) + manipulated_resource.add_sub_resource( + self.__slice_parent_from_relative_path(parent, resource.relative_address), sub_resource) + self.__set_models_hierarchy_recursively( + dict, + rank + 1, + sub_resource, + resource.relative_address, + attributes) + + def __attach_attributes_to_resource(self, attributes, curr_relative_addr, resource): + for attribute in attributes[curr_relative_addr]: + setattr(resource, attribute.attribute_name.lower().replace(' ', '_'), attribute.attribute_value) + del attributes[curr_relative_addr] + + def __slice_parent_from_relative_path(self, parent, relative_addr): + if parent is '': + return relative_addr + return relative_addr[len(parent) + 1:] # + 1 because we want to remove the seperator also + + def __generate_datamodel_classes_dict(self): + return dict(self.__collect_generated_classes()) + + def __collect_generated_classes(self): + import sys, inspect + return inspect.getmembers(sys.modules[__name__], inspect.isclass) + + +class LanforgeResource(object): + def __init__(self, name): + """ + + """ + self.attributes = {} + self.resources = {} + self._cloudshell_model_name = 'Lanforge Resource' + self._name = name + + def add_sub_resource(self, relative_path, sub_resource): + self.resources[relative_path] = sub_resource + + @classmethod + def create_from_context(cls, context): + """ + Creates an instance of NXOS by given context + :param context: cloudshell.shell.core.driver_context.ResourceCommandContext + :type context: cloudshell.shell.core.driver_context.ResourceCommandContext + :return: + :rtype LanforgeResource + """ + result = LanforgeResource(name=context.resource.name) + for attr in context.resource.attributes: + result.attributes[attr] = context.resource.attributes[attr] + return result + + def create_autoload_details(self, relative_path=''): + """ + :param relative_path: + :type relative_path: str + :return + """ + resources = [AutoLoadResource(model=self.resources[r].cloudshell_model_name, + name=self.resources[r].name, + relative_address=self._get_relative_path(r, relative_path)) + for r in self.resources] + attributes = [AutoLoadAttribute(relative_path, a, self.attributes[a]) for a in self.attributes] + autoload_details = AutoLoadDetails(resources, attributes) + for r in self.resources: + curr_path = relative_path + '/' + r if relative_path else r + curr_auto_load_details = self.resources[r].create_autoload_details(curr_path) + autoload_details = self._merge_autoload_details(autoload_details, curr_auto_load_details) + return autoload_details + + def _get_relative_path(self, child_path, parent_path): + """ + Combines relative path + :param child_path: Path of a model within it parent model, i.e 1 + :type child_path: str + :param parent_path: Full path of parent model, i.e 1/1. Might be empty for root model + :type parent_path: str + :return: Combined path + :rtype str + """ + return parent_path + '/' + child_path if parent_path else child_path + + @staticmethod + def _merge_autoload_details(autoload_details1, autoload_details2): + """ + Merges two instances of AutoLoadDetails into the first one + :param autoload_details1: + :type autoload_details1: AutoLoadDetails + :param autoload_details2: + :type autoload_details2: AutoLoadDetails + :return: + :rtype AutoLoadDetails + """ + for attribute in autoload_details2.attributes: + autoload_details1.attributes.append(attribute) + for resource in autoload_details2.resources: + autoload_details1.resources.append(resource) + return autoload_details1 + + @property + def cloudshell_model_name(self): + """ + Returns the name of the Cloudshell model + :return: + """ + return 'LanforgeResource' + + @property + def user(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.User'] if 'Lanforge Resource.User' in self.attributes else None + + @user.setter + def user(self, value): + """ + User with administrative privileges + :type value: str + """ + self.attributes['Lanforge Resource.User'] = value + + @property + def password(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.Password'] if 'Lanforge Resource.Password' in self.attributes else None + + @password.setter + def password(self, value): + """ + + :type value: string + """ + self.attributes['Lanforge Resource.Password'] = value + + @property + def enable_password(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.Enable Password'] if 'Lanforge Resource.Enable Password' in self.attributes else None + + @enable_password.setter + def enable_password(self, value): + """ + The enable password is required by some CLI protocols such as Telnet and is required according to the device configuration. + :type value: string + """ + self.attributes['Lanforge Resource.Enable Password'] = value + + @property + def power_management(self): + """ + :rtype: bool + """ + return self.attributes['Lanforge Resource.Power Management'] if 'Lanforge Resource.Power Management' in self.attributes else None + + @power_management.setter + def power_management(self, value=True): + """ + Used by the power management orchestration, if enabled, to determine whether to automatically manage the device power status. Enabled by default. + :type value: bool + """ + self.attributes['Lanforge Resource.Power Management'] = value + + @property + def sessions_concurrency_limit(self): + """ + :rtype: float + """ + return self.attributes['Lanforge Resource.Sessions Concurrency Limit'] if 'Lanforge Resource.Sessions Concurrency Limit' in self.attributes else None + + @sessions_concurrency_limit.setter + def sessions_concurrency_limit(self, value='1'): + """ + The maximum number of concurrent sessions that the driver will open to the device. Default is 1 (no concurrency). + :type value: float + """ + self.attributes['Lanforge Resource.Sessions Concurrency Limit'] = value + + @property + def snmp_read_community(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.SNMP Read Community'] if 'Lanforge Resource.SNMP Read Community' in self.attributes else None + + @snmp_read_community.setter + def snmp_read_community(self, value): + """ + The SNMP Read-Only Community String is like a password. It is sent along with each SNMP Get-Request and allows (or denies) access to device. + :type value: string + """ + self.attributes['Lanforge Resource.SNMP Read Community'] = value + + @property + def snmp_write_community(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.SNMP Write Community'] if 'Lanforge Resource.SNMP Write Community' in self.attributes else None + + @snmp_write_community.setter + def snmp_write_community(self, value): + """ + The SNMP Write Community String is like a password. It is sent along with each SNMP Set-Request and allows (or denies) chaning MIBs values. + :type value: string + """ + self.attributes['Lanforge Resource.SNMP Write Community'] = value + + @property + def snmp_v3_user(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.SNMP V3 User'] if 'Lanforge Resource.SNMP V3 User' in self.attributes else None + + @snmp_v3_user.setter + def snmp_v3_user(self, value): + """ + Relevant only in case SNMP V3 is in use. + :type value: str + """ + self.attributes['Lanforge Resource.SNMP V3 User'] = value + + @property + def snmp_v3_password(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.SNMP V3 Password'] if 'Lanforge Resource.SNMP V3 Password' in self.attributes else None + + @snmp_v3_password.setter + def snmp_v3_password(self, value): + """ + Relevant only in case SNMP V3 is in use. + :type value: string + """ + self.attributes['Lanforge Resource.SNMP V3 Password'] = value + + @property + def snmp_v3_private_key(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.SNMP V3 Private Key'] if 'Lanforge Resource.SNMP V3 Private Key' in self.attributes else None + + @snmp_v3_private_key.setter + def snmp_v3_private_key(self, value): + """ + Relevant only in case SNMP V3 is in use. + :type value: str + """ + self.attributes['Lanforge Resource.SNMP V3 Private Key'] = value + + @property + def snmp_v3_authentication_protocol(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.SNMP V3 Authentication Protocol'] if 'Lanforge Resource.SNMP V3 Authentication Protocol' in self.attributes else None + + @snmp_v3_authentication_protocol.setter + def snmp_v3_authentication_protocol(self, value='No Authentication Protocol'): + """ + Relevant only in case SNMP V3 is in use. + :type value: str + """ + self.attributes['Lanforge Resource.SNMP V3 Authentication Protocol'] = value + + @property + def snmp_v3_privacy_protocol(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.SNMP V3 Privacy Protocol'] if 'Lanforge Resource.SNMP V3 Privacy Protocol' in self.attributes else None + + @snmp_v3_privacy_protocol.setter + def snmp_v3_privacy_protocol(self, value='No Privacy Protocol'): + """ + Relevant only in case SNMP V3 is in use. + :type value: str + """ + self.attributes['Lanforge Resource.SNMP V3 Privacy Protocol'] = value + + @property + def snmp_version(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.SNMP Version'] if 'Lanforge Resource.SNMP Version' in self.attributes else None + + @snmp_version.setter + def snmp_version(self, value=''): + """ + The version of SNMP to use. Possible values are v1, v2c and v3. + :type value: str + """ + self.attributes['Lanforge Resource.SNMP Version'] = value + + @property + def enable_snmp(self): + """ + :rtype: bool + """ + return self.attributes['Lanforge Resource.Enable SNMP'] if 'Lanforge Resource.Enable SNMP' in self.attributes else None + + @enable_snmp.setter + def enable_snmp(self, value=True): + """ + If set to True and SNMP isn???t enabled yet in the device the Shell will automatically enable SNMP in the device when Autoload command is called. SNMP must be enabled on the device for the Autoload command to run successfully. True by default. + :type value: bool + """ + self.attributes['Lanforge Resource.Enable SNMP'] = value + + @property + def disable_snmp(self): + """ + :rtype: bool + """ + return self.attributes['Lanforge Resource.Disable SNMP'] if 'Lanforge Resource.Disable SNMP' in self.attributes else None + + @disable_snmp.setter + def disable_snmp(self, value=False): + """ + If set to True SNMP will be disabled automatically by the Shell after the Autoload command execution is completed. False by default. + :type value: bool + """ + self.attributes['Lanforge Resource.Disable SNMP'] = value + + @property + def console_server_ip_address(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.Console Server IP Address'] if 'Lanforge Resource.Console Server IP Address' in self.attributes else None + + @console_server_ip_address.setter + def console_server_ip_address(self, value): + """ + The IP address of the console server, in IPv4 format. + :type value: str + """ + self.attributes['Lanforge Resource.Console Server IP Address'] = value + + @property + def console_user(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.Console User'] if 'Lanforge Resource.Console User' in self.attributes else None + + @console_user.setter + def console_user(self, value): + """ + + :type value: str + """ + self.attributes['Lanforge Resource.Console User'] = value + + @property + def console_port(self): + """ + :rtype: float + """ + return self.attributes['Lanforge Resource.Console Port'] if 'Lanforge Resource.Console Port' in self.attributes else None + + @console_port.setter + def console_port(self, value): + """ + The port on the console server, usually TCP port, which the device is associated with. + :type value: float + """ + self.attributes['Lanforge Resource.Console Port'] = value + + @property + def console_password(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.Console Password'] if 'Lanforge Resource.Console Password' in self.attributes else None + + @console_password.setter + def console_password(self, value): + """ + + :type value: string + """ + self.attributes['Lanforge Resource.Console Password'] = value + + @property + def cli_connection_type(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.CLI Connection Type'] if 'Lanforge Resource.CLI Connection Type' in self.attributes else None + + @cli_connection_type.setter + def cli_connection_type(self, value='Auto'): + """ + The CLI connection type that will be used by the driver. Possible values are Auto, Console, SSH, Telnet and TCP. If Auto is selected the driver will choose the available connection type automatically. Default value is Auto. + :type value: str + """ + self.attributes['Lanforge Resource.CLI Connection Type'] = value + + @property + def cli_tcp_port(self): + """ + :rtype: float + """ + return self.attributes['Lanforge Resource.CLI TCP Port'] if 'Lanforge Resource.CLI TCP Port' in self.attributes else None + + @cli_tcp_port.setter + def cli_tcp_port(self, value): + """ + TCP Port to user for CLI connection. If kept empty a default CLI port will be used based on the chosen protocol, for example Telnet will use port 23. + :type value: float + """ + self.attributes['Lanforge Resource.CLI TCP Port'] = value + + @property + def backup_location(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.Backup Location'] if 'Lanforge Resource.Backup Location' in self.attributes else None + + @backup_location.setter + def backup_location(self, value): + """ + Used by the save/restore orchestration to determine where backups should be saved. + :type value: str + """ + self.attributes['Lanforge Resource.Backup Location'] = value + + @property + def backup_type(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.Backup Type'] if 'Lanforge Resource.Backup Type' in self.attributes else None + + @backup_type.setter + def backup_type(self, value='File System'): + """ + Supported protocols for saving and restoring of configuration and firmware files. Possible values are 'File System' 'FTP' and 'TFTP'. Default value is 'File System'. + :type value: str + """ + self.attributes['Lanforge Resource.Backup Type'] = value + + @property + def backup_user(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.Backup User'] if 'Lanforge Resource.Backup User' in self.attributes else None + + @backup_user.setter + def backup_user(self, value): + """ + Username for the storage server used for saving and restoring of configuration and firmware files. + :type value: str + """ + self.attributes['Lanforge Resource.Backup User'] = value + + @property + def backup_password(self): + """ + :rtype: string + """ + return self.attributes['Lanforge Resource.Backup Password'] if 'Lanforge Resource.Backup Password' in self.attributes else None + + @backup_password.setter + def backup_password(self, value): + """ + Password for the storage server used for saving and restoring of configuration and firmware files. + :type value: string + """ + self.attributes['Lanforge Resource.Backup Password'] = value + + @property + def name(self): + """ + :rtype: str + """ + return self._name + + @name.setter + def name(self, value): + """ + + :type value: str + """ + self._name = value + + @property + def cloudshell_model_name(self): + """ + :rtype: str + """ + return self._cloudshell_model_name + + @cloudshell_model_name.setter + def cloudshell_model_name(self, value): + """ + + :type value: str + """ + self._cloudshell_model_name = value + + @property + def system_name(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.System Name'] if 'CS_GenericResource.System Name' in self.attributes else None + + @system_name.setter + def system_name(self, value): + """ + A unique identifier for the device, if exists in the device terminal/os. + :type value: str + """ + self.attributes['CS_GenericResource.System Name'] = value + + @property + def vendor(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.Vendor'] if 'CS_GenericResource.Vendor' in self.attributes else None + + @vendor.setter + def vendor(self, value=''): + """ + The name of the device manufacture. + :type value: str + """ + self.attributes['CS_GenericResource.Vendor'] = value + + @property + def contact_name(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.Contact Name'] if 'CS_GenericResource.Contact Name' in self.attributes else None + + @contact_name.setter + def contact_name(self, value): + """ + The name of a contact registered in the device. + :type value: str + """ + self.attributes['CS_GenericResource.Contact Name'] = value + + @property + def location(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.Location'] if 'CS_GenericResource.Location' in self.attributes else None + + @location.setter + def location(self, value=''): + """ + The device physical location identifier. For example Lab1/Floor2/Row5/Slot4. + :type value: str + """ + self.attributes['CS_GenericResource.Location'] = value + + @property + def model(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.Model'] if 'CS_GenericResource.Model' in self.attributes else None + + @model.setter + def model(self, value=''): + """ + The device model. This information is typically used for abstract resource filtering. + :type value: str + """ + self.attributes['CS_GenericResource.Model'] = value + + @property + def model_name(self): + """ + :rtype: str + """ + return self.attributes['CS_GenericResource.Model Name'] if 'CS_GenericResource.Model Name' in self.attributes else None + + @model_name.setter + def model_name(self, value=''): + """ + The catalog name of the device model. This attribute will be displayed in CloudShell instead of the CloudShell model. + :type value: str + """ + self.attributes['CS_GenericResource.Model Name'] = value + + +class ResourcePort(object): + def __init__(self, name): + """ + + """ + self.attributes = {} + self.resources = {} + self._cloudshell_model_name = 'Lanforge Resource.ResourcePort' + self._name = name + + def add_sub_resource(self, relative_path, sub_resource): + self.resources[relative_path] = sub_resource + + @classmethod + def create_from_context(cls, context): + """ + Creates an instance of NXOS by given context + :param context: cloudshell.shell.core.driver_context.ResourceCommandContext + :type context: cloudshell.shell.core.driver_context.ResourceCommandContext + :return: + :rtype ResourcePort + """ + result = ResourcePort(name=context.resource.name) + for attr in context.resource.attributes: + result.attributes[attr] = context.resource.attributes[attr] + return result + + def create_autoload_details(self, relative_path=''): + """ + :param relative_path: + :type relative_path: str + :return + """ + resources = [AutoLoadResource(model=self.resources[r].cloudshell_model_name, + name=self.resources[r].name, + relative_address=self._get_relative_path(r, relative_path)) + for r in self.resources] + attributes = [AutoLoadAttribute(relative_path, a, self.attributes[a]) for a in self.attributes] + autoload_details = AutoLoadDetails(resources, attributes) + for r in self.resources: + curr_path = relative_path + '/' + r if relative_path else r + curr_auto_load_details = self.resources[r].create_autoload_details(curr_path) + autoload_details = self._merge_autoload_details(autoload_details, curr_auto_load_details) + return autoload_details + + def _get_relative_path(self, child_path, parent_path): + """ + Combines relative path + :param child_path: Path of a model within it parent model, i.e 1 + :type child_path: str + :param parent_path: Full path of parent model, i.e 1/1. Might be empty for root model + :type parent_path: str + :return: Combined path + :rtype str + """ + return parent_path + '/' + child_path if parent_path else child_path + + @staticmethod + def _merge_autoload_details(autoload_details1, autoload_details2): + """ + Merges two instances of AutoLoadDetails into the first one + :param autoload_details1: + :type autoload_details1: AutoLoadDetails + :param autoload_details2: + :type autoload_details2: AutoLoadDetails + :return: + :rtype AutoLoadDetails + """ + for attribute in autoload_details2.attributes: + autoload_details1.attributes.append(attribute) + for resource in autoload_details2.resources: + autoload_details1.resources.append(resource) + return autoload_details1 + + @property + def cloudshell_model_name(self): + """ + Returns the name of the Cloudshell model + :return: + """ + return 'ResourcePort' + + @property + def mac_address(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.ResourcePort.MAC Address'] if 'Lanforge Resource.ResourcePort.MAC Address' in self.attributes else None + + @mac_address.setter + def mac_address(self, value=''): + """ + + :type value: str + """ + self.attributes['Lanforge Resource.ResourcePort.MAC Address'] = value + + @property + def ipv4_address(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.ResourcePort.IPv4 Address'] if 'Lanforge Resource.ResourcePort.IPv4 Address' in self.attributes else None + + @ipv4_address.setter + def ipv4_address(self, value): + """ + + :type value: str + """ + self.attributes['Lanforge Resource.ResourcePort.IPv4 Address'] = value + + @property + def ipv6_address(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.ResourcePort.IPv6 Address'] if 'Lanforge Resource.ResourcePort.IPv6 Address' in self.attributes else None + + @ipv6_address.setter + def ipv6_address(self, value): + """ + + :type value: str + """ + self.attributes['Lanforge Resource.ResourcePort.IPv6 Address'] = value + + @property + def port_speed(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.ResourcePort.Port Speed'] if 'Lanforge Resource.ResourcePort.Port Speed' in self.attributes else None + + @port_speed.setter + def port_speed(self, value): + """ + The port speed (e.g 10Gb/s, 40Gb/s, 100Mb/s) + :type value: str + """ + self.attributes['Lanforge Resource.ResourcePort.Port Speed'] = value + + @property + def name(self): + """ + :rtype: str + """ + return self._name + + @name.setter + def name(self, value): + """ + + :type value: str + """ + self._name = value + + @property + def cloudshell_model_name(self): + """ + :rtype: str + """ + return self._cloudshell_model_name + + @cloudshell_model_name.setter + def cloudshell_model_name(self, value): + """ + + :type value: str + """ + self._cloudshell_model_name = value + + @property + def model_name(self): + """ + :rtype: str + """ + return self.attributes['CS_Port.Model Name'] if 'CS_Port.Model Name' in self.attributes else None + + @model_name.setter + def model_name(self, value=''): + """ + The catalog name of the device model. This attribute will be displayed in CloudShell instead of the CloudShell model. + :type value: str + """ + self.attributes['CS_Port.Model Name'] = value + + +class GenericPowerPort(object): + def __init__(self, name): + """ + + """ + self.attributes = {} + self.resources = {} + self._cloudshell_model_name = 'Lanforge Resource.GenericPowerPort' + self._name = name + + def add_sub_resource(self, relative_path, sub_resource): + self.resources[relative_path] = sub_resource + + @classmethod + def create_from_context(cls, context): + """ + Creates an instance of NXOS by given context + :param context: cloudshell.shell.core.driver_context.ResourceCommandContext + :type context: cloudshell.shell.core.driver_context.ResourceCommandContext + :return: + :rtype GenericPowerPort + """ + result = GenericPowerPort(name=context.resource.name) + for attr in context.resource.attributes: + result.attributes[attr] = context.resource.attributes[attr] + return result + + def create_autoload_details(self, relative_path=''): + """ + :param relative_path: + :type relative_path: str + :return + """ + resources = [AutoLoadResource(model=self.resources[r].cloudshell_model_name, + name=self.resources[r].name, + relative_address=self._get_relative_path(r, relative_path)) + for r in self.resources] + attributes = [AutoLoadAttribute(relative_path, a, self.attributes[a]) for a in self.attributes] + autoload_details = AutoLoadDetails(resources, attributes) + for r in self.resources: + curr_path = relative_path + '/' + r if relative_path else r + curr_auto_load_details = self.resources[r].create_autoload_details(curr_path) + autoload_details = self._merge_autoload_details(autoload_details, curr_auto_load_details) + return autoload_details + + def _get_relative_path(self, child_path, parent_path): + """ + Combines relative path + :param child_path: Path of a model within it parent model, i.e 1 + :type child_path: str + :param parent_path: Full path of parent model, i.e 1/1. Might be empty for root model + :type parent_path: str + :return: Combined path + :rtype str + """ + return parent_path + '/' + child_path if parent_path else child_path + + @staticmethod + def _merge_autoload_details(autoload_details1, autoload_details2): + """ + Merges two instances of AutoLoadDetails into the first one + :param autoload_details1: + :type autoload_details1: AutoLoadDetails + :param autoload_details2: + :type autoload_details2: AutoLoadDetails + :return: + :rtype AutoLoadDetails + """ + for attribute in autoload_details2.attributes: + autoload_details1.attributes.append(attribute) + for resource in autoload_details2.resources: + autoload_details1.resources.append(resource) + return autoload_details1 + + @property + def cloudshell_model_name(self): + """ + Returns the name of the Cloudshell model + :return: + """ + return 'GenericPowerPort' + + @property + def model(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.GenericPowerPort.Model'] if 'Lanforge Resource.GenericPowerPort.Model' in self.attributes else None + + @model.setter + def model(self, value): + """ + The device model. This information is typically used for abstract resource filtering. + :type value: str + """ + self.attributes['Lanforge Resource.GenericPowerPort.Model'] = value + + @property + def serial_number(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.GenericPowerPort.Serial Number'] if 'Lanforge Resource.GenericPowerPort.Serial Number' in self.attributes else None + + @serial_number.setter + def serial_number(self, value): + """ + + :type value: str + """ + self.attributes['Lanforge Resource.GenericPowerPort.Serial Number'] = value + + @property + def version(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.GenericPowerPort.Version'] if 'Lanforge Resource.GenericPowerPort.Version' in self.attributes else None + + @version.setter + def version(self, value): + """ + The firmware version of the resource. + :type value: str + """ + self.attributes['Lanforge Resource.GenericPowerPort.Version'] = value + + @property + def port_description(self): + """ + :rtype: str + """ + return self.attributes['Lanforge Resource.GenericPowerPort.Port Description'] if 'Lanforge Resource.GenericPowerPort.Port Description' in self.attributes else None + + @port_description.setter + def port_description(self, value): + """ + The description of the port as configured in the device. + :type value: str + """ + self.attributes['Lanforge Resource.GenericPowerPort.Port Description'] = value + + @property + def name(self): + """ + :rtype: str + """ + return self._name + + @name.setter + def name(self, value): + """ + + :type value: str + """ + self._name = value + + @property + def cloudshell_model_name(self): + """ + :rtype: str + """ + return self._cloudshell_model_name + + @cloudshell_model_name.setter + def cloudshell_model_name(self, value): + """ + + :type value: str + """ + self._cloudshell_model_name = value + + @property + def model_name(self): + """ + :rtype: str + """ + return self.attributes['CS_PowerPort.Model Name'] if 'CS_PowerPort.Model Name' in self.attributes else None + + @model_name.setter + def model_name(self, value=''): + """ + The catalog name of the device model. This attribute will be displayed in CloudShell instead of the CloudShell model. + :type value: str + """ + self.attributes['CS_PowerPort.Model Name'] = value + + + diff --git a/Quali/lanforge_resource/src/driver.py b/Quali/lanforge_resource/src/driver.py new file mode 100755 index 00000000..277dc073 --- /dev/null +++ b/Quali/lanforge_resource/src/driver.py @@ -0,0 +1,309 @@ +from cloudshell.shell.core.resource_driver_interface import ResourceDriverInterface +from cloudshell.shell.core.driver_context import InitCommandContext, ResourceCommandContext, AutoLoadResource, \ + AutoLoadAttribute, AutoLoadDetails, CancellationContext +from cloudshell.shell.core.session.cloudshell_session import CloudShellSessionContext +import mock +from data_model import * +# run 'shellfoundry generate' to generate data model classes +import subprocess +import sys +import os +import importlib +import paramiko + +# command = "./lanforge-scripts/py-scripts/update_dependencies.py" +# print("running:[{}]".format(command)) +# process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) +# outs, errs = process.communicate() +# print(outs) +# print(errs) + +# if 'lanforge-scripts' not in sys.path: +# sys.path.append('./lanforge-scripts') + +# create_wanlink = importlib.import_module("lanforge-scripts.py-json.create_wanlink") +# create_l3 = importlib.import_module("lanforge-scripts.py-scripts.create_l3") +# CreateL3 = create_l3.CreateL3 +class LanforgeResourceDriver (ResourceDriverInterface): + + def __init__(self): + """ + ctor must be without arguments, it is created with reflection at run time + """ + pass + + def initialize(self, context): + """ + Initialize the driver session, this function is called everytime a new instance of the driver is created + This is a good place to load and cache the driver configuration, initiate sessions etc. + :param InitCommandContext context: the context the command runs on + """ + pass + + def cleanup(self): + """ + Destroy the driver session, this function is called everytime a driver instance is destroyed + This is a good place to close any open sessions, finish writing to log files + """ + pass + + def get_inventory(self, context): + """ + Discovers the resource structure and attributes. + :param AutoLoadCommandContext context: the context the command runs on + :return Attribute and sub-resource information for the Shell resource you can return an AutoLoadDetails object + :rtype: AutoLoadDetails + """ + # See below some example code demonstrating how to return the resource structure and attributes + # In real life, this code will be preceded by SNMP/other calls to the resource details and will not be static + # run 'shellfoundry generate' in order to create classes that represent your data model + + ''' + resource = LanforgeResource.create_from_context(context) + resource.vendor = 'specify the shell vendor' + resource.model = 'specify the shell model' + + port1 = ResourcePort('Port 1') + port1.ipv4_address = '192.168.10.7' + resource.add_sub_resource('1', port1) + + return resource.create_autoload_details() + ''' + return AutoLoadDetails([], []) + + def orchestration_save(self, context, cancellation_context, mode, custom_params): + """ + Saves the Shell state and returns a description of the saved artifacts and information + This command is intended for API use only by sandbox orchestration scripts to implement + a save and restore workflow + :param ResourceCommandContext context: the context object containing resource and reservation info + :param CancellationContext cancellation_context: Object to signal a request for cancellation. Must be enabled in drivermetadata.xml as well + :param str mode: Snapshot save mode, can be one of two values 'shallow' (default) or 'deep' + :param str custom_params: Set of custom parameters for the save operation + :return: SavedResults serialized as JSON + :rtype: OrchestrationSaveResult + """ + + # See below an example implementation, here we use jsonpickle for serialization, + # to use this sample, you'll need to add jsonpickle to your requirements.txt file + # The JSON schema is defined at: + # https://github.com/QualiSystems/sandbox_orchestration_standard/blob/master/save%20%26%20restore/saved_artifact_info.schema.json + # You can find more information and examples examples in the spec document at + # https://github.com/QualiSystems/sandbox_orchestration_standard/blob/master/save%20%26%20restore/save%20%26%20restore%20standard.md + ''' + # By convention, all dates should be UTC + created_date = datetime.datetime.utcnow() + + # This can be any unique identifier which can later be used to retrieve the artifact + # such as filepath etc. + + # By convention, all dates should be UTC + created_date = datetime.datetime.utcnow() + + # This can be any unique identifier which can later be used to retrieve the artifact + # such as filepath etc. + identifier = created_date.strftime('%y_%m_%d %H_%M_%S_%f') + + orchestration_saved_artifact = OrchestrationSavedArtifact('REPLACE_WITH_ARTIFACT_TYPE', identifier) + + saved_artifacts_info = OrchestrationSavedArtifactInfo( + resource_name="some_resource", + created_date=created_date, + restore_rules=OrchestrationRestoreRules(requires_same_resource=True), + saved_artifact=orchestration_saved_artifact) + + return OrchestrationSaveResult(saved_artifacts_info) + ''' + pass + + def orchestration_restore(self, context, cancellation_context, saved_artifact_info, custom_params): + """ + Restores a saved artifact previously saved by this Shell driver using the orchestration_save function + :param ResourceCommandContext context: The context object for the command with resource and reservation info + :param CancellationContext cancellation_context: Object to signal a request for cancellation. Must be enabled in drivermetadata.xml as well + :param str saved_artifact_info: A JSON string representing the state to restore including saved artifacts and info + :param str custom_params: Set of custom parameters for the restore operation + :return: None + """ + ''' + # The saved_details JSON will be defined according to the JSON Schema and is the same object returned via the + # orchestration save function. + # Example input: + # { + # "saved_artifact": { + # "artifact_type": "REPLACE_WITH_ARTIFACT_TYPE", + # "identifier": "16_08_09 11_21_35_657000" + # }, + # "resource_name": "some_resource", + # "restore_rules": { + # "requires_same_resource": true + # }, + # "created_date": "2016-08-09T11:21:35.657000" + # } + + # The example code below just parses and prints the saved artifact identifier + saved_details_object = json.loads(saved_details) + return saved_details_object[u'saved_artifact'][u'identifier'] + ''' + pass + + def example_command(self, context): + """ + this is my example command + :param ResourceCommandContext context + :return: str + """ + resource = LanforgeResource.create_from_context(context) + msg = "My resource: " + resource.name + msg += ", at address: " + context.resource.address + return msg + + def create_wanlink(self, context, name, latency, rate): + resource = LanforgeResource.create_from_context(context) + terminal_ip = context.resource.address + terminal_user = context.resource.attributes["{}User".format(shell_name)] = "lanforge" + terminal_pass = context.resource.attributes["{}Password".format(shell_name)] = "lanforge" + + print("Initializing SSH connection to {ip}, with user {user} and password {password}".format(ip=terminal_ip, user=terminal_user, password=terminal_pass)) + s = paramiko.SSHClient() + s.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + s.connect(hostname=terminal_ip, username=terminal_user, password=terminal_pass) + + command = "/home/lanforge/lanforge-scripts/py-json/create_wanlink.py --host {host} --port_A {port_A} --port_B {port_B} --name \"{name}\" --latency \"{latency}\" --latency_A \"{latency_A}\" --latency_B \"{latency_B}\" --rate {rate} --rate_A {rate_A} --rate_B {rate_B} --jitter {jitter} --jitter_A {jitter_A} --jitter_B {jitter_B} --jitter_freq_A {jitter_freq_A} --jitter_freq_B {jitter_freq_B} --drop_A {drop_A} --drop_B {drop_B}".format( + host="localhost", + port_A="eth1", + port_B="eth2", + name=name, + latency=latency, + latency_A=latency, + latency_B=latency, + rate=rate, + rate_A=rate, + rate_B=rate, + jitter="0", + jitter_A="0", + jitter_B="0", + jitter_freq_A="0", + jitter_freq_B="0", + drop_A="0", + drop_B="0" + ) + + (stdin, stdout, stderr) = s.exec_command(command) + output = '' + errors = '' + for line in stdout.readlines(): + output += line + for line in stderr.readlines(): + errors += line + print(errors) + # if errors != '': + print(errors) + # else: + print(output) + s.close() + + # print(args) + # command = "./lanforge-scripts/py-json/create_wanlink.py --host \"{host}\" --name my_wanlink4 --latency \"{latency}\" --rate \"{rate}\"".format( + # host = context.resource.address, + # name=args['name'], + # latency=args['latency'], + # rate=args['rate'] + # ) + # print("running:[{}]".format(command)) + # process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) + # outs, errs = process.communicate() + # print(outs) + # print(errs) + + def create_l3(self, context, name, min_rate_a, min_rate_b, endp_a, endp_b): + # api_session = CloudShellSessionContext(context) + resource = LanforgeResource.create_from_context(context) + args = { + "host": context.resource.address, + "name_prefix": name, + "min_rate_a": min_rate_a, + "min_rate_b": min_rate_b, + "endp_a": endp_a, + "endp_b": endp_b + } + # ip_var_test = CreateL3( + # host=context.resource.address, + # name_prefix=name, + # endp_a=[endp_a], + # endp_b=endp_b, + # min_rate_a=min_rate_a, + # min_rate_b=min_rate_b + # ) + + print(args) + terminal_ip = context.resource.address + terminal_user = context.resource.attributes["{}.User".format(shell_name)] = "lanforge" + terminal_pass = context.resource.attributes["{}.Password".format(shell_name)] = "lanforge" + + print("Initializing SSH connection to {ip}, with user {user} and password {password}".format(ip=terminal_ip, user=terminal_user, password=terminal_pass)) + s = paramiko.SSHClient() + s.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + s.connect(hostname=terminal_ip, username=terminal_user, password=terminal_pass) + + command = "/home/lanforge/lanforge-scripts/py-scripts/create_l3.py --endp_a \"{endp_a}\" --endp_b \"{endp_b}\" --min_rate_a \"{min_rate_a}\" --min_rate_b \"{min_rate_b}\"".format( + endp_a=args['endp_a'], + endp_b=args['endp_b'], + min_rate_a=args['min_rate_a'], + min_rate_b=args['min_rate_b'] + ) + + (stdin, stdout, stderr) = s.exec_command(command) + output = '' + errors = '' + for line in stdout.readlines(): + output += line + for line in stderr.readlines(): + errors += line + print(errors) + if errors != '': + print(errors) + else: + print(output) + s.close() + + # print("running:[{}]".format(command)) + # process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) + # outs, errs = process.communicate() + # print(outs) + # print(errs) + + # num_sta = 2 + # ip_var_test.pre_cleanup() + # ip_var_test.build() + # if not ip_var_test.passes(): + # print(ip_var_test.get_fail_message()) + # ip_var_test.exit_fail() + # print('Created %s stations and connections' % num_sta) + +if __name__ == "__main__": + # setup for mock-debug environment + shell_name = "LanforgeResource" + cancellation_context = mock.create_autospec(CancellationContext) + context = mock.create_autospec(ResourceCommandContext) + context.resource = mock.MagicMock() + context.reservation = mock.MagicMock() + context.connectivity = mock.MagicMock() + context.reservation.reservation_id = "" + context.resource.address = "192.168.100.176" + context.resource.name = "Lanforge_Resource" + context.resource.attributes = dict() + context.resource.attributes["{}.User".format(shell_name)] = "lanforge" + context.resource.attributes["{}.Password".format(shell_name)] = "lanforge" + context.resource.attributes["{}.SNMP Read Community".format(shell_name)] = "" + + # add information for api connectivity + context.reservation.domain = "Global" + context.connectivity.server_address = "192.168.100.131" + driver = LanforgeResourceDriver() + # print driver.run_custom_command(context, custom_command="sh run", cancellation_context=cancellation_context) + # result = driver.example_command_with_api(context) + + driver.create_l3(context, "my_fire", "69000", "41000", "eth1", "eth2") + driver.create_wanlink(context, name="my_wanlin", latency="49", rate="6000") + print("done") diff --git a/Quali/lanforge_resource/src/drivermetadata.xml b/Quali/lanforge_resource/src/drivermetadata.xml new file mode 100644 index 00000000..59cbeb1c --- /dev/null +++ b/Quali/lanforge_resource/src/drivermetadata.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Quali/lanforge_resource/src/importlib b/Quali/lanforge_resource/src/importlib new file mode 100644 index 00000000..e69de29b diff --git a/Quali/lanforge_resource/src/requirements.txt b/Quali/lanforge_resource/src/requirements.txt new file mode 100644 index 00000000..8c1ba7fe --- /dev/null +++ b/Quali/lanforge_resource/src/requirements.txt @@ -0,0 +1,25 @@ +mock +cloudshell-shell-core>=5.0.3,<6.0.0 +cloudshell-automation-api +pandas +plotly +numpy==1.16.6 +cryptography +paramiko +bokeh +streamlit==0.62.0 +cython +pyarrow==4.0.0 +websocket-client +xlsxwriter +pyshark +influxdb +influxdb-client +matplotlib +pdfkit +pip-search +pyserial +pexpect-serial +scp +dash +kaleido diff --git a/Quali/lanforge_resource/src/sys b/Quali/lanforge_resource/src/sys new file mode 100644 index 00000000..e69de29b diff --git a/Quali/lanforge_resource/test_requirements.txt b/Quali/lanforge_resource/test_requirements.txt new file mode 100644 index 00000000..7d963ba7 --- /dev/null +++ b/Quali/lanforge_resource/test_requirements.txt @@ -0,0 +1,7 @@ +nose +coverage +unittest2 +mock +teamcity-messages +jsonpickle +nose-exclude \ No newline at end of file diff --git a/Quali/lanforge_resource/tests/__init__.py b/Quali/lanforge_resource/tests/__init__.py new file mode 100644 index 00000000..40a96afc --- /dev/null +++ b/Quali/lanforge_resource/tests/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/Quali/lanforge_resource/tests/test_lanforge-resource.py b/Quali/lanforge_resource/tests/test_lanforge-resource.py new file mode 100644 index 00000000..de11d725 --- /dev/null +++ b/Quali/lanforge_resource/tests/test_lanforge-resource.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +Tests for `LanforgeResourceDriver` +""" + +import unittest + +from driver import LanforgeResourceDriver + + +class TestLanforgeResourceDriver(unittest.TestCase): + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_000_something(self): + pass + + +if __name__ == '__main__': + import sys + sys.exit(unittest.main()) From 3a81ad91307c6105114deae85816bf2c5c68923f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 14:50:39 -0600 Subject: [PATCH 090/731] ct_X_tests.json updated the chamberview scenarios Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 30 +++++++-------- py-scripts/tools/ct_us_002_tests.json | 28 +++++++------- py-scripts/tools/ct_us_003_tests.json | 54 +++++++++++++-------------- py-scripts/tools/ct_us_004_tests.json | 30 +++++++-------- 4 files changed, 71 insertions(+), 71 deletions(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index c48c049f..0e213864 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -76,7 +76,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name wc_m57915e", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name mt7915e_wc", " --upstream UPSTREAM_PORT --batch_size 1,10,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", " --test_rig TEST_RIG", @@ -114,7 +114,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name mt7915e_dp", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan7", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -164,7 +164,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-001-scenario ", + " --create_scenario ATH10K(9984)_wc ", " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] @@ -177,7 +177,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name wc_ATH10K", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_wc", " --upstream 1.1.eth2 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", " --test_rig TEST_RIG ", @@ -216,7 +216,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_dp", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -245,7 +245,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-001-AX210-scenario ", + " --create_scenario AX210_wc ", " --raw_line \"profile_link 1.1 STA-AX 1 'DUT: DUT_NAME Radio-2' NA wiphy3,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\" " ] @@ -258,7 +258,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name AX210_wc", " --upstream 1.1.eth2 --batch_size 1 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --stations 1.1.wlan3 --test_tag 'AX210'", " --test_rig TEST_RIG", @@ -296,7 +296,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name AX210_dp", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan3", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -325,7 +325,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-001-mt7915e-scenario ", + " --create_scenario mt7915e_wc ", " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] @@ -338,7 +338,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name mt7915e_wc", " --upstream 1.1.eth2 --batch_size 1,5,10,15,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", " --test_rig TEST_RIG", @@ -376,7 +376,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name mt7915e_dp", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan7", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -404,7 +404,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ap-script ", + " --create_scenario ap_auto ", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " @@ -418,7 +418,7 @@ "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", - " --instance_name ap-auto-instance --config_name test_con --upstream eth2", + " --instance_name ap_auto --config_name test_con --upstream eth2", " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", @@ -466,7 +466,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ap-script", + " --create_scenario ap_auto", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " @@ -480,7 +480,7 @@ "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", - " --instance_name ap-auto-instance --config_name test_con --upstream eth2", + " --instance_name ap_auto --config_name test_con --upstream eth2", " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 62f362e5..6a4af1ad 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -51,7 +51,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ucentral-scenario ", + " --create_scenario ap_auto ", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy4,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " @@ -64,7 +64,7 @@ "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS", - " --instance_name ap-auto-instance --config_name test_con --upstream UPSTREAM_PORT", + " --instance_name ap_auto --config_name test_con --upstream UPSTREAM_PORT", " --dut5_0 'DUT_NAME lanforge BSSID (1)' --dut2_0 'DUT_NAME lanforge BSSID (1)'", " --max_stations_2 32 --max_stations_5 32 --max_stations_dual 100 --radio2 1.1.wiphy1", " --radio5 1.1.wiphy2 --set 'Basic Client Connectivity' 1", @@ -116,7 +116,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name wct_ath10k", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name ATH10K(9984)_wc", " --upstream UPSTREAM_PORT --batch_size 1,5,15 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", " --test_rig TEST_RIG", @@ -134,14 +134,14 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "create_chamberview_ATH10k(9984)_dp":{ + "create_chamberview_ATH10K(9984)_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10k(9984)_dp", + " --create_scenario ATH10K(9984)_dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] @@ -152,7 +152,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name cicd_dpt_ATH10k", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name ATH10K(9984)_dp", " --config_name test_con --upstream UPSTREAM_PORT --dut DUT_NAME --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -191,7 +191,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name cicd-ax200", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name AX200_wc", " --upstream UPSTREAM_PORT --batch_size 1 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --stations 1.1.wlan4 --test_tag 'ATH10K(9984)' ", " --set DUT_SET_NAME" @@ -226,7 +226,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name cicd_dpt_AX210", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name AX200_dp", " --config_name test_con --upstream UPSTREAM_PORT --dut DUT_NAME --duration 30s --station 1.1.wlan4", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -266,18 +266,18 @@ "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", - " --instance_name ap-auto-instance --config_name test_con --upstream eth2", + " --instance_name ap_auto --config_name test_con --upstream eth2", " --dut5_0 'DUT_NAME lanforge BSSID (2)' --dut2_0 'DUT_NAME lanforge BSSID (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy0 --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", " --set 'Basic Client Connectivity' 1", - " --set 'Multi Band Performance' 1", - " --set 'Stability' 1", + " --set 'Multi Band Performance' 0", + " --set 'Stability' 0", " --set 'Multi-Station Throughput vs Pkt Size' 0,", - " --set 'Throughput vs Pkt Size' 1", - " --set 'Capacity' 1", - " --set 'Band-Steering' 1", + " --set 'Throughput vs Pkt Size' 0", + " --set 'Capacity' 0", + " --set 'Band-Steering' 0", " --set 'Skip 2.4 Ghz Tests' 0", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", " --test_rig TEST_RIG", diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index 20c6521d..e8061af9 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -76,14 +76,14 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name wc_m57915e", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name mt7915e_wc", " --upstream UPSTREAM_PORT --batch_size 1,10,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] }, - "create_chamberview_dut_for_mt7915e_dp":{ + "create_chamberview_dut_mt7915e_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -102,7 +102,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-003-mt7915e-scenario ", + " --create_scenario mt7915e_dp ", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] @@ -114,7 +114,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name mt7915e_dp", " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan7", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -168,7 +168,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name wc_ATH10K", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_wc", " --upstream 1.1.eth1 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", " --test_rig TEST_RIG ", @@ -207,7 +207,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_dp", " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -248,7 +248,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name AX210_wc", " --upstream 1.1.eth1 --batch_size 1 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --stations 1.1.wlan3 --test_tag 'AX210'", " --test_rig TEST_RIG", @@ -286,7 +286,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name AX210_dp", " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan3", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -328,7 +328,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct-mt7915e", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name mt7915e_wc", " --upstream 1.1.eth1 --batch_size 1,5,10,15,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", " --test_rig TEST_RIG", @@ -366,7 +366,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt-mt7915e", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name mt7915e_dp", " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan7", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -377,7 +377,7 @@ ] }, "create_chamberview_dut_ap":{ - "enabled":"FALSE", + "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", "args":"", @@ -388,38 +388,38 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, "create_chamberview_ap":{ - "enabled":"FALSE", + "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ap-script ", + " --create_scenario ap_auto ", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " ] }, "ap_auto": { - "enabled": "FALSE", + "enabled": "TRUE", "command": "lf_ap_auto_test.py", "timeout":"25200", "iterations":"1", "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", - " --instance_name ap-auto-instance --config_name test_con --upstream eth2", + " --instance_name ap_auto --config_name test_con --upstream eth2", " --dut5_0 'DUT_NAME lanforge BSSID (2)' --dut2_0 'DUT_NAME lanforge BSSID (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", " --set 'Basic Client Connectivity' 1", - " --set 'Multi Band Performance' 1", - " --set 'Stability' 1", + " --set 'Multi Band Performance' 0", + " --set 'Stability' 0", " --set 'Multi-Station Throughput vs Pkt Size' 0,", - " --set 'Throughput vs Pkt Size' 1", - " --set 'Capacity' 1", - " --set 'Band-Steering' 1", + " --set 'Throughput vs Pkt Size' 0", + " --set 'Capacity' 0", + " --set 'Band-Steering' 0", " --set 'Skip 2.4 Ghz Tests' 0", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", " --test_rig TEST_RIG", @@ -456,7 +456,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ap-script", + " --create_scenario ap_auto", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " @@ -470,19 +470,19 @@ "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", - " --instance_name ap-auto-instance --config_name test_con --upstream eth2", + " --instance_name ap_auto --config_name test_con --upstream eth2", " --dut5_0 'DUT_NAME lanforge BSSID (2)' --dut2_0 'DUT_NAME lanforge BSSID (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", " --set 'Basic Client Connectivity' 1", " --set 'Multi Band Performance' 1", - " --set 'Stability' 0", + " --set 'Stability' 1", " --set 'Multi-Station Throughput vs Pkt Size' 0,", - " --set 'Throughput vs Pkt Size' 0", - " --set 'Capacity' 0", - " --set 'Band-Steering' 0", - " --set 'Skip 2.4 Ghz Tests' 1", + " --set 'Throughput vs Pkt Size' 1", + " --set 'Capacity' 1", + " --set 'Band-Steering' 1", + " --set 'Skip 2.4 Ghz Tests' 0", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", " --test_rig TEST_RIG", " --set DUT_SET_NAME" diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index af7ed350..03248c5c 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -76,7 +76,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name wc_m57915e", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name mt7915e_wc", " --upstream UPSTREAM_PORT --batch_size 1,10,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", " --test_rig TEST_RIG", @@ -114,7 +114,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name mt7915e_dp", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan7", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -164,7 +164,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-001-scenario ", + " --create_scenario ATH10K(9984)_wc ", " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] @@ -177,7 +177,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name wc_ATH10K", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_wc", " --upstream 1.1.eth2 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", " --test_rig TEST_RIG ", @@ -216,7 +216,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_dp", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -245,7 +245,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-001-AX210-scenario ", + " --create_scenario AX210_wc ", " --raw_line \"profile_link 1.1 STA-AX 1 'DUT: DUT_NAME Radio-2' NA wiphy3,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\" " ] @@ -258,7 +258,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH210_wc", " --upstream 1.1.eth2 --batch_size 1 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --stations 1.1.wlan3 --test_tag 'AX210'", " --test_rig TEST_RIG", @@ -296,7 +296,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name AX210_dp", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan3", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -325,7 +325,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ct-us-001-mt7915e-scenario ", + " --create_scenario m7915e_wc ", " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] @@ -338,7 +338,7 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name mt7915e_wc", " --upstream 1.1.eth2 --batch_size 1,5,10,15,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", " --test_rig TEST_RIG", @@ -376,7 +376,7 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name mt7915e_dp", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan7", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", @@ -404,7 +404,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ap-script ", + " --create_scenario ap_auto ", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " @@ -418,7 +418,7 @@ "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", - " --instance_name ap-auto-instance --config_name test_con --upstream eth2", + " --instance_name ap_auto --config_name test_con --upstream eth2", " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", @@ -466,7 +466,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ap-script", + " --create_scenario ap_auto", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " @@ -480,7 +480,7 @@ "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", - " --instance_name ap-auto-instance --config_name test_con --upstream eth2", + " --instance_name ap_auto --config_name test_con --upstream eth2", " --dut5_0 'DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'DUT_NAME lanforge DUT_BSSID_2G (1)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", From 57d4006b45e048e0212b96adca1d97aa9bdedc9c Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 15:15:21 -0600 Subject: [PATCH 091/731] ct_us tests.json default ap_auto in test suite to only basic connect. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 20 ++++++++++---------- py-scripts/tools/ct_us_004_tests.json | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 0e213864..45c49099 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -424,12 +424,12 @@ " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", " --set 'Basic Client Connectivity' 1", - " --set 'Multi Band Performance' 1", - " --set 'Stability' 1", + " --set 'Multi Band Performance' 0", + " --set 'Stability' 0", " --set 'Multi-Station Throughput vs Pkt Size' 0,", - " --set 'Throughput vs Pkt Size' 1", - " --set 'Capacity' 1", - " --set 'Band-Steering' 1", + " --set 'Throughput vs Pkt Size' 0", + " --set 'Capacity' 0", + " --set 'Band-Steering' 0", " --set 'Skip 2.4 Ghz Tests' 0", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", " --test_rig TEST_RIG", @@ -487,12 +487,12 @@ " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", " --set 'Basic Client Connectivity' 1", " --set 'Multi Band Performance' 1", - " --set 'Stability' 0", + " --set 'Stability' 1", " --set 'Multi-Station Throughput vs Pkt Size' 0,", - " --set 'Throughput vs Pkt Size' 0", - " --set 'Capacity' 0", - " --set 'Band-Steering' 0", - " --set 'Skip 2.4 Ghz Tests' 1", + " --set 'Throughput vs Pkt Size' 1", + " --set 'Capacity' 1", + " --set 'Band-Steering' 1", + " --set 'Skip 2.4 Ghz Tests' 0", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", " --test_rig TEST_RIG", " --set DUT_SET_NAME" diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index 03248c5c..aa4afd13 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -424,12 +424,12 @@ " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", " --set 'Basic Client Connectivity' 1", - " --set 'Multi Band Performance' 1", - " --set 'Stability' 1", + " --set 'Multi Band Performance' 0", + " --set 'Stability' 0", " --set 'Multi-Station Throughput vs Pkt Size' 0,", - " --set 'Throughput vs Pkt Size' 1", - " --set 'Capacity' 1", - " --set 'Band-Steering' 1", + " --set 'Throughput vs Pkt Size' 0", + " --set 'Capacity' 0", + " --set 'Band-Steering' 0", " --set 'Skip 2.4 Ghz Tests' 0", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", " --test_rig TEST_RIG", @@ -487,12 +487,12 @@ " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", " --set 'Basic Client Connectivity' 1", " --set 'Multi Band Performance' 1", - " --set 'Stability' 0", + " --set 'Stability' 1", " --set 'Multi-Station Throughput vs Pkt Size' 0,", - " --set 'Throughput vs Pkt Size' 0", - " --set 'Capacity' 0", - " --set 'Band-Steering' 0", - " --set 'Skip 2.4 Ghz Tests' 1", + " --set 'Throughput vs Pkt Size' 1", + " --set 'Capacity' 1", + " --set 'Band-Steering' 1", + " --set 'Skip 2.4 Ghz Tests' 0", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", " --test_rig TEST_RIG", " --set DUT_SET_NAME" From 9e57b2ef199cce6fa565d3f6f361624f391344ff Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 15:28:17 -0600 Subject: [PATCH 092/731] lf_check.py : added 15 second sleep after loading a lanforge db Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index f987a420..3eb0d3c7 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -610,8 +610,11 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) out, err = process.communicate() errcode = process.returncode print("load_FACTORY_DFLT_database errcode: {errcode}".format(errcode=errcode)) + # DO NOT REMOVE 15 second sleep. + # After every DB load, the loed changes are applied, and part of the apply is to re-build + # The underlying netsmith objects + sleep(15) - # not currently used def load_BLANK_database(self): try: os.chdir(self.scripts_wd) @@ -626,7 +629,10 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) out, err = process.communicate() errcode = process.returncode print("load_BLANK_database errcode: {errcode}".format(errcode=errcode)) - + # DO NOT REMOVE 15 second sleep. + # After every DB load, the loed changes are applied, and part of the apply is to re-build + # The underlying netsmith objects + sleep(15) def load_custom_database(self, custom_db): try: @@ -642,6 +648,10 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) out, err = process.communicate() errcode = process.returncode print("load_custome_database errcode: {errcode}".format(errcode=errcode)) + # DO NOT REMOVE 15 second sleep. + # After every DB load, the loed changes are applied, and part of the apply is to re-build + # The underlying netsmith objects + sleep(15) def run_script_test(self): self.start_html_results() @@ -765,25 +775,19 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.logger.info("no load_db present in dictionary, load db normally") if self.use_factory_default_db == "TRUE": self.load_FACTORY_DFLT_database() - sleep(3) self.logger.info("FACTORY_DFLT loaded between tests with scenario.py --load FACTORY_DFLT") if self.use_blank_db == "TRUE": self.load_BLANK_database() - sleep(1) self.logger.info("BLANK loaded between tests with scenario.py --load BLANK") if self.use_custom_db == "TRUE": try: self.load_custom_database(self.custom_db) - sleep(1) - self.logger.info("{} loaded between tests with scenario.py --load {}".format(self.custom_db, - self.custom_db)) + self.logger.info("{} loaded between tests with scenario.py --load {}".format(self.custom_db,self.custom_db)) except: - self.logger.info("custom database failed to load check existance and location: {}".format( - self.custom_db)) + self.logger.info("custom database failed to load check existance and location: {}".format(self.custom_db)) else: self.logger.info("no db loaded between tests: {}".format(self.use_custom_db)) - sleep(1) # DO NOT REMOVE the sleep is to allow for the database to stablize try: os.chdir(self.scripts_wd) # self.logger.info("Current Working Directory {}".format(os.getcwd())) From b60ae7985c7e5987d13a8ae2e1aece1028e27a0f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 16:13:10 -0600 Subject: [PATCH 093/731] lf_check.py add lanforge GUI version back to the meta data to be used for test tag update scenerio naming Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 24 ++++++++++++------------ py-scripts/tools/ct_us_002_tests.json | 26 +++++++++++++------------- py-scripts/tools/ct_us_003_tests.json | 24 ++++++++++++------------ py-scripts/tools/ct_us_004_tests.json | 24 ++++++++++++------------ py-scripts/tools/lf_check.py | 8 ++++++-- 5 files changed, 55 insertions(+), 51 deletions(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 45c49099..9955fcbf 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -145,7 +145,7 @@ " " ] }, - "create_chamberview_dut_ATH10K(9984)_wc":{ + "create_chamberview_dut_ATH10K_9984__wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -157,19 +157,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "create_chamberview_ATH10K(9984)_wc":{ + "create_chamberview_ATH10K_9984__wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K(9984)_wc ", + " --create_scenario ATH10K_9984__wc ", " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "wifi_capacity_ATH10K(9984)":{ + "wifi_capacity_ATH10K_9984_":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -177,14 +177,14 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_wc", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__wc", " --upstream 1.1.eth2 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_'", " --test_rig TEST_RIG ", " --set DUT_SET_NAME" ] }, - "create_chamberview_dut_ATH10K(9984)_dp":{ + "create_chamberview_dut_ATH10K_9984__dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -196,19 +196,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "create_chamberview_ATH10K(9984)_dp":{ + "create_chamberview_ATH10K_9984__dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K(9984)_dp", + " --create_scenario ATH10K_9984__dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "dataplane_ATH10K(9984)":{ + "dataplane_ATH10K_9984_":{ "enabled":"TRUE", "load_db":"skip", "timeout":"600", @@ -216,12 +216,12 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_dp", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__dp", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", - " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)' ", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_' ", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 6a4af1ad..5f624a9c 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -86,7 +86,7 @@ } }, "suite_wc_dp":{ - "create_chamberview_dut_ATH10k(9984)":{ + "create_chamberview_dut_ATH10K_9984_":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -97,33 +97,33 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "create_chamberview_ATH10k(9984)":{ + "create_chamberview_ATH10K_9984_":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K(9984)_wc", + " --create_scenario ATH10K_9984__wc", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, - "wifi_capacity_ATH10k(9984)":{ + "wifi_capacity_ATH10K_9984_":{ "enabled":"TRUE", "load_db":"skip", "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name ATH10K(9984)_wc", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name ATH10K_9984__wc", " --upstream UPSTREAM_PORT --batch_size 1,5,15 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_'", " --test_rig TEST_RIG", " --set DUT_SET_NAME " ] }, - "create_chamberview_dut_ATH10K(9984)_dp":{ + "create_chamberview_dut_ATH10K_9984__dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -134,30 +134,30 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "create_chamberview_ATH10K(9984)_dp":{ + "create_chamberview_ATH10K_9984__dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K(9984)_dp", + " --create_scenario ATH10K_9984__dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, - "dataplane_ATH10k(9984)":{ + "dataplane_ATH10K_9984_":{ "enabled":"TRUE", "load_db":"skip", "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name ATH10K(9984)_dp", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name ATH10K_9984__dp", " --config_name test_con --upstream UPSTREAM_PORT --dut DUT_NAME --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' ", - " --raw_line 'spatial_streams: 4' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)' ", + " --raw_line 'spatial_streams: 4' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_' ", " --set DUT_SET_NAME" ] }, @@ -193,7 +193,7 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name AX200_wc", " --upstream UPSTREAM_PORT --batch_size 1 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --stations 1.1.wlan4 --test_tag 'ATH10K(9984)' ", + " --pull_report --local_lf_report_dir REPORT_PATH --stations 1.1.wlan4 --test_tag 'ATH10K_9984_' ", " --set DUT_SET_NAME" ] }, diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index e8061af9..1e9040bd 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -136,7 +136,7 @@ } }, "suite_wc_dp_ap":{ - "create_chamberview_dut_ATH10K(9984)_wc":{ + "create_chamberview_dut_ATH10K_9984__wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -148,19 +148,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "create_chamberview_ATH10K(9984)_wc":{ + "create_chamberview_ATH10K_9984__wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K(9984)_wc ", + " --create_scenario ATH10K_9984__wc ", " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "wifi_capacity_ATH10K(9984)":{ + "wifi_capacity_ATH10K_9984_":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -168,14 +168,14 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_wc", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__wc", " --upstream 1.1.eth1 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_'", " --test_rig TEST_RIG ", " --set DUT_SET_NAME" ] }, - "create_chamberview_dut_ATH10K(9984)_dp":{ + "create_chamberview_dut_ATH10K_9984__dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -187,19 +187,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "create_chamberview_ATH10K(9984)_dp":{ + "create_chamberview_ATH10K_9984__dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K(9984)_dp", + " --create_scenario ATH10K_9984__dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "dataplane_ATH10K(9984)":{ + "dataplane_ATH10K_9984_":{ "enabled":"TRUE", "load_db":"skip", "timeout":"600", @@ -207,12 +207,12 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_dp", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__dp", " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", - " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)' ", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_' ", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index aa4afd13..534293d9 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -145,7 +145,7 @@ " " ] }, - "create_chamberview_dut_ATH10K(9984)_wc":{ + "create_chamberview_dut_ATH10K_9984__wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -157,19 +157,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "create_chamberview_ATH10K(9984)_wc":{ + "create_chamberview_ATH10K_9984__wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K(9984)_wc ", + " --create_scenario ATH10K_9984__wc ", " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "wifi_capacity_ATH10K(9984)":{ + "wifi_capacity_ATH10K_9984_":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -177,14 +177,14 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_wc", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__wc", " --upstream 1.1.eth2 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)'", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_'", " --test_rig TEST_RIG ", " --set DUT_SET_NAME" ] }, - "create_chamberview_dut_ATH10K(9984)_dp":{ + "create_chamberview_dut_ATH10K_9984__dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -196,19 +196,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "create_chamberview_ATH10K(9984)_dp":{ + "create_chamberview_ATH10K_9984__dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K(9984)_dp", + " --create_scenario ATH10K_9984__dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "dataplane_ATH10K(9984)":{ + "dataplane_ATH10K_9984_":{ "enabled":"TRUE", "load_db":"skip", "timeout":"600", @@ -216,12 +216,12 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K(9984)_dp", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__dp", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", - " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K(9984)' ", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_' ", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 3eb0d3c7..d28c21e2 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -312,7 +312,8 @@ class lf_check(): for element in self.lanforge_gui_version_full: if "BuildVersion" in element: ver_str = str(element) - self.lanforge_gui_version = ver_str.split(':',maxsplit=1)[-1].replace(',','') + self.lanforge_gui_version = ver_str.split(':',maxsplit=1)[-1].replace(',','') + self.lanforge_gui_version = self.lanforge_gui_version.strip().replace('"','') print("BuildVersion {}".format(self.lanforge_gui_version)) if "BuildDate" in element: gui_str = str(element) @@ -861,6 +862,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) meta_data_fd.write('$ Generated by Candela Technologies LANforge network testing tool\n') meta_data_fd.write('$ meta.txt file location\n') meta_data_fd.write("file {path}\n".format(path=meta_data_path)) + meta_data_fd.write('$ LANforge GUI\n') + meta_data_fd.write('gui_version: {gui_version} \n'.format(gui_version=self.lanforge_gui_version)) meta_data_fd.write('$ LANforge SERVER\n') meta_data_fd.write('server_version: {server_version} \n'.format(server_version=self.lanforge_server_version)) meta_data_fd.write('$ LANforge command\n') @@ -868,12 +871,13 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) # split command at test-tag , at rest of string once at the actual test-tag value test_tag = command.split('test_tag',maxsplit=1)[-1].split(maxsplit=1)[0] test_tag = test_tag.replace("'","") - meta_data_fd.write('$ LANforge test_tag\n') + meta_data_fd.write('$ LANforge test tag\n') meta_data_fd.write("test_tag {test_tag}\n".format(test_tag=test_tag)) # LANforge information is a list thus [0] meta_data_fd.write('$ LANforge Information\n') meta_data_fd.write("lanforge_system_node {lanforge_system_node}\n".format(lanforge_system_node=self.lanforge_system_node_version[0])) meta_data_fd.write("lanforge_kernel_version {lanforge_kernel_version}\n".format(lanforge_kernel_version=self.lanforge_kernel_version[0])) + meta_data_fd.write("lanforge_gui_version_full {lanforge_gui_version_full}\n".format(lanforge_gui_version_full=self.lanforge_gui_version_full[0])) meta_data_fd.write("lanforge_server_version_full {lanforge_server_version_full}\n".format(lanforge_server_version_full=self.lanforge_server_version_full[0])) meta_data_fd.close() From dfcf8c9f9b3c653792a1cde1a1a129d1c99c8862 Mon Sep 17 00:00:00 2001 From: erinnerim Date: Wed, 6 Oct 2021 12:00:24 -0700 Subject: [PATCH 094/731] requirements.txt: only basic requirements, paramiko --- Quali/lanforge_resource/src/requirements.txt | 21 -------------------- 1 file changed, 21 deletions(-) diff --git a/Quali/lanforge_resource/src/requirements.txt b/Quali/lanforge_resource/src/requirements.txt index 8c1ba7fe..18127790 100644 --- a/Quali/lanforge_resource/src/requirements.txt +++ b/Quali/lanforge_resource/src/requirements.txt @@ -1,25 +1,4 @@ mock cloudshell-shell-core>=5.0.3,<6.0.0 cloudshell-automation-api -pandas -plotly -numpy==1.16.6 -cryptography paramiko -bokeh -streamlit==0.62.0 -cython -pyarrow==4.0.0 -websocket-client -xlsxwriter -pyshark -influxdb -influxdb-client -matplotlib -pdfkit -pip-search -pyserial -pexpect-serial -scp -dash -kaleido From dc93792c8597cba3f0b3201f795b85ea72ca09c7 Mon Sep 17 00:00:00 2001 From: erinnerim Date: Wed, 6 Oct 2021 16:40:30 -0700 Subject: [PATCH 095/731] driver.py: function definition for send_command; paramiko update for create_l3 and create_wanlink drivers --- Quali/lanforge_resource/src/driver.py | 159 ++++++++++---------------- py-scripts/create_l3.py | 3 +- 2 files changed, 62 insertions(+), 100 deletions(-) diff --git a/Quali/lanforge_resource/src/driver.py b/Quali/lanforge_resource/src/driver.py index 277dc073..4656bea2 100755 --- a/Quali/lanforge_resource/src/driver.py +++ b/Quali/lanforge_resource/src/driver.py @@ -2,6 +2,9 @@ from cloudshell.shell.core.resource_driver_interface import ResourceDriverInterf from cloudshell.shell.core.driver_context import InitCommandContext, ResourceCommandContext, AutoLoadResource, \ AutoLoadAttribute, AutoLoadDetails, CancellationContext from cloudshell.shell.core.session.cloudshell_session import CloudShellSessionContext +from cloudshell.api.cloudshell_api import CloudShellAPISession +# from cloudshell.shell.core.resource_driver_interface import ResourceDriverInterface +# from cloudshell.shell.core.context import InitCommandContext, ResourceCommandContext import mock from data_model import * # run 'shellfoundry generate' to generate data model classes @@ -146,6 +149,36 @@ class LanforgeResourceDriver (ResourceDriverInterface): return saved_details_object[u'saved_artifact'][u'identifier'] ''' pass + + def send_command(self, context, cmd): + + msg = "" + resource = LanforgeResource.create_from_context(context) + session = CloudShellAPISession(host=context.connectivity.server_address, + token_id=context.connectivity.admin_auth_token, + domain=context.reservation.domain) + resource_model_name = resource.cloudshell_model_name + terminal_ip = context.resource.address + terminal_user = context.resource.attributes[f'{resource_model_name}.User'] + terminal_pass = session.DecryptPassword(context.resource.attributes[f'{resource_model_name}.Password']).Value + + msg += f"Initializing SSH connection to {terminal_ip}, with user {terminal_user} and password {terminal_pass}\n" + s = paramiko.SSHClient() + s.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + s.connect(hostname=terminal_ip, username=terminal_user, password=terminal_pass) + + print(f"running:[{cmd}]") + (stdin, stdout, stderr) = s.exec_command(cmd) + + output = '' + errors = '' + for line in stdout.readlines(): + output += line + for line in stderr.readlines(): + errors += line + msg += output + errors + s.close() + return msg def example_command(self, context): """ @@ -154,22 +187,22 @@ class LanforgeResourceDriver (ResourceDriverInterface): :return: str """ resource = LanforgeResource.create_from_context(context) - msg = "My resource: " + resource.name - msg += ", at address: " + context.resource.address + session = CloudShellAPISession(host=context.connectivity.server_address, + token_id=context.connectivity.admin_auth_token, + domain=context.reservation.domain) + + resource_model_name = resource.cloudshell_model_name + password = session.DecryptPassword(context.resource.attributes[f'{resource_model_name}.Password']).Value + username = context.resource.attributes[f'{resource_model_name}.User'] + + msg = f"My resource {resource.name} at address {context.resource.address} has model name {resource_model_name}. " + msg += f"The username is {username} and password is {password}." return msg - def create_wanlink(self, context, name, latency, rate): - resource = LanforgeResource.create_from_context(context) - terminal_ip = context.resource.address - terminal_user = context.resource.attributes["{}User".format(shell_name)] = "lanforge" - terminal_pass = context.resource.attributes["{}Password".format(shell_name)] = "lanforge" - print("Initializing SSH connection to {ip}, with user {user} and password {password}".format(ip=terminal_ip, user=terminal_user, password=terminal_pass)) - s = paramiko.SSHClient() - s.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - s.connect(hostname=terminal_ip, username=terminal_user, password=terminal_pass) + def create_wanlink(self, context, name, latency, rate): - command = "/home/lanforge/lanforge-scripts/py-json/create_wanlink.py --host {host} --port_A {port_A} --port_B {port_B} --name \"{name}\" --latency \"{latency}\" --latency_A \"{latency_A}\" --latency_B \"{latency_B}\" --rate {rate} --rate_A {rate_A} --rate_B {rate_B} --jitter {jitter} --jitter_A {jitter_A} --jitter_B {jitter_B} --jitter_freq_A {jitter_freq_A} --jitter_freq_B {jitter_freq_B} --drop_A {drop_A} --drop_B {drop_B}".format( + cmd = "/home/lanforge/lanforge-scripts/py-json/create_wanlink.py --host {host} --port_A {port_A} --port_B {port_B} --name \"{name}\" --latency \"{latency}\" --latency_A \"{latency_A}\" --latency_B \"{latency_B}\" --rate {rate} --rate_A {rate_A} --rate_B {rate_B} --jitter {jitter} --jitter_A {jitter_A} --jitter_B {jitter_B} --jitter_freq_A {jitter_freq_A} --jitter_freq_B {jitter_freq_B} --drop_A {drop_A} --drop_B {drop_B}".format( host="localhost", port_A="eth1", port_B="eth2", @@ -189,97 +222,27 @@ class LanforgeResourceDriver (ResourceDriverInterface): drop_B="0" ) - (stdin, stdout, stderr) = s.exec_command(command) - output = '' - errors = '' - for line in stdout.readlines(): - output += line - for line in stderr.readlines(): - errors += line - print(errors) - # if errors != '': - print(errors) - # else: + output = self.send_command(context, cmd) print(output) - s.close() - - # print(args) - # command = "./lanforge-scripts/py-json/create_wanlink.py --host \"{host}\" --name my_wanlink4 --latency \"{latency}\" --rate \"{rate}\"".format( - # host = context.resource.address, - # name=args['name'], - # latency=args['latency'], - # rate=args['rate'] - # ) - # print("running:[{}]".format(command)) - # process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) - # outs, errs = process.communicate() - # print(outs) - # print(errs) - + return output + def create_l3(self, context, name, min_rate_a, min_rate_b, endp_a, endp_b): - # api_session = CloudShellSessionContext(context) - resource = LanforgeResource.create_from_context(context) - args = { - "host": context.resource.address, - "name_prefix": name, - "min_rate_a": min_rate_a, - "min_rate_b": min_rate_b, - "endp_a": endp_a, - "endp_b": endp_b - } - # ip_var_test = CreateL3( - # host=context.resource.address, - # name_prefix=name, - # endp_a=[endp_a], - # endp_b=endp_b, - # min_rate_a=min_rate_a, - # min_rate_b=min_rate_b - # ) - print(args) - terminal_ip = context.resource.address - terminal_user = context.resource.attributes["{}.User".format(shell_name)] = "lanforge" - terminal_pass = context.resource.attributes["{}.Password".format(shell_name)] = "lanforge" + # args = { + # "host": context.resource.address, + # "name_prefix": name, + # "min_rate_a": min_rate_a, + # "min_rate_b": min_rate_b, + # "endp_a": endp_a, + # "endp_b": endp_b + # } - print("Initializing SSH connection to {ip}, with user {user} and password {password}".format(ip=terminal_ip, user=terminal_user, password=terminal_pass)) - s = paramiko.SSHClient() - s.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - s.connect(hostname=terminal_ip, username=terminal_user, password=terminal_pass) - - command = "/home/lanforge/lanforge-scripts/py-scripts/create_l3.py --endp_a \"{endp_a}\" --endp_b \"{endp_b}\" --min_rate_a \"{min_rate_a}\" --min_rate_b \"{min_rate_b}\"".format( - endp_a=args['endp_a'], - endp_b=args['endp_b'], - min_rate_a=args['min_rate_a'], - min_rate_b=args['min_rate_b'] - ) - - (stdin, stdout, stderr) = s.exec_command(command) - output = '' - errors = '' - for line in stdout.readlines(): - output += line - for line in stderr.readlines(): - errors += line - print(errors) - if errors != '': - print(errors) - else: - print(output) - s.close() - - # print("running:[{}]".format(command)) - # process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) - # outs, errs = process.communicate() - # print(outs) - # print(errs) + cmd = f"/home/lanforge/lanforge-scripts/py-scripts/create_l3.py --endp_a \"{endp_a}\" --endp_b \"{endp_b}\" --min_rate_a \"{min_rate_a}\" --min_rate_b \"{min_rate_b}\"" - # num_sta = 2 - # ip_var_test.pre_cleanup() - # ip_var_test.build() - # if not ip_var_test.passes(): - # print(ip_var_test.get_fail_message()) - # ip_var_test.exit_fail() - # print('Created %s stations and connections' % num_sta) + output = self.send_command(context, cmd) + print(output) + return output + if __name__ == "__main__": # setup for mock-debug environment diff --git a/py-scripts/create_l3.py b/py-scripts/create_l3.py index a0289b22..30214636 100755 --- a/py-scripts/create_l3.py +++ b/py-scripts/create_l3.py @@ -16,7 +16,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LANforge = importlib.import_module("py-json.LANforge") @@ -87,7 +86,7 @@ def main(args): mode=args.mode, _debug_on=args.debug) - ip_var_test.pre_cleanup() + # ip_var_test.pre_cleanup() ip_var_test.build() if not ip_var_test.passes(): print(ip_var_test.get_fail_message()) From 83fcde44f7a1852f41306706c078c9892942cb79 Mon Sep 17 00:00:00 2001 From: erinnerim Date: Wed, 6 Oct 2021 16:41:24 -0700 Subject: [PATCH 096/731] drivermetadata.py: change default quali ICE rate --- Quali/lanforge_resource/src/drivermetadata.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Quali/lanforge_resource/src/drivermetadata.xml b/Quali/lanforge_resource/src/drivermetadata.xml index 59cbeb1c..a4b411d9 100644 --- a/Quali/lanforge_resource/src/drivermetadata.xml +++ b/Quali/lanforge_resource/src/drivermetadata.xml @@ -31,7 +31,7 @@ From 14a86b76995aae6fdf95803eb27ec24b97fca7de Mon Sep 17 00:00:00 2001 From: erinnerim Date: Wed, 6 Oct 2021 17:02:30 -0700 Subject: [PATCH 097/731] create_wanlink.py: remove stopping wanlink --- py-json/create_wanlink.py | 56 +++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/py-json/create_wanlink.py b/py-json/create_wanlink.py index d53a1a1d..06618c4c 100755 --- a/py-json/create_wanlink.py +++ b/py-json/create_wanlink.py @@ -197,36 +197,36 @@ def main(args={}): print("Wanlink is running") - # stop wanlink - lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state") - lf_r.addPostData({ - 'test_mgr': 'all', - 'cx_name': args['name'], - 'cx_state': 'STOPPED' - }) - lf_r.jsonPost() - running = 1 - while (running > 0): - sleep(1) - lf_r = LFRequest.LFRequest(base_url+"/wl/"+args['name']+"?fields=name,eid,state,_links") - LFUtils.debug_printer.pprint(json_response) - try: - json_response = lf_r.getAsJson() - if (json_response is None): - continue - for key, value in json_response.items(): - if (isinstance(value, dict)): - if ("_links" in value): - if (value["name"] == args['name']): - if (value["state"].startswith("Stop")): - LFUtils.debug_printer.pprint(json_response) - running = 0 + # # stop wanlink + # lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state") + # lf_r.addPostData({ + # 'test_mgr': 'all', + # 'cx_name': args['name'], + # 'cx_state': 'STOPPED' + # }) + # lf_r.jsonPost() + # running = 1 + # while (running > 0): + # sleep(1) + # lf_r = LFRequest.LFRequest(base_url+"/wl/"+args['name']+"?fields=name,eid,state,_links") + # LFUtils.debug_printer.pprint(json_response) + # try: + # json_response = lf_r.getAsJson() + # if (json_response is None): + # continue + # for key, value in json_response.items(): + # if (isinstance(value, dict)): + # if ("_links" in value): + # if (value["name"] == args['name']): + # if (value["state"].startswith("Stop")): + # LFUtils.debug_printer.pprint(json_response) + # running = 0 - except urllib.error.HTTPError as error: - print("Error code "+error.code) - continue + # except urllib.error.HTTPError as error: + # print("Error code "+error.code) + # continue - print("Wanlink is stopped.") + # print("Wanlink is stopped.") # print("Wanlink info:") # lf_r = LFRequest.LFRequest(base_url+"/wl/wl_eg1") From 02f5876036ed26c68a52a64be8e5124cc2b0aa14 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 6 Oct 2021 22:41:30 -0600 Subject: [PATCH 098/731] ct_us_002_tests.json test name change Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_003_tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index 1e9040bd..420d98fb 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -135,7 +135,7 @@ ] } }, - "suite_wc_dp_ap":{ + "suite_wc_dp":{ "create_chamberview_dut_ATH10K_9984__wc":{ "enabled":"TRUE", "load_db":"skip", From 1fbf6ced05494dcab9226711dfdfbde6db2da23a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 7 Oct 2021 07:44:22 -0600 Subject: [PATCH 099/731] ct_us_X json naming fixes Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_002_tests.json | 20 ++++++++++---------- py-scripts/tools/ct_us_003_tests.json | 24 ++++++++++++------------ py-scripts/tools/ct_us_004_tests.json | 24 ++++++++++++------------ 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 5f624a9c..af7403f3 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -86,7 +86,7 @@ } }, "suite_wc_dp":{ - "create_chamberview_dut_ATH10K_9984_":{ + "create_chamberview_dut_ATH10K_9984":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -97,7 +97,7 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "create_chamberview_ATH10K_9984_":{ + "create_chamberview_ATH10K_9984":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", @@ -110,20 +110,20 @@ " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, - "wifi_capacity_ATH10K_9984_":{ + "wifi_capacity_ATH10K_9984":{ "enabled":"TRUE", "load_db":"skip", "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name ATH10K_9984__wc", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name ATH10K_9984_wc", " --upstream UPSTREAM_PORT --batch_size 1,5,15 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_'", " --test_rig TEST_RIG", " --set DUT_SET_NAME " ] }, - "create_chamberview_dut_ATH10K_9984__dp":{ + "create_chamberview_dut_ATH10K_9984_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -134,19 +134,19 @@ " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ]}, - "create_chamberview_ATH10K_9984__dp":{ + "create_chamberview_ATH10K_9984_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K_9984__dp", + " --create_scenario ATH10K_9984_dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, - "dataplane_ATH10K_9984_":{ + "dataplane_ATH10K_9984":{ "enabled":"TRUE", "load_db":"skip", "command":"lf_dataplane_test.py", @@ -157,7 +157,7 @@ " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' ", - " --raw_line 'spatial_streams: 4' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_' ", + " --raw_line 'spatial_streams: 4' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984' ", " --set DUT_SET_NAME" ] }, @@ -193,7 +193,7 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name AX200_wc", " --upstream UPSTREAM_PORT --batch_size 1 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --stations 1.1.wlan4 --test_tag 'ATH10K_9984_' ", + " --pull_report --local_lf_report_dir REPORT_PATH --stations 1.1.wlan4 --test_tag 'ATH10K_9984' ", " --set DUT_SET_NAME" ] }, diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index 420d98fb..38006885 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -136,7 +136,7 @@ } }, "suite_wc_dp":{ - "create_chamberview_dut_ATH10K_9984__wc":{ + "create_chamberview_dut_ATH10K_9984_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -148,19 +148,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "create_chamberview_ATH10K_9984__wc":{ + "create_chamberview_ATH10K_9984_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K_9984__wc ", + " --create_scenario ATH10K_9984_wc ", " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "wifi_capacity_ATH10K_9984_":{ + "wifi_capacity_ATH10K_9984":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -168,14 +168,14 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__wc", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984_wc", " --upstream 1.1.eth1 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_'", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984'", " --test_rig TEST_RIG ", " --set DUT_SET_NAME" ] }, - "create_chamberview_dut_ATH10K_9984__dp":{ + "create_chamberview_dut_ATH10K_9984_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -187,19 +187,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "create_chamberview_ATH10K_9984__dp":{ + "create_chamberview_ATH10K_9984_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K_9984__dp", + " --create_scenario ATH10K_9984_dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "dataplane_ATH10K_9984_":{ + "dataplane_ATH10K_9984":{ "enabled":"TRUE", "load_db":"skip", "timeout":"600", @@ -207,12 +207,12 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__dp", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984_dp", " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", - " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_' ", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984' ", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index 534293d9..ebd9104d 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -145,7 +145,7 @@ " " ] }, - "create_chamberview_dut_ATH10K_9984__wc":{ + "create_chamberview_dut_ATH10K_9984_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -157,19 +157,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "create_chamberview_ATH10K_9984__wc":{ + "create_chamberview_ATH10K_9984_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K_9984__wc ", + " --create_scenario ATH10K_9984_wc ", " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "wifi_capacity_ATH10K_9984_":{ + "wifi_capacity_ATH10K_9984":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", @@ -177,14 +177,14 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__wc", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984_wc", " --upstream 1.1.eth2 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_'", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984'", " --test_rig TEST_RIG ", " --set DUT_SET_NAME" ] }, - "create_chamberview_dut_ATH10K_9984__dp":{ + "create_chamberview_dut_ATH10K_9984_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -196,19 +196,19 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "create_chamberview_ATH10K_9984__dp":{ + "create_chamberview_ATH10K_9984_dp":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K_9984__dp", + " --create_scenario ATH10K_9984_dp", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "dataplane_ATH10K_9984_":{ + "dataplane_ATH10K_9984":{ "enabled":"TRUE", "load_db":"skip", "timeout":"600", @@ -216,12 +216,12 @@ "command":"lf_dataplane_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__dp", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984_dp", " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", - " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_' ", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984' ", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] From 979895b49fdbae79c45569e575933eeb7da9011e Mon Sep 17 00:00:00 2001 From: erinnerim Date: Wed, 6 Oct 2021 17:59:44 -0700 Subject: [PATCH 100/731] create_l3: start cross-connects once they exist --- Quali/lanforge_resource/src/driver.py | 2 +- py-scripts/create_l3.py | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Quali/lanforge_resource/src/driver.py b/Quali/lanforge_resource/src/driver.py index 4656bea2..5bfd48d0 100755 --- a/Quali/lanforge_resource/src/driver.py +++ b/Quali/lanforge_resource/src/driver.py @@ -237,7 +237,7 @@ class LanforgeResourceDriver (ResourceDriverInterface): # "endp_b": endp_b # } - cmd = f"/home/lanforge/lanforge-scripts/py-scripts/create_l3.py --endp_a \"{endp_a}\" --endp_b \"{endp_b}\" --min_rate_a \"{min_rate_a}\" --min_rate_b \"{min_rate_b}\"" + cmd = f"/home/lanforge/lanforge-scripts/py-scripts/create_l3.py --host \"localhost\" --endp_a \"{endp_a}\" --endp_b \"{endp_b}\" --min_rate_a \"{min_rate_a}\" --min_rate_b \"{min_rate_b}\"" output = self.send_command(context, cmd) print(output) diff --git a/py-scripts/create_l3.py b/py-scripts/create_l3.py index 30214636..f357eaa3 100755 --- a/py-scripts/create_l3.py +++ b/py-scripts/create_l3.py @@ -65,17 +65,16 @@ class CreateL3(Realm): side_a=self.endp_a, side_b=self.endp_b, sleep_time=0) + self.cx_profile.start_cx() self._pass("PASS: Cross-connect build finished") def main(args): - num_sta = 2 - if (args.num_stations is not None) and (int(args.num_stations) > 0): - num_sta = int(args.num_stations) + num_sta = 1 + # if (args.num_stations is not None) and (int(args.num_stations) > 0): + # num_sta = int(args.num_stations) - # station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=int(args.number_template), end_id_=num_sta+int(args.number_template) - 1, padding_number_=10000, - # radio=args.radio) ip_var_test = CreateL3(host=args.mgr, port=args.mgr_port, name_prefix="VT", @@ -91,8 +90,7 @@ def main(args): if not ip_var_test.passes(): print(ip_var_test.get_fail_message()) ip_var_test.exit_fail() - print('Created %s stations and connections' % num_sta) - + print(f'Created {num_sta} stations and connections') if __name__ == "__main__": parser = LFCliBase.create_basic_argparse( From b89145bd97071f351675e72a6d99c389591767f2 Mon Sep 17 00:00:00 2001 From: erinnerim Date: Thu, 7 Oct 2021 08:57:31 -0700 Subject: [PATCH 101/731] create_wanlink.py, create_l3.py: comment out auto-start code --- py-json/create_wanlink.py | 18 +++++++++--------- py-scripts/create_l3.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/py-json/create_wanlink.py b/py-json/create_wanlink.py index 06618c4c..bdc265b5 100755 --- a/py-json/create_wanlink.py +++ b/py-json/create_wanlink.py @@ -165,15 +165,15 @@ def main(args={}): print("Error code "+error.code) continue - print("starting wanlink:") - # print("the latency is {laten}".format(laten=latency)) - lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state") - lf_r.addPostData({ - 'test_mgr': 'all', - 'cx_name': args['name'], - 'cx_state': 'RUNNING' - }) - lf_r.jsonPost() + # print("starting wanlink:") + # # print("the latency is {laten}".format(laten=latency)) + # lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state") + # lf_r.addPostData({ + # 'test_mgr': 'all', + # 'cx_name': args['name'], + # 'cx_state': 'RUNNING' + # }) + # lf_r.jsonPost() running = 0 while (running < 1): diff --git a/py-scripts/create_l3.py b/py-scripts/create_l3.py index f357eaa3..2aecf8cb 100755 --- a/py-scripts/create_l3.py +++ b/py-scripts/create_l3.py @@ -65,7 +65,7 @@ class CreateL3(Realm): side_a=self.endp_a, side_b=self.endp_b, sleep_time=0) - self.cx_profile.start_cx() + # self.cx_profile.start_cx() self._pass("PASS: Cross-connect build finished") From faf6db0ae8db66e98ece21831ea8c18bc16f0833 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 7 Oct 2021 14:21:52 -0600 Subject: [PATCH 102/731] lf_qa.py : Subtest-pass Subtest-fail on placed in the html interactive graph This is not the final place will figure out how to have in own graph. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_qa.py | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 1c9e9065..144dab8a 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -224,6 +224,10 @@ class csv_sql(): # information on sqlite database # https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_sql.html + # sqlite browser: + # Fedora sudo dnf install sqlitebrowser + # Ubuntu sudo apt-get install sqlite3 + # def store(self): print("reading kpi and storing in db {}".format(self.database)) path = Path(self.path) @@ -271,7 +275,7 @@ class csv_sql(): graph_group_list = list(set(graph_group_list)) print("graph_group_list: {}".format(graph_group_list)) - # prior to 5.4.3 there was not test-tag + # prior to 5.4.3 there was not test-tag, the test tag is in the meta data #print("dataframe df3 {df3}".format(df3=df3)) test_tag_list = list(df3['test-tag']) test_tag_list = list(set(test_tag_list)) @@ -287,12 +291,15 @@ class csv_sql(): for group in graph_group_list: df_tmp = df3.loc[(df3['test-rig'] == test_rig) & (df3['Graph-Group'] == str(group)) & (df3['test-tag'] == str(test_tag))] if df_tmp.empty == False: + # Note if graph group is score there is sub tests for pass and fail + # would like a percentage df_tmp = df_tmp.sort_values(by='Date') test_id_list = list(df_tmp['test-id']) kpi_path_list = list(df_tmp['kpi_path']) # get Device Under Test Information , # the set reduces the redundency , list puts it back into a list + # the [0] will get the latest versions for the report self.dut_model_num_list = list(set(list(df_tmp['dut-model-num']))) print("in png self.dut_model_num_list {dut_model_num_list}".format(dut_model_num_list=self.dut_model_num_list)) if self.dut_model_num_list[0] != None: @@ -312,9 +319,23 @@ class csv_sql(): units_list = list(df_tmp['Units']) print("GRAPHING::: test-rig {} test-tag {} Graph-Group {}".format(test_rig,test_tag,group)) - kpi_fig = (px.scatter(df_tmp, x="Date", y="numeric-score", - color="short-description", hover_name="short-description", - size_max=60)).update_traces(mode='lines+markers') + if group == 'Score': + kpi_fig = (px.scatter(df_tmp, x="Date", y="numeric-score", + custom_data=['numeric-score','Subtest-Pass','Subtest-Fail'], + color="short-description", hover_name="short-description", + size_max=60)).update_traces(mode='lines+markers') + + kpi_fig.update_traces( + hovertemplate="
".join([ + "numeric-score: %{customdata[0]}", + "Subtest-Pass: %{customdata[1]}", + "Subtest-Fail: %{customdata[2]}" + ]) + ) + else: + kpi_fig = (px.scatter(df_tmp, x="Date", y="numeric-score", + color="short-description", hover_name="short-description", + size_max=60)).update_traces(mode='lines+markers') kpi_fig.update_layout( title="{} : {} : {} : {}".format(test_id_list[-1], group, test_tag, test_rig), @@ -325,7 +346,7 @@ class csv_sql(): # save the figure - figures will be over written png # for testing png_server_img = '' - #TODO work out when to generate the png files + #generate the png files if self.png: if self.png_generated: pass From c11321dc05e3880655746f4bca210087f1ca5a99 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 8 Oct 2021 12:35:17 -0700 Subject: [PATCH 103/731] Update scenario aNd RegrEs IO n . Py Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 172 ++++++++++++---------------------- py-scripts/scenario.py | 11 ++- 2 files changed, 68 insertions(+), 115 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 9fe96ec4..dd55c00d 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -4,7 +4,7 @@ ########################## Help() { - echo "This bash script aims to automate the test process of all Candela Technologies's test_* scripts in the lanforge-scripts directory. The script can be run 2 ways and may include (via user input) the \"start_num\" and \"stop_num\" variables to select which tests should be run." + echo "This bash script aims to automate the test process of all Candela Technologies test_* scripts in the lanforge-scripts directory. The script can be run 2 ways and may include (via user input) the \"start_num\" and \"stop_num\" variables to select which tests should be run." echo "OPTION ONE: ./regression_test.sh : this command runs all the scripts in the array \"testCommands\"" echo "OPTION TWO: ./regression_test.sh 4 5 : this command runs py-script commands (in testCommands array) that include the py-script options beginning with 4 and 5 (inclusive) in case function ret_case_num." echo "Optional Variables:" @@ -15,11 +15,12 @@ Help() echo "A is used to call to test a specific command based on" echo "F is used to pass in an RC file which can store the credentials for running regression multiple times on your system" echo "H is used to test the help feature of each script, to make sure it renders properly." + echo "L is used to give the IP address of the LANforge device which is under test" echo "Example command: ./regression_test.sh -s SSID -p PASSWD -w SECURITY -m MGR" echo "If using the help flag, put the H flag at the end of the command after other flags." } -while getopts ":h:s:p:w:m:A:r:F:B:U:D:H:" option; do +while getopts ":h:s:p:w:m:A:r:F:B:U:D:L:H:" option; do case "${option}" in h) # display Help Help @@ -56,6 +57,9 @@ while getopts ":h:s:p:w:m:A:r:F:B:U:D:H:" option; do DUT5=${OPTARG} DUT2=${OPTARG} ;; + L) + LANFORGE_DUT=${OPTARG} + ;; H) ./lf_help_check.bash ;; @@ -75,6 +79,11 @@ if [[ ${#RADIO_USED} -eq 0 ]]; then # Allow the user to change the radio they te RADIO_USED="wiphy1" fi + +if [[ ${#MGR} -eq 0 ]]; then # Allow the user to change the radio they test against + MGR="localhost" +fi + if [[ ${#UPSTREAM} -eq 0 ]]; then UPSTREAM="eth1" fi @@ -143,7 +152,12 @@ function testgroup_delete_group() { ./testgroup.py --group_name group1--del_group --debug --mgr "$MGR" } -if [[ $MGRLEN -gt 0 ]]; then +if [[ $MGR == "short" ]]; then + testCommands=( + run_l3_longevity + "./test_ipv4_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format excel --layer3_cols $COL_NAMES --debug --mgr $MGR" + ) +else testCommands=( "./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" "./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug --mgr $MGR" @@ -160,12 +174,11 @@ if [[ $MGRLEN -gt 0 ]]; then "./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./create_vap.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./create_vr.py --mgr $MGR --vr_name 2.vr0 --ports 2.br0,2.vap2 --services 1.br0=dhcp,nat --services 1.vr0=radvd --debug" - #./create_wanlink #./csv_convert #./csv_processor #./csv_to_grafana #./csv_to_influx - "./cv_manager.py --mgr $MGR --scenario FACTORY_DFLT" + #"./cv_manager.py --mgr $MGR --scenario FACTORY_DFLT" #"./cv_to_grafana --mgr $MGR " #"./docstrings.py --mgr $MGR" #"./event_breaker --mgr $MGR" @@ -173,22 +186,19 @@ if [[ $MGRLEN -gt 0 ]]; then "./example_security_connection.py --num_stations $NUM_STA --ssid $SSID_USED \ --passwd $PASSWD_USED --radio 1.1.$RADIO_USED --security wpa2 --debug --mgr $MGR" #./ftp_html.py - #./ghost_profile #./grafana_profile - #./html_template - #./influx - "./layer3_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" + "./layer3_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED" "./layer4_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" "./lf_ap_auto_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ - --dut5_0 \"$DUT5 (2)\" --dut2_0 \"$DUT2 (1)\" --max_stations_2 100 --max_stations_5 100 --max_stations_dual 200 \ - --radio2 1.1.wiphy0 --radio2 1.1.wiphy1 --set \"Basic Client Connectivity\" 1 --set \"Multi Band Performance\" 1 \ - --set \"Skip 2.4Ghz Tests\" 1 --set \"Skip 5Ghz Tests\" 1 --set \"Throughput vs Pkt Size\" 0 --set 'Capacity' 0 \ - --set 'Stability' 0 --set 'Band-Steering' 0 --set \"Multi-Station Throughput vs Pkt Size\" 0 \ - --set \"Long-Term\" 0 --pull_report --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ - --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ - --influx_bucket ben --influx_tag testbed Ferndale-01" - "./lf_atten_mod_test.py -hst $MGR --debug" + --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ + --dut5_0 \"$DUT5 (2)\" --dut2_0 \"$DUT2 (1)\" --max_stations_2 100 --max_stations_5 100 --max_stations_dual 200 \ + --radio2 1.1.wiphy0 --radio2 1.1.wiphy1 --set \"Basic Client Connectivity\" 1 --set \"Multi Band Performance\" 1 \ + --set \"Skip 2.4Ghz Tests\" 1 --set \"Skip 5Ghz Tests\" 1 --set \"Throughput vs Pkt Size\" 0 --set \"Capacity\" 0 \ + --set \"Stability\" 0 --set \"Band-Steering\" 0 --set \"Multi-Station Throughput vs Pkt Size\" 0 \ + --set \"Long-Term\" 0 --pull_report --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ + --influx_bucket ben --influx_tag testbed Ferndale-01" + "./lf_atten_mod_test.py --host $MGR --debug" #./lf_csv #./lf_dataplane_config "./lf_dataplane_test.py --mgr $MGR --lf_user lanforge --lf_password lanforge \ @@ -200,34 +210,31 @@ if [[ $MGRLEN -gt 0 ]]; then --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ --influx_bucket ben \ --influx_tag testbed Ferndale-01" - #./lf_dfs_test - #"./lf_dut_sta_vap_test.py " - #"./lf_ftp.py --mgr $MGR --mgr_port 8080 --upstream_port $UPSTREAM --ssid $SSID --security $SECURITY --passwd $PASSWD_USED \ - # --ap_name WAC505 --ap_ip 192.168.213.90 --bands Both --directions Download --twog_radio wiphy1 --fiveg_radio wiphy0 --file_size 2MB --num_stations 40 --Both_duration 1 --traffic_duration 2 --ssh_port 22_" - #"./lf_ftp.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --bands 5G --direction Download \ - # --file_size 2MB --num_stations 2" + "./lf_dut_sta_vap_test.py --mgr $MGR --dut_host $LANFORGE_DUT --radio $RADIO_USED \ + --num_sta 1 --sta_id 1 --ssid $SSID_USED --security $SECURITY --upstream $UPSTREAM \ + --protocol lf_udp --min_bps 1000 --max_bps 10000 --duration 1" "./lf_graph.py --mgr $MGR" - "./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line 'selected_dut2 RootAP wactest $BSSID'" + "./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line \"selected_dut2 RootAP wactest $BSSID\"" #"./lf_multipsk.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --debug" "./lf_report.py" "./lf_report_test.py" "./lf_rvr_test.py" "./lf_rx_sensitivity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name rx-sensitivity-instance --config_name test_con --upstream 1.1.eth2 \ - --dut linksys-8450 --duration 15s --station 1.1.sta01500 \ - --download_speed 85% --upload_speed 0 \ - --raw_line 'txo_preamble: VHT' \ - --raw_line 'txo_mcs: 4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT' \ - --raw_line 'spatial_streams: 3' \ - --raw_line 'bandw_options: 80' \ - --raw_line 'txo_sgi: ON' \ - --raw_line 'txo_retries: No Retry' \ - --raw_line 'txo_txpower: 17' \ - --test_rig Testbed-01 --pull_report \ - --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ - --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ - --influx_bucket ben \ - --influx_tag testbed Ferndale-01" + --instance_name rx-sensitivity-instance --config_name test_con --upstream 1.1.eth2 \ + --dut linksys-8450 --duration 15s --station 1.1.sta01500 \ + --download_speed 85% --upload_speed 0 \ + --raw_line \"txo_preamble\: VHT\" \ + --raw_line \"txo_mcs\: 4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT\" \ + --raw_line \"spatial_streams\: 3\" \ + --raw_line \"bandw_options\: 80\" \ + --raw_line \"txo_sgi\: ON\" \ + --raw_line \"txo_retries\: No Retry\" \ + --raw_line \"txo_txpower\: 17\" \ + --test_rig Testbed-01 --pull_report \ + --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ + --influx_bucket ben \ + --influx_tag testbed Ferndale-01" "./lf_sniff_radio.py --mgr $MGR --mgr_port 8080 @@ -255,18 +262,18 @@ if [[ $MGRLEN -gt 0 ]]; then --enable_flag osen_enable --disable_flag ht160_enable --debug" - "./modify_vap.py --radio $RADIO_USED --vap 1.1.vap0000 --security $SECURITY -ssid $SSID_USED \ + "./modify_vap.py --radio $RADIO_USED --vap 1.1.vap0000 --security $SECURITY --ssid $SSID_USED \ --passwd $PASSWD_USED --enable_flag osen_enable --disable_flag ht160_enable --debug" #recordinflux.py - "./load_ap_scenario.py --lfmgr $MGR --scenario_db 'handsets' --cv_test --test_scenario 'test-20'" - "./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test --test_scenario 'test-20'" + "./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test Dataplane \ + --test_profile http --cv_scenario ct-us-001" #scenario.py #"./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C" #./sta_connect_bssid_mac.py - #sta_connect_example.py - #sta_connect_multi_example.py + "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED" #sta_connect.py - "./sta_scan_test.py --ssid $SSID --security $SECURITY --passwd $PASSWD_USED --radio $RADIO_USED" + "./sta_scan_test.py --ssid $SSID_USED --security $SECURITY --passwd $PASSWD_USED \ + --radio $RADIO_USED" #station_layer3.py #stations_connected.py #"./test_1k_clients_jedtest.py @@ -286,17 +293,14 @@ if [[ $MGRLEN -gt 0 ]]; then #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type iperf3 --debug --mgr $MGR" #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfcurl --dest $TEST_HTTP_IP --file_output ${HOMEPATH}/Documents/lfcurl_output.txt --debug --mgr $MGR" "./testgroup.py --group_name group1 --add_group --list_groups --debug --mgr $MGR" - #testgroup_list_groups - #testgroup_list_connections - #testgroup_delete_group #"./testgroup2.py --num_stations 4 --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --group_name group0 --add_group --mgr $MGR" "./test_ip_connection.py --radio $RADIO_USED --num_stations $NUM_STA --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - #"./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format excel --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" - #"./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" + "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format excel --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" + "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" "./test_ip_connection.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --ipv6" - #"./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" + "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - #./test_ipv4_ttls + "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_udp lf_tcp' --upstream_port 1.1.$UPSTREAM \ --radio \"radio==1.1.wiphy0 stations==10 ssid==ASUS_70 ssid_pw==[BLANK] security==open\" \ --radio \"radio==1.1.wiphy1 stations==1 ssid==ASUS_70 ssid_pw==[BLANK] security==open\" \ @@ -309,69 +313,16 @@ if [[ $MGRLEN -gt 0 ]]; then #./test_l3_unicast_traffic_gen #./test_l3_unicast_traffic_gen #./test_l3_WAN_LAN - #./test_l4 + "./test_l4.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_status_msg.py --debug --mgr $MGR" #this is all which is needed to run #"./test_wanlink.py --name my_wanlink4 --latency_A 20 --latency_B 69 --rate 1000 --jitter_A 53 --jitter_B 73 --jitter_freq 6 --drop_A 12 --drop_B 11 --debug --mgr $MGR" #./test_wpa_passphrases #./tip_station_powersave #./video_rates - "./wlan_capacity_calculator.py -sta 11abg -t Voice -p 48 -m 106 -e WEP -q Yes -b 1 2 5.5 11 -pre Long -s N/A -co G.711 -r Yes -c Yes -m $MGR" - "./wlan_capacity_calculator.py -sta 11n -t Voice -d 17 -ch 40 -gu 800 -high 9 -e WEP -q Yes -ip 5 -mc 42 -b 6 9 12 24 -m 1538 -co G.729 -pl Greenfield -cw 15 -r Yes -c Yes -m $MGR" - "./wlan_capacity_calculator.py -sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes -m $MGR" - #"./ws_generic_monitor_test.py --mgr $MGR" - ) -elif [[ $MGR == "short" ]]; then - testCommands=( - run_l3_longevity - "./test_ipv4_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format excel --layer3_cols $COL_NAMES --debug --mgr $MGR" - ) -else - testCommands=( - #"../cpu_stats.py --duration 15" - "./example_security_connection.py --num_stations $NUM_STA --ssid jedway-wpa-1 --passwd jedway-wpa-1 --radio $RADIO_USED --security wpa --debug" - "./example_security_connection.py --num_stations $NUM_STA --ssid $SSID_USED --passwd $PASSWD_USED --radio $RADIO_USED --security wpa2 --debug" - "./example_security_connection.py --num_stations $NUM_STA --ssid jedway-wep-48 --passwd 0123456789 --radio $RADIO_USED --security wep --debug" - "./example_security_connection.py --num_stations $NUM_STA --ssid jedway-wpa3-1 --passwd jedway-wpa3-1 --radio $RADIO_USED --security wpa3 --debug" - "./sta_connect2.py --dut_ssid $SSID_USED --dut_passwd $PASSWD_USED --dut_security $SECURITY" - "./sta_connect_example.py" - # want if [[ $DO_FILEIO = 1 ]] - "./test_fileio.py --macvlan_parent eth2 --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 --netmask 255.255.255.0 --test_duration 30s --gateway 192.168.92.1" # Better tested on Kelly, where VRF is turned off - "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug" - "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security $SECURITY --debug" - "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type iperf3 --debug" - "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfcurl --dest $TEST_HTTP_IP --file_output ${HOMEPATH}/Documents/lfcurl_output.txt --debug" - "./testgroup.py --group_name group1 --add_group --list_groups --debug" - testgroup_list_groups - testgroup_list_connections - testgroup_delete_group - "./testgroup2.py --num_stations 4 --ssid lanforge --passwd password --security wpa2 --radio wiphy0 --group_name group0 --add_group" - "./test_ipv4_connection.py --radio $RADIO_USED --num_stations $NUM_STA --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug" - "./test_ipv4_l4_urls_per_ten.py --radio $RADIO_USED --num_stations $NUM_STA --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --num_tests 1 --requests_per_ten 600 --target_per_ten 600 --debug" - "./test_ipv4_l4_wifi.py --radio $RADIO_USED --num_stations $NUM_STA --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --test_duration 15s --debug" - "./test_ipv4_l4.py --radio $RADIO_USED --num_stations 4 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --test_duration 15s --debug" - "./test_ipv4_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format excel --layer3_cols $COL_NAMES --traffic_type lf_udp --debug" - "./test_ipv4_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --traffic_type lf_udp --debug" - "./test_ipv4_l4_ftp_upload.py --upstream_port eth1 --radio $RADIO_USED --num_stations $NUM_STA --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --test_duration 15s --debug" - "./test_ipv6_connection.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug" - "./test_ipv6_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --cx_type tcp6 --debug" - run_l3_longevity - "./test_l3_powersave_traffic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug" - #"./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput" #always hangs the regression - "./test_status_msg.py --action run_test " #this is all which is needed to run - "./test_wanlink.py --debug" - #"./ws_generic_monitor_test.py" - #"../py-json/ws-sta-monitor.py --debug" - "./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug" - "./create_l3.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug" - "./create_l4.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug" - "./create_macvlan.py --radio $RADIO_USED --macvlan_parent eth1 --debug" - "./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug" - "./create_vap.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug" - "./create_vr.py --vr_name 2.vr0 --ports 2.br0,2.vap2 --services" - "./create_qvlan.py --radio $RADIO_USED --qvlan_parent eth1" "./wlan_capacity_calculator.py -sta 11abg -t Voice -p 48 -m 106 -e WEP -q Yes -b 1 2 5.5 11 -pre Long -s N/A -co G.711 -r Yes -c Yes" "./wlan_capacity_calculator.py -sta 11n -t Voice -d 17 -ch 40 -gu 800 -high 9 -e WEP -q Yes -ip 5 -mc 42 -b 6 9 12 24 -m 1538 -co G.729 -pl Greenfield -cw 15 -r Yes -c Yes" "./wlan_capacity_calculator.py -sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes" + #"./ws_generic_monitor_test.py --mgr $MGR" ) fi #declare -A name_to_num @@ -409,7 +360,6 @@ name_to_num=( ["lf_csv"]=30 ["lf_dataplane_config"]=31 ["lf_dataplane_test"]=32 - ["lf_dfs_test"]=33 ["lf_dut_sta_vap_test"]=34 ["lf_ft"]=35 ["lf_ftp_test"]=36 @@ -496,9 +446,9 @@ function echo_print() { function test() { if [[ $MGRLEN -gt 0 ]]; then - ./scenario.py --load FACTORY_DFLT --mgr "${MGR}" + ./scenario.py --load BLANK --mgr "${MGR}" else - ./scenario.py --load FACTORY_DFLT + ./scenario.py --load BLANK fi echo "" diff --git a/py-scripts/scenario.py b/py-scripts/scenario.py index c1df589d..4cb0de4f 100755 --- a/py-scripts/scenario.py +++ b/py-scripts/scenario.py @@ -83,8 +83,6 @@ class LoadScenario(Realm): data['clean_chambers'] = "yes" print("Loading database %s" % self.scenario) self.json_post("/cli-json/load", data) - - elif self.start is not None: print("Starting test group %s..." % self.start) self.json_post("/cli-json/start_group", {"name": self.start}) @@ -100,16 +98,21 @@ class LoadScenario(Realm): while not completed: current_events = self.json_get('/events/since=time/1h') new_events = find_new_events(starting_events, current_events) + target_events = [event for event in get_events(new_events, 'event description') if event.startswith('LOAD COMPLETED')] if 'LOAD-DB: Load attempt has been completed.' in get_events(new_events, 'event description'): completed = True print('Scenario %s fully loaded after %s seconds' % (self.scenario, timer)) + elif len(target_events) > 0: + completed = True + print('Scenario %s fully loaded after %s seconds' % (self.scenario, timer)) else: timer += 1 time.sleep(1) if timer > self.timeout: completed = True - print('Scenario failed to load after 120 seconds') + print('Scenario failed to load after %s seconds' % self.timeout) else: + print(new_events) print('Waiting %s out of %s seconds to load scenario %s' % (timer, self.timeout, self.scenario)) @@ -161,7 +164,7 @@ def main(): timeout=args.timeout, debug=args.debug) - # LoadScenario.scenario() + # scenario_loader.load_scenario() if __name__ == '__main__': From f67868d1c0c91d3a8d4229391415cfd305408dc7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 8 Oct 2021 13:57:49 -0700 Subject: [PATCH 104/731] Cleanup white space in create_bridge.py Signed-off-by: Matthew Stidham --- py-scripts/create_bridge.py | 43 +++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/py-scripts/create_bridge.py b/py-scripts/create_bridge.py index c830e646..b4b4ed34 100755 --- a/py-scripts/create_bridge.py +++ b/py-scripts/create_bridge.py @@ -13,7 +13,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -24,7 +23,7 @@ Realm = realm.Realm class CreateBridge(Realm): - def __init__(self,sta_list,resource,target_device,radio, + def __init__(self, sta_list, resource, target_device, radio, _ssid=None, _security=None, _password=None, @@ -54,7 +53,6 @@ class CreateBridge(Realm): pprint.pprint(self.sta_list) print("---- ~bridge List ----- ----- ----- ----- ----- ----- \n") - def build(self): # Build bridges @@ -76,8 +74,6 @@ class CreateBridge(Realm): self.json_post("cli-json/set_port", bridge_set_port) - - def main(): parser = LFCliBase.create_basic_argparse( prog='create_bridge.py', @@ -102,16 +98,16 @@ Command example: ''') required = parser.add_argument_group('required arguments') required.add_argument('--target_device', help='Where the bridges should be connecting', required=True) - #required.add_argument('--security', help='WiFi Security protocol: < open | wep | wpa | wpa2 | wpa3 >', required=True) + # required.add_argument('--security', help='WiFi Security protocol: < open | wep | wpa | wpa2 | wpa3 >', required=True) optional = parser.add_argument_group('optional arguments') optional.add_argument('--num_bridges', help='Number of bridges to Create', required=False) args = parser.parse_args() - #if args.debug: + # if args.debug: # pprint.pprint(args) # time.sleep(5) - if (args.radio is None): - raise ValueError("--radio required") + if args.radio is None: + raise ValueError("--radio required") num_bridge = 2 if (args.num_bridges is not None) and (int(args.num_bridges) > 0): @@ -119,25 +115,26 @@ Command example: num_bridge = num_bridges_converted bridge_list = LFUtils.port_name_series(prefix="bridge", - start_id=0, - end_id=num_bridge-1, - padding_number=10000, - radio=args.radio) + start_id=0, + end_id=num_bridge - 1, + padding_number=10000, + radio=args.radio) create_bridge = CreateBridge(_host=args.mgr, - _port=args.mgr_port, - _ssid=args.ssid, - _password=args.passwd, - _security=args.security, - _bridge_list=bridge_list, - radio=args.radio, - _debug_on=args.debug, - sta_list=bridge_list, - resource=1, - target_device=args.target_device) + _port=args.mgr_port, + _ssid=args.ssid, + _password=args.passwd, + _security=args.security, + _bridge_list=bridge_list, + radio=args.radio, + _debug_on=args.debug, + sta_list=bridge_list, + resource=1, + target_device=args.target_device) create_bridge.build() print('Created %s bridges' % num_bridge) + if __name__ == "__main__": main() From 7ae81b1cf2f5abbfdd5828f1177e783ba46e8e52 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 8 Oct 2021 07:59:24 -0600 Subject: [PATCH 105/731] lf_qa.py : update for percentage pass fail Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_qa.py | 178 ++++++++++++++++++++++++++------------ 1 file changed, 121 insertions(+), 57 deletions(-) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 144dab8a..1351cfb4 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -7,6 +7,7 @@ import sys import os import importlib import plotly.express as px +import plotly.graph_objects as go import pandas as pd import sqlite3 import argparse @@ -36,7 +37,6 @@ class csv_sql(): self.server = _server self.cut = _cut self.png = _png - self.png_generated = False self.kpi_list = [] self.html_list = [] self.conn = None @@ -255,6 +255,50 @@ class csv_sql(): exit(1) self.conn.close() + def generate_png(self,group,test_id_list,test_tag,test_rig,kpi_path_list,kpi_fig,df_tmp): + # save the figure - figures will be over written png + # for testing + png_server_img = '' + #generate the png files + print("generate png and kpi images from kpi kpi_path:{}".format(df_tmp['kpi_path'])) + # generate png img path + png_path = os.path.join(kpi_path_list[-1],"{}_{}_{}_kpi.png".format( group, test_tag, test_rig)) + png_path = png_path.replace(' ','') + # generate html graphics path + html_path = os.path.join(kpi_path_list[-1],"{}_{}_{}_kpi.html".format( group, test_tag, test_rig)) + html_path = html_path.replace(' ','') + # NOTE: html links to png do not like spaces + png_server_img = self.server + png_path.replace(self.cut,'') + # generate png image + try: + kpi_fig.write_image(png_path,scale=1,width=1200,height=350) + except: + print("ERROR: {database} Was correct database passed in, moved or duplicates of same name?".format(database=self.database)) + # generate html image (interactive) + kpi_fig.write_html(html_path) + img_kpi_html_path = self.server + html_path + img_kpi_html_path = img_kpi_html_path.replace(self.cut,'') + self.html_results += """ + + + + """.format(img_kpi_html_path=img_kpi_html_path,png_server_img=png_server_img) + # link to interactive results + kpi_html_path = self.server + html_path + kpi_html_path = kpi_html_path.replace(self.cut,'') + #self.html_results +="""
""" + # link to full test results + report_index_html_path = self.server + kpi_path_list[-1] + "index.html" + report_index_html_path = report_index_html_path.replace(self.cut,'') + self.html_results +="""{test_id}_{group}_{test_tag}_{test_rig}_Report + """.format(report_index_html_path=report_index_html_path,test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig) + self.html_results +="""
""" + self.html_results +="""
""" + self.html_results +="""
""" + self.html_results +="""
""" + self.html_results +="""
""" + + def generate_graph_png(self): print("generate png and html to display, generate time: {}".format(time.time())) @@ -297,6 +341,7 @@ class csv_sql(): df_tmp = df_tmp.sort_values(by='Date') test_id_list = list(df_tmp['test-id']) kpi_path_list = list(df_tmp['kpi_path']) + # get Device Under Test Information , # the set reduces the redundency , list puts it back into a list # the [0] will get the latest versions for the report @@ -319,12 +364,14 @@ class csv_sql(): units_list = list(df_tmp['Units']) print("GRAPHING::: test-rig {} test-tag {} Graph-Group {}".format(test_rig,test_tag,group)) + # group of Score will have subtest if group == 'Score': + # Print out the Standard Score report , May want to check for empty pass fail kpi_fig = (px.scatter(df_tmp, x="Date", y="numeric-score", custom_data=['numeric-score','Subtest-Pass','Subtest-Fail'], color="short-description", hover_name="short-description", size_max=60)).update_traces(mode='lines+markers') - + kpi_fig.update_traces( hovertemplate="
".join([ "numeric-score: %{customdata[0]}", @@ -332,67 +379,84 @@ class csv_sql(): "Subtest-Fail: %{customdata[2]}" ]) ) + + kpi_fig.update_layout( + title="{} : {} : {} : {}".format(test_id_list[-1], group, test_tag, test_rig), + xaxis_title="Time", + yaxis_title="{}".format(units_list[-1]), + xaxis = {'type' : 'date'} + ) + + self.generate_png(df_tmp=df_tmp, + group=group, + test_id_list=test_id_list, + test_tag=test_tag, + test_rig=test_rig, + kpi_path_list=kpi_path_list, + kpi_fig=kpi_fig) + + #kpi_fig = (px.bar(df_tmp, x="Date", y=["Subtest-Pass","Subtest-Fail"], title="This is the title")) + #kpi_fig = (px.bar(df_tmp, x="Date", y="Subtest-Pass", title="This is the title")) + + df_tmp["Percent"] = df_tmp["Subtest-Pass"] / (df_tmp["Subtest-Pass"] + df_tmp["Subtest-Fail"]) + + fig1 = (px.scatter(df_tmp, x="Date", y="Percent", + custom_data=['short-description','Percent','Subtest-Pass','Subtest-Fail'], + color="short-description", hover_name="short-description", + size_max=60)).update_traces(mode='lines+markers') + + fig1.update_traces( + hovertemplate="
".join([ + "short-description: %{customdata[0]}", + "Percent: %{customdata[1]:.2%}", + "Subtest-Pass: %{customdata[2]}", + "Subtest-Fail: %{customdata[3]}" + ]) + ) + + #kpi_fig = go.Figure(data=fig1.data + fig2.data) + # the kpi_fig is a go.Figure + kpi_fig = go.Figure(data=fig1.data) + kpi_fig.update_layout(yaxis=dict(tickformat='.2%')) + kpi_fig.update_layout( + title="{} : {} : Subtests : {} : {}".format(test_id_list[-1], group, test_tag, test_rig), + xaxis_title="Time", + yaxis_title="Subtest Percent Pass", + xaxis = {'type' : 'date'} + ) + + # modify the group + group = group + "_subtests" + + self.generate_png(df_tmp=df_tmp, + group=group, + test_id_list=test_id_list, + test_tag=test_tag, + test_rig=test_rig, + kpi_path_list=kpi_path_list, + kpi_fig=kpi_fig) + + #kpi_fig.add_scatter(x=df_tmp['Date'], y=df_tmp['Subtest-Fail']).update_traces(mode='lines+markers') + else: kpi_fig = (px.scatter(df_tmp, x="Date", y="numeric-score", color="short-description", hover_name="short-description", size_max=60)).update_traces(mode='lines+markers') - kpi_fig.update_layout( - title="{} : {} : {} : {}".format(test_id_list[-1], group, test_tag, test_rig), - xaxis_title="Time", - yaxis_title="{}".format(units_list[-1]), - xaxis = {'type' : 'date'} - ) - # save the figure - figures will be over written png - # for testing - png_server_img = '' - #generate the png files - if self.png: - if self.png_generated: - pass - else: - print("generate png and kpi images from kpi kpi_path:{}".format(df_tmp['kpi_path'])) - # generate png img path - png_path = os.path.join(kpi_path_list[-1],"{}_{}_{}_kpi.png".format( group, test_tag, test_rig)) - png_path = png_path.replace(' ','') - # generate html graphics path - html_path = os.path.join(kpi_path_list[-1],"{}_{}_{}_kpi.html".format( group, test_tag, test_rig)) - html_path = html_path.replace(' ','') - # NOTE: html links to png do not like spaces - png_server_img = self.server + png_path.replace(self.cut,'') - # generate png image - try: - kpi_fig.write_image(png_path,scale=1,width=1200,height=350) - except: - print("ERROR: {database} Was correct database passed in, moved or duplicates of same name?".format(database=self.database)) - # generate html image (interactive) - kpi_fig.write_html(html_path) - img_kpi_html_path = self.server + html_path - img_kpi_html_path = img_kpi_html_path.replace(self.cut,'') + kpi_fig.update_layout( + title="{} : {} : {} : {}".format(test_id_list[-1], group, test_tag, test_rig), + xaxis_title="Time", + yaxis_title="{}".format(units_list[-1]), + xaxis = {'type' : 'date'} + ) - self.html_results += """ - - - - """.format(img_kpi_html_path=img_kpi_html_path,png_server_img=png_server_img) - - # link to interactive results - kpi_html_path = self.server + html_path - kpi_html_path = kpi_html_path.replace(self.cut,'') - #self.html_results +="""
""" - # link to full test results - report_index_html_path = self.server + kpi_path_list[-1] + "index.html" - report_index_html_path = report_index_html_path.replace(self.cut,'') - self.html_results +="""{test_id}_{group}_{test_tag}_{test_rig}_Report - """.format(report_index_html_path=report_index_html_path,test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig) - self.html_results +="""
""" - self.html_results +="""
""" - self.html_results +="""
""" - self.html_results +="""
""" - self.html_results +="""
""" - - # TODO see if this stops the regenration of the graphs each time - self.png_generated = True + self.generate_png(df_tmp=df_tmp, + group=group, + test_id_list=test_id_list, + test_tag=test_tag, + test_rig=test_rig, + kpi_path_list=kpi_path_list, + kpi_fig=kpi_fig) # Feature, Sum up the subtests passed/failed from the kpi files for each run, poke those into the database, and generate a kpi graph for them. From c4665ba67b4966809acb4b1daef9372792cd28cf Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 8 Oct 2021 17:13:59 -0600 Subject: [PATCH 106/731] lf_qa.py adjusted the frame height for the reports. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_qa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 1351cfb4..96b06b66 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -271,7 +271,7 @@ class csv_sql(): png_server_img = self.server + png_path.replace(self.cut,'') # generate png image try: - kpi_fig.write_image(png_path,scale=1,width=1200,height=350) + kpi_fig.write_image(png_path,scale=1,width=1200,height=300) except: print("ERROR: {database} Was correct database passed in, moved or duplicates of same name?".format(database=self.database)) # generate html image (interactive) From a9526b2c9eeefb0cdbd9643261f8f972c1c0d70e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 8 Oct 2021 17:30:20 -0600 Subject: [PATCH 107/731] lf_qa.py : white space changes Tested updates Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_qa.py | 402 +++++++++++++++++++++----------------- 1 file changed, 222 insertions(+), 180 deletions(-) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 96b06b66..936ba8ba 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -11,7 +11,7 @@ import plotly.graph_objects as go import pandas as pd import sqlite3 import argparse -from pathlib import Path +from pathlib import Path import time sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) @@ -21,15 +21,17 @@ lf_report = lf_report.lf_report # Any style components can be used external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] + + class csv_sql(): def __init__(self, - _path = '.', - _file = 'kpi.csv', - _database = 'qa_db', - _table = 'qa_table', - _server = 'http://192.168.95.6/', - _cut = '/home/lanforge/', - _png = False): + _path='.', + _file='kpi.csv', + _database='qa_db', + _table='qa_table', + _server='http://192.168.95.6/', + _cut='/home/lanforge/', + _png=False): self.path = _path self.file = _file self.database = _database @@ -42,7 +44,7 @@ class csv_sql(): self.conn = None self.df = pd.DataFrame() self.plot_figure = [] - self.html_results ="" + self.html_results = "" self.test_rig_list = [] self.dut_model_num_list = "NA" self.dut_model_num = "NA" @@ -61,15 +63,15 @@ class csv_sql(): return self.html_results def get_dut_info(self): - #try: + # try: print("get_dut_info DUT: {DUT} SW:{SW} HW:{HW} SN:{SN}" - .format(DUT=self.dut_model_num,SW=self.dut_sw_version,HW=self.dut_hw_version,SN=self.dut_serial_num)) + .format(DUT=self.dut_model_num, SW=self.dut_sw_version, HW=self.dut_hw_version, SN=self.dut_serial_num)) dut_dict = { - 'DUT':[self.dut_model_num], + 'DUT': [self.dut_model_num], 'SW version': [self.dut_sw_version], - 'HW version':[self.dut_hw_version], - 'SN':[self.dut_serial_num] + 'HW version': [self.dut_hw_version], + 'SN': [self.dut_serial_num] } print('DUT dict: {dict}'.format(dict=dut_dict)) dut_info_df = pd.DataFrame(dut_dict) @@ -77,73 +79,80 @@ class csv_sql(): return dut_info_df - def get_parent_path(self,_path): + def get_parent_path(self, _path): parent_path = os.path.dirname(_path) return parent_path - def get_test_id_test_tag(self,_kpi_path): + def get_test_id_test_tag(self, _kpi_path): test_id = "NA" test_tag = "NA" use_meta_test_tag = False try: kpi_df = pd.read_csv(_kpi_path, sep='\t') - test_id_list = list(kpi_df['test-id']) + test_id_list = list(kpi_df['test-id']) test_id = list(set(test_id_list)) - test_id = test_id[-1] # done to get element of list + test_id = test_id[-1] # done to get element of list except: - print("exception reading test_id in csv _kpi_path {kpi_path}".format(kpi_path=_kpi_path)) + print("exception reading test_id in csv _kpi_path {kpi_path}".format( + kpi_path=_kpi_path)) try: - test_tag_list = list(kpi_df['test-tag']) + test_tag_list = list(kpi_df['test-tag']) test_tag = list(set(test_tag_list)) - test_tag = test_tag[-1] # done to get element of list + test_tag = test_tag[-1] # done to get element of list except: - print("exception reading test-tag in csv _kpi_path {kpi_path}, try meta.txt".format(kpi_path=_kpi_path)) + print( + "exception reading test-tag in csv _kpi_path {kpi_path}, try meta.txt".format(kpi_path=_kpi_path)) - #if test_tag still NA then try meta file + # if test_tag still NA then try meta file try: if test_tag == "NA": - _kpi_path = _kpi_path.replace('kpi.csv','') - use_meta_test_tag, test_tag = self.get_test_tag_from_meta(_kpi_path) + _kpi_path = _kpi_path.replace('kpi.csv', '') + use_meta_test_tag, test_tag = self.get_test_tag_from_meta( + _kpi_path) except: - print("exception reading meta.txt _kpi_path: {kpi_path}".format(kpi_path=_kpi_path)) + print("exception reading meta.txt _kpi_path: {kpi_path}".format( + kpi_path=_kpi_path)) if use_meta_test_tag: - print("test_tag from meta.txt _kpi_path: {kpi_path}".format(kpi_path=_kpi_path)) - return test_id , test_tag + print("test_tag from meta.txt _kpi_path: {kpi_path}".format( + kpi_path=_kpi_path)) + return test_id, test_tag - def get_test_tag_from_meta(self,_kpi_path): + def get_test_tag_from_meta(self, _kpi_path): test_tag = "NA" use_meta_test_tag = False gui_version_5_4_3 = False print("read meta path {_kpi_path}".format(_kpi_path=_kpi_path)) - try: + try: meta_data_path = _kpi_path + '/' + '/meta.txt' meta_data_fd = open(meta_data_path, 'r') for line in meta_data_fd: if "gui_version:" in line: - gui_version = line.replace("gui_version:","") + gui_version = line.replace("gui_version:", "") gui_version = gui_version.strip() - if gui_version =='5.4.3': + if gui_version == '5.4.3': gui_version_5_4_3 = True use_meta_test_tag = True print("meta_data_path: {meta_data_path} gui_version: {gui_version} 5.4.3: {gui_version_5_4_3}".format( - meta_data_path=meta_data_path,gui_version=gui_version,gui_version_5_4_3=gui_version_5_4_3)) - meta_data_fd.close() - if gui_version_5_4_3: + meta_data_path=meta_data_path, gui_version=gui_version, gui_version_5_4_3=gui_version_5_4_3)) + meta_data_fd.close() + if gui_version_5_4_3: meta_data_fd = open(meta_data_path, 'r') test_tag = 'NA' for line in meta_data_fd: if "test_tag" in line: - test_tag = line.replace("test_tag","") + test_tag = line.replace("test_tag", "") test_tag = test_tag.strip() - print("meta_data_path {meta_data_path} test_tag {test_tag}".format(meta_data_path=meta_data_path,test_tag=test_tag)) - meta_data_fd.close() + print("meta_data_path {meta_data_path} test_tag {test_tag}".format( + meta_data_path=meta_data_path, test_tag=test_tag)) + meta_data_fd.close() except: - print("exception reading test_tag from {_kpi_path}".format(_kpi_path=_kpi_path)) + print("exception reading test_tag from {_kpi_path}".format( + _kpi_path=_kpi_path)) return use_meta_test_tag, test_tag def get_suite_html(self): - suite_html_results = """ + suite_html_results = """
@@ -154,9 +163,9 @@ class csv_sql(): """ - + path = Path(self.path) - pdf_info_list= list(path.glob('**/*.pdf')) # Hard code for now + pdf_info_list = list(path.glob('**/*.pdf')) # Hard code for now print("pdf_info_list {}".format(pdf_info_list)) for pdf_info in pdf_info_list: if "lf_qa" in str(pdf_info): @@ -167,16 +176,16 @@ class csv_sql(): pass else: parent_path = os.path.dirname(pdf_info) - pdf_path = os.path.join(parent_path,pdf_base_name) - pdf_path = self.server + pdf_path.replace(self.cut,'') - html_path = os.path.join(parent_path,"index.html") - html_path = self.server + html_path.replace(self.cut,'') - kpi_path = os.path.join(parent_path,"kpi.csv") + pdf_path = os.path.join(parent_path, pdf_base_name) + pdf_path = self.server + pdf_path.replace(self.cut, '') + html_path = os.path.join(parent_path, "index.html") + html_path = self.server + html_path.replace(self.cut, '') + kpi_path = os.path.join(parent_path, "kpi.csv") test_id, test_tag = self.get_test_id_test_tag(kpi_path) suite_html_results += """ - """.format(test_id=test_id,test_tag=test_tag,html_path=html_path,pdf_path=pdf_path) + """.format(test_id=test_id, test_tag=test_tag, html_path=html_path, pdf_path=pdf_path) suite_html_results += """
{test_id}{test_tag}html / pdf
@@ -186,23 +195,25 @@ class csv_sql(): return suite_html_results def get_kpi_chart_html(self): - kpi_chart_html = """ + kpi_chart_html = """ """ path = Path(self.path) - kpi_chart_list= list(path.glob('**/kpi-chart*.png')) # Hard code for now - table_index = 0 + # Hard code for now + kpi_chart_list = list(path.glob('**/kpi-chart*.png')) + table_index = 0 for kpi_chart in kpi_chart_list: parent_path = os.path.dirname(kpi_chart) - kpi_path = os.path.join(parent_path,"kpi.csv") - test_tag , test_id = self.get_test_id_test_tag(kpi_path) - kpi_chart = os.path.abspath(kpi_chart) # Path returns a list of objects - kpi_chart = self.server + kpi_chart.replace(self.cut,'') + kpi_path = os.path.join(parent_path, "kpi.csv") + test_tag, test_id = self.get_test_id_test_tag(kpi_path) + # Path returns a list of objects + kpi_chart = os.path.abspath(kpi_chart) + kpi_chart = self.server + kpi_chart.replace(self.cut, '') if "print" in kpi_chart: pass - else: - if (table_index %2) == 0: + else: + if (table_index % 2) == 0: kpi_chart_html += """""" kpi_chart_html += """ - """.format(test_tag=test_tag,test_id=test_id,kpi_chart_0=kpi_chart,kpi_chart_1=kpi_chart,kpi_chart_2=kpi_chart) + """.format(test_tag=test_tag, test_id=test_id, kpi_chart_0=kpi_chart, kpi_chart_1=kpi_chart, kpi_chart_2=kpi_chart) table_index += 1 - if (table_index %2) == 0: - kpi_chart_html += """""" - if (table_index %2) != 0: + if (table_index % 2) == 0: kpi_chart_html += """""" + if (table_index % 2) != 0: + kpi_chart_html += """""" kpi_chart_html += """
@@ -213,12 +224,12 @@ class csv_sql():
""" return kpi_chart_html @@ -226,86 +237,93 @@ class csv_sql(): # https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_sql.html # sqlite browser: # Fedora sudo dnf install sqlitebrowser - # Ubuntu sudo apt-get install sqlite3 + # Ubuntu sudo apt-get install sqlite3 # def store(self): print("reading kpi and storing in db {}".format(self.database)) path = Path(self.path) - self.kpi_list = list(path.glob('**/kpi.csv')) # Hard code for now + self.kpi_list = list(path.glob('**/kpi.csv')) # Hard code for now if not self.kpi_list: print("WARNING: used --store , no new kpi.csv found, check input path or remove --store from command line") - for kpi in self.kpi_list: #TODO note empty kpi.csv failed test - df_kpi_tmp = pd.read_csv(kpi, sep='\t') - _kpi_path = str(kpi).replace('kpi.csv','') # only store the path to the kpi.csv file + for kpi in self.kpi_list: # TODO note empty kpi.csv failed test + df_kpi_tmp = pd.read_csv(kpi, sep='\t') + # only store the path to the kpi.csv file + _kpi_path = str(kpi).replace('kpi.csv', '') df_kpi_tmp['kpi_path'] = _kpi_path - use_meta_test_tag, test_tag = self.get_test_tag_from_meta(_kpi_path) + use_meta_test_tag, test_tag = self.get_test_tag_from_meta( + _kpi_path) if use_meta_test_tag: df_kpi_tmp['test-tag'] = test_tag df_kpi_tmp = df_kpi_tmp.append(df_kpi_tmp, ignore_index=True) self.df = self.df.append(df_kpi_tmp, ignore_index=True) - self.conn = sqlite3.connect(self.database) + self.conn = sqlite3.connect(self.database) try: - self.df.to_sql(self.table,self.conn,if_exists='append') + self.df.to_sql(self.table, self.conn, if_exists='append') except: - print("attempt to append to database with different column layout, caused an exception, input new name --database ") - print("Error attempt to append to database with different column layout, caused an exception, input new name --database ", file=sys.stderr) + print("attempt to append to database with different column layout, caused an exception, input new name --database ") + print("Error attempt to append to database with different column layout, caused an exception, input new name --database ", file=sys.stderr) exit(1) self.conn.close() - def generate_png(self,group,test_id_list,test_tag,test_rig,kpi_path_list,kpi_fig,df_tmp): - # save the figure - figures will be over written png - # for testing + def generate_png(self, group, test_id_list, test_tag, test_rig, kpi_path_list, kpi_fig, df_tmp): + # save the figure - figures will be over written png + # for testing png_server_img = '' - #generate the png files - print("generate png and kpi images from kpi kpi_path:{}".format(df_tmp['kpi_path'])) + # generate the png files + print("generate png and kpi images from kpi kpi_path:{}".format( + df_tmp['kpi_path'])) # generate png img path - png_path = os.path.join(kpi_path_list[-1],"{}_{}_{}_kpi.png".format( group, test_tag, test_rig)) - png_path = png_path.replace(' ','') + png_path = os.path.join( + kpi_path_list[-1], "{}_{}_{}_kpi.png".format(group, test_tag, test_rig)) + png_path = png_path.replace(' ', '') # generate html graphics path - html_path = os.path.join(kpi_path_list[-1],"{}_{}_{}_kpi.html".format( group, test_tag, test_rig)) - html_path = html_path.replace(' ','') + html_path = os.path.join( + kpi_path_list[-1], "{}_{}_{}_kpi.html".format(group, test_tag, test_rig)) + html_path = html_path.replace(' ', '') # NOTE: html links to png do not like spaces - png_server_img = self.server + png_path.replace(self.cut,'') + png_server_img = self.server + png_path.replace(self.cut, '') # generate png image try: - kpi_fig.write_image(png_path,scale=1,width=1200,height=300) + kpi_fig.write_image(png_path, scale=1, width=1200, height=300) except: - print("ERROR: {database} Was correct database passed in, moved or duplicates of same name?".format(database=self.database)) + print("ERROR: {database} Was correct database passed in, moved or duplicates of same name?".format( + database=self.database)) # generate html image (interactive) kpi_fig.write_html(html_path) img_kpi_html_path = self.server + html_path - img_kpi_html_path = img_kpi_html_path.replace(self.cut,'') + img_kpi_html_path = img_kpi_html_path.replace(self.cut, '') self.html_results += """ - """.format(img_kpi_html_path=img_kpi_html_path,png_server_img=png_server_img) + """.format(img_kpi_html_path=img_kpi_html_path, png_server_img=png_server_img) # link to interactive results kpi_html_path = self.server + html_path - kpi_html_path = kpi_html_path.replace(self.cut,'') + kpi_html_path = kpi_html_path.replace(self.cut, '') #self.html_results +="""
""" # link to full test results report_index_html_path = self.server + kpi_path_list[-1] + "index.html" - report_index_html_path = report_index_html_path.replace(self.cut,'') - self.html_results +="""{test_id}_{group}_{test_tag}_{test_rig}_Report - """.format(report_index_html_path=report_index_html_path,test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig) - self.html_results +="""
""" - self.html_results +="""
""" - self.html_results +="""
""" - self.html_results +="""
""" - self.html_results +="""
""" - + report_index_html_path = report_index_html_path.replace(self.cut, '') + self.html_results += """{test_id}_{group}_{test_tag}_{test_rig}_Report + """.format(report_index_html_path=report_index_html_path, test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig) + self.html_results += """
""" + self.html_results += """
""" + self.html_results += """
""" + self.html_results += """
""" + self.html_results += """
""" def generate_graph_png(self): print("generate png and html to display, generate time: {}".format(time.time())) - #https://datacarpentry.org/python-ecology-lesson/09-working-with-sql/index.html- + # https://datacarpentry.org/python-ecology-lesson/09-working-with-sql/index.html- self.conn = sqlite3.connect(self.database) - df3 = pd.read_sql_query("SELECT * from {}".format(self.table) ,self.conn) #current connection is sqlite3 /TODO move to SQLAlchemy - # sort by date from oldest to newest. + # current connection is sqlite3 /TODO move to SQLAlchemy + df3 = pd.read_sql_query( + "SELECT * from {}".format(self.table), self.conn) + # sort by date from oldest to newest. try: df3 = df3.sort_values(by='Date') except: @@ -316,7 +334,7 @@ class csv_sql(): # graph group and test-tag are used for detemining the graphs, can use any columns # the following list manipulation removes the duplicates graph_group_list = list(df3['Graph-Group']) - graph_group_list = list(set(graph_group_list)) + graph_group_list = list(set(graph_group_list)) print("graph_group_list: {}".format(graph_group_list)) # prior to 5.4.3 there was not test-tag, the test tag is in the meta data @@ -324,16 +342,17 @@ class csv_sql(): test_tag_list = list(df3['test-tag']) test_tag_list = list(set(test_tag_list)) #print("test_tag_list: {}".format(test_tag_list) ) - + test_rig_list = list(df3['test-rig']) test_rig_list = list(set(test_rig_list)) self.test_rig_list = test_rig_list - print("test_rig_list: {}".format(test_rig_list) ) + print("test_rig_list: {}".format(test_rig_list)) for test_rig in test_rig_list: for test_tag in test_tag_list: for group in graph_group_list: - df_tmp = df3.loc[(df3['test-rig'] == test_rig) & (df3['Graph-Group'] == str(group)) & (df3['test-tag'] == str(test_tag))] + df_tmp = df3.loc[(df3['test-rig'] == test_rig) & ( + df3['Graph-Group'] == str(group)) & (df3['test-tag'] == str(test_tag))] if df_tmp.empty == False: # Note if graph group is score there is sub tests for pass and fail # would like a percentage @@ -342,68 +361,79 @@ class csv_sql(): test_id_list = list(df_tmp['test-id']) kpi_path_list = list(df_tmp['kpi_path']) - # get Device Under Test Information , + # get Device Under Test Information , # the set reduces the redundency , list puts it back into a list # the [0] will get the latest versions for the report - self.dut_model_num_list = list(set(list(df_tmp['dut-model-num']))) - print("in png self.dut_model_num_list {dut_model_num_list}".format(dut_model_num_list=self.dut_model_num_list)) + self.dut_model_num_list = list( + set(list(df_tmp['dut-model-num']))) + print("in png self.dut_model_num_list {dut_model_num_list}".format( + dut_model_num_list=self.dut_model_num_list)) if self.dut_model_num_list[0] != None: self.dut_model_num = self.dut_model_num_list[0] - self.dut_sw_version_list = list(set(list(df_tmp['dut-sw-version']))) + self.dut_sw_version_list = list( + set(list(df_tmp['dut-sw-version']))) if self.dut_sw_version_list[0] != None: self.dut_sw_version = self.dut_sw_version_list[0] - self.dut_hw_version_list = list(set(list(df_tmp['dut-hw-version']))) + self.dut_hw_version_list = list( + set(list(df_tmp['dut-hw-version']))) if self.dut_hw_version_list[0] != None: self.dut_hw_version = self.dut_hw_version_list[0] - self.dut_serial_num_list = list(set(list(df_tmp['dut-serial-num']))) + self.dut_serial_num_list = list( + set(list(df_tmp['dut-serial-num']))) if self.dut_serial_num_list[0] != None: self.dut_serial_num_ = self.dut_serial_num_list[0] print("In png DUT: {DUT} SW:{SW} HW:{HW} SN:{SN}" - .format(DUT=self.dut_model_num_list,SW=self.dut_sw_version_list,HW=self.dut_hw_version_list,SN=self.dut_serial_num_list)) + .format(DUT=self.dut_model_num_list, SW=self.dut_sw_version_list, HW=self.dut_hw_version_list, SN=self.dut_serial_num_list)) units_list = list(df_tmp['Units']) - print("GRAPHING::: test-rig {} test-tag {} Graph-Group {}".format(test_rig,test_tag,group)) + print( + "GRAPHING::: test-rig {} test-tag {} Graph-Group {}".format(test_rig, test_tag, group)) # group of Score will have subtest if group == 'Score': # Print out the Standard Score report , May want to check for empty pass fail kpi_fig = (px.scatter(df_tmp, x="Date", y="numeric-score", - custom_data=['numeric-score','Subtest-Pass','Subtest-Fail'], - color="short-description", hover_name="short-description", - size_max=60)).update_traces(mode='lines+markers') + custom_data=[ + 'numeric-score', 'Subtest-Pass', 'Subtest-Fail'], + color="short-description", hover_name="short-description", + size_max=60)).update_traces(mode='lines+markers') kpi_fig.update_traces( hovertemplate="
".join([ "numeric-score: %{customdata[0]}", "Subtest-Pass: %{customdata[1]}", "Subtest-Fail: %{customdata[2]}" - ]) + ]) ) kpi_fig.update_layout( - title="{} : {} : {} : {}".format(test_id_list[-1], group, test_tag, test_rig), + title="{} : {} : {} : {}".format( + test_id_list[-1], group, test_tag, test_rig), xaxis_title="Time", yaxis_title="{}".format(units_list[-1]), - xaxis = {'type' : 'date'} + xaxis={'type': 'date'} ) self.generate_png(df_tmp=df_tmp, - group=group, - test_id_list=test_id_list, - test_tag=test_tag, - test_rig=test_rig, - kpi_path_list=kpi_path_list, - kpi_fig=kpi_fig) + group=group, + test_id_list=test_id_list, + test_tag=test_tag, + test_rig=test_rig, + kpi_path_list=kpi_path_list, + kpi_fig=kpi_fig) #kpi_fig = (px.bar(df_tmp, x="Date", y=["Subtest-Pass","Subtest-Fail"], title="This is the title")) #kpi_fig = (px.bar(df_tmp, x="Date", y="Subtest-Pass", title="This is the title")) - - df_tmp["Percent"] = df_tmp["Subtest-Pass"] / (df_tmp["Subtest-Pass"] + df_tmp["Subtest-Fail"]) + + df_tmp["Percent"] = df_tmp["Subtest-Pass"] / \ + (df_tmp["Subtest-Pass"] + + df_tmp["Subtest-Fail"]) fig1 = (px.scatter(df_tmp, x="Date", y="Percent", - custom_data=['short-description','Percent','Subtest-Pass','Subtest-Fail'], - color="short-description", hover_name="short-description", - size_max=60)).update_traces(mode='lines+markers') + custom_data=[ + 'short-description', 'Percent', 'Subtest-Pass', 'Subtest-Fail'], + color="short-description", hover_name="short-description", + size_max=60)).update_traces(mode='lines+markers') fig1.update_traces( hovertemplate="
".join([ @@ -411,7 +441,7 @@ class csv_sql(): "Percent: %{customdata[1]:.2%}", "Subtest-Pass: %{customdata[2]}", "Subtest-Fail: %{customdata[3]}" - ]) + ]) ) #kpi_fig = go.Figure(data=fig1.data + fig2.data) @@ -419,44 +449,46 @@ class csv_sql(): kpi_fig = go.Figure(data=fig1.data) kpi_fig.update_layout(yaxis=dict(tickformat='.2%')) kpi_fig.update_layout( - title="{} : {} : Subtests : {} : {}".format(test_id_list[-1], group, test_tag, test_rig), + title="{} : {} : Subtests : {} : {}".format( + test_id_list[-1], group, test_tag, test_rig), xaxis_title="Time", yaxis_title="Subtest Percent Pass", - xaxis = {'type' : 'date'} + xaxis={'type': 'date'} ) - # modify the group + # modify the group group = group + "_subtests" self.generate_png(df_tmp=df_tmp, - group=group, - test_id_list=test_id_list, - test_tag=test_tag, - test_rig=test_rig, - kpi_path_list=kpi_path_list, - kpi_fig=kpi_fig) - + group=group, + test_id_list=test_id_list, + test_tag=test_tag, + test_rig=test_rig, + kpi_path_list=kpi_path_list, + kpi_fig=kpi_fig) + #kpi_fig.add_scatter(x=df_tmp['Date'], y=df_tmp['Subtest-Fail']).update_traces(mode='lines+markers') - + else: kpi_fig = (px.scatter(df_tmp, x="Date", y="numeric-score", - color="short-description", hover_name="short-description", - size_max=60)).update_traces(mode='lines+markers') + color="short-description", hover_name="short-description", + size_max=60)).update_traces(mode='lines+markers') kpi_fig.update_layout( - title="{} : {} : {} : {}".format(test_id_list[-1], group, test_tag, test_rig), + title="{} : {} : {} : {}".format( + test_id_list[-1], group, test_tag, test_rig), xaxis_title="Time", yaxis_title="{}".format(units_list[-1]), - xaxis = {'type' : 'date'} + xaxis={'type': 'date'} ) self.generate_png(df_tmp=df_tmp, - group=group, - test_id_list=test_id_list, - test_tag=test_tag, - test_rig=test_rig, - kpi_path_list=kpi_path_list, - kpi_fig=kpi_fig) + group=group, + test_id_list=test_id_list, + test_tag=test_tag, + test_rig=test_rig, + kpi_path_list=kpi_path_list, + kpi_fig=kpi_fig) # Feature, Sum up the subtests passed/failed from the kpi files for each run, poke those into the database, and generate a kpi graph for them. @@ -474,15 +506,24 @@ File: read kpi.csv place in sql database, create png of historical kpi and prese Usage: lf_qa.py --store --png --path --database ''') - parser.add_argument('--path', help='--path top directory path to kpi if regererating database or png files',default='') - parser.add_argument('--file', help='--file kpi.csv default: kpi.csv',default='kpi.csv') #TODO is this needed - parser.add_argument('--database', help='--database qa_test_db default: qa_test_db',default='qa_test_db') - parser.add_argument('--table', help='--table qa_table default: qa_table',default='qa_table') - parser.add_argument('--server', help='--server http:/// default: http://192.168.95.6/',default='http://192.168.95.6/') - parser.add_argument('--cut', help='--cut /home/lanforge/ used to adjust server path default: /home/lanforge/',default='/home/lanforge/') - parser.add_argument('--store', help='--store , store kpi to db, action store_true',action='store_true') - parser.add_argument('--png', help='--png, generate png for kpi in path, generate display, action store_true',action='store_true') - parser.add_argument('--dir', help="--dir default lf_qa", default="lf_qa") + parser.add_argument( + '--path', help='--path top directory path to kpi if regererating database or png files', default='') + parser.add_argument('--file', help='--file kpi.csv default: kpi.csv', + default='kpi.csv') # TODO is this needed + parser.add_argument( + '--database', help='--database qa_test_db default: qa_test_db', default='qa_test_db') + parser.add_argument( + '--table', help='--table qa_table default: qa_table', default='qa_table') + parser.add_argument( + '--server', help='--server http:/// default: http://192.168.95.6/', default='http://192.168.95.6/') + parser.add_argument( + '--cut', help='--cut /home/lanforge/ used to adjust server path default: /home/lanforge/', default='/home/lanforge/') + parser.add_argument( + '--store', help='--store , store kpi to db, action store_true', action='store_true') + parser.add_argument( + '--png', help='--png, generate png for kpi in path, generate display, action store_true', action='store_true') + parser.add_argument( + '--dir', help="--dir default lf_qa", default="lf_qa") args = parser.parse_args() @@ -496,7 +537,7 @@ Usage: lf_qa.py --store --png --path --databas __cut = args.cut print("config: path:{path} file:{file} database:{database} table:{table} server:{server} store:{store} png:{png}" - .format(path=__path,file=__file,database=__database,table=__table,server=__server,store=args.store,png=args.png)) + .format(path=__path, file=__file, database=__database, table=__table, server=__server, store=args.store, png=args.png)) if(__path == '' and args.store == True): print("--path must be entered if --store , exiting") @@ -510,24 +551,24 @@ Usage: lf_qa.py --store --png --path --databas print("Need to enter an action of --store --png ") # create report class for reporting - report = lf_report(_path = __path, - _results_dir_name =__dir, + report = lf_report(_path=__path, + _results_dir_name=__dir, _output_html="lf_qa.html", - _output_pdf="lf_qa.pdf" ) + _output_pdf="lf_qa.pdf") csv_dash = csv_sql( - _path = __path, - _file = __file, - _database = __database, - _table = __table, - _server = __server, - _cut = __cut, - _png = __png) + _path=__path, + _file=__file, + _database=__database, + _table=__table, + _server=__server, + _cut=__cut, + _png=__png) if args.store: csv_dash.store() if args.png: csv_dash.generate_graph_png() - + # generate output reports report.set_title("LF QA: Verification Test Run") report.build_banner_left() @@ -540,22 +581,24 @@ Usage: lf_qa.py --store --png --path --databas print("DUT Results: {}".format(dut_info_df)) report.set_table_dataframe(dut_info_df) report.build_table() - + test_rig_list = csv_dash.get_test_rig_list() - report.set_table_title("Test Rig: {} Links".format(test_rig_list[-1])) # keep the list, currently one test bed results + # keep the list, currently one test bed results + report.set_table_title("Test Rig: {} Links".format(test_rig_list[-1])) report.build_table_title() pdf_link_path = report.get_pdf_path() - pdf_link_path = __server + pdf_link_path.replace(__cut,'') - report.build_pdf_link("PDF_Report",pdf_link_path) + pdf_link_path = __server + pdf_link_path.replace(__cut, '') + report.build_pdf_link("PDF_Report", pdf_link_path) report_path = report.get_path() - report_path = __server + report_path.replace(__cut,'') - report.build_link("Current Test Suite Results Directory",report_path) + report_path = __server + report_path.replace(__cut, '') + report.build_link("Current Test Suite Results Directory", report_path) report_parent_path = report.get_parent_path() - report_parent_path = __server + report_parent_path.replace(__cut,'') - report.build_link("All Test-Rig Test Suites Results Directory",report_parent_path) + report_parent_path = __server + report_parent_path.replace(__cut, '') + report.build_link( + "All Test-Rig Test Suites Results Directory", report_parent_path) # links table for tests TODO : can this be a table report.set_table_title("Test Suite") @@ -571,7 +614,6 @@ Usage: lf_qa.py --store --png --path --databas kpi_chart_html = csv_dash.get_kpi_chart_html() report.set_custom_html(kpi_chart_html) report.build_custom() - report.set_table_title("QA Test Results") report.build_table_title() @@ -588,6 +630,6 @@ Usage: lf_qa.py --store --png --path --databas except: print("exception write_pdf_with_timestamp()") + if __name__ == '__main__': main() - From 6577f16ecedcb1dcc3d576841031dd08f4d2c73e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 8 Oct 2021 17:39:59 -0600 Subject: [PATCH 108/731] lf_qa.py : line length update Tested Script Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_qa.py | 184 +++++++++++++++++++++++++------------- 1 file changed, 122 insertions(+), 62 deletions(-) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 936ba8ba..59f402e6 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 ''' File: read kpi.csv place in sql database, create png of historical kpi and present graph on dashboard -Usage: lf_qa.py --store --png --show --path --database +Usage: lf_qa.py --store --png --show --path --database ''' import sys import os @@ -64,8 +64,12 @@ class csv_sql(): def get_dut_info(self): # try: - print("get_dut_info DUT: {DUT} SW:{SW} HW:{HW} SN:{SN}" - .format(DUT=self.dut_model_num, SW=self.dut_sw_version, HW=self.dut_hw_version, SN=self.dut_serial_num)) + print( + "get_dut_info DUT: {DUT} SW:{SW} HW:{HW} SN:{SN}" .format( + DUT=self.dut_model_num, + SW=self.dut_sw_version, + HW=self.dut_hw_version, + SN=self.dut_serial_num)) dut_dict = { 'DUT': [self.dut_model_num], @@ -92,16 +96,18 @@ class csv_sql(): test_id_list = list(kpi_df['test-id']) test_id = list(set(test_id_list)) test_id = test_id[-1] # done to get element of list - except: - print("exception reading test_id in csv _kpi_path {kpi_path}".format( - kpi_path=_kpi_path)) + except BaseException: + print( + "exception reading test_id in csv _kpi_path {kpi_path}".format( + kpi_path=_kpi_path)) try: test_tag_list = list(kpi_df['test-tag']) test_tag = list(set(test_tag_list)) test_tag = test_tag[-1] # done to get element of list - except: + except BaseException: print( - "exception reading test-tag in csv _kpi_path {kpi_path}, try meta.txt".format(kpi_path=_kpi_path)) + "exception reading test-tag in csv _kpi_path {kpi_path}, try meta.txt".format( + kpi_path=_kpi_path)) # if test_tag still NA then try meta file try: @@ -109,7 +115,7 @@ class csv_sql(): _kpi_path = _kpi_path.replace('kpi.csv', '') use_meta_test_tag, test_tag = self.get_test_tag_from_meta( _kpi_path) - except: + except BaseException: print("exception reading meta.txt _kpi_path: {kpi_path}".format( kpi_path=_kpi_path)) if use_meta_test_tag: @@ -142,17 +148,19 @@ class csv_sql(): if "test_tag" in line: test_tag = line.replace("test_tag", "") test_tag = test_tag.strip() - print("meta_data_path {meta_data_path} test_tag {test_tag}".format( - meta_data_path=meta_data_path, test_tag=test_tag)) + print( + "meta_data_path {meta_data_path} test_tag {test_tag}".format( + meta_data_path=meta_data_path, + test_tag=test_tag)) meta_data_fd.close() - except: + except BaseException: print("exception reading test_tag from {_kpi_path}".format( _kpi_path=_kpi_path)) return use_meta_test_tag, test_tag def get_suite_html(self): - suite_html_results = """ + suite_html_results = """ @@ -189,13 +197,13 @@ class csv_sql(): suite_html_results += """
-
+
""" return suite_html_results def get_kpi_chart_html(self): - kpi_chart_html = """ + kpi_chart_html = """ """ @@ -222,7 +230,7 @@ class csv_sql(): """.format(test_tag=test_tag, test_id=test_id, kpi_chart_0=kpi_chart, kpi_chart_1=kpi_chart, kpi_chart_2=kpi_chart) table_index += 1 @@ -262,13 +270,16 @@ class csv_sql(): self.conn = sqlite3.connect(self.database) try: self.df.to_sql(self.table, self.conn, if_exists='append') - except: + except BaseException: print("attempt to append to database with different column layout, caused an exception, input new name --database ") - print("Error attempt to append to database with different column layout, caused an exception, input new name --database ", file=sys.stderr) + print( + "Error attempt to append to database with different column layout, caused an exception, input new name --database ", + file=sys.stderr) exit(1) self.conn.close() - def generate_png(self, group, test_id_list, test_tag, test_rig, kpi_path_list, kpi_fig, df_tmp): + def generate_png(self, group, test_id_list, test_tag, + test_rig, kpi_path_list, kpi_fig, df_tmp): # save the figure - figures will be over written png # for testing png_server_img = '' @@ -288,9 +299,10 @@ class csv_sql(): # generate png image try: kpi_fig.write_image(png_path, scale=1, width=1200, height=300) - except: - print("ERROR: {database} Was correct database passed in, moved or duplicates of same name?".format( - database=self.database)) + except BaseException: + print( + "ERROR: {database} Was correct database passed in, moved or duplicates of same name?".format( + database=self.database)) # generate html image (interactive) kpi_fig.write_html(html_path) img_kpi_html_path = self.server + html_path @@ -316,7 +328,9 @@ class csv_sql(): self.html_results += """
""" def generate_graph_png(self): - print("generate png and html to display, generate time: {}".format(time.time())) + print( + "generate png and html to display, generate time: {}".format( + time.time())) # https://datacarpentry.org/python-ecology-lesson/09-working-with-sql/index.html- self.conn = sqlite3.connect(self.database) @@ -326,7 +340,7 @@ class csv_sql(): # sort by date from oldest to newest. try: df3 = df3.sort_values(by='Date') - except: + except BaseException: print("Database empty: KeyError(key) when sorting by Date, check Database name, path to kpi, typo in path, exiting") exit(1) self.conn.close() @@ -353,7 +367,7 @@ class csv_sql(): for group in graph_group_list: df_tmp = df3.loc[(df3['test-rig'] == test_rig) & ( df3['Graph-Group'] == str(group)) & (df3['test-tag'] == str(test_tag))] - if df_tmp.empty == False: + if not df_tmp.empty: # Note if graph group is score there is sub tests for pass and fail # would like a percentage @@ -366,37 +380,51 @@ class csv_sql(): # the [0] will get the latest versions for the report self.dut_model_num_list = list( set(list(df_tmp['dut-model-num']))) - print("in png self.dut_model_num_list {dut_model_num_list}".format( - dut_model_num_list=self.dut_model_num_list)) - if self.dut_model_num_list[0] != None: + print( + "in png self.dut_model_num_list {dut_model_num_list}".format( + dut_model_num_list=self.dut_model_num_list)) + if self.dut_model_num_list[0] is not None: self.dut_model_num = self.dut_model_num_list[0] self.dut_sw_version_list = list( set(list(df_tmp['dut-sw-version']))) - if self.dut_sw_version_list[0] != None: + if self.dut_sw_version_list[0] is not None: self.dut_sw_version = self.dut_sw_version_list[0] self.dut_hw_version_list = list( set(list(df_tmp['dut-hw-version']))) - if self.dut_hw_version_list[0] != None: + if self.dut_hw_version_list[0] is not None: self.dut_hw_version = self.dut_hw_version_list[0] self.dut_serial_num_list = list( set(list(df_tmp['dut-serial-num']))) - if self.dut_serial_num_list[0] != None: + if self.dut_serial_num_list[0] is not None: self.dut_serial_num_ = self.dut_serial_num_list[0] - print("In png DUT: {DUT} SW:{SW} HW:{HW} SN:{SN}" - .format(DUT=self.dut_model_num_list, SW=self.dut_sw_version_list, HW=self.dut_hw_version_list, SN=self.dut_serial_num_list)) + print( + "In png DUT: {DUT} SW:{SW} HW:{HW} SN:{SN}" .format( + DUT=self.dut_model_num_list, + SW=self.dut_sw_version_list, + HW=self.dut_hw_version_list, + SN=self.dut_serial_num_list)) units_list = list(df_tmp['Units']) print( "GRAPHING::: test-rig {} test-tag {} Graph-Group {}".format(test_rig, test_tag, group)) # group of Score will have subtest if group == 'Score': - # Print out the Standard Score report , May want to check for empty pass fail - kpi_fig = (px.scatter(df_tmp, x="Date", y="numeric-score", - custom_data=[ - 'numeric-score', 'Subtest-Pass', 'Subtest-Fail'], - color="short-description", hover_name="short-description", - size_max=60)).update_traces(mode='lines+markers') + # Print out the Standard Score report , May want to + # check for empty pass fail + kpi_fig = ( + px.scatter( + df_tmp, + x="Date", + y="numeric-score", + custom_data=[ + 'numeric-score', + 'Subtest-Pass', + 'Subtest-Fail'], + color="short-description", + hover_name="short-description", + size_max=60)).update_traces( + mode='lines+markers') kpi_fig.update_traces( hovertemplate="
".join([ @@ -429,11 +457,20 @@ class csv_sql(): (df_tmp["Subtest-Pass"] + df_tmp["Subtest-Fail"]) - fig1 = (px.scatter(df_tmp, x="Date", y="Percent", - custom_data=[ - 'short-description', 'Percent', 'Subtest-Pass', 'Subtest-Fail'], - color="short-description", hover_name="short-description", - size_max=60)).update_traces(mode='lines+markers') + fig1 = ( + px.scatter( + df_tmp, + x="Date", + y="Percent", + custom_data=[ + 'short-description', + 'Percent', + 'Subtest-Pass', + 'Subtest-Fail'], + color="short-description", + hover_name="short-description", + size_max=60)).update_traces( + mode='lines+markers') fig1.update_traces( hovertemplate="
".join([ @@ -470,9 +507,15 @@ class csv_sql(): #kpi_fig.add_scatter(x=df_tmp['Date'], y=df_tmp['Subtest-Fail']).update_traces(mode='lines+markers') else: - kpi_fig = (px.scatter(df_tmp, x="Date", y="numeric-score", - color="short-description", hover_name="short-description", - size_max=60)).update_traces(mode='lines+markers') + kpi_fig = ( + px.scatter( + df_tmp, + x="Date", + y="numeric-score", + color="short-description", + hover_name="short-description", + size_max=60)).update_traces( + mode='lines+markers') kpi_fig.update_layout( title="{} : {} : {} : {}".format( @@ -491,7 +534,8 @@ class csv_sql(): kpi_fig=kpi_fig) -# Feature, Sum up the subtests passed/failed from the kpi files for each run, poke those into the database, and generate a kpi graph for them. +# Feature, Sum up the subtests passed/failed from the kpi files for each +# run, poke those into the database, and generate a kpi graph for them. def main(): parser = argparse.ArgumentParser( @@ -503,27 +547,43 @@ def main(): ''', description='''\ File: read kpi.csv place in sql database, create png of historical kpi and present graph on dashboard -Usage: lf_qa.py --store --png --path --database +Usage: lf_qa.py --store --png --path --database ''') parser.add_argument( - '--path', help='--path top directory path to kpi if regererating database or png files', default='') + '--path', + help='--path top directory path to kpi if regererating database or png files', + default='') parser.add_argument('--file', help='--file kpi.csv default: kpi.csv', default='kpi.csv') # TODO is this needed parser.add_argument( - '--database', help='--database qa_test_db default: qa_test_db', default='qa_test_db') + '--database', + help='--database qa_test_db default: qa_test_db', + default='qa_test_db') parser.add_argument( - '--table', help='--table qa_table default: qa_table', default='qa_table') + '--table', + help='--table qa_table default: qa_table', + default='qa_table') parser.add_argument( - '--server', help='--server http:/// default: http://192.168.95.6/', default='http://192.168.95.6/') + '--server', + help='--server http:/// default: http://192.168.95.6/', + default='http://192.168.95.6/') parser.add_argument( - '--cut', help='--cut /home/lanforge/ used to adjust server path default: /home/lanforge/', default='/home/lanforge/') + '--cut', + help='--cut /home/lanforge/ used to adjust server path default: /home/lanforge/', + default='/home/lanforge/') parser.add_argument( - '--store', help='--store , store kpi to db, action store_true', action='store_true') + '--store', + help='--store , store kpi to db, action store_true', + action='store_true') parser.add_argument( - '--png', help='--png, generate png for kpi in path, generate display, action store_true', action='store_true') + '--png', + help='--png, generate png for kpi in path, generate display, action store_true', + action='store_true') parser.add_argument( - '--dir', help="--dir default lf_qa", default="lf_qa") + '--dir', + help="--dir default lf_qa", + default="lf_qa") args = parser.parse_args() @@ -536,14 +596,14 @@ Usage: lf_qa.py --store --png --path --databas __dir = args.dir __cut = args.cut - print("config: path:{path} file:{file} database:{database} table:{table} server:{server} store:{store} png:{png}" - .format(path=__path, file=__file, database=__database, table=__table, server=__server, store=args.store, png=args.png)) + print("config: path:{path} file:{file} database:{database} table:{table} server:{server} store:{store} png:{png}" .format( + path=__path, file=__file, database=__database, table=__table, server=__server, store=args.store, png=args.png)) - if(__path == '' and args.store == True): + if(__path == '' and args.store): print("--path must be entered if --store , exiting") exit(1) - if(args.png == True and args.store == False): + if(args.png and args.store == False): print("if --png set to create png files then --store must also be set, exiting") exit(1) @@ -627,7 +687,7 @@ Usage: lf_qa.py --store --png --path --databas print("html report: {}".format(html_report)) try: report.write_pdf_with_timestamp() - except: + except BaseException: print("exception write_pdf_with_timestamp()") From c87ab357ec2dd6da24572b2223e97e52b7dd71d2 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 8 Oct 2021 18:07:33 -0600 Subject: [PATCH 109/731] lf_qa.py : whitespace updates Tested Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_qa.py | 40 ++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 59f402e6..d205f2eb 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -271,9 +271,11 @@ class csv_sql(): try: self.df.to_sql(self.table, self.conn, if_exists='append') except BaseException: - print("attempt to append to database with different column layout, caused an exception, input new name --database ") + print("attempt to append to database with different column layout,\ + caused an exception, input new name --database ") print( - "Error attempt to append to database with different column layout, caused an exception, input new name --database ", + "Error attempt to append to database with different column layout,\ + caused an exception, input new name --database ", file=sys.stderr) exit(1) self.conn.close() @@ -315,7 +317,7 @@ class csv_sql(): # link to interactive results kpi_html_path = self.server + html_path kpi_html_path = kpi_html_path.replace(self.cut, '') - #self.html_results +="""
""" + # self.html_results +="""
""" # link to full test results report_index_html_path = self.server + kpi_path_list[-1] + "index.html" report_index_html_path = report_index_html_path.replace(self.cut, '') @@ -352,10 +354,11 @@ class csv_sql(): print("graph_group_list: {}".format(graph_group_list)) # prior to 5.4.3 there was not test-tag, the test tag is in the meta data - #print("dataframe df3 {df3}".format(df3=df3)) + # print("dataframe df3 {df3}".format(df3=df3)) + test_tag_list = list(df3['test-tag']) test_tag_list = list(set(test_tag_list)) - #print("test_tag_list: {}".format(test_tag_list) ) + # print("test_tag_list: {}".format(test_tag_list) ) test_rig_list = list(df3['test-rig']) test_rig_list = list(set(test_rig_list)) @@ -450,9 +453,6 @@ class csv_sql(): kpi_path_list=kpi_path_list, kpi_fig=kpi_fig) - #kpi_fig = (px.bar(df_tmp, x="Date", y=["Subtest-Pass","Subtest-Fail"], title="This is the title")) - #kpi_fig = (px.bar(df_tmp, x="Date", y="Subtest-Pass", title="This is the title")) - df_tmp["Percent"] = df_tmp["Subtest-Pass"] / \ (df_tmp["Subtest-Pass"] + df_tmp["Subtest-Fail"]) @@ -480,9 +480,10 @@ class csv_sql(): "Subtest-Fail: %{customdata[3]}" ]) ) - - #kpi_fig = go.Figure(data=fig1.data + fig2.data) - # the kpi_fig is a go.Figure + ''' + kpi_fig = go.Figure(data=fig1.data + fig2.data) + the kpi_fig is a go.Figure + ''' kpi_fig = go.Figure(data=fig1.data) kpi_fig.update_layout(yaxis=dict(tickformat='.2%')) kpi_fig.update_layout( @@ -504,7 +505,7 @@ class csv_sql(): kpi_path_list=kpi_path_list, kpi_fig=kpi_fig) - #kpi_fig.add_scatter(x=df_tmp['Date'], y=df_tmp['Subtest-Fail']).update_traces(mode='lines+markers') + # kpi_fig.add_scatter(x=df_tmp['Date'], y=df_tmp['Subtest-Fail']).update_traces(mode='lines+markers') else: kpi_fig = ( @@ -596,18 +597,23 @@ Usage: lf_qa.py --store --png --path --databas __dir = args.dir __cut = args.cut - print("config: path:{path} file:{file} database:{database} table:{table} server:{server} store:{store} png:{png}" .format( - path=__path, file=__file, database=__database, table=__table, server=__server, store=args.store, png=args.png)) + print("config:\ + path:{path} file:{file}\ + database:{database} table:{table} \ + server:{server} store:{store} png:{png}" .format( + path=__path, file=__file, + database=__database, table=__table, + server=__server, store=args.store, png=args.png)) if(__path == '' and args.store): print("--path must be entered if --store , exiting") exit(1) - if(args.png and args.store == False): + if(args.png and args.store is False): print("if --png set to create png files then --store must also be set, exiting") exit(1) - if args.store == False and args.png == False: + if args.store is False and args.png is False: print("Need to enter an action of --store --png ") # create report class for reporting @@ -660,7 +666,7 @@ Usage: lf_qa.py --store --png --path --databas report.build_link( "All Test-Rig Test Suites Results Directory", report_parent_path) - # links table for tests TODO : can this be a table + # links table for tests TODO : can this be a table report.set_table_title("Test Suite") report.build_table_title() suite_html = csv_dash.get_suite_html() From e907ccd1123b214ab63bbd1c98727ee7ecd1e042 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 9 Oct 2021 19:11:01 -0600 Subject: [PATCH 110/731] ct_us_002_tests.json : set spatial streams to auto Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_002_tests.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index af7403f3..c301111a 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -157,7 +157,7 @@ " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' ", - " --raw_line 'spatial_streams: 4' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984' ", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984' ", " --set DUT_SET_NAME" ] }, @@ -231,7 +231,7 @@ " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", - " --raw_line 'spatial_streams: 4' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AX200'", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AX200'", " --set DUT_SET_NAME" ] }, From 2032b464330f503e204ae5ad08271b404123a2b5 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sun, 10 Oct 2021 09:24:35 -0600 Subject: [PATCH 111/731] lf_check.py add test run path to meta data ct_us_003_tests.json reduced stations created. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_003_tests.json | 2 +- py-scripts/tools/lf_check.py | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index 38006885..015006ee 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -156,7 +156,7 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario ATH10K_9984_wc ", - " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AUTO 16 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index d28c21e2..c92ddbfc 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -860,12 +860,10 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) if meta_data_path != "": meta_data_fd = open(meta_data_path,'w+') meta_data_fd.write('$ Generated by Candela Technologies LANforge network testing tool\n') - meta_data_fd.write('$ meta.txt file location\n') - meta_data_fd.write("file {path}\n".format(path=meta_data_path)) - meta_data_fd.write('$ LANforge GUI\n') - meta_data_fd.write('gui_version: {gui_version} \n'.format(gui_version=self.lanforge_gui_version)) - meta_data_fd.write('$ LANforge SERVER\n') - meta_data_fd.write('server_version: {server_version} \n'.format(server_version=self.lanforge_server_version)) + meta_data_fd.write("test_run {test_run}\n".format(test_run=self.report_path)) + meta_data_fd.write("file_meta {path}\n".format(path=meta_data_path)) + meta_data_fd.write('lanforge_gui_version: {gui_version} \n'.format(gui_version=self.lanforge_gui_version)) + meta_data_fd.write('lanforge_server_version: {server_version} \n'.format(server_version=self.lanforge_server_version)) meta_data_fd.write('$ LANforge command\n') meta_data_fd.write("command {command}\n".format(command=command)) # split command at test-tag , at rest of string once at the actual test-tag value @@ -877,7 +875,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) meta_data_fd.write('$ LANforge Information\n') meta_data_fd.write("lanforge_system_node {lanforge_system_node}\n".format(lanforge_system_node=self.lanforge_system_node_version[0])) meta_data_fd.write("lanforge_kernel_version {lanforge_kernel_version}\n".format(lanforge_kernel_version=self.lanforge_kernel_version[0])) - meta_data_fd.write("lanforge_gui_version_full {lanforge_gui_version_full}\n".format(lanforge_gui_version_full=self.lanforge_gui_version_full[0])) + meta_data_fd.write("lanforge_gui_version_full {lanforge_gui_version_full}\n".format(lanforge_gui_version_full=self.lanforge_gui_version_full)) meta_data_fd.write("lanforge_server_version_full {lanforge_server_version_full}\n".format(lanforge_server_version_full=self.lanforge_server_version_full[0])) meta_data_fd.close() From dc235780633206d49a408226fe9ce0761a235d38 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 11 Oct 2021 06:50:10 -0600 Subject: [PATCH 112/731] ls_qa.py read test_run from meta.txt and if not present get test_run from the location of the kpi.csv Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_qa.py | 101 ++++++++++++++------------------------ 1 file changed, 38 insertions(+), 63 deletions(-) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index d205f2eb..7d3cfe3b 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -123,6 +123,32 @@ class csv_sql(): kpi_path=_kpi_path)) return test_id, test_tag + def get_test_run_from_meta(self, _kpi_path): + test_run = "NA" + print("read meta path {_kpi_path}".format(_kpi_path=_kpi_path)) + try: + meta_data_path = _kpi_path + '/' + '/meta.txt' + meta_data_fd = open(meta_data_path, 'r') + for line in meta_data_fd: + if "test_run" in line: + test_run = line.replace("test_run", "") + test_run = test_run.strip() + print("meta_data_path: {meta_data_path} test_run: {test_run}".format( + meta_data_path=meta_data_path, test_run=test_run)) + meta_data_fd.close() + except BaseException: + print("exception reading test_run from {_kpi_path}".format( + _kpi_path=_kpi_path)) + + if test_run is "NA": + try: + test_run = _kpi_path.rsplit('/', 2)[0] + print("try harder test_run {test_run}".format(test_run)) + except BaseException: + print("exception getting test_run from kpi_path") + print("Try harder test_run: {test_run} _kpi_path: {_kpi_path}".format(test_run=test_run, _kpi_path=_kpi_path)) + return test_run + def get_test_tag_from_meta(self, _kpi_path): test_tag = "NA" use_meta_test_tag = False @@ -260,8 +286,9 @@ class csv_sql(): # only store the path to the kpi.csv file _kpi_path = str(kpi).replace('kpi.csv', '') df_kpi_tmp['kpi_path'] = _kpi_path - use_meta_test_tag, test_tag = self.get_test_tag_from_meta( - _kpi_path) + test_run = self.get_test_run_from_meta(_kpi_path) + df_kpi_tmp['test_run'] = test_run + use_meta_test_tag, test_tag = self.get_test_tag_from_meta(_kpi_path) if use_meta_test_tag: df_kpi_tmp['test-tag'] = test_tag df_kpi_tmp = df_kpi_tmp.append(df_kpi_tmp, ignore_index=True) @@ -365,6 +392,9 @@ class csv_sql(): self.test_rig_list = test_rig_list print("test_rig_list: {}".format(test_rig_list)) + # TODO determin the subtest pass and fail graph + + # create the rest of the graphs for test_rig in test_rig_list: for test_tag in test_tag_list: for group in graph_group_list: @@ -413,8 +443,7 @@ class csv_sql(): "GRAPHING::: test-rig {} test-tag {} Graph-Group {}".format(test_rig, test_tag, group)) # group of Score will have subtest if group == 'Score': - # Print out the Standard Score report , May want to - # check for empty pass fail + # Print out the Standard Score report kpi_fig = ( px.scatter( df_tmp, @@ -438,8 +467,8 @@ class csv_sql(): ) kpi_fig.update_layout( - title="{} : {} : {} : {}".format( - test_id_list[-1], group, test_tag, test_rig), + title="{test_id} : {group} : {test_tag} : {test_rig}".format( + test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig), xaxis_title="Time", yaxis_title="{}".format(units_list[-1]), xaxis={'type': 'date'} @@ -453,60 +482,6 @@ class csv_sql(): kpi_path_list=kpi_path_list, kpi_fig=kpi_fig) - df_tmp["Percent"] = df_tmp["Subtest-Pass"] / \ - (df_tmp["Subtest-Pass"] + - df_tmp["Subtest-Fail"]) - - fig1 = ( - px.scatter( - df_tmp, - x="Date", - y="Percent", - custom_data=[ - 'short-description', - 'Percent', - 'Subtest-Pass', - 'Subtest-Fail'], - color="short-description", - hover_name="short-description", - size_max=60)).update_traces( - mode='lines+markers') - - fig1.update_traces( - hovertemplate="
".join([ - "short-description: %{customdata[0]}", - "Percent: %{customdata[1]:.2%}", - "Subtest-Pass: %{customdata[2]}", - "Subtest-Fail: %{customdata[3]}" - ]) - ) - ''' - kpi_fig = go.Figure(data=fig1.data + fig2.data) - the kpi_fig is a go.Figure - ''' - kpi_fig = go.Figure(data=fig1.data) - kpi_fig.update_layout(yaxis=dict(tickformat='.2%')) - kpi_fig.update_layout( - title="{} : {} : Subtests : {} : {}".format( - test_id_list[-1], group, test_tag, test_rig), - xaxis_title="Time", - yaxis_title="Subtest Percent Pass", - xaxis={'type': 'date'} - ) - - # modify the group - group = group + "_subtests" - - self.generate_png(df_tmp=df_tmp, - group=group, - test_id_list=test_id_list, - test_tag=test_tag, - test_rig=test_rig, - kpi_path_list=kpi_path_list, - kpi_fig=kpi_fig) - - # kpi_fig.add_scatter(x=df_tmp['Date'], y=df_tmp['Subtest-Fail']).update_traces(mode='lines+markers') - else: kpi_fig = ( px.scatter( @@ -519,10 +494,10 @@ class csv_sql(): mode='lines+markers') kpi_fig.update_layout( - title="{} : {} : {} : {}".format( - test_id_list[-1], group, test_tag, test_rig), + title="{test_id} : {group} : {test_tag} : {test_rig}".format( + test_id=test_id_list[-1], group=group, test_tag=test_tag, test_rig=test_rig), xaxis_title="Time", - yaxis_title="{}".format(units_list[-1]), + yaxis_title="{units}".format(units=units_list[-1]), xaxis={'type': 'date'} ) From 58effa8e1b9068388878e87ed2d6a825cf970c8a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 11 Oct 2021 11:40:46 -0700 Subject: [PATCH 113/731] Better whitespace in create_chambervew_dut.py Signed-off-by: Matthew Stidham --- py-scripts/create_chamberview_dut.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/py-scripts/create_chamberview_dut.py b/py-scripts/create_chamberview_dut.py index b21c75a8..632259c6 100755 --- a/py-scripts/create_chamberview_dut.py +++ b/py-scripts/create_chamberview_dut.py @@ -54,7 +54,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) # from cv_dut_profile import cv_dut as dut @@ -92,7 +91,6 @@ class DUT(dut): self.dut_name = dut_name self.ssid = ssid - def setup(self): self.create_dut() @@ -117,7 +115,7 @@ class DUT(dut): self.ssid[j]['flag'] = [] self.ssid[j].keys - flag=0x0 + flag = 0x0 if 'security' in self.ssid[j].keys(): self.ssid[j]['security'] = self.ssid[j]['security'].split('|') for security in self.ssid[j]['security']: @@ -172,10 +170,10 @@ def main(): port=args.port, dut_name=args.dut_name, ssid=args.ssid, - sw_version = args.sw_version, - hw_version = args.hw_version, - serial_num = args.serial_num, - model_num = args.model_num, + sw_version=args.sw_version, + hw_version=args.hw_version, + serial_num=args.serial_num, + model_num=args.model_num, dut_flags=args.dut_flag ) From 261d9cf56aa81c2de1ea47fb200aa186b6c82248 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Mon, 11 Oct 2021 09:46:26 -0700 Subject: [PATCH 114/731] Added shebang, fixed issue with datetime.datetime, fixed spelling --- py-scripts/lf_ftp.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/py-scripts/lf_ftp.py b/py-scripts/lf_ftp.py index e097b527..44d29704 100755 --- a/py-scripts/lf_ftp.py +++ b/py-scripts/lf_ftp.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """ lf_ftp.py will verify that N clients connected on specified band and can simultaneously download/upload some amount of file from FTP server and measuring the time taken by client to download/upload the file. cli- python3 lf_ftp.py --mgr localhost --mgr_port 8080 --upstream_port eth1 --ssid FTP --security open --passwd BLANK --ap_name WAC505 --ap_ip 192.168.213.90 --bands Both --directions Download --twog_radio wiphy1 --fiveg_radio wiphy0 --file_size 2MB --num_stations 40 --Both_duration 1 --traffic_duration 2 --ssh_port 22_ Copyright 2021 Candela Technologies Inc @@ -11,6 +12,7 @@ from datetime import datetime import time import os import matplotlib.patches as mpatches +import pandas as pd if sys.version_info[0] != 3: print("This script requires Python 3") @@ -301,7 +303,7 @@ class FtpTest(LFCliBase): for i in range(self.num_sta): list_of_time.append(0) #running layer 4 traffic upto user given time - while str(datetime.datetime.now() - time1) <= self.traffic_duration: + while str(datetime.now() - time1) <= self.traffic_duration: if list_of_time.count(0) == 0: break @@ -309,11 +311,11 @@ class FtpTest(LFCliBase): # run script upto given time if counter == 0: - if str(datetime.datetime.now() - time1) >= self.duration: + if str(datetime.now() - time1) >= self.duration: counter = counter + 1 break else: - if str(datetime.datetime.now() - time1) >= self.traffic_duration: + if str(datetime.now() - time1) >= self.traffic_duration: break for i in range(self.num_sta): @@ -732,10 +734,10 @@ def main(): args = parser.parse_args() # 1st time stamp for test duration - time_stamp1 = datetime.datetime.now() + time_stamp1 = datetime.now() # use for creating ftp_test dictionary - iteraration_num = 0 + interation_num = 0 # empty dictionary for whole test data ftp_data = {} @@ -794,7 +796,7 @@ def main(): ssh_port=args.ssh_port ) - iteraration_num = iteraration_num + 1 + interation_num = interation_num + 1 obj.file_create() obj.set_values() obj.precleanup() @@ -804,7 +806,7 @@ def main(): exit(1) # First time stamp - time1 = datetime.datetime.now() + time1 = datetime.now() obj.start(False, False) @@ -815,19 +817,19 @@ def main(): pass_fail = obj.pass_fail_check(time_list) # dictionary of whole data - ftp_data[iteraration_num] = obj.ftp_test_data(time_list, pass_fail, args.bands, args.file_sizes, + ftp_data[interation_num] = obj.ftp_test_data(time_list, pass_fail, args.bands, args.file_sizes, args.directions, args.num_stations) obj.stop() obj.postcleanup() # 2nd time stamp for test duration - time_stamp2 = datetime.datetime.now() + time_stamp2 = datetime.now() # total time for test duration test_duration = str(time_stamp2 - time_stamp1)[:-7] - date = str(datetime.datetime.now()).split(",")[0].replace(" ", "-").split(".")[0] + date = str(datetime.now()).split(",")[0].replace(" ", "-").split(".")[0] #print(ftp_data) From b5255c88d3c43f229210a31b355f6754318dde19 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Mon, 11 Oct 2021 11:57:50 -0700 Subject: [PATCH 115/731] Removed port_probe.py, renamed port_probe2.py to port_probe.py --- py-scripts/port_probe.py | 157 --------------------------------------- 1 file changed, 157 deletions(-) delete mode 100755 py-scripts/port_probe.py diff --git a/py-scripts/port_probe.py b/py-scripts/port_probe.py deleted file mode 100755 index 64e9ca3f..00000000 --- a/py-scripts/port_probe.py +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env python3 - -""" -NAME: port_probe.py - -PURPOSE: -Probes a port for information. If a station is used, an ssid, radio, and security type must be specified - -Use './port_probe.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. -""" - -import sys -import os - -if sys.version_info[0] != 3: - print("This script requires Python 3") - exit(1) - -if 'py-json' not in sys.path: - sys.path.append(os.path.join(os.path.abspath('..'), 'py-json')) - -if 'py-dashboard' not in sys.path: - sys.path.append(os.path.join(os.path.abspath('..'), 'py-dashboard')) - -import argparse -from LANforge import LFUtils -from realm import Realm -import datetime -import time -import pprint - - -class PortProbe(Realm): - def __init__(self, - ssid=None, - security=None, - password=None, - port_name=None, - upstream=None, - radio=None, - host="localhost", - port=8080, - mode=0, - number_template="00000", - use_ht160=False, - _debug_on=False, - _exit_on_error=False, - _exit_on_fail=False): - super().__init__(lfclient_host=host, - lfclient_port=port), - self.upstream = upstream - self.host = host - self.port = port - self.ssid = ssid - self.port_name = port_name - self.security = security - self.password = password - self.radio = radio - self.mode = mode - self.debug = _debug_on - if 'sta' in self.port_name: - self.number_template = number_template - self.station_profile = self.new_station_profile() - self.station_profile.lfclient_url = self.lfclient_url - self.station_profile.ssid = self.ssid - self.station_profile.ssid_pass = self.password - self.station_profile.security = self.security - self.station_profile.number_template_ = self.number_template - self.station_profile.debug = self.debug - - self.station_profile.use_ht160 = use_ht160 - if self.station_profile.use_ht160: - self.station_profile.mode = 9 - self.station_profile.mode = mode - - def start(self): - if 'sta' in self.port_name: - self.station_profile.admin_up() - print("Probing %s" % self.port_name) - port_info = self.name_to_eid(self.port_name) - data = { - "shelf": 1, - "resource": 1, - "port": self.port_name, - "key": "probe_port.quiet.%d.%d.%s" % (port_info[0], port_info[1], port_info[2]) - } - self.json_post("/cli-json/probe_port", data) - time.sleep(10) - probe_results = self.json_get("probe/1/1/%s" % self.port_name) - - print(probe_results) - - def cleanup(self): - if 'sta' in self.port_name: - self.station_profile.cleanup() - LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=self.station_profile.station_names, - debug=self.debug) - - def build(self): - if 'sta' in self.port_name: - self.station_profile.use_security(self.security, self.ssid, self.password) - self.station_profile.set_number_template(self.number_template) - print("Creating stations") - 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=self.radio, sta_names_=[self.port_name], num_stations=1, debug=self.debug) - LFUtils.wait_until_ports_appear(self.port_name) - self._pass("PASS: Station build finished") - - -def main(): - parser = Realm.create_basic_argparse( - prog='port_probe_test.py', - formatter_class=argparse.RawTextHelpFormatter, - epilog='''\ - Used to probe ports for information - ''', - description='''\ - Probes a port for information. If a station is used, an ssid, radio, and security type must be specified - - Example: - ./port_probe.py --ssid test_name --security open --radio wiphy0 - ''') - - parser.add_argument('--mode', help='Used to force mode of stations') - parser.add_argument('--port_name', help='Name of station to be used', default="sta0000") - - args = parser.parse_args() - - port_probe = PortProbe(host=args.mgr, - port=args.mgr_port, - number_template="0000", - port_name=args.port_name, - upstream=args.upstream_port, - ssid=args.ssid, - password=args.passwd, - radio=args.radio, - security=args.security, - use_ht160=False, - mode=args.mode, - _debug_on=args.debug) - - port_probe.build() - # exit() - if not port_probe.passes(): - print(port_probe.get_fail_message()) - port_probe.exit_fail() - - port_probe.start() - port_probe.cleanup() - - -if __name__ == "__main__": - main() From c39332dcf1d63114bba4d0c4774956554f9d7a40 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Mon, 11 Oct 2021 11:59:08 -0700 Subject: [PATCH 116/731] renamed port_probe2.py to port_probe.py --- py-scripts/{port_probe2.py => port_probe.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename py-scripts/{port_probe2.py => port_probe.py} (98%) diff --git a/py-scripts/port_probe2.py b/py-scripts/port_probe.py similarity index 98% rename from py-scripts/port_probe2.py rename to py-scripts/port_probe.py index 6f05b526..a6a988e2 100755 --- a/py-scripts/port_probe2.py +++ b/py-scripts/port_probe.py @@ -59,7 +59,7 @@ def main(): prog=__name__, description='''\ Example: - ./port_probe2.py --port 1.1.eth0 + ./port_probe.py --port 1.1.eth0 ''') parser.add_argument('--mode', help='Used to force mode of stations') From 23b286122d0c18348702c0344764260dc260c845 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 11 Oct 2021 11:59:08 -0700 Subject: [PATCH 117/731] Bring white space up to standard in create_l3_stations.py Signed-off-by: Matthew Stidham --- py-scripts/create_l3_stations.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/py-scripts/create_l3_stations.py b/py-scripts/create_l3_stations.py index 65521043..44e0c13b 100755 --- a/py-scripts/create_l3_stations.py +++ b/py-scripts/create_l3_stations.py @@ -142,7 +142,7 @@ def main(): for group in parser._action_groups: if group.title == "required arguments": required_args = group - break; + break if required_args is not None: required_args.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) required_args.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000) @@ -151,12 +151,15 @@ def main(): for group in parser._action_groups: if group.title == "optional arguments": optional_args = group - break; + break if optional_args is not None: optional_args.add_argument('--mode', help='Used to force mode of stations') optional_args.add_argument('--ap', help='Used to force a connection to a particular AP') - optional_args.add_argument('--number_template', help='Start the station numbering with a particular number. Default is 0000', default=0000) - optional_args.add_argument('--station_list', help='Optional: User defined station names', action='append',default=None) + optional_args.add_argument('--number_template', + help='Start the station numbering with a particular number. Default is 0000', + default=0000) + optional_args.add_argument('--station_list', help='Optional: User defined station names', action='append', + default=None) args = parser.parse_args() num_sta = 2 @@ -164,7 +167,8 @@ def main(): num_sta = int(args.num_stations) if args.station_list is None: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=int(args.number_template), end_id_=num_sta+int(args.number_template) - 1, padding_number_=10000, + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=int(args.number_template), + end_id_=num_sta + int(args.number_template) - 1, padding_number_=10000, radio=args.radio) else: station_list = args.station_list From 373fea3b92a619e1a67cb19628b48823b015a065 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 11 Oct 2021 12:07:48 -0700 Subject: [PATCH 118/731] Fix whitespace errors in create_l4.py Signed-off-by: Matthew Stidham --- py-scripts/create_l4.py | 71 +++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/py-scripts/create_l4.py b/py-scripts/create_l4.py index 12662b49..0eb72f61 100755 --- a/py-scripts/create_l4.py +++ b/py-scripts/create_l4.py @@ -13,7 +13,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -27,10 +26,10 @@ TestGroupProfile = realm.TestGroupProfile class CreateL4(Realm): def __init__(self, ssid, security, password, sta_list, name_prefix, upstream, radio, - host="localhost", port=8080, mode = 0, ap=None, + host="localhost", port=8080, mode=0, ap=None, side_a_min_rate=56, side_a_max_rate=0, side_b_min_rate=56, side_b_max_rate=0, - number_template="00000", use_ht160=False, + number_template="00000", use_ht160=False, _debug_on=False, _exit_on_error=False, _exit_on_fail=False): @@ -43,8 +42,8 @@ class CreateL4(Realm): self.security = security self.password = password self.radio = radio - self.mode= mode - self.ap=ap + self.mode = mode + self.ap = ap self.number_template = number_template self.debug = _debug_on self.name_prefix = name_prefix @@ -61,9 +60,8 @@ class CreateL4(Realm): self.station_profile.mode = 9 self.station_profile.mode = mode if self.ap is not None: - self.station_profile.set_command_param("add_sta", "ap",self.ap) - #self.station_list= LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=2, padding_number_=10000, radio='wiphy0') #Make radio a user defined variable from terminal. - + self.station_profile.set_command_param("add_sta", "ap", self.ap) + # self.station_list= LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=2, padding_number_=10000, radio='wiphy0') #Make radio a user defined variable from terminal. self.cx_profile.host = self.host self.cx_profile.port = self.port @@ -77,8 +75,8 @@ class CreateL4(Realm): self.cx_profile.cleanup() self.station_profile.cleanup() LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, - port_list=self.station_profile.station_names, - debug=self.debug) + port_list=self.station_profile.station_names, + debug=self.debug) def build(self): # Build stations @@ -91,7 +89,9 @@ class CreateL4(Realm): self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug) self._pass("PASS: Station build finished") - self.cx_profile.create(ports=self.station_profile.station_names, sleep_time=.5, debug_=self.debug, suppress_related_commands_=True) + self.cx_profile.create(ports=self.station_profile.station_names, sleep_time=.5, debug_=self.debug, + suppress_related_commands_=True) + def main(): parser = LFCliBase.create_basic_argparse( @@ -134,46 +134,47 @@ python3 ./layer4.py --debug ''') - required_args=None + required_args = None for group in parser._action_groups: if group.title == "required arguments": - required_args=group - break; + required_args = group + break if required_args is not None: required_args.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) required_args.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000) - optional_args=None + optional_args = None for group in parser._action_groups: if group.title == "optional arguments": - optional_args=group - break; + optional_args = group + break if optional_args is not None: - optional_args.add_argument('--mode',help='Used to force mode of stations', default=0) - optional_args.add_argument('--ap',help='Used to force a connection to a particular AP') + optional_args.add_argument('--mode', help='Used to force mode of stations', default=0) + optional_args.add_argument('--ap', help='Used to force a connection to a particular AP') args = parser.parse_args() num_sta = 2 if (args.num_stations is not None) and (int(args.num_stations) > 0): num_sta = int(args.num_stations) - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta-1, padding_number_=10000, radio=args.radio) + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, + radio=args.radio) ip_var_test = CreateL4(host=args.mgr, - port=args.mgr_port, - number_template="0000", - sta_list=station_list, - name_prefix="VT", - upstream=args.upstream_port, - ssid=args.ssid, - password=args.passwd, - radio=args.radio, - security=args.security, - use_ht160=False, - side_a_min_rate=args.a_min, - side_b_min_rate=args.b_min, - mode=args.mode, - ap=args.ap, - _debug_on=args.debug) + port=args.mgr_port, + number_template="0000", + sta_list=station_list, + name_prefix="VT", + upstream=args.upstream_port, + ssid=args.ssid, + password=args.passwd, + radio=args.radio, + security=args.security, + use_ht160=False, + side_a_min_rate=args.a_min, + side_b_min_rate=args.b_min, + mode=args.mode, + ap=args.ap, + _debug_on=args.debug) ip_var_test.cleanup() ip_var_test.build() From dcf4be6cd34a452f4eae1ee6d7a89364134006f9 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 11 Oct 2021 12:19:39 -0700 Subject: [PATCH 119/731] Fix white space errors in create_macvlan.py Signed-off-by: Matthew Stidham --- py-scripts/create_macvlan.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py-scripts/create_macvlan.py b/py-scripts/create_macvlan.py index 5694f006..02330fe3 100755 --- a/py-scripts/create_macvlan.py +++ b/py-scripts/create_macvlan.py @@ -96,6 +96,8 @@ Generic command layout: ./create_macvlan.py --radio 1.wiphy0 --macvlan_parent eth1 --num_ports 3 --use_ports eth1#0=10.40.3.103,eth1#1,eth1#2 --connections_per_port 2 --netmask 255.255.240.0 --gateway 10.40.0.1 + + You can only add MAC-VLANs to Ethernet, Bonding, Redir, and 802.1Q VLAN devices. ''') parser.add_argument('--num_stations', help='Number of stations to create', default=0) @@ -103,7 +105,7 @@ Generic command layout: parser.add_argument('-u', '--upstream_port', help='non-station port that generates traffic: ., e.g: 1.eth1', default='1.eth1') - parser.add_argument('--macvlan_parent', help='specifies parent port for macvlan creation', default=None) + parser.add_argument('--macvlan_parent', help='specifies parent port for macvlan creation', required=True) parser.add_argument('--first_port', help='specifies name of first port to be used', default=None) parser.add_argument('--num_ports', help='number of ports to create', default=1) parser.add_argument('--connections_per_port', help='specifies number of connections to be used per port', default=1, From 03602df37d6b3972cabc5344a99b03102385fa44 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 11 Oct 2021 12:20:06 -0700 Subject: [PATCH 120/731] Fix mutable argument in create_macvlan, and also require the user to define a macvlan parent Signed-off-by: Matthew Stidham --- py-scripts/create_macvlan.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/py-scripts/create_macvlan.py b/py-scripts/create_macvlan.py index 02330fe3..61f948c3 100755 --- a/py-scripts/create_macvlan.py +++ b/py-scripts/create_macvlan.py @@ -8,7 +8,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -29,7 +28,7 @@ class CreateMacVlan(Realm): netmask=None, gateway=None, dhcp=True, - port_list=[], + port_list=None, ip_list=None, connections_per_port=1, _debug_on=False, @@ -51,7 +50,6 @@ class CreateMacVlan(Realm): self.mvlan_profile = self.new_mvlan_profile() - self.mvlan_profile.num_macvlans = int(num_ports) self.mvlan_profile.desired_macvlans = self.port_list self.mvlan_profile.macvlan_parent = self.macvlan_parent @@ -69,6 +67,7 @@ class CreateMacVlan(Realm): self._pass("PASS: MACVLAN build finished") self.created_ports += self.mvlan_profile.created_macvlans + def main(): parser = LFCliBase.create_bare_argparse( prog='create_macvlan.py', @@ -116,8 +115,8 @@ Generic command layout: parser.add_argument('--first_mvlan_ip', help='specifies first static ip address to be used or dhcp', default=None) parser.add_argument('--netmask', help='specifies netmask to be used with static ip addresses', default=None) parser.add_argument('--gateway', help='specifies default gateway to be used with static addressing', default=None) - parser.add_argument('--cxs', help='list of cxs to add/remove depending on use of --add_to_group or --del_from_group' - , default=None) + parser.add_argument('--cxs', help='list of cxs to add/remove depending on use of --add_to_group or --del_from_group', + default=None) args = parser.parse_args() port_list = [] From 7bd0bc48c970bfe3ccac532e3457bc1263790e2d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 11 Oct 2021 12:33:13 -0700 Subject: [PATCH 121/731] Fixing whitespace in create_chamberview.py Signed-off-by: Matthew Stidham --- py-scripts/create_chamberview.py | 55 ++++++++++++++++---------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/py-scripts/create_chamberview.py b/py-scripts/create_chamberview.py index c8b4f2af..c4c8c0b9 100755 --- a/py-scripts/create_chamberview.py +++ b/py-scripts/create_chamberview.py @@ -41,7 +41,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) cv_test_manager = importlib.import_module("py-json.cv_test_manager") @@ -52,28 +51,28 @@ class CreateChamberview(cv): def __init__(self, lfmgr="localhost", port="8080", - ): + ): super().__init__( - lfclient_host=lfmgr, - lfclient_port=port, + lfclient_host=lfmgr, + lfclient_port=port, ) self.lfmgr = lfmgr self.port = port - def clean_cv_scenario(self,type="Network-Connectivity",scenario_name=None): - self.rm_cv_text_blob(type,scenario_name) + def clean_cv_scenario(self, type="Network-Connectivity", scenario_name=None): + self.rm_cv_text_blob(type, scenario_name) def setup(self, - create_scenario="", - line="", - raw_line=[]): + create_scenario="", + line="", + raw_line=[]): if raw_line: print("creating %s scenario" % create_scenario) for create_lines in raw_line: - self.pass_raw_lines_to_cv(create_scenario,create_lines[0]) + self.pass_raw_lines_to_cv(create_scenario, create_lines[0]) - #check for lines + # check for lines if line: scenario_name = create_scenario line = line @@ -130,43 +129,43 @@ class CreateChamberview(cv): continue self.add_text_blob_line(scenario_name, - Resource, - Profile, - Amount, - DUT, - DUT_Radio, - Uses1, - Uses2, - Traffic, - Freq, - VLAN - ); # To manage scenario + Resource, + Profile, + Amount, + DUT, + DUT_Radio, + Uses1, + Uses2, + Traffic, + Freq, + VLAN + ) # To manage scenario if not line and not raw_line: raise Exception("scenario creation failed") return True - def build(self,scenario_name): + def build(self, scenario_name): self.sync_cv() # chamberview sync time.sleep(2) self.apply_cv_scenario(scenario_name) # Apply scenario - self.show_text_blob(None, None, False) # Show changes on GUI + self.show_text_blob(None, None, False) # Show changes on GUI self.apply_cv_scenario(scenario_name) # Apply scenario self.build_cv_scenario() # build scenario tries = 0 - while (True): + while True: self.get_popup_info_and_close() if not self.get_cv_is_built(): # It can take a while to build a large scenario, so wait-time # is currently max of 5 minutes. - print("Waiting %i/300 for Chamber-View to be built." % (tries)) + print("Waiting %i/300 for Chamber-View to be built." % tries) tries += 1 - if (tries > 300): + if tries > 300: break time.sleep(1) else: break - print("completed building %s scenario" %scenario_name) + print("completed building %s scenario" % scenario_name) def main(): From bc006199ff542fccf21a45eedf84f0cac589c6c0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 11 Oct 2021 12:42:31 -0700 Subject: [PATCH 122/731] Fix mutable arguments and shadowing build in functions in create_chamberview.py Signed-off-by: Matthew Stidham --- py-scripts/create_chamberview.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/create_chamberview.py b/py-scripts/create_chamberview.py index c4c8c0b9..f9beaed7 100755 --- a/py-scripts/create_chamberview.py +++ b/py-scripts/create_chamberview.py @@ -59,13 +59,13 @@ class CreateChamberview(cv): self.lfmgr = lfmgr self.port = port - def clean_cv_scenario(self, type="Network-Connectivity", scenario_name=None): - self.rm_cv_text_blob(type, scenario_name) + def clean_cv_scenario(self, cv_type="Network-Connectivity", scenario_name=None): + self.rm_cv_text_blob(cv_type, scenario_name) def setup(self, create_scenario="", line="", - raw_line=[]): + raw_line=None): if raw_line: print("creating %s scenario" % create_scenario) @@ -205,7 +205,7 @@ def main(): port=args.port, ) if args.delete_scenario: - Create_Chamberview.clean_cv_scenario(type="Network-Connectivity", scenario_name=args.create_scenario) + Create_Chamberview.clean_cv_scenario(cv_type="Network-Connectivity", scenario_name=args.create_scenario) Create_Chamberview.setup(create_scenario=args.create_scenario, line=args.line, From a8531a14c816e929dc3c6dbb22d4f963bf247e28 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 11 Oct 2021 15:17:48 -0700 Subject: [PATCH 123/731] JAG: new top level package named lanforge_client holds renamed lanforge_api module --- lanforge_client/__init__.py | 0 lanforge_client/lanforge_api.py | 15380 ++++++++++++++++++++++++++++++ 2 files changed, 15380 insertions(+) create mode 100644 lanforge_client/__init__.py create mode 100644 lanforge_client/lanforge_api.py diff --git a/lanforge_client/__init__.py b/lanforge_client/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lanforge_client/lanforge_api.py b/lanforge_client/lanforge_api.py new file mode 100644 index 00000000..e2f16d5d --- /dev/null +++ b/lanforge_client/lanforge_api.py @@ -0,0 +1,15380 @@ +#!/usr/bin/env python3 +"""----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + + LANforge-GUI Source Code + Copyright (C) 1999-2021 Candela Technologies Inc + http:www.candelatech.com + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + Contact: Candela Technologies if you have any + questions. + + LANforge JSON API + + A distinct difference from previous LF scripts is the notion of a session. + Please create a session instance before connecting to your LANforge client. + The session is informative for a GUI user how many scripts are actively + using the GUI. It also provides logging to diagnose how many scripts are + potentially accessing the GUI at the same time. + + EXAMPLE PYTHON USAGE: + ----- ----- ----- 8< ----- ----- ----- 8< ----- ----- ----- + session = LFSession(lfclient_url="http://localhost:8080", + connect_timeout_sec=20, + proxy_map={ + 'http':'http://192.168.1.250:3128' + }, + debug=True, + die_on_error=False); + lf_command = session.get_command() + full_response = [] + first_response = lf_command.json_post( url="/nc_show_ports", + post_data={ + "shelf": 1, + "resource": 1, + "ports": "all" + }, + full_response) + pprint(first_response) + + lf_query = session.get_query() + response = lf_query.get_as_json(url="/port/1/1/list", + debug=True) + pprint(response) + ----- ----- ----- 8< ----- ----- ----- 8< ----- ----- ----- + + The API that this library provides is ACTIVELY BEING CHANGED. + + MAINTENANCE: + To maintain this library, please refer to these files: + * client/candela/lanforge/json_api.py + - the basis for many of the auto-generated python classes + that follow after these class definitions. + * client/candela/lanforge/JsonApiPythonGenerator.java + - the builder class that produces lf_json_autogen + The file json_api.py is intended to be bundled in lfclient.jar and + not to be extracted. It is sourced during build by the JsonApiPythonGenerator + class which appends subclasses to it. + +----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" +import http.client +import sys + +if sys.version_info[0] != 3: + print("This script requires Python 3") + exit() + +import urllib +from urllib import request +from urllib import error +from urllib import parse +from http.client import HTTPResponse + +import json +import logging +from logging import Logger +import time +import traceback +# from typing import Type +from datetime import datetime +from enum import IntFlag +from pprint import pprint +from pprint import pformat +from enum import Enum + + +SESSION_HEADER = 'X-LFJson-Session' +LOGGER = Logger('json_api') + +def _now_ms() -> int: + return round(time.time() * 1000) + + +def _now_sec() -> int: + return round(time.time() * 1000 * 1000) + + +def _is(text: str) -> bool: + if text is None: + return False + if (len(text) == 0) or (text.strip() == ""): + return False + return True + + +def _not(text: str) -> bool: + return not _is(text=text) + + +def default_proxies() -> dict: + return { + # 'http': 'http://example.com', + # 'https': 'https://example.com' + } + + +def print_diagnostics(url_: str = None, + request_: urllib.request.Request = None, + responses_: list = None, + error_=None, + error_list_: list = None, + debug_: bool = False, + die_on_error_: bool = False): + if debug_: + print("::print_diagnostics: error_.__class__: %s" % error_.__class__) + pprint(error_) + + if url_ is None: + print("WARNING:print_diagnostics: url_ is None") + if request_ is None: + print("WARNING:print_diagnostics: request_ is None") + if error_ is None: + print("WARNING:print_diagnostics: error_ is None") + + method = 'NA' + if hasattr(request_, 'method'): + method = request_.method + err_code = 0 + err_reason = 'NA' + err_headers = [] + err_full_url = url_ + if hasattr(error_, 'code'): + err_code = error_.code + if hasattr(error_, 'reason'): + err_reason = error_.reason + if hasattr(error_, 'headers'): + err_headers = error_.headers + if hasattr(error_, 'get_full_url'): + err_full_url = error_.get_full_url() + xerrors = [] + if err_code == 404: + xerrors.append("[%s HTTP %s] <%s> : %s" % (method, err_code, err_full_url, err_reason)) + else: + if len(err_headers) > 0: + for headername in sorted(err_headers.keys()): + if headername.startswith("X-Error-"): + xerrors.append("%s: %s" % (headername, err_headers.get(headername))) + if len(xerrors) > 0: + print(" = = LANforge Error Messages = =") + print(" = = URL: %s" % err_full_url) + for xerr in xerrors: + print(xerr) + if (error_list_ is not None) and isinstance(error_list_, list): + error_list_.append(xerr) + print(" = = = = = = = = = = = = = = = =") + + if error_.__class__ is urllib.error.HTTPError: + if debug_: + print("----- HTTPError: ------------------------------------ print_diagnostics:") + print("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) + + if err_code == 404: + if (error_list_ is not None) and isinstance(error_list_, list): + error_list_.append("[%s HTTP %s] <%s> : %s" % (method, err_code, err_full_url, err_reason)) + else: + if debug_: + print(" Content-type:[%s] Accept[%s]" % ( + request_.get_header('Content-type'), request_.get_header('Accept'))) + + if hasattr(request_, "data") and (request_.data is not None): + print(" Data:") + pprint(request_.data) + elif debug_: + print(" ") + + if debug_ and (len(err_headers) > 0): + # the HTTPError is of type HTTPMessage a subclass of email.message + print(" Response Headers: ") + for headername in sorted(err_headers.keys()): + print(" %s: %s" % (headername, err_headers.get(headername))) + + if len(responses_) > 0: + print("----- Response: --------------------------------------------------------") + pprint(responses_[0].reason) + if debug_: + print("------------------------------------------------------------------------") + if die_on_error_: + exit(1) + return + + if error_.__class__ is urllib.error.URLError: + print("----- URLError: ---------------------------------------------") + print("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) + print("------------------------------------------------------------------------") + if die_on_error_: + exit(1) + +class Logg: + DEFAULT_LEVEL = logging.WARNING + + def __init__(self, + log_level: int = DEFAULT_LEVEL, + name: str = None, + debug: bool = False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Base class that can be used to send logging messages elsewhere. extend this + in order to send log messages from this framework elsewhere. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + self.level = log_level + self.logger : Logger + + self.start_time = datetime.now() + self.start_time_str = time.strftime("%Y%m%d-%I:%M%:%S") + if name: + self.name = name + if "@" in name: + self.name = name.replace('@', self.start_time_str) + else: + self.name = "started-" + self.start_time_str + self.logger = Logger(name, level=log_level) + + if debug: + self.logg(level=logging.WARNING, message="Logger begun: " + self.name) + + def logg(self, + level: int = logging.WARNING, + message: str = None): + """ + + :param level: python logging priority + :param message: text to send to logging channel + :return: None + """ + if _not(message): + return + if level == logging.CRITICAL: + self.logger.critical(message) + + if level == logging.ERROR: + self.logger.error(message) + + if level == logging.WARNING: + self.logger.warning(message) + + if level == logging.INFO: + self.logger.info(message) + + if level == logging.DEBUG: + self.logger.debug(message) + + + def error(self, message: str = None): + if not message: + return + self.logg(level=logging.ERROR, message=message) + + def warning(self, message: str = None): + if not message: + return + self.logg(level=logging.WARNING, message=message) + + def info(self, message: str = None): + if not message: + return + self.logg(level=logging.INFO, message=message) + + def debug(self, message: str = None): + if not message: + return + self.logg(level=logging.DEBUG, message=message) + + +class BaseLFJsonRequest: + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Perform HTTP get/post/put/delete with extensions specific to LANforge JSON + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + No_Data: dict = {'No Data': 0} + OK_STATUSES = (100, 200, 201, 204, 205, 206, 301, 302, 303, 304, 307, 308, 404) + subclasses = [] + + def __init_subclass__(cls, **kwargs): + super().__init_subclass__(**kwargs) + cls.subclasses.append(cls) + + def __init__(self, + session_obj: 'BaseSession' = None, + debug: bool = False, + stream_errors: bool = True, + stream_warnings: bool = False, + exit_on_error: bool = False): + self.default_headers: dict = {'Accept': 'application/json'} + self.debug_on: bool = False + self.error_list: list = [] + # post_data: dict = No_Data + self.proxies_installed: bool = False + self.session_instance: 'BaseSession' + self.session_instance = None + self.stream_errors: bool = True + self.stream_warnings: bool = False + + if not session_obj: + LOGGER.warning("BaseLFJsonRequest: no session instance") + else: + self.session_instance = session_obj + self.session_id = session_obj.get_session_id() + self.proxies_installed = session_obj.proxies_installed + + self.die_on_error: bool + self.die_on_error = exit_on_error + if session_obj: + self.die_on_error |= session_obj.is_exit_on_error() + + self.lfclient_url = session_obj.get_lfclient_url() + + self.stream_errors = stream_errors + self.warnings = [] + self.stream_warnings = stream_warnings + self.logger = Logg(name="LFJsonRequest-@", debug=debug) + self.debug_on = debug + + def get_corrected_url(self, + url: str = None, + debug: bool = False): + """ + + :param url: If you have a session you can provide the abbreviated URL optionally starting with a slash + :param debug: turn on debugging + :return: full url prepended with + """ + if _not(url): + raise Exception("%s: Bad url[%s]" % (__name__, url)) + + corrected_url: str = url + + if not url.startswith(self.session_instance.get_lfclient_url()): + if url.startswith('/'): + corrected_url = self.session_instance.get_lfclient_url() + url + else: + corrected_url = self.session_instance.get_lfclient_url() + '/' + url + + if _not(corrected_url): + raise Exception("%s: Bad url[%s]" % (__name__, url)) + + if corrected_url.find('//'): + protopos = corrected_url.find("://") + corrected_url = corrected_url[:protopos + 2] + corrected_url[protopos + 2:].replace("//", "/") + + # finding '#' prolly indicates a macvlan (eth1#0) + # finding ' ' prolly indicates a field name that should imply %20 + if corrected_url.find('#') >= 1: + corrected_url = corrected_url.replace('#', '%23') + if corrected_url.find(' ') >= 1: + corrected_url = corrected_url.replace(' ', '%20') + if debug: + self.logger.debug("%s: url [%s] now [%s]" % (str(__class__), url, corrected_url)) + return corrected_url + + def add_error(self, message: str = None): + if not message: + return + if self.stream_errors: + self.logger.error(message=message) + self.error_list.append(message) + + def add_warning(self, message: str = None): + self.logger.warning(message) + if self.stream_errors: + self.logger.warning(message=message) + self.warnings.append(message) + + def get_errors(self) -> list: + return self.error_list + + def get_warnings(self) -> list: + return self.warnings + + def clear_warnings_errors(self, flush_to_session=False): + """ erase errors and warnings """ + if flush_to_session: + if not self.session_instance: + self.logger.error(message="cannot flush messages to session when there is no session instance") + else: + self.session_instance.session_error_list.extend(self.error_list) + self.session_instance.session_warnings_list.extend(self.warnings) + self.error_list = [] + self.warnings = [] + self.logger.info(message='BaseLFJsonRequest.clear()') + + def extract_values(self, + response: dict = None, + singular_key: str = None, + plural_key: str = None) -> list: + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Extract fields from this response using the expected keys: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if not singular_key: + raise ValueError("extract_values wants non-empty singular_key") + if not plural_key: + raise ValueError("extract_values wants non-empty plural_key") + + if singular_key not in response: + if plural_key not in response: + self.add_warning("response did not contain <{}> or <{}>".format(singular_key, plural_key)) + return [] + if not response[plural_key]: + self.add_warning("response[{}] is empty".format(plural_key)) + return response[plural_key] + if not response[singular_key]: + self.add_warning("response[{}] is empty".format(singular_key)) + return response[singular_key] + + def form_post(self, + url: str = None, + post_data: dict = None, + debug: bool = False, + die_on_error_: bool = False): + die_on_error_ |= self.die_on_error + debug |= self.debug_on + responses = [] + # https://stackoverflow.com/a/59635684/11014343 + if (self.session_instance.proxy_map is not None) and (len(self.session_instance.proxy_map) > 0): + # https://stackoverflow.com/a/59635684/11014343 + opener = request.build_opener(request.ProxyHandler(self.session_instance.proxy_map)) + request.install_opener(opener) + + if debug: + self.logger.debug("formPost: url: " + url) + if (post_data is not None) and (post_data is not self.No_Data): + urlenc_data = urllib.parse.urlencode(post_data).encode("utf-8") + if debug: + self.logger.debug("formPost: data looks like:" + str(urlenc_data)) + print("formPost: url: " + url) + myrequest = request.Request(url=url, + data=urlenc_data, + headers=self.default_headers) + else: + myrequest = request.Request(url=url, headers=self.default_headers) + self.logger.info("json_post: No data sent to [%s]" % url) + + myrequest.headers['Content-type'] = 'application/x-www-form-urlencoded' + + try: + resp = urllib.request.urlopen(myrequest) + responses.append(resp) + return responses[0] + + except urllib.error.HTTPError as herror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=herror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error_) + if die_on_error_ and (herror.code != 404): + exit(1) + except urllib.error.URLError as uerror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=uerror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error_) + if die_on_error_: + exit(1) + if die_on_error_: + exit(1) + return None + + def json_post(self, + url: str = "", + post_data: dict = None, + debug: bool = False, + die_on_error: bool = False, + response_json_list: list = None, + method_: str = 'POST', + session_id_: str = ""): + """ + + :param url: URL to post to + :param post_data: data to send in post + :param debug: turn on diagnostics + :param die_on_error: exit() if the return status is not 200 + :param response_json_list: list of result data + :param method_: override HTTP method, please do not override + :param session_id_: insert a session to the header; this is useful in the case where we are + operating outside a session context, like during the __del__ constructor + :return: returns first set of http.client.HTTPResponse data + """ + debug |= self.debug_on + die_on_error |= self.die_on_error + + if self.session_id != self.session_instance.get_session_id(): + self.logger.error("BaseLFJsonRequest.session_id[%s] != session.get_session_id: [%s]" + % (self.session_id, self.session_instance.get_session_id())) + if die_on_error: + exit(1) + responses = [] + url = self.get_corrected_url(url) + if (post_data is not None) and (post_data is not self.No_Data): + myrequest = request.Request(url=url, + method=method_, + data=json.dumps(post_data).encode("utf-8"), + headers=self.default_headers) + else: + myrequest = request.Request(url=url, + headers=self.default_headers, + method=method_, + data=post_data) + self.logger.info("json_post: empty post sent to [%s]" % url) + + myrequest.headers['Content-type'] = 'application/json' + sess_id = self.session_instance.get_session_id() + if _is(sess_id): + myrequest.headers[SESSION_HEADER] = str(sess_id) + elif _is(session_id_): + myrequest.headers[SESSION_HEADER] = str(session_id_) + else: + self.logger.warning("Request sent without X-LFJson-ID header: "+url) + if debug: + self.logger.warning("json_post headers to "+url) + self.logger.warning(pformat(myrequest.headers)) + + # https://stackoverflow.com/a/59635684/11014343 + + resp: http.client.HTTPResponse + try: + resp = urllib.request.urlopen(myrequest) + resp_data = resp.read().decode('utf-8') + if debug and die_on_error: + self.logger.debug(__name__+" ----- json_post: debug: --------------------------------------------") + self.logger.debug("URL: %s :%d " % (url, resp.status)) + self.logger.debug(__name__+" ----- headers -------------------------------------------------") + if resp.status != 200: + self.logger.error(pformat(resp.getheaders())) + self.logger.error(__name__+" ----- response -------------------------------------------------") + self.logger.error(pformat(resp_data)) + self.logger.error(" ----- -------------------------------------------------") + responses.append(resp) + headers = resp.getheaders() + if debug: + self.logger.warning("response headers:") + self.logger.warning(pformat(headers)) + if SESSION_HEADER in headers: + if self.session_id != headers[SESSION_HEADER]: + self.logger.warning("established session header [%s] different from response session header[%s]" + % (self.session_id, headers[SESSION_HEADER])) + if response_json_list is not None: + if type(response_json_list) is not list: + raise ValueError("reponse_json_list needs to be type list") + jzon_str = json.loads(resp_data) + if debug: + self.logger.debug(__name__+":----- json_post debug: --------------------------------------------") + self.logger.debug("URL: %s :%d " % (url, resp.status)) + self.logger.debug(__name__+" ----- headers -------------------------------------------------") + self.logger.debug(pformat(resp.getheaders())) + self.logger.debug(__name__+" ----- response -------------------------------------------------") + self.logger.debug(pformat(jzon_str)) + self.logger.debug("-------------------------------------------------") + response_json_list.append(jzon_str) + if resp.status not in self.OK_STATUSES: + self.logger.debug("----------------- BAD STATUS --------------------------------") + if die_on_error: + exit(1) + return responses[0] + + except urllib.error.HTTPError as herror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=herror, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + + except urllib.error.URLError as uerror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=uerror, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + + if die_on_error: + exit(1) + return None + + def json_put(self, + url: str = None, + debug: bool = False, + die_on_error: bool = False, + response_json_list: list = None): + if not url: + raise ValueError("json_put requires url") + return self.json_post(url=url, + debug=debug | self.debug_on, + die_on_error=die_on_error | self.die_on_error, + response_json_list=response_json_list, + method_='PUT') + + def json_delete(self, + url: str = None, + debug: bool = False, + die_on_error: bool = False): + return self.get_as_json(url=url, + debug=debug | self.debug_on, + die_on_error=die_on_error, + method_='DELETE') + + def get(self, + url: str = None, + debug: bool = False, + die_on_error: bool = False, + method_: str = 'GET', + connection_timeout_sec: int = None): + """ + Makes a HTTP GET request with specified timeout. + :param url: Fully qualified URL to request + :param debug: if true, print out diagnostic information + :param die_on_error: call exit() if query fails to connect, is a 400 or 500 response status. + Responses with 404 status are expected to be normal and will not cause an exit. + :param method_: Override the HTTP METHOD. Please do not override. + :param connection_timeout_sec: number of seconds to have an outstanding request + :return: returns an urllib.response or None + """ + debug |= self.debug_on + die_on_error |= self.die_on_error + + if debug: + self.logger.debug(message="%s url:[%s]" % (__name__, url)) + + if not connection_timeout_sec: + if self.session_instance.get_timeout_sec(): + connection_timeout_sec = self.session_instance.get_timeout_sec() + else: + connection_timeout_sec = 120 + + requested_url = self.get_corrected_url(url, + debug=debug | self.debug_on) + myrequest = request.Request(url=requested_url, + headers=self.default_headers, + method=method_) + if connection_timeout_sec: + myrequest.timeout = connection_timeout_sec + + myresponses = [] + try: + myresponses.append(request.urlopen(myrequest)) + return myresponses[0] + + except urllib.error.HTTPError as herror: + print_diagnostics(url_=requested_url, + request_=myrequest, + responses_=myresponses, + error_=herror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + except urllib.error.URLError as uerror: + print_diagnostics(url_=requested_url, + request_=myrequest, + responses_=myresponses, + error_=uerror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + if die_on_error: + exit(1) + return None + + def get_as_json(self, + url: str = None, + die_on_error: bool = False, + debug: bool = False, + timeout_sec: float = None, + method_='GET'): + """ + :param url: url to do GET request on + :param die_on_error: exit immediate if result status is BAD RESPONSE + :param debug: print diagnostic information about query + :param timeout_sec: number of seconds to wait for a response + :param method_: Overrides the HTTP method used. Please do not override. + :return: get request as Json data + """ + responses = [] + j = self.get(url=url, + debug=debug, + die_on_error=die_on_error, + connection_timeout_sec=timeout_sec, + method_=method_) + responses.append(j) + if len(responses) < 1: + if debug and self.has_errors(): + self.print_errors() + return None + + if responses[0] is None: + if debug: + self.logger.debug(message="No response from " + url) + return None + json_data = json.loads(responses[0].read().decode('utf-8')) + return json_data + + def json_get(self, + url: str = None, + debug: bool = False, + wait_sec: float = None, + request_timeout_sec: float = None, + max_timeout_sec: float = None, + errors_warnings: list = None): + """ + Returns json record from GET request. This will retry until timeout_sec + :param url: URL to make GET request to + :param debug: print diagnostic information if true + :param wait_sec: time to wait before making request, or waiting until you get a non-404 response + :param request_timeout_sec: maximum time each request can take + :param max_timeout_sec: maximum time to spend making requests + :param errors_warnings: if present, fill this with error and warning messages from the response JSON + :return: dictionary of json response from server + """ + debug |= self.debug_on + json_response = None + if not max_timeout_sec: + max_timeout_sec = self.session_instance.max_timeout_sec + + if _not(url): + raise ValueError("json_get called withou url") + + url = self.get_corrected_url(url=url) + + deadline_sec: float = (_now_ms() * 1000) + max_timeout_sec + self.error_list.clear() + attempt_counter = 1 + while _now_sec() < deadline_sec: + time.sleep(wait_sec) + try: + json_response = self.get_as_json(url=url, + debug=debug, + die_on_error=False, + timeout_sec=request_timeout_sec) + if debug: + self.logger.debug("[%s] json_get: URL[%s]" % (attempt_counter, url)) + self.logger.debug(pformat(json_response)) + if json_response is None: + if errors_warnings: + errors_warnings.append("No json_response") + errors_warnings.extend(self.error_list) + if debug: + if hasattr(self, 'print_errors'): + self.print_errors() + else: + self.logger.error("json_get: [%s] no response, check other errors" % url) + time.sleep(wait_sec) + return None + else: + return json_response + except ValueError as ve: + if debug or self.die_on_error: + self.logger.error("json_get: [%s] " % url) + self.logger.error("Exception %s:" % ve) + self.logger.error(traceback.format_exception(ValueError, ve, ve.__traceback__, chain=True)) + # traceback.print_exception(ValueError, ve, ve.__traceback__, chain=True) + if self.die_on_error: + sys.exit(1) + return json_response + + # def set_post_data(self, data): + # """ + # :param data: dictionary of parameters for post + # :return: nothing + # """ + # self.post_data = data + + def has_errors(self): + return (True, False)[len(self.error_list) > 0] + + def print_errors(self): + if not self.has_errors: + self.logger.debug("---------- no errors ----------") + return + for err in self.error_list: + Logg.error("error: %s" % err) + + @staticmethod + def create_port_eid_url(eid_list: list = None) -> str: + """ ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Convert a list of EIDs into a URL: + :param eid_list + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- """ + if not len(eid_list): + return "/list" + url = "/" + if isinstance(eid_list, str): + return url + eid_list.replace('.', '/') + + # The first in a series has to define the resource number, + # but the remainder of a series has to match that resource number + for i in range(0, len(eid_list)): + eid = eid_list[i] + if i == 0: + url += eid.replace('.', '/') + elif eid.find('.') > 0: + url += str(',' + eid.split('.')[-1]) + else: + url += str(',' + eid) + return url + + +class JsonQuery(BaseLFJsonRequest): + """ ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + request LANforge JSON data with knowledge of the LANforge JSON headers + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- """ + + def __init__(self, + session_obj: 'BaseSession' = None, + debug=False, + exit_on_error=False): + super().__init__(session_obj=session_obj, + debug=debug | session_obj.is_debug(), + exit_on_error=exit_on_error) + + +class JsonCommand(BaseLFJsonRequest): + def __init__(self, + session_obj: object = None, + debug: bool = False, + exit_on_error: bool = False): + super().__init__(session_obj=session_obj, + debug=debug, + exit_on_error=exit_on_error) + self.logger.debug("%s new instance " % str(__class__)) + + @staticmethod + def set_flags(flag_class: IntFlag, starting_value: int, flag_names=None): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + :param flag_class: flag class, a subclass of IntFlag + :param starting_value: integer flag value to OR values into + :param flag_names: list of flag names to convert to integers to OR onto starting_value + + Example Usage: + value = LFJsonPost.add_flags(SetPortMumble, 0, flag_names=['bridge', 'dhcp']) + print('value now: '+value) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if starting_value is None: + raise ValueError("starting_value should be an integer greater or equal than zero, not None") + if not flag_names: + raise ValueError("flag_names should be a name or a list of names, not None") + if type(flag_names) is list: + selected_flags = [] + for flag in flag_names: + if isinstance(flag, str): + if flag not in flag_class.__members__: + raise ValueError("%s lacks member:[%s]" % + (flag_class.__class__.__name__, flag)) + selected_flags.extend([flag_class[member].value + for member in flag_class.__members__ if member == flag]) + if isinstance(flag, IntFlag): + if flag not in flag_class: + raise ValueError("%s lacks member:[%s]" % + (flag_class.__class__.__name__, flag)) + selected_flags.extend([member.value + for member in flag_class.__members___ if member == flag]) + selected_flags.append(starting_value) + result_flags = 0 + for i in selected_flags: + result_flags |= i + return result_flags + f_name = None + if type(flag_names) is str: + f_name = flag_names + print('f_name is str %s' % f_name) + else: + print('f_name is %s' % type(flag_names)) + if f_name not in flag_class.__members__: + raise ValueError("%s lacks member:[%s]" % + (flag_class.__class__.__name__, f_name)) + return flag_class.valueof(f_name) + + @staticmethod + def clear_flags(flag_class: IntFlag, starting_value: int, flag_names=None): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + :param flag_class: flag class, a subclass of IntFlag + :param starting_value: integer flag value to OR values into + :param flag_names: list of flag names to convert to integers to OR onto starting_value + + Example Usage: + value = LFJsonPost.clear_flags(SetPortMumble, 0, flag_names=['bridge', 'dhcp']) + print('value now: '+value) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if starting_value is None: + raise ValueError("starting_value should be an integer greater than zero and not None") + if not flag_names: + raise ValueError("flag_names should be a name or a list of names, not None") + unselected_val = None + if type(flag_names) is list: + unselected_val = starting_value + for flag in flag_names: + if isinstance(flag, str): + if flag not in flag_class.__members__: + raise ValueError("%s has no member:[%s]" % (flag_class.__class__.__name__, flag)) + if isinstance(flag, IntFlag): + if flag not in flag_class: + raise ValueError("%s has no member:[%s]" % (flag_class.__class__.__name__, flag)) + unselected_val &= ~flag.value + # print("unselected b[%s]" % (hex(unselected_val))) + return unselected_val + if isinstance(flag_names, str): + if flag_names not in flag_class.__members__: + raise ValueError("%s lacks member:[%s]" % + (flag_class.__class__.__name__, flag_names)) + unselected_val = starting_value + unselected_val &= ~flag_class.valueof(flag_names) + if isinstance(flag_names, IntFlag): + if flag_names not in flag_class: + raise ValueError("%s lacks member:[%s]" % + (flag_class.__class__.__name__, flag_names)) + unselected_val = starting_value + unselected_val &= ~flag_names.value + return unselected_val + + def start_session(self, + debug: bool = False, + die_without_session_id_: bool = False) -> bool: + responses = [] + debug |= self.debug_on + if not self.session_instance: + raise ValueError("JsonCommand::start_session lacks self.session_instance") + + first_response: HTTPResponse + first_response = self.json_post(url="/newsession", + debug=True, + response_json_list=responses) + if not first_response: + self.logger.warning("No session established.") + self.logger.debug(pformat(first_response)) + self.logger.debug(pformat(responses)) + if die_without_session_id_: + exit(1) + return False + if _not(first_response.msg): + self.logger.error("no session_response.msg: %s" % pformat(first_response)) + if die_without_session_id_: + exit(1) + return False + + if debug: + self.logger.debug("%s: newsession: %s" % (__name__, pformat(first_response))) + # self.session_instance.session_id = first_response["session_id"] + self.logger.debug(pformat( ("start_session headers:", + first_response.getheaders()))) + if SESSION_HEADER not in first_response.headers: + self.logger.error("start_session: no %s in response headers:" % SESSION_HEADER) + self.logger.error(pformat(first_response.headers)) + if die_without_session_id_: + exit(1) + return False + + self.session_id = first_response.getheader(SESSION_HEADER) + self.session_instance.session_id = first_response.getheader(SESSION_HEADER) + return True + + +class BaseSession: + """ + Use this class to make your initial connection to a LANforge GUI. This class can + will create a session id and hold errors and warnings as needed. + """ + + Default_Base_URL: str = "http://localhost:8080" + Default_Retry_Sec: float = 1.0 + Default_Request_Timeout_Sec: float = 120.0 + Default_Max_Timeout_Sec: float = 240.0 + subclasses = [] + + def __init_subclass__(cls, **kwargs): + super().__init_subclass__(**kwargs) + cls.subclasses.append(cls) + + def __init__(self, lfclient_url: str = 'http://localhost:8080', + debug: bool = False, + proxy_map: dict = None, + connection_timeout_sec: float = Default_Request_Timeout_Sec, + max_timeout_sec: float = Default_Max_Timeout_Sec, + retry_sec: float = Default_Retry_Sec, + stream_errors: bool = True, + stream_warnings: bool = False, + exit_on_error: bool = False): + self.debug_on = debug + self.logger = Logg(name='json_api_session') + if debug: + self.logger.level = logging.DEBUG + self.exit_on_error = exit_on_error + self.command_instance: JsonCommand + self.connection_timeout_sec: int = 10 + self.debug_on: bool + self.debug_on = False + self.exit_on_error: bool + self.exit_on_error = False + self.lfclient_url: str + self.max_timeout_sec: float + self.max_timeout_sec = max_timeout_sec + self.proxies_installed: bool + self.proxies_installed = False + self.proxy_map: dict + self.query_instance: JsonQuery + self.query_instance = None + self.retry_sec: float + self.retry_sec = retry_sec + self.session_error_list: list = [] + self.session_id: str + self.session_id = None + self.session_warnings_list: list = [] + self.stream_errors: bool + self.stream_errors = True + self.stream_warnings: bool + self.stream_warnings = False + self.session_connection_check: bool + self.session_connection_check = False + self.session_started_at: int = 0 + + # please see this discussion on ProxyHandlers: + # https://docs.python.org/3/library/urllib.request.html#urllib.request.ProxyHandler + # but this makes much more sense: + # https://gist.github.com/aleiphoenix/4159510 + + if debug: + if proxy_map is None: + self.logger.debug("%s: no proxy_str" % __class__) + else: + self.logger.debug("BaseSession.__init__: proxies_: %s" % pformat(proxy_map)) + + if (proxy_map is not None) and (len(proxy_map) > 0): + if ("http" not in proxy_map) and ("https" not in proxy_map): + raise ValueError("Neither http or https set in proxy definitions. Expects proxy={'http':, 'https':, }") + self.proxy_map = proxy_map + if (proxy_map is not None) and (len(proxy_map) > 0): + opener = urllib.request.build_opener(request.ProxyHandler(proxy_map)) + urllib.request.install_opener(opener) + self.proxies_installed = True + + if connection_timeout_sec: + self.connection_timeout_sec = connection_timeout_sec + self.logger.debug("%s connection timeout sec now [%f]" % (__name__, connection_timeout_sec)) + + self.stream_errors = stream_errors + self.stream_warnings = stream_warnings + + # if debug: + # if self.proxies is None: + # print("BaseSession _init_: no proxies") + # else: + # print("BaseSession _init_: proxies: ") + # pprint.pprint(self.proxies) + + if not lfclient_url.startswith("http://") and not lfclient_url.startswith("https://"): + self.logger.warning("No http:// or https:// found, prepending http:// to " + lfclient_url) + lfclient_url = "http://" + lfclient_url + + # we do not want the lfclient_url to end with a slash + if lfclient_url.endswith('/'): + self.lfclient_url = lfclient_url[0: len(lfclient_url) - 1] + else: + self.lfclient_url = lfclient_url + + # test connection with GUI to get a session id, then set our session ids in those instances + # self.session_connection_check = self.command_instance.start_session(debug=debug) + self.command_instance = None + self.query_instance = None + + # indicate session destroyed if possible + def __del__(self): + if not self.session_connection_check: + self.logger.warning("%s no connection established, exiting" % self.session_connection_check) + return + self.logger.debug("%s: asking for session %s to end" % (__name__, self.session_id)) + BaseSession.end_session(command_obj=self.command_instance, + session_id_=self.session_id) + + def get_command(self) -> 'JsonCommand': + """ + Remember to override this method with your session subclass, it should return LFJsonCommand + :return: registered instance of JsonCommand + """ + if self.command_instance: + return self.command_instance + self.command_instance = JsonCommand(session_obj=self) + return self.command_instance + + def get_query(self) -> 'JsonQuery': + """ + Remember to override this method with your session subclass, it should return LFJsonQuery + :return: registered instance of JsonQuery + """ + if self.query_instance: + return self.query_instance + self.query_instance = JsonQuery(session_obj=self, debug=self.debug_on) + return self.query_instance + + def is_exit_on_error(self) -> bool: + return self.exit_on_error + + def get_lfclient_url(self) -> str: + return self.lfclient_url + + def get_lf_client_error(self) -> str: + return self.lfclient_url + + def is_debug(self) -> bool: + return self.debug_on + + def get_session_id(self) -> str: + return self.session_id + + def get_proxies(self): + return self.proxy_map + + def get_timeout_sec(self) -> float: + return self.connection_timeout_sec + + @classmethod + def end_session(cls, + command_obj: JsonCommand = None, + session_id_: str = ""): + responses = [] + first_response = command_obj.json_post(url="endsession", + debug=True, + response_json_list=responses, + session_id_=session_id_) + pprint(first_response) + pprint(responses) + +# End of json_api.py; subclasses defined below + + +class LFJsonCommand(JsonCommand): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + LFJsonCommand inherits from JsonCommand + Commands are used for POST requests. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def __init__(self, + session_obj: object = None, + debug: bool = False, + exit_on_error: bool = False): + super().__init__(session_obj=session_obj, + debug=debug, + exit_on_error=exit_on_error) + + # Auto generated methods follow: + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_arm_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_arm_endp(self, + alias: str = None, # Name of endpoint. [R] + cpu_id: str = None, # Preferred CPU ID on which this endpoint should run. + mx_pkt_sz: str = None, # Maximum packet size, including all Ethernet headers. + pkt_sz: str = None, # Minimum packet size, including all Ethernet headers. + port: str = None, # Port number. [W] + pps: str = None, # Packets per second to generate. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. Required. [R][D:1] + tos: str = None, # The Type of Service, can be HEX. See set_endp_tos for details. + p_type: str = None, # Endpoint Type : arm_udp. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_arm_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if cpu_id is not None: + data["cpu_id"] = cpu_id + if mx_pkt_sz is not None: + data["mx_pkt_sz"] = mx_pkt_sz + if pkt_sz is not None: + data["pkt_sz"] = pkt_sz + if port is not None: + data["port"] = port + if pps is not None: + data["pps"] = pps + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if tos is not None: + data["tos"] = tos + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_arm_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_bgp_peer + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddBgpPeerFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddBgpPeerFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + ENABLE_PEER = 0x1 # Set this to zero if you don't want this peer enabled. + PEER_CLIENT = 0x2 # Sets corresponding Xorp flag in BGP Peer section. + PEER_CONFED_MEMBER = 0x4 # Sets corresponding Xorp flag in BGP Peer section. + PEER_UNICAST_V4 = 0x8 # Sets corresponding Xorp flag in BGP Peer section. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddBgpPeerFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_add_bgp_peer(self, + p_as: str = None, # BGP Peer Autonomous System number, 0-65535 + delay_open_time: str = None, # BGP Peer delay open time. + flags: str = None, # Virtual router BGP Peer flags, see above for definitions. + holdtime: str = None, # BGP Peer hold-time. + local_dev: str = None, # BGP Peer Local interface. + nexthop: str = None, # BGP Peer Nexthop, IPv4 Address. + nexthop6: str = None, # BGP Peer IPv6 Nexthop address. + peer_id: str = None, # BGP Peer Identifier: IPv4 Address + peer_index: str = None, # Peer index in this virtual router (0-7). + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + vr_id: str = None, # Name of virtual router. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_bgp_peer(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if p_as is not None: + data["as"] = p_as + if delay_open_time is not None: + data["delay_open_time"] = delay_open_time + if flags is not None: + data["flags"] = flags + if holdtime is not None: + data["holdtime"] = holdtime + if local_dev is not None: + data["local_dev"] = local_dev + if nexthop is not None: + data["nexthop"] = nexthop + if nexthop6 is not None: + data["nexthop6"] = nexthop6 + if peer_id is not None: + data["peer_id"] = peer_id + if peer_index is not None: + data["peer_index"] = peer_index + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if vr_id is not None: + data["vr_id"] = vr_id + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_bgp_peer", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_bond + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_bond(self, + network_devs: str = None, # Comma-separated list of network devices: eth1,eth2,eth3... [W] + port: str = None, # Name of the bond device. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_bond(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if network_devs is not None: + data["network_devs"] = network_devs + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_bond", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_br + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddBrBrFlags(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + none = 0 # no features + stp_enabled = 1 # Enable Spanning Tree Protocol (STP) + + def post_add_br(self, + br_aging_time: str = None, # MAC aging time, in seconds, 32-bit number. + br_flags: str = None, # Bridge flags, see above. + br_forwarding_delay: str = None, # How long to wait until the bridge will start forwarding packets. + br_hello_time: str = None, # How often does the bridge send out STP hello packets. + br_max_age: str = None, # How long until STP considers a non-responsive bridge dead. + br_priority: str = None, # Bridge priority, 16-bit number. + network_devs: str = None, # Comma-separated list of network devices: eth1,eth2,eth3... + port: str = None, # Name of the bridge device. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_br(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if br_aging_time is not None: + data["br_aging_time"] = br_aging_time + if br_flags is not None: + data["br_flags"] = br_flags + if br_forwarding_delay is not None: + data["br_forwarding_delay"] = br_forwarding_delay + if br_hello_time is not None: + data["br_hello_time"] = br_hello_time + if br_max_age is not None: + data["br_max_age"] = br_max_age + if br_priority is not None: + data["br_priority"] = br_priority + if network_devs is not None: + data["network_devs"] = network_devs + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_br", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_cd + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddCdFlags(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + ERR = 2 # Set to kernel mode. + RUNNING = 1 # Set to running state. + + def post_add_cd(self, + alias: str = None, # Name of Collision Domain. [W] + bps: str = None, # Maximum speed at which this collision domain can run. + flags: str = None, # See above. Leave blank or use 'NA' for no default values. + report_timer: str = None, # How often to report stats. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + state: str = None, # RUNNING or STOPPED (default is RUNNING). Use this to start/stop. + p_type: str = None, # CD Type: WIFI, WISER_SURFACE, WISER_SURFACE_AIR, WISER_AIR_AIR, + # WISER_NCW + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_cd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if bps is not None: + data["bps"] = bps + if flags is not None: + data["flags"] = flags + if report_timer is not None: + data["report_timer"] = report_timer + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if state is not None: + data["state"] = state + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_cd_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_cd_endp(self, + cd: str = None, # Name of Collision Domain. [R] + endp: str = None, # Endpoint name/id. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_cd_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cd is not None: + data["cd"] = cd + if endp is not None: + data["endp"] = endp + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_cd_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_cd_vr + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_cd_vr(self, + cd: str = None, # Name of Collision Domain. [R] + vr: str = None, # Virtual-Router name/ID. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_cd_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cd is not None: + data["cd"] = cd + if vr is not None: + data["vr"] = vr + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_cd_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_chamber + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddChamberChamberFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddChamberChamberFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + OPEN = 0x4 # (3) Door is open, no real isolation right now. + PHANTOM = 0x1 # (1) Chamber is not actually here right now. + VIRTUAL = 0x2 # (2) No real chamber, open-air grouping of equipment. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddChamberChamberFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class AddChamberTurntableType(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddChamberTurntableType0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + COMXIM = 0x1 # ComXim stand-alone USB connected turn-table. + CT840A = 0x2 # Modbus API turntable in CT840A 2D chamber. + CT850A = 0x0 # TCP-IP Connected turntable in CT850A 2D chamber. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddChamberTurntableType has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_add_chamber(self, + chamber_type: str = None, # Chamber type, see above. Use 1 for Medium if uncertain. [W] + dut_name1: str = None, # Name of first DUT in this chamber or NA + dut_name2: str = None, # Name of second DUT in this chamber or NA + dut_name3: str = None, # Name of third DUT in this chamber or NA + dut_name4: str = None, # Name of fourth DUT in this chamber or NA + flags: str = None, # Flag field for Chamber, see above. [W] + flags_mask: str = None, # Mask of what flags to pay attention to, or NA for all. + height: str = None, # Height to be used when drawn in the LANforge-GUI. + isolation: str = None, # Estimated isolation in db for this chamber. + lanforge1: str = None, # EID of first LANforge Resource in this chamber or NA + lanforge2: str = None, # EID of second LANforge Resource in this chamber or NA + lanforge3: str = None, # EID of third LANforge Resource in this chamber or NA + lanforge4: str = None, # EID of fourth LANforge Resource in this chamber or NA + name: str = None, # Name of Chamber, unique identifier. [R] + resource: str = None, # LANforge Resource ID for controlling turn-table via serial + # protocol. + sma_count: str = None, # Number of SMA connectors on this chamber, default is 16. + turntable_type: str = None, # Turn-Table type: see above. + width: str = None, # Width to be used when drawn in the LANforge-GUI. + x: str = None, # X coordinate to be used when drawn in the LANforge-GUI. + y: str = None, # Y coordinate to be used when drawn in the LANforge-GUI. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_chamber(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if chamber_type is not None: + data["chamber_type"] = chamber_type + if dut_name1 is not None: + data["dut_name1"] = dut_name1 + if dut_name2 is not None: + data["dut_name2"] = dut_name2 + if dut_name3 is not None: + data["dut_name3"] = dut_name3 + if dut_name4 is not None: + data["dut_name4"] = dut_name4 + if flags is not None: + data["flags"] = flags + if flags_mask is not None: + data["flags_mask"] = flags_mask + if height is not None: + data["height"] = height + if isolation is not None: + data["isolation"] = isolation + if lanforge1 is not None: + data["lanforge1"] = lanforge1 + if lanforge2 is not None: + data["lanforge2"] = lanforge2 + if lanforge3 is not None: + data["lanforge3"] = lanforge3 + if lanforge4 is not None: + data["lanforge4"] = lanforge4 + if name is not None: + data["name"] = name + if resource is not None: + data["resource"] = resource + if sma_count is not None: + data["sma_count"] = sma_count + if turntable_type is not None: + data["turntable_type"] = turntable_type + if width is not None: + data["width"] = width + if x is not None: + data["x"] = x + if y is not None: + data["y"] = y + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_chamber_cx + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddChamberCxChamberCxFlags(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + CONNECTED = 1 # (1) Connected to something. If flag is not set, connection is open to the air + # +(maybe with antenna) + TERMINATED = 2 # (2) Connection is terminated, signal shall not pass! + + def post_add_chamber_cx(self, + a_id: str = None, # EidAntenna in string format for A side connection. + atten_id: str = None, # EID for the Attenuator module if one is inline on this + # connection. + b_id: str = None, # EidAntenna in string format for B side connection. + connection_idx: str = None, # Connection index, currently up to 32 connections supported + # (0-31) [R] + flags: str = None, # Flag field for Chamber Connection, see above. + flags_mask: str = None, # Mask of what flags to pay attention to, or NA for all. + internal: str = None, # Internal (1) or not (0): Internal connections are no longer + # supported. + min_atten: str = None, # Specify minimum attenuation in 10ths of a db. Distance + # logic will not set atten below this. + name: str = None, # Name of Chamber, unique identifier. [R] + zrssi2: str = None, # Specify 2.4Ghz zero-attenuation RSSI in 10ths of a db. + # Distance logic will consider this in its calculations. + zrssi5: str = None, # Specify 5Ghz zero-attenuation RSSI in 10ths of a db. + # Distance logic will consider this in its calculations. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_chamber_cx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if a_id is not None: + data["a_id"] = a_id + if atten_id is not None: + data["atten_id"] = atten_id + if b_id is not None: + data["b_id"] = b_id + if connection_idx is not None: + data["connection_idx"] = connection_idx + if flags is not None: + data["flags"] = flags + if flags_mask is not None: + data["flags_mask"] = flags_mask + if internal is not None: + data["internal"] = internal + if min_atten is not None: + data["min_atten"] = min_atten + if name is not None: + data["name"] = name + if zrssi2 is not None: + data["zrssi2"] = zrssi2 + if zrssi5 is not None: + data["zrssi5"] = zrssi5 + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_chamber_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_chamber_path + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_chamber_path(self, + chamber: str = None, # Chamber Name. [R] + content: str = None, # [BLANK] will erase all content, any other text will + # be appended to existing text. + path: str = None, # Path Name [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_chamber_path(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if chamber is not None: + data["chamber"] = chamber + if content is not None: + data["content"] = content + if path is not None: + data["path"] = path + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_chamber_path", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_channel_group + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddChannelGroupTypes(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + clear = "clear" # Channel(s) are bundled into a single span. No conversion or + e_m = "e&m" # Channel(s) are signalled using E&M signalling (specific + fcshdlc = "fcshdlc" # The zapdel driver performs HDLC encoding and decoding on the + fxogs = "fxogs" # Channel(s) are signalled using FXO Groundstart protocol. + fxoks = "fxoks" # Channel(s) are signalled using FXO Koolstart protocol. + fxols = "fxols" # Channel(s) are signalled using FXO Loopstart protocol. + fxsgs = "fxsgs" # Channel(s) are signalled using FXS Groundstart protocol. + fxsks = "fxsks" # Channel(s) are signalled using FXS Koolstart protocol. + fxsls = "fxsls" # Channel(s) are signalled using FXS Loopstart protocol. + indclear = "indclear" # Like 'clear' except all channels are treated individually and + nethdlc = "nethdlc" # The zaptel driver bundles the channels together into an + rawhdlc = "rawhdlc" # The zaptel driver performs HDLC encoding and decoding on the + unused = "unused" # No signalling is performed, each channel in the list remains idle + + def post_add_channel_group(self, + alias: str = None, # Name for this Channel Group. [R] + channels: str = None, # List of channels to add to this group. + idle_flag: str = None, # Idle flag (byte) for this channel group, for instance: + # 0x7e + mtu: str = None, # MTU (and MRU) for this channel group. Must be a multiple + # of the number of channels if configuring a T1 WanLink. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + span_num: str = None, # The span number. First span is 1, second is 2... [W] + p_type: str = None, # The channel-type. Use 'clear' for PPP links. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_channel_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if channels is not None: + data["channels"] = channels + if idle_flag is not None: + data["idle_flag"] = idle_flag + if mtu is not None: + data["mtu"] = mtu + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if span_num is not None: + data["span_num"] = span_num + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_channel_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_cx + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_cx(self, + alias: str = None, # Name of the Cross Connect to create. [R] + rx_endp: str = None, # Name of Receiving endpoint. [W] + test_mgr: str = None, # Name of test-manager to create the CX on. [W][D:default_tm] + tx_endp: str = None, # Name of Transmitting endpoint. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_cx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if rx_endp is not None: + data["rx_endp"] = rx_endp + if test_mgr is not None: + data["test_mgr"] = test_mgr + if tx_endp is not None: + data["tx_endp"] = tx_endp + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_dut + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddDutDutFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddDutDutFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + p_11r = 0x200 # Use .11r connection logic on all ssids, deprecated, see add_dut_ssid. + AP_MODE = 0x2 # (2) DUT acts as AP. + DHCPD_LAN = 0x40 # Provides DHCP server on LAN port + DHCPD_WAN = 0x80 # Provides DHCP server on WAN port + EAP_PEAP = 0x800 # Use EAP-PEAP connection logic on all ssids, deprecated, see add_dut_ssid. + EAP_TTLS = 0x400 # Use EAP-TTLS connection logic on all ssids, deprecated, see add_dut_ssid. + INACTIVE = 0x4 # (3) Ignore this in ChamberView, etc + NOT_DHCPCD = 0x1000 # Station/edge device that is NOT using DHCP. + STA_MODE = 0x1 # (1) DUT acts as Station. + WEP = 0x8 # Use WEP encryption on all ssids, deprecated, see add_dut_ssid. + WPA = 0x10 # Use WPA encryption on all ssids, deprecated, see add_dut_ssid. + WPA2 = 0x20 # Use WPA2 encryption on all ssids, deprecated, see add_dut_ssid. + WPA3 = 0x100 # Use WPA3 encryption on all ssids, deprecated, see add_dut_extras. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddDutDutFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_add_dut(self, + antenna_count1: str = None, # Antenna count for first radio. + antenna_count2: str = None, # Antenna count for second radio. + antenna_count3: str = None, # Antenna count for third radio. + api_id: str = None, # DUT API Identifier (none specified yet) + bssid1: str = None, # BSSID for first radio. + bssid2: str = None, # BSSID for second radio. + bssid3: str = None, # BSSID for third radio. + eap_id: str = None, # EAP Identifier, for EAP-PEAP. + flags: str = None, # Flag field for DUT, see above. [W] + flags_mask: str = None, # Optional mask to specify what DUT flags are being set. + hw_version: str = None, # DUT Hardware Version information + img_file: str = None, # File-Name for image to represent DUT. + lan_port: str = None, # IP/Mask for LAN port + mgt_ip: str = None, # Management IP Address to access DUT + model_num: str = None, # DUT Model information + name: str = None, # Name of DUT, cannot contain '.' [R] + passwd1: str = None, # WiFi Password that can be used to connect to DUT + passwd2: str = None, # WiFi Password that can be used to connect to DUT + passwd3: str = None, # WiFi Password that can be used to connect to DUT + serial_num: str = None, # DUT Identifier (serial-number, etc) + serial_port: str = None, # Resource and Serial port name on LANforge that connects to DUT + # (1.2.ttyS0). + ssid1: str = None, # WiFi SSID that can be used to connect to DUT + ssid2: str = None, # WiFi SSID that can be used to connect to DUT + ssid3: str = None, # WiFi SSID that can be used to connect to DUT + sw_version: str = None, # DUT Software Version information + top_left_x: str = None, # X Location for Chamber View. + top_left_y: str = None, # X Location for Chamber View. + wan_port: str = None, # IP/Mask for WAN port + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_dut(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if antenna_count1 is not None: + data["antenna_count1"] = antenna_count1 + if antenna_count2 is not None: + data["antenna_count2"] = antenna_count2 + if antenna_count3 is not None: + data["antenna_count3"] = antenna_count3 + if api_id is not None: + data["api_id"] = api_id + if bssid1 is not None: + data["bssid1"] = bssid1 + if bssid2 is not None: + data["bssid2"] = bssid2 + if bssid3 is not None: + data["bssid3"] = bssid3 + if eap_id is not None: + data["eap_id"] = eap_id + if flags is not None: + data["flags"] = flags + if flags_mask is not None: + data["flags_mask"] = flags_mask + if hw_version is not None: + data["hw_version"] = hw_version + if img_file is not None: + data["img_file"] = img_file + if lan_port is not None: + data["lan_port"] = lan_port + if mgt_ip is not None: + data["mgt_ip"] = mgt_ip + if model_num is not None: + data["model_num"] = model_num + if name is not None: + data["name"] = name + if passwd1 is not None: + data["passwd1"] = passwd1 + if passwd2 is not None: + data["passwd2"] = passwd2 + if passwd3 is not None: + data["passwd3"] = passwd3 + if serial_num is not None: + data["serial_num"] = serial_num + if serial_port is not None: + data["serial_port"] = serial_port + if ssid1 is not None: + data["ssid1"] = ssid1 + if ssid2 is not None: + data["ssid2"] = ssid2 + if ssid3 is not None: + data["ssid3"] = ssid3 + if sw_version is not None: + data["sw_version"] = sw_version + if top_left_x is not None: + data["top_left_x"] = top_left_x + if top_left_y is not None: + data["top_left_y"] = top_left_y + if wan_port is not None: + data["wan_port"] = wan_port + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_dut", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_dut_notes + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_dut_notes(self, + dut: str = None, # DUT Name. [R] + text: str = None, # [BLANK] will erase all, any other text will be appended to + # existing text. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_dut_notes(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if dut is not None: + data["dut"] = dut + if text is not None: + data["text"] = text + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_dut_notes", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_dut_ssid + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddDutSsidDutFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddDutSsidDutFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + p_11r = 0x200 # Use .11r connection logic + EAP_PEAP = 0x800 # Use EAP-PEAP connection logic + EAP_TTLS = 0x400 # Use EAP-TTLS connection logic + WEP = 0x8 # Use WEP encryption + WPA = 0x10 # Use WPA encryption + WPA2 = 0x20 # Use WPA2 encryption + WPA3 = 0x100 # Use WPA3 encryption + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddDutSsidDutFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_add_dut_ssid(self, + bssid: str = None, # BSSID for cooresponding SSID. + name: str = None, # Name of DUT, cannot contain '.' [R] + passwd: str = None, # WiFi Password that can be used to connect to DUT + ssid: str = None, # WiFi SSID that can be used to connect to DUT + ssid_flags: str = None, # SSID flags, see above. + ssid_flags_mask: str = None, # SSID flags mask + ssid_idx: str = None, # Index of the SSID. Zero-based indexing: (0 - 7) [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_dut_ssid(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if bssid is not None: + data["bssid"] = bssid + if name is not None: + data["name"] = name + if passwd is not None: + data["passwd"] = passwd + if ssid is not None: + data["ssid"] = ssid + if ssid_flags is not None: + data["ssid_flags"] = ssid_flags + if ssid_flags_mask is not None: + data["ssid_flags_mask"] = ssid_flags_mask + if ssid_idx is not None: + data["ssid_idx"] = ssid_idx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_dut_ssid", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddEndpPayloadPattern(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + PRBS_11_8_10 = "PRBS_11_8_10" # PRBS (see above) + PRBS_15_0_14 = "PRBS_15_0_14" # PRBS (see above) + PRBS_4_0_3 = "PRBS_4_0_3" # Use linear feedback shift register to generate pseudo random sequence. + PRBS_7_0_6 = "PRBS_7_0_6" # PRBS (see above) + custom = "custom" # Enter your own payload with the set_endp_payload cmd. + decreasing = "decreasing" # bytes start at FF and decrease, wrapping if needed + increasing = "increasing" # bytes start at 00 and increase, wrapping if needed + ones = "ones" # payload is all ones (FF) + random = "random" # generate a new random payload each time sent + random_fixed = "random_fixed" # means generate one random payload, and send it over and over again. + zeros = "zeros" # payload is all zeros (00) + + class AddEndpType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + custom_ether = "custom_ether" # LF frames with custom options, use with playback + custom_mc_udp = "custom_mc_udp" # LF Multicast UDP IPv4 + custom_tcp = "custom_tcp" # LF TCP IPv4 frame with custom options + custom_udp = "custom_udp" # LF UDP IPv4 frame with custom options + lf = "lf" # LF protocol + lf_sctp = "lf_sctp" # SCTP IPv4 protocol + lf_sctp6 = "lf_sctp6" # SCTP IPv6 protocol + lf_tcp = "lf_tcp" # TCP IPv4 connection + lf_tcp6 = "lf_tcp6" # TCP IPv6 connection + lf_udp = "lf_udp" # UDP IPv4 connection + lf_udp6 = "lf_udp6" # UDP IPv6 connection + mc_udp = "mc_udp" # LF Multicast IPv4 + + def post_add_endp(self, + alias: str = None, # Name of endpoint. [R] + ip_port: str = None, # IP Port: IP port for layer three endpoints. Use -1 to let + # the LANforge server automatically configure the ip_port. + # Layer 2 endpoints will ignore + is_pkt_sz_random: str = None, # Yes means use random sized packets, anything else means NO. + is_rate_bursty: str = None, # Yes means bursty, anything else means NO. + max_pkt: str = None, # Maximum packet size, including all headers. 0 means 'same', + # -1 means AUTO (5.3.2+) [D:0] + max_rate: str = None, # Maximum transmit rate (bps), used if in bursty mode. + min_pkt: str = None, # Minimum packet size, including all headers. -1 means AUTO + # (5.3.2+) [W][D:-1] + min_rate: str = None, # Minimum transmit rate (bps), or only rate if not bursty. [W] + multi_conn: str = None, # If > 0, will create separate process with this many + # connections per endpoint. See AUTO_HELPER flag + payload_pattern: str = None, # Payload pattern, see above. + port: str = None, # Port/Interface name or number. [R] + resource: str = None, # Resource number. [W] + send_bad_crc_per_million: str = None, # If NIC supports it, will randomly send X per million packets + # with bad ethernet Frame Check Sum. + shelf: str = None, # Shelf name/id. [R][D:1] + ttl: str = None, # Time-to-live, used by UDP Multicast Endpoints only. + p_type: str = None, # Endpoint Type: See above. [W] + use_checksum: str = None, # Yes means checksum the payload, anything else means NO. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if ip_port is not None: + data["ip_port"] = ip_port + if is_pkt_sz_random is not None: + data["is_pkt_sz_random"] = is_pkt_sz_random + if is_rate_bursty is not None: + data["is_rate_bursty"] = is_rate_bursty + if max_pkt is not None: + data["max_pkt"] = max_pkt + if max_rate is not None: + data["max_rate"] = max_rate + if min_pkt is not None: + data["min_pkt"] = min_pkt + if min_rate is not None: + data["min_rate"] = min_rate + if multi_conn is not None: + data["multi_conn"] = multi_conn + if payload_pattern is not None: + data["payload_pattern"] = payload_pattern + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if send_bad_crc_per_million is not None: + data["send_bad_crc_per_million"] = send_bad_crc_per_million + if shelf is not None: + data["shelf"] = shelf + if ttl is not None: + data["ttl"] = ttl + if p_type is not None: + data["type"] = p_type + if use_checksum is not None: + data["use_checksum"] = use_checksum + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_event + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_event(self, + details: str = None, # Event text description. Cannot include double-quote characters. [R] + event_id: str = None, # Numeric ID for the event to modify, or 'new' if creating a new one. + # [W][D:new] + name: str = None, # Event entity name. + priority: str = None, # See set_event_priority for available priorities. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_event(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if details is not None: + data["details"] = details + if event_id is not None: + data["event_id"] = event_id + if name is not None: + data["name"] = name + if priority is not None: + data["priority"] = priority + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_event", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_file_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddFileEndpFioFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddFileEndpFioFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + AUTO_MOUNT = 0x2 # (2) Attempt to mount with the provided information if not already mounted. + AUTO_UNMOUNT = 0x4 # (4) Attempt to un-mount when stopping test. + CHECK_MOUNT = 0x1 # (1) Attempt to verify NFS and SMB mounts match the configured values. + O_APPEND = 0x200 # (512) Open files for writing with O_APPEND instead + O_DIRECT = 0x8 # (8) Open file with O_DIRECT flag, disables caching. Must use block-size + # +read/write calls. + O_LARGEFILE = 0x20 # (32) Open files with O_LARGEFILE. This allows greater than 2GB files on + # +32-bit systems. + UNLINK_BW = 0x10 # (16) Unlink file before writing. This works around issues with CIFS for some + # +file-servers. + UNMOUNT_FORCE = 0x40 # (64) Use -f flag when calling umount + UNMOUNT_LAZY = 0x80 # (128) Use -l flag when calling umount + USE_FSTATFS = 0x100 # (256) Use fstatfs system call to verify file-system type when opening files. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddFileEndpFioFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class AddFileEndpPayloadPattern(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + PRBS_11_8_10 = "PRBS_11_8_10" # PRBS (see above) + PRBS_15_0_14 = "PRBS_15_0_14" # PRBS (see above) + PRBS_4_0_3 = "PRBS_4_0_3" # Use linear feedback shift register to generate pseudo random sequence. + PRBS_7_0_6 = "PRBS_7_0_6" # PRBS (see above) + custom = "custom" # Enter your own payload with the set_endp_payload cmd. + decreasing = "decreasing" # bytes start at FF and decrease, wrapping if needed. + increasing = "increasing" # bytes start at 00 and increase, wrapping if needed. + ones = "ones" # Payload is all ones (FF). + random = "random" # generate a new random payload each time sent. + random_fixed = "random_fixed" # Means generate one random payload, and send it over + zeros = "zeros" # Payload is all zeros (00). + + class AddFileEndpType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + fe_cifs = "fe_cifs" # Does a CIFS (Samba) mount + fe_cifs_ip6 = "fe_cifs/ip6" # Does an IPv6 CIFS mount + fe_generic = "fe_generic" # Uses unspecified file protocol + fe_iscsi = "fe_iscsi" # Does a ISCSI mount + fe_nfs = "fe_nfs" # Does an NFSv3 mount + fe_nfs_ip6 = "fe_nfs/ip6" # Does a NFSv3 IPv6 mount + fe_nfs4 = "fe_nfs4" # Does an NFSv4 mount + fe_nfs4_ip6 = "fe_nfs4/ip6" # Does a NFSv4 IPv6 mount + fe_smb2 = "fe_smb2" # Does a SMB v2.0 mount + fe_smb2_ip6 = "fe_smb2/ip6" # Does a SMB v2.0 IPv6 mount + fe_smb21 = "fe_smb21" # Does a SMB v2.1 mount + fe_smb21_ip6 = "fe_smb21/ip6" # Does a SMB v2.1 IPv6 mount + fe_smb30 = "fe_smb30" # Does a SMB v3.0 mount + fe_smb30_ip6 = "fe_smb30/ip6" # Does a SMB v3.0 IPv6 mount + + def post_add_file_endp(self, + alias: str = None, # Name of endpoint. [R] + directory: str = None, # The directory to read/write in. Absolute path suggested. + # [W] + fio_flags: str = None, # File-IO flags, see above for details. + max_read_rate: str = None, # Maximum read rate, bits-per-second. + max_write_rate: str = None, # Maximum write rate, bits-per-second. + min_read_rate: str = None, # Minimum read rate, bits-per-second. + min_write_rate: str = None, # Minimum write rate, bits-per-second. + mount_dir: str = None, # Directory to mount/unmount (if blank, will use + # 'directory'). + mount_options: str = None, # Optional mount options, passed to the mount command. 'NONE' + # clears. + payload_pattern: str = None, # Payload pattern, see above. + port: str = None, # Port number. [W] + prefix: str = None, # The prefix of the file(s) to read/write. + resource: str = None, # Resource number. [W] + retry_timer: str = None, # Number of miliseconds to retry errored IO calls before + # giving up. + server_mount: str = None, # The server to mount, ex: + # 192.168.100.5/exports/test1 [W] + shelf: str = None, # Shelf name/id. [R][D:1] + p_type: str = None, # Endpoint Type (like fe_nfs) [W] + volume: str = None, # iSCSI volume to mount + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_file_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if directory is not None: + data["directory"] = directory + if fio_flags is not None: + data["fio_flags"] = fio_flags + if max_read_rate is not None: + data["max_read_rate"] = max_read_rate + if max_write_rate is not None: + data["max_write_rate"] = max_write_rate + if min_read_rate is not None: + data["min_read_rate"] = min_read_rate + if min_write_rate is not None: + data["min_write_rate"] = min_write_rate + if mount_dir is not None: + data["mount_dir"] = mount_dir + if mount_options is not None: + data["mount_options"] = mount_options + if payload_pattern is not None: + data["payload_pattern"] = payload_pattern + if port is not None: + data["port"] = port + if prefix is not None: + data["prefix"] = prefix + if resource is not None: + data["resource"] = resource + if retry_timer is not None: + data["retry_timer"] = retry_timer + if server_mount is not None: + data["server_mount"] = server_mount + if shelf is not None: + data["shelf"] = shelf + if p_type is not None: + data["type"] = p_type + if volume is not None: + data["volume"] = volume + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_file_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_gen_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_gen_endp(self, + alias: str = None, # Name of endpoint. [R] + port: str = None, # Port number. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + p_type: str = None, # Endpoint Type : gen_generic [W][D:gen_generic] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_gen_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_gen_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_gre + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_gre(self, + local_lower_ip: str = None, # The local lower-level IP to use. + port: str = None, # Name of the GRE to create, suggested to start with 'gre' [W] + remote_lower_ip: str = None, # The remote lower-level IP to use. + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_gre(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if local_lower_ip is not None: + data["local_lower_ip"] = local_lower_ip + if port is not None: + data["port"] = port + if remote_lower_ip is not None: + data["remote_lower_ip"] = remote_lower_ip + if report_timer is not None: + data["report_timer"] = report_timer + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_gre", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_group + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddGroupFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddGroupFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + group_total_rates = 0x4 # Set rates as total for group. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddGroupFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_add_group(self, + flags: str = None, # Flags for this group, see above. + flags_mask: str = None, # Mask for flags that we care about, use 0xFFFFFFFF or leave blank + # for all. + name: str = None, # The name of the test group. Must be unique across all groups. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if flags is not None: + data["flags"] = flags + if flags_mask is not None: + data["flags_mask"] = flags_mask + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_l4_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddL4EndpHttpAuthType(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddL4EndpHttpAuthType0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + BASIC = 0x1 # Basic authentication + DIGEST = 0x2 # Digest (MD5) authentication + GSSNEGOTIATE = 0x4 # GSS authentication + NTLM = 0x8 # NTLM authentication + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddL4EndpHttpAuthType has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class AddL4EndpProxyAuthType(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddL4EndpProxyAuthType0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + BASIC = 0x1 # 1 Basic authentication + BIND_DNS = 0x200 # 512 Make DNS requests go out endpoints Port. + DIGEST = 0x2 # 2 Digest (MD5) authentication + DISABLE_EPSV = 0x1000 # 4096 Disable FTP EPSV option + DISABLE_PASV = 0x800 # 2048 Disable FTP PASV option (will use PORT command) + GSSNEGOTIATE = 0x4 # 4 GSS authentication + INCLUDE_HEADERS = 0x100 # 256 especially for IMAP + NTLM = 0x8 # 8 NTLM authentication + USE_DEFLATE_COMPRESSION = 0x80 # 128 Use deflate compression + USE_GZIP_COMPRESSION = 0x40 # 64 Use gzip compression + USE_IPV6 = 0x400 # 1024 Resolve URL is IPv6. Will use IPv4 if not selected. + USE_PROXY_CACHE = 0x20 # 32 Use proxy cache + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddL4EndpProxyAuthType has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class AddL4EndpType(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddL4EndpType0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + l4_generic = 0x0 # Layer 4 type + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddL4EndpType has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_add_l4_endp(self, + alias: str = None, # Name of endpoint. [R] + block_size: str = None, # TFTP Block size, in bytes. + dns_cache_timeout: str = None, # In seconds, how long to cache DNS lookups. 0 means no + # caching at all. + http_auth_type: str = None, # Bit-field for allowable http-authenticate methods. + ip_addr: str = None, # Local IP address, for binding to specific secondary IP. + max_speed: str = None, # In bits-per-second, can rate limit upload or download speed + # of the URL contents. 0 means infinite. + port: str = None, # Port number. [W] + proxy_auth_type: str = None, # Bit-field for allowable proxy-authenticate methods. + proxy_port: str = None, # HTTP Proxy port if you are using a proxy. + proxy_server: str = None, # The name of our proxy server if using one. + proxy_userpwd: str = None, # The user-name and password for proxy authentication, format: + # user:passwd. + quiesce_after: str = None, # Quiesce test after this many URLs have been processed. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + smtp_from: str = None, # SMTP From address. + ssl_cert_fname: str = None, # Name of SSL Certs file. + timeout: str = None, # How long to wait for a connection, in milliseconds + p_type: str = None, # Endpoint Type : l4_generic [W] + url: str = None, # The URL, see syntax above. Can also be a local file. + url_rate: str = None, # How often should we process the URL(s), per 10 + # minutes.
  • 600: 1/s
  • 1200: 2/s
  • 1800: 3/s
  • 2400: + # 4/s
[R][D:600] + user_agent: str = None, # User-Agent string. Leave blank for default. Also SMTP-TO: + # <a@b.com><c@d.com>...<q@x.com> + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_l4_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if block_size is not None: + data["block_size"] = block_size + if dns_cache_timeout is not None: + data["dns_cache_timeout"] = dns_cache_timeout + if http_auth_type is not None: + data["http_auth_type"] = http_auth_type + if ip_addr is not None: + data["ip_addr"] = ip_addr + if max_speed is not None: + data["max_speed"] = max_speed + if port is not None: + data["port"] = port + if proxy_auth_type is not None: + data["proxy_auth_type"] = proxy_auth_type + if proxy_port is not None: + data["proxy_port"] = proxy_port + if proxy_server is not None: + data["proxy_server"] = proxy_server + if proxy_userpwd is not None: + data["proxy_userpwd"] = proxy_userpwd + if quiesce_after is not None: + data["quiesce_after"] = quiesce_after + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if smtp_from is not None: + data["smtp_from"] = smtp_from + if ssl_cert_fname is not None: + data["ssl_cert_fname"] = ssl_cert_fname + if timeout is not None: + data["timeout"] = timeout + if p_type is not None: + data["type"] = p_type + if url is not None: + data["url"] = url + if url_rate is not None: + data["url_rate"] = url_rate + if user_agent is not None: + data["user_agent"] = user_agent + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_l4_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_monitor + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddMonitorFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddMonitorFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + disable_ht40 = 0x800 # Disable HT-40 even if hardware and AP support it. + disable_ht80 = 0x8000000 # Disable HT80 (for AC chipset NICs only) + ht160_enable = 0x100000000 # Enable HT160 mode. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddMonitorFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_add_monitor(self, + aid: str = None, # AID, may be used when sniffing on /AX radios. + ap_name: str = None, # Name for this Monitor interface, for example: moni0 [W] + bssid: str = None, # BSSID to use when sniffing on /AX radios, optional. + flags: str = None, # Flags for this monitor interface. + flags_mask: str = None, # Flags mask for this monitor interface. + radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_monitor(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aid is not None: + data["aid"] = aid + if ap_name is not None: + data["ap_name"] = ap_name + if bssid is not None: + data["bssid"] = bssid + if flags is not None: + data["flags"] = flags + if flags_mask is not None: + data["flags_mask"] = flags_mask + if radio is not None: + data["radio"] = radio + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_monitor", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_mvlan + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_mvlan(self, + flags: str = None, # 0x1: Create admin-down. + index: str = None, # Optional: The index of the VLAN, (the 4 in + # eth0#4) + mac: str = None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: + # xx:xx:xx:*:*:xx [W] + old_name: str = None, # The temporary name, used for configuring un-discovered hardware. + port: str = None, # Port number of an existing Ethernet interface. [W] + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_mvlan(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if flags is not None: + data["flags"] = flags + if index is not None: + data["index"] = index + if mac is not None: + data["mac"] = mac + if old_name is not None: + data["old_name"] = old_name + if port is not None: + data["port"] = port + if report_timer is not None: + data["report_timer"] = report_timer + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_mvlan", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_ppp_link + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_ppp_link(self, + auth: str = None, # YES if you want to authenticate. Default is NO. + channel_groups: str = None, # List of channel groups, see above. + p_debug: str = None, # YES for debug, otherwise debugging for the ppp connection + # is off. + down_time_max_ms: str = None, # Maximum length of downtime (ms) for PPP link between runs, + # or 0 for the link to be always up. + down_time_min_ms: str = None, # Minimum length of downtime (ms) for PPP link between runs, + # or 0 for the link to be always up. + dst_ip: str = None, # Destination IP address for this PPP connection. + extra_args: str = None, # Extra arguments to be passed directly to the pppd server. + holdoff: str = None, # Seconds between attempt to bring link back up if it dies, + # suggest 1. + lcp_echo_failure: str = None, # LCP echo failures before we determine links is dead, + # suggest 5. + lcp_echo_interval: str = None, # Seconds between LCP echos, suggest 1. + mlppp_descriptor: str = None, # A unique key for use with multi-link PPP connections. + persist: str = None, # YES if you want to persist the connection. This is + # suggested. + pppoe_transport_port: str = None, # Port number (or name) for underlying PPPoE transport. + resource: str = None, # Resource (machine) number. [W] + run_time_max_ms: str = None, # Maximum uptime (ms) for PPP link during an experiment, or + # 0 for the link to be always up. + run_time_min_ms: str = None, # Minimum uptime (ms) for PPP link during an experiment, or + # 0 for the link to be always up. + shelf: str = None, # Shelf name/id. [R] + src_ip: str = None, # Source IP address for this PPP connection. + transport_type: str = None, # What sort of transport this ppp link uses. + tty_transport_device: str = None, # TTY device for PPP links associated with TTYs. + unit: str = None, # Unit number for the PPP link. ie, the 7 in ppp7. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_ppp_link(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if auth is not None: + data["auth"] = auth + if channel_groups is not None: + data["channel_groups"] = channel_groups + if p_debug is not None: + data["debug"] = p_debug + if down_time_max_ms is not None: + data["down_time_max_ms"] = down_time_max_ms + if down_time_min_ms is not None: + data["down_time_min_ms"] = down_time_min_ms + if dst_ip is not None: + data["dst_ip"] = dst_ip + if extra_args is not None: + data["extra_args"] = extra_args + if holdoff is not None: + data["holdoff"] = holdoff + if lcp_echo_failure is not None: + data["lcp_echo_failure"] = lcp_echo_failure + if lcp_echo_interval is not None: + data["lcp_echo_interval"] = lcp_echo_interval + if mlppp_descriptor is not None: + data["mlppp_descriptor"] = mlppp_descriptor + if persist is not None: + data["persist"] = persist + if pppoe_transport_port is not None: + data["pppoe_transport_port"] = pppoe_transport_port + if resource is not None: + data["resource"] = resource + if run_time_max_ms is not None: + data["run_time_max_ms"] = run_time_max_ms + if run_time_min_ms is not None: + data["run_time_min_ms"] = run_time_min_ms + if shelf is not None: + data["shelf"] = shelf + if src_ip is not None: + data["src_ip"] = src_ip + if transport_type is not None: + data["transport_type"] = transport_type + if tty_transport_device is not None: + data["tty_transport_device"] = tty_transport_device + if unit is not None: + data["unit"] = unit + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_profile + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddProfileProfileFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddProfileProfileFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + p_11r = 0x40 # Use 802.11r roaming setup. + ALLOW_11W = 0x800 # Set 11w (MFP/PMF) to optional. + BSS_TRANS = 0x400 # Enable BSS Transition logic + DHCP_SERVER = 0x1 # This should provide DHCP server. + EAP_PEAP = 0x200 # Enable EAP-PEAP + EAP_TTLS = 0x80 # Use 802.1x EAP-TTLS + NAT = 0x100 # Enable NAT if this object is in a virtual router + SKIP_DHCP_ROAM = 0x10 # Ask station to not re-do DHCP on roam. + WEP = 0x2 # Use WEP encryption + WPA = 0x4 # Use WPA encryption + WPA2 = 0x8 # Use WPA2 encryption + WPA3 = 0x20 # Use WPA3 encryption + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddProfileProfileFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class AddProfileWifiMode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + p_802_11a = "802.11a" # 802.11a + AUTO = "AUTO" # 802.11g + aAX = "aAX" # 802.11a-AX (6E disables /n and /ac) + abg = "abg" # 802.11abg + abgn = "abgn" # 802.11abgn + abgnAC = "abgnAC" # 802.11abgn-AC + abgnAX = "abgnAX" # 802.11abgn-AX + an = "an" # 802.11an + anAC = "anAC" # 802.11an-AC + anAX = "anAX" # 802.11an-AX + as_is = "as_is" # Make no changes to current configuration + b = "b" # 802.11b + bg = "bg" # 802.11bg + bgn = "bgn" # 802.11bgn + bgnAC = "bgnAC" # 802.11bgn-AC + bgnAX = "bgnAX" # 802.11bgn-AX + bond = "bond" # Bonded pair of Ethernet ports. + bridged_ap = "bridged_ap" # AP device in bridged mode. The EIDs may specify radio and bridged port. + client = "client" # Client-side non-WiFi device (Ethernet port, for instance). + g = "g" # 802.11g + mobile_sta = "mobile_sta" # Mobile station device. Expects to connect to DUT AP(s) and upstream + # +LANforge. + monitor = "monitor" # Monitor device/sniffer. The EIDs may specify which radios to use. + peer = "peer" # Edge device, client or server (Ethernet port, for instance). + rdd = "rdd" # Pair of redirect devices, typically associated with VR to act as traffic + # +endpoint + routed_ap = "routed_ap" # AP in routed mode. The EIDs may specify radio and upstream port. + sta = "sta" # Station device, most likely non mobile. The EIDs may specify radio(s) to + # +use. + uplink = "uplink" # Uplink towards rest of network (can go in virtual router and do NAT) + upstream = "upstream" # Upstream server device. The EIDs may specify which ports to use. + vlan = "vlan" # 802.1q VLAN. Specify VID with the 'freq' option. + + def post_add_profile(self, + alias_prefix: str = None, # Port alias prefix, aka hostname prefix. + antenna: str = None, # Antenna count for this profile. + bandwidth: str = None, # 0 (auto), 20, 40, 80 or 160 + eap_id: str = None, # EAP Identifier + flags_mask: str = None, # Specify what flags to set. + freq: str = None, # WiFi frequency to be used, 0 means default. + instance_count: str = None, # Number of devices (stations, vdevs, etc) + mac_pattern: str = None, # Optional MAC-Address pattern, for instance: xx:xx:xx:*:*:xx + name: str = None, # Profile Name. [R] + passwd: str = None, # WiFi Password to be used (AP Mode), [BLANK] means no password. + profile_flags: str = None, # Flags for this profile, see above. + profile_type: str = None, # Profile type: See above. [W] + ssid: str = None, # WiFi SSID to be used, [BLANK] means any. + vid: str = None, # Vlan-ID (only valid for vlan profiles). + wifi_mode: str = None, # WiFi Mode for this profile. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias_prefix is not None: + data["alias_prefix"] = alias_prefix + if antenna is not None: + data["antenna"] = antenna + if bandwidth is not None: + data["bandwidth"] = bandwidth + if eap_id is not None: + data["eap_id"] = eap_id + if flags_mask is not None: + data["flags_mask"] = flags_mask + if freq is not None: + data["freq"] = freq + if instance_count is not None: + data["instance_count"] = instance_count + if mac_pattern is not None: + data["mac_pattern"] = mac_pattern + if name is not None: + data["name"] = name + if passwd is not None: + data["passwd"] = passwd + if profile_flags is not None: + data["profile_flags"] = profile_flags + if profile_type is not None: + data["profile_type"] = profile_type + if ssid is not None: + data["ssid"] = ssid + if vid is not None: + data["vid"] = vid + if wifi_mode is not None: + data["wifi_mode"] = wifi_mode + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_profile_notes + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_profile_notes(self, + dut: str = None, # Profile Name. [R] + text: str = None, # [BLANK] will erase all, any other text will be appended to + # existing text. Unescaped Value + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_profile_notes(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if dut is not None: + data["dut"] = dut + if text is not None: + data["text"] = text + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_profile_notes", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_rdd + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_rdd(self, + peer_ifname: str = None, # The peer (other) RedirectDevice in this pair. + port: str = None, # Name of the Redirect Device to create. [W] + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_rdd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if peer_ifname is not None: + data["peer_ifname"] = peer_ifname + if port is not None: + data["port"] = port + if report_timer is not None: + data["report_timer"] = report_timer + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_rdd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_sec_ip + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_sec_ip(self, + ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix. [W] + port: str = None, # Name of network device (Port) to which these IPs will be added. + # [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_sec_ip(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if ip_list is not None: + data["ip_list"] = ip_list + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_sec_ip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_sta + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddStaFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddStaFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + p_80211r_pmska_cache = 0x4000000 # Enable oportunistic PMSKA caching for WPA2 (Related to + # +802.11r). + p_80211u_additional = 0x100000 # AP requires additional step for access (802.11u Interworking) + p_80211u_auto = 0x40000 # Enable 802.11u (Interworking) Auto-internetworking feature. + # +Always enabled currently. + p_80211u_e911 = 0x200000 # AP claims emergency services reachable (802.11u Interworking) + p_80211u_e911_unauth = 0x400000 # AP provides Unauthenticated emergency services (802.11u + # +Interworking) + p_80211u_enable = 0x20000 # Enable 802.11u (Interworking) feature. + p_80211u_gw = 0x80000 # AP Provides access to internet (802.11u Interworking) + p_8021x_radius = 0x2000000 # Use 802.1x (RADIUS for AP). + create_admin_down = 0x1000000000 # Station should be created admin-down. + custom_conf = 0x20 # Use Custom wpa_supplicant config file. + disable_ofdma = 0x200000000000 # Disable OFDMA mode + disable_twt = 0x100000000000 # Disable TWT mode + disable_fast_reauth = 0x200000000 # Disable fast_reauth option for virtual stations. + disable_gdaf = 0x1000000 # AP: Disable DGAF (used by HotSpot 2.0). + disable_ht80 = 0x8000000 # Disable HT80 (for AC chipset NICs only) + disable_roam = 0x80000000 # Disable automatic station roaming based on scan results. + disable_sgi = 0x4000 # Disable SGI (Short Guard Interval). + hs20_enable = 0x800000 # Enable Hotspot 2.0 (HS20) feature. Requires WPA-2. + ht160_enable = 0x100000000 # Enable HT160 mode. + ht40_disable = 0x800 # Disable HT-40 even if hardware and AP support it. + ibss_mode = 0x20000000 # Station should be in IBSS mode. + lf_sta_migrate = 0x8000 # OK-To-Migrate (Allow station migration between LANforge + # +radios) + mesh_mode = 0x400000000 # Station should be in MESH mode. + no_supp_op_class_ie = 0x4000000000 # Do not include supported-oper-class-IE in assoc requests. May + # +work around AP bugs. + osen_enable = 0x40000000 # Enable OSEN protocol (OSU Server-only Authentication) + passive_scan = 0x2000 # Use passive scanning (don't send probe requests). + power_save_enable = 0x800000000 # Station should enable power-save. May not work in all + # +drivers/configurations. + scan_ssid = 0x1000 # Enable SCAN-SSID flag in wpa_supplicant. + txo_enable = 0x8000000000 # Enable/disable tx-offloads, typically managed by set_wifi_txo + # +command + use_bss_transition = 0x80000000000 # Enable BSS transition. + use_wpa3 = 0x10000000000 # Enable WPA-3 (SAE Personal) mode. + verbose = 0x10000 # Verbose-Debug: Increase debug info in wpa-supplicant and + # +hostapd logs. + wds_mode = 0x2000000000 # WDS station (sort of like a lame mesh), not supported on + # +ath10k + wep_enable = 0x200 # Use wpa_supplicant configured for WEP encryption. + wpa2_enable = 0x400 # Use wpa_supplicant configured for WPA2 encryption. + wpa_enable = 0x10 # Enable WPA + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddStaFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class AddStaMode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + p_802_11a = 1 # 802.11a + AUTO = 0 # 802.11g + aAX = 15 # 802.11a-AX (6E disables /n and /ac) + abg = 4 # 802.11abg + abgn = 5 # 802.11abgn + abgnAC = 8 # 802.11abgn-AC + abgnAX = 12 # 802.11abgn-AX + an = 10 # 802.11an + anAC = 9 # 802.11an-AC + anAX = 14 # 802.11an-AX + b = 2 # 802.11b + bg = 7 # 802.11bg + bgn = 6 # 802.11bgn + bgnAC = 11 # 802.11bgn-AC + bgnAX = 13 # 802.11bgn-AX + g = 3 # 802.11g + + class AddStaRate(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + p_a_g = "/a/g" # 6 Mbps, 9 Mbps, 12 Mbps, 18 Mbps, 24 Mbps, 36 Mbps, 48 Mbps, 54 Mbps + p_b = "/b" # 1Mbps, 2Mbps, 5.5 Mbps, 11 Mbps + DEFAULT = "DEFAULT" # Use maximum available speed + MCS0_76 = "MCS0-76" # /n rates + p_bitmap_ = "[bitmap]" # '0xff 00 ...' to directly specify the MCS bitmap. + + def post_add_sta(self, + ampdu_density: str = None, # 0-7, or 0xFF to not set. + ampdu_factor: str = None, # 0-3, or 0xFF to not set. + ap: str = None, # The Access Point BSSID this Virtual STA should be associated with + flags: str = None, # Flags for this interface (see above.) [W] + flags_mask: str = None, # If set, only these flags will be considered. + ieee80211w: str = None, # Management Frame Protection: 0: disabled, 1: optional, 2: + # Required. + key: str = None, # Encryption key (WEP, WPA, WPA2, WPA3, etc) for this Virtual STA. + # Prepend with 0x for ascii-hex input. + mac: str = None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: + # xx:xx:xx:*:*:xx [W] + max_amsdu: str = None, # 1 == enabled, 0 == disabled, 0xFF == do not set. + mode: str = None, # WiFi mode:
  • 0: AUTO,
  • 1: 802.11a
  • 2: b
  • + #
  • 3: g
  • 4: abg
  • 5: abgn
  • 6: bgn
  • + #
  • 7: bg
  • 8: abgnAC
  • 9 anAC
  • 10 + # an
  • 11 bgnAC
  • 12 abgnAX
  • 13 bgnAX
  • 14 + # anAX
  • 15 aAX
[D:0] + nickname: str = None, # Nickname for this Virtual STA. (No longer used) + radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] + rate: str = None, # Max rate, see help above. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + ssid: str = None, # SSID for this Virtual STA. Use [BLANK] for empty SSID. Start with + # 0x for HEX interpretation. [W] + sta_br_ip: str = None, # IP Address for station bridging. Set to 0.0.0.0 to use MAC + # bridging. + sta_name: str = None, # Name for this Virtual STA, for example: sta0 [W] + wpa_cfg_file: str = None, # WPA Supplicant config file. + x_coord: str = None, # Floating point number. + y_coord: str = None, # Floating point number. + z_coord: str = None, # Floating point number. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_sta(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if ampdu_density is not None: + data["ampdu_density"] = ampdu_density + if ampdu_factor is not None: + data["ampdu_factor"] = ampdu_factor + if ap is not None: + data["ap"] = ap + if flags is not None: + data["flags"] = flags + if flags_mask is not None: + data["flags_mask"] = flags_mask + if ieee80211w is not None: + data["ieee80211w"] = ieee80211w + if key is not None: + data["key"] = key + if mac is not None: + data["mac"] = mac + if max_amsdu is not None: + data["max_amsdu"] = max_amsdu + if mode is not None: + data["mode"] = mode + if nickname is not None: + data["nickname"] = nickname + if radio is not None: + data["radio"] = radio + if rate is not None: + data["rate"] = rate + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if ssid is not None: + data["ssid"] = ssid + if sta_br_ip is not None: + data["sta_br_ip"] = sta_br_ip + if sta_name is not None: + data["sta_name"] = sta_name + if wpa_cfg_file is not None: + data["wpa_cfg_file"] = wpa_cfg_file + if x_coord is not None: + data["x_coord"] = x_coord + if y_coord is not None: + data["y_coord"] = y_coord + if z_coord is not None: + data["z_coord"] = z_coord + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_sta", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_t1_span + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddT1SpanBuildout(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + p_15db = 6 # -15db (CSU) + p_22_5db = 7 # -22.5db (CSU) + p_7_5db = 5 # -7.5db (CSU) + p_0db = 8 # 0db (CSU) + p_133_ft = 0 # 1-133 feet + p_266_ft = 1 # 122-266 feet + p_399_ft = 2 # 266-399 feet + p_533_ft = 3 # 399-533 feet + p_655_ft = 4 # 533-655 feet + + class AddT1SpanType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + Digium_T1 = "Digium_T1" # + Sangoma_E1 = "Sangoma_E1" # + Sangoma_T1 = "Sangoma_T1" # + + def post_add_t1_span(self, + buildout: str = None, # Buildout, Integer, see above. + coding: str = None, # Coding: T1: ami or b8zs. E1: ami or hdb3 + cpu_id: str = None, # CPU identifier (A, B, etc) for multiport Sangoma resources. + first_channel: str = None, # The first DS0 channel for this span. + framing: str = None, # Framing: T1: esf or d4. E1: cas or ccs. + mtu: str = None, # MTU for this span (used by in-band management, if at all). + pci_bus: str = None, # PCI Bus number, needed for Sangoma resources. + pci_slot: str = None, # PCI slot number, needed for Sangoma resources. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + span_num: str = None, # The span number. First span is 1, second is 2... [W] + timing: str = None, # Timing: 0 == do not use, 1 == primary, 2 == secondary.. + p_type: str = None, # Currently supported types listed above. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_t1_span(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if buildout is not None: + data["buildout"] = buildout + if coding is not None: + data["coding"] = coding + if cpu_id is not None: + data["cpu_id"] = cpu_id + if first_channel is not None: + data["first_channel"] = first_channel + if framing is not None: + data["framing"] = framing + if mtu is not None: + data["mtu"] = mtu + if pci_bus is not None: + data["pci_bus"] = pci_bus + if pci_slot is not None: + data["pci_slot"] = pci_slot + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if span_num is not None: + data["span_num"] = span_num + if timing is not None: + data["timing"] = timing + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_t1_span", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_text_blob + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_text_blob(self, + name: str = None, # Text name, for instance '2-AP-test-case' [R] + text: str = None, # [BLANK] will erase all, any other text will be appended to + # existing text. Unescaped Value + p_type: str = None, # Text type identifier stream, for instance 'cv-connectivity' [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_text_blob(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if text is not None: + data["text"] = text + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_text_blob", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_tgcx + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_tgcx(self, + cxname: str = None, # The name of the CX. [R] + tgname: str = None, # The name of the test group. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_tgcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cxname is not None: + data["cxname"] = cxname + if tgname is not None: + data["tgname"] = tgname + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_tgcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_threshold + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddThresholdThreshId(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + Delete_Marked = -3 # Delete any marked. + Mark_All = -2 # Mark all + + class AddThresholdThreshType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + NO_RX_SINCE = 6 # Have not received any bytes/packets in specified time. + RX_BPS_RATE_OOR_1m = 5 # rx-bps over last 1 minute is out of range. + RX_BPS_RATE_OOR_30S = 3 # rx-bps over last 30 seconds is out of range. + RX_BPS_RATE_OOR_3S = 1 # rx-bps over last 3 seconds is out of range. + TT_RX_DROP_OOR = 8 # RX Drop percentage is out of range (per-million). + TT_RX_LAT_OOR = 7 # Latency running-average out of range. + TX_BPS_RATE_OOR_1m = 4 # tx-bps over last 1 minute is out of range. + TX_BPS_RATE_OOR_30S = 2 # tx-bps over last 30 seconds is out of range. + TX_BPS_RATE_OOR_3S = 0 # tx-bps over last 3 seconds is out of range. + + def post_add_threshold(self, + endp: str = None, # Endpoint name or ID. [R] + thresh_id: str = None, # Threshold ID. If adding new threshold, use -1, otherwise use + # correct ID. [W] + thresh_max: str = None, # Maximum acceptable value for this threshold. + thresh_min: str = None, # Minimum acceptable value for this threshold. + thresh_type: str = None, # Threshold type, integer, (see above). + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_threshold(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp is not None: + data["endp"] = endp + if thresh_id is not None: + data["thresh_id"] = thresh_id + if thresh_max is not None: + data["thresh_max"] = thresh_max + if thresh_min is not None: + data["thresh_min"] = thresh_min + if thresh_type is not None: + data["thresh_type"] = thresh_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_threshold", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_tm + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_tm(self, + name: str = None, # The name of the test manager. Must be unique across test managers. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_tm(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_tm", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_traffic_profile + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddTrafficProfileTrafficProfileFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddTrafficProfileTrafficProfileFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + BI_DIRECTIONAL = 0x2 # Should we do bi-directional traffic? + IPERF_UDP = 0x4 # If Iperf, should use UDP. If not set, then will use TCP. + UP = 0x1 # Upload direction (this not set means download) + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddTrafficProfileTrafficProfileFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class AddTrafficProfileWifiMode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + Iperf3_Client = "Iperf3-Client" # iperf3 client + Iperf3_Server = "Iperf3-Server" # iperf3 server + as_is = "as_is" # Make no changes to current configuration + http = "http" # Not yet implemented + https = "https" # Not yet implemented + tcp = "tcp" # + udp = "udp" # + + def post_add_traffic_profile(self, + instance_count: str = None, # Number of connections per device + max_pdu: str = None, # Minimum PDU size + max_speed: str = None, # Opposite-Direction Speed in bps. + min_pdu: str = None, # Minimum PDU size + min_speed: str = None, # Opposite-Direction Speed in bps. + name: str = None, # Profile Name. [R] + tos: str = None, # IP Type-of-Service + traffic_profile_flags: str = None, # Flags for this profile, none defined at this + # point. + traffic_profile_flags_mask: str = None, # Specify what flags to set. + p_type: str = None, # Profile type: See above. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_traffic_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if instance_count is not None: + data["instance_count"] = instance_count + if max_pdu is not None: + data["max_pdu"] = max_pdu + if max_speed is not None: + data["max_speed"] = max_speed + if min_pdu is not None: + data["min_pdu"] = min_pdu + if min_speed is not None: + data["min_speed"] = min_speed + if name is not None: + data["name"] = name + if tos is not None: + data["tos"] = tos + if traffic_profile_flags is not None: + data["traffic_profile_flags"] = traffic_profile_flags + if traffic_profile_flags_mask is not None: + data["traffic_profile_flags_mask"] = traffic_profile_flags_mask + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_traffic_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_traffic_profile_notes + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_traffic_profile_notes(self, + dut: str = None, # Profile Name. [R] + text: str = None, # [BLANK] will erase all, any other text will be + # appended to existing text. Unescaped Value + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_traffic_profile_notes(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if dut is not None: + data["dut"] = dut + if text is not None: + data["text"] = text + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_traffic_profile_notes", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_vap + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddVapFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddVapFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + p_80211h_enable = 0x10000000 # Enable 802.11h (needed for running on DFS channels) Requires + # +802.11d. + p_80211r_pmska_cache = 0x4000000 # Enable oportunistic PMSKA caching for WPA2 (Related to + # +802.11r). + p_80211u_additional = 0x100000 # AP requires additional step for access (802.11u Interworking) + p_80211u_auto = 0x40000 # Enable 802.11u (Interworking) Auto-internetworking feature. + # +Always enabled currently. + p_80211u_e911 = 0x200000 # AP claims emergency services reachable (802.11u Interworking) + p_80211u_e911_unauth = 0x400000 # AP provides Unauthenticated emergency services (802.11u + # +Interworking) + p_80211u_enable = 0x20000 # Enable 802.11u (Interworking) feature. + p_80211u_gw = 0x80000 # AP Provides access to internet (802.11u Interworking) + p_8021x_radius = 0x2000000 # Use 802.1x (RADIUS for AP). + create_admin_down = 0x1000000000 # Station should be created admin-down. + disable_dgaf = 0x1000000 # AP Disable DGAF (used by HotSpot 2.0). + disable_ht40 = 0x800 # Disable HT-40 (will use HT-20 if available). + disable_ht80 = 0x8000000 # Disable HT80 (for AC chipset NICs only) + enable_80211d = 0x40 # Enable 802.11D to broadcast country-code & channels in + # +VAPs + enable_wpa = 0x10 # Enable WPA + hostapd_config = 0x20 # Use Custom hostapd config file. + hs20_enable = 0x800000 # Enable Hotspot 2.0 (HS20) feature. Requires WPA-2. + ht160_enable = 0x100000000 # Enable HT160 mode. + osen_enable = 0x40000000 # Enable OSEN protocol (OSU Server-only Authentication) + pri_sec_ch_enable = 0x100 # Enable Primary/Secondary channel switch. + short_preamble = 0x80 # Allow short-preamble + use_bss_load = 0x20000000000 # Enable BSS Load IE in Beacons and Probe Responses (.11e). + use_bss_transition = 0x80000000000 # Enable BSS transition. + use_rrm_report = 0x40000000000 # Enable Radio measurements IE in beacon and probe responses. + use_wpa3 = 0x10000000000 # Enable WPA-3 (SAE Personal) mode. + verbose = 0x10000 # Verbose-Debug: Increase debug info in wpa-supplicant and + # +hostapd logs. + wep_enable = 0x200 # Enable WEP Encryption + wpa2_enable = 0x400 # Enable WPA2 Encryption + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddVapFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class AddVapMode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + p_802_11a = 1 # 802.11a + AUTO = 0 # 802.11g + aAX = 15 # 802.11a-AX (6E disables /n and /ac) + abg = 4 # 802.11abg + abgn = 5 # 802.11abgn + abgnAC = 8 # 802.11abgn-AC + abgnAX = 12 # 802.11abgn-AX + an = 10 # 802.11an + anAC = 9 # 802.11an-AC + anAX = 14 # 802.11an-AX + b = 2 # 802.11b + bg = 7 # 802.11bg + bgn = 6 # 802.11bgn + bgnAC = 11 # 802.11bgn-AC + bgnAX = 13 # 802.11bgn-AX + g = 3 # 802.11g + + def post_add_vap(self, + ap_name: str = None, # Name for this Virtual AP, for example: vap0 [W] + beacon: str = None, # The beacon interval, in 1kus (1.024 ms), default 100, range: + # 15..65535 + custom_cfg: str = None, # Custom hostapd config file, if you want to craft your own config. + dtim_period: str = None, # DTIM period, range 1..255. Default 2. + flags: str = None, # Flags for this interface (see above.) [W] + flags_mask: str = None, # If set, only these flags will be considered. + frag_thresh: str = None, # UN-USED, Was Fragmentation threshold, which is now set with + # set_wifi_radio, use NA [W] + ieee80211w: str = None, # Management Frame Protection: 0: disabled, 1: optional, 2: Required. + key: str = None, # Encryption key for this Virtual AP. Prepend with 0x for ascii-hex + # representation. + mac: str = None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: + # xx:xx:xx:*:*:xx + max_sta: str = None, # Maximum number of Stations allowed to join this AP (1..2007) + mode: str = None, # WiFi mode: see table [W] + radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] + rate: str = None, # Max rate, see help for add_vsta + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + ssid: str = None, # SSID for this Virtual AP. [W] + x_coord: str = None, # Floating point number. + y_coord: str = None, # Floating point number. + z_coord: str = None, # Floating point number. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vap(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if ap_name is not None: + data["ap_name"] = ap_name + if beacon is not None: + data["beacon"] = beacon + if custom_cfg is not None: + data["custom_cfg"] = custom_cfg + if dtim_period is not None: + data["dtim_period"] = dtim_period + if flags is not None: + data["flags"] = flags + if flags_mask is not None: + data["flags_mask"] = flags_mask + if frag_thresh is not None: + data["frag_thresh"] = frag_thresh + if ieee80211w is not None: + data["ieee80211w"] = ieee80211w + if key is not None: + data["key"] = key + if mac is not None: + data["mac"] = mac + if max_sta is not None: + data["max_sta"] = max_sta + if mode is not None: + data["mode"] = mode + if radio is not None: + data["radio"] = radio + if rate is not None: + data["rate"] = rate + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if ssid is not None: + data["ssid"] = ssid + if x_coord is not None: + data["x_coord"] = x_coord + if y_coord is not None: + data["y_coord"] = y_coord + if z_coord is not None: + data["z_coord"] = z_coord + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_vap", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_venue + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddVenueFreq24(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddVenueFreq240, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + ALL = 0xffff # ALL + Ch_1 = 0x1 # Channel 1 + Ch_2 = 0x2 # Channel 2 + Ch_3 = 0x4 # Channel 3 + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddVenueFreq24 has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class AddVenueFreq5(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddVenueFreq50, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + Ch_100 = 0x800 # Channel 100 5500 + Ch_104 = 0x1000 # Channel 104 5520 + Ch_108 = 0x2000 # Channel 108 5540 + Ch_112 = 0x4000 # Channel 112 5560 + Ch_116 = 0x8000 # Channel 116 5580 + Ch_120 = 0x10000 # Channel 120 5600 + Ch_124 = 0x20000 # Channel 124 5620 + Ch_128 = 0x40000 # Channel 128 5640 + Ch_132 = 0x80000 # Channel 132 5660 + Ch_136 = 0x100000 # Channel 136 5680 + Ch_140 = 0x200000 # Channel 140 5700 + Ch_149 = 0x400000 # Channel 149 5745 + Ch_153 = 0x800000 # Channel 153 5765 + Ch_157 = 0x1000000 # Channel 157 5785 + Ch_161 = 0x2000000 # Channel 161 5805 + Ch_165 = 0x4000000 # Channel 165 5825 + Ch_36 = 0x1 # Channel 36 5180 + Ch_38 = 0x2 # Channel 38 5190 + Ch_40 = 0x4 # Channel 40 5200 + Ch_42 = 0x8 # Channel 42 5210 + Ch_44 = 0x10 # Channel 44 5220 + Ch_46 = 0x20 # Channel 46 5230 + Ch_48 = 0x40 # Channel 48 5240 + Ch_52 = 0x80 # Channel 52 5260 + Ch_56 = 0x100 # Channel 56 5280 + Ch_60 = 0x200 # Channel 60 5300 + Ch_64 = 0x400 # Channel 64 5320 + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddVenueFreq5 has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_add_venue(self, + description: str = None, # User-supplied description, ie: Big City Ball Park; + # 47-characters max. + freq_24: str = None, # Frequency list for 2.4Ghz band, see above. + freq_5: str = None, # Frequency list for 5Ghz band, see above. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + venu_id: str = None, # Number to uniquely identify this venue on this resource. [W] + x1: str = None, # Floating point coordinate for lower-left corner. + x2: str = None, # Floating point coordinate for upper-right corner. + y1: str = None, # Floating point coordinate for lower-left corner. + y2: str = None, # Floating point coordinate for upper-right corner. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_venue(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if description is not None: + data["description"] = description + if freq_24 is not None: + data["freq_24"] = freq_24 + if freq_5 is not None: + data["freq_5"] = freq_5 + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if venu_id is not None: + data["venu_id"] = venu_id + if x1 is not None: + data["x1"] = x1 + if x2 is not None: + data["x2"] = x2 + if y1 is not None: + data["y1"] = y1 + if y2 is not None: + data["y2"] = y2 + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_venue", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_vlan + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_vlan(self, + old_name: str = None, # The temporary name, used for configuring un-discovered hardware. + port: str = None, # Port number of an existing Ethernet interface. [W] + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + vid: str = None, # The VLAN-ID for this 802.1Q VLAN interface. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vlan(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if old_name is not None: + data["old_name"] = old_name + if port is not None: + data["port"] = port + if report_timer is not None: + data["report_timer"] = report_timer + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if vid is not None: + data["vid"] = vid + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_vlan", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_voip_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_voip_endp(self, + alias: str = None, # Name of endpoint. [R] + auth_user_name: str = None, # Use this field for authentication user name. AUTO or blank + # mean use phone number. + display_name: str = None, # User-Name to be displayed. Use AUTO to display phone number. + gateway_port: str = None, # IP Port for SIP gateway (defaults to 5060). + ip_addr: str = None, # Use this IP for local IP address. Useful when there are + # multiple IPs on a port. + peer_phone_num: str = None, # Use AUTO to use phone number of peer endpoint, otherwise + # specify a number: user[@host[:port]] + phone_num: str = None, # Phone number for Endpoint [W] + port: str = None, # Port number or name. [W] + proxy_passwd: str = None, # Password to be used when registering with proxy/gateway. + resource: str = None, # Resource number. [W] + rtp_port: str = None, # RTP port to use for send and receive. + rx_sound_file: str = None, # File name to save received PCM data to. Will be in WAV + # format, or AUTO + shelf: str = None, # Shelf name/id. [R][D:1] + sip_gateway: str = None, # SIP Gateway/Proxy Name, this is who to register with, or + # AUTO + tx_sound_file: str = None, # File name containing the sound sample we will be playing. + vad_max_timer: str = None, # How often should we force a packet, even if VAD is on. + vad_timer: str = None, # How much silence (milliseconds) before VAD is enabled. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_voip_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if auth_user_name is not None: + data["auth_user_name"] = auth_user_name + if display_name is not None: + data["display_name"] = display_name + if gateway_port is not None: + data["gateway_port"] = gateway_port + if ip_addr is not None: + data["ip_addr"] = ip_addr + if peer_phone_num is not None: + data["peer_phone_num"] = peer_phone_num + if phone_num is not None: + data["phone_num"] = phone_num + if port is not None: + data["port"] = port + if proxy_passwd is not None: + data["proxy_passwd"] = proxy_passwd + if resource is not None: + data["resource"] = resource + if rtp_port is not None: + data["rtp_port"] = rtp_port + if rx_sound_file is not None: + data["rx_sound_file"] = rx_sound_file + if shelf is not None: + data["shelf"] = shelf + if sip_gateway is not None: + data["sip_gateway"] = sip_gateway + if tx_sound_file is not None: + data["tx_sound_file"] = tx_sound_file + if vad_max_timer is not None: + data["vad_max_timer"] = vad_max_timer + if vad_timer is not None: + data["vad_timer"] = vad_timer + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_voip_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_vr + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddVrFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddVrFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + p_4BYTE_AS_NUMBER = 0x40 # Sets corresponding Xorp flag. + BGP_CONFED = 0x100 # Configure BGP in a confederation. + BGP_DAMPING = 0x200 # Enable BGP damping section in Xorp configuration file. + ENABLE_BGP = 0x20 # Set this to zero if you don't want BGP on this VR. + RIP_ACCEPT_DR = 0x800 # Tell RIP to accept default-routes. + ROUTE_REFLECTOR = 0x80 # Act as BGP Route Reflector. + USE_IPV6 = 0x10 # Enable IPv6 OSPF routing for this virtual router. + USE_IPV6_RADVD = 0x8 # Enable IPv6 RADV Daemon for interfaces in this virtual router. + USE_RIP = 0x400 # Enable RIP routing protocol in Xorp. + USE_XORP_MCAST = 0x2 # Enable Xorp Multicast routing (requires OSPF to be enabled currently) + USE_XORP_OLSR = 0x1000 # Enable OLSR routing protocol in Xorp. + USE_XORP_OSPF = 0x1 # Enable Xorp router daemon with OSPF (IPv4) protocol + USE_XORP_SHA = 0x4 # Enable Telcordia's Xorp SHA option (requires OSPF to be enabled) + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddVrFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_add_vr(self, + alias: str = None, # Name of virtual router. [R] + flags: str = None, # Virtual router flags, see above for definitions. + height: str = None, # Height to be used when drawn in the LANforge-GUI. + notes: str = None, # Notes for this Virtual Router. Put in quotes if the notes include + # white-space. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + vr_id: str = None, # Leave blank, use NA or 0xFFFF unless you are certain of the value you + # want to enter. + width: str = None, # Width to be used when drawn in the LANforge-GUI. + x: str = None, # X coordinate to be used when drawn in the LANforge-GUI. + y: str = None, # Y coordinate to be used when drawn in the LANforge-GUI. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if flags is not None: + data["flags"] = flags + if height is not None: + data["height"] = height + if notes is not None: + data["notes"] = notes + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if vr_id is not None: + data["vr_id"] = vr_id + if width is not None: + data["width"] = width + if x is not None: + data["x"] = x + if y is not None: + data["y"] = y + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_vr_bgp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddVrBgpFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddVrBgpFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + p_4BYTE_AS_NUMBER = 0x40 # Sets corresponding Xorp flag. + BGP_CONFED = 0x100 # Configure BGP in a confederation. + BGP_DAMPING = 0x200 # Enable BGP damping section in Xorp configuration file. + ENABLE_BGP = 0x20 # Set this to zero if you don't want BGP on this VR. + ROUTE_REFLECTOR = 0x80 # Act as BGP Route Reflector. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddVrBgpFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_add_vr_bgp(self, + bgp_id: str = None, # BGP Identifier: IPv4 Address [W] + cluster_id: str = None, # Cluster ID, IPv4 Address. Use NA if not clustering. + confed_id: str = None, # Confederation ID 1-65535. Use NA if not in a confederation. + flags: str = None, # Virtual router BGP flags, see above for definitions. + half_life: str = None, # Halflife in minutes for damping configuration. + local_as: str = None, # BGP Autonomous System number, 1-65535 + max_suppress: str = None, # Maximum hold down time in minutes for damping configuration. + resource: str = None, # Resource number. [W] + reuse: str = None, # Route flag damping reuse threshold, in minutes. + shelf: str = None, # Shelf name/id. [R][D:1] + suppress: str = None, # Route flag damping cutoff threshold, in minutes. + vr_id: str = None, # Name of virtual router. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vr_bgp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if bgp_id is not None: + data["bgp_id"] = bgp_id + if cluster_id is not None: + data["cluster_id"] = cluster_id + if confed_id is not None: + data["confed_id"] = confed_id + if flags is not None: + data["flags"] = flags + if half_life is not None: + data["half_life"] = half_life + if local_as is not None: + data["local_as"] = local_as + if max_suppress is not None: + data["max_suppress"] = max_suppress + if resource is not None: + data["resource"] = resource + if reuse is not None: + data["reuse"] = reuse + if shelf is not None: + data["shelf"] = shelf + if suppress is not None: + data["suppress"] = suppress + if vr_id is not None: + data["vr_id"] = vr_id + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_vr_bgp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_vrcx + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddVrcxFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddVrcxFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + custom_dhcpd = 0x400 # Use custom DHCP config file + dhcpd_enabled = 0x200 # Serve IPv4 DHCP on this interface + ipv6_enabled = 0x2000 # Serve IPv6 DHCP on this interface + nat_enabled = 0x100 # This connection will NAT outgoing packets + subnet_0 = 0x1 # Specify subnet 0 + subnet_1 = 0x2 # Specify subnet 1 + subnet_2 = 0x4 # Specify subnet 2 + subnet_3 = 0x8 # Specify subnet 3 + subnet_4 = 0x10 # Specify subnet 4 + subnet_5 = 0x20 # Specify subnet 5 + subnet_6 = 0x40 # Specify subnet 6 + subnet_7 = 0x80 # Specify subnet 7 + use_multicast = 0x800 # Use this interface for multicast and-rp + use_vrrp = 0x1000 # Use this interface for VRRP + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddVrcxFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_add_vrcx(self, + dhcp_dns: str = None, # IP Address of DNS server. + dhcp_dns6: str = None, # IPv6 Address of DNS server. + dhcp_domain: str = None, # DHCP Domain name to serve. + dhcp_lease_time: str = None, # DHCP Lease time (in seconds) + dhcp_max: str = None, # Minimum IP address range to serve. + dhcp_max6: str = None, # Minimum IPv6 address to serve. + dhcp_min: str = None, # Minimum IP address range to serve. + dhcp_min6: str = None, # Minimum IPv6 address to serve. + flags: str = None, # Flags, specify if subnets 0-7 are in use, see above for others. + height: str = None, # Height to be used when drawn in the LANforge-GUI. + interface_cost: str = None, # If using OSPF, this sets the cost for this link (1-65535). + local_dev: str = None, # Name of port A, the local network device pair. [W] + local_dev_b: str = None, # Name of port B for the local redirect device pair. [W] + nexthop: str = None, # The next-hop to use when routing packets out this interface. + ospf_area: str = None, # If using OSPF, this sets the OSPF area for this interface. + # Default is 0.0.0.0. + remote_dev: str = None, # Name the remote network device. [W] + remote_dev_b: str = None, # Name of port B for the remote network device. [W] + resource: str = None, # Resource number. [W] + rip_metric: str = None, # If using RIP, this determines the RIP metric (cost), (1-15, 15 + # is infinite). + shelf: str = None, # Shelf name/id. [R][D:1] + subnets: str = None, # Subnets associated with this link, format: + # 1.1.1.1/24,1.1.2.1/16... + vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add + # a stand-alone endpoint. [R][D:FREE_LIST] + vrrp_id: str = None, # VRRP id, must be unique in this virtual router (1-255) + vrrp_interval: str = None, # VRRP broadcast message interval, in seconds (1-255) + vrrp_ip: str = None, # VRRP IPv4 address..ignored if not flagged for VRRP. + vrrp_ip_prefix: str = None, # Number of bits in subnet mask, ie 24 for 255.255.255.0 + vrrp_priority: str = None, # VRRP Priority (1-255, higher is more priority.) + wanlink: str = None, # The name of the WanLink that connects the two B ports. [W] + width: str = None, # Width to be used when drawn in the LANforge-GUI. + x: str = None, # X coordinate to be used when drawn in the LANforge-GUI. + y: str = None, # Y coordinate to be used when drawn in the LANforge-GUI. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vrcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if dhcp_dns is not None: + data["dhcp_dns"] = dhcp_dns + if dhcp_dns6 is not None: + data["dhcp_dns6"] = dhcp_dns6 + if dhcp_domain is not None: + data["dhcp_domain"] = dhcp_domain + if dhcp_lease_time is not None: + data["dhcp_lease_time"] = dhcp_lease_time + if dhcp_max is not None: + data["dhcp_max"] = dhcp_max + if dhcp_max6 is not None: + data["dhcp_max6"] = dhcp_max6 + if dhcp_min is not None: + data["dhcp_min"] = dhcp_min + if dhcp_min6 is not None: + data["dhcp_min6"] = dhcp_min6 + if flags is not None: + data["flags"] = flags + if height is not None: + data["height"] = height + if interface_cost is not None: + data["interface_cost"] = interface_cost + if local_dev is not None: + data["local_dev"] = local_dev + if local_dev_b is not None: + data["local_dev_b"] = local_dev_b + if nexthop is not None: + data["nexthop"] = nexthop + if ospf_area is not None: + data["ospf_area"] = ospf_area + if remote_dev is not None: + data["remote_dev"] = remote_dev + if remote_dev_b is not None: + data["remote_dev_b"] = remote_dev_b + if resource is not None: + data["resource"] = resource + if rip_metric is not None: + data["rip_metric"] = rip_metric + if shelf is not None: + data["shelf"] = shelf + if subnets is not None: + data["subnets"] = subnets + if vr_name is not None: + data["vr_name"] = vr_name + if vrrp_id is not None: + data["vrrp_id"] = vrrp_id + if vrrp_interval is not None: + data["vrrp_interval"] = vrrp_interval + if vrrp_ip is not None: + data["vrrp_ip"] = vrrp_ip + if vrrp_ip_prefix is not None: + data["vrrp_ip_prefix"] = vrrp_ip_prefix + if vrrp_priority is not None: + data["vrrp_priority"] = vrrp_priority + if wanlink is not None: + data["wanlink"] = wanlink + if width is not None: + data["width"] = width + if x is not None: + data["x"] = x + if y is not None: + data["y"] = y + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_vrcx2 + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_add_vrcx2(self, + local_dev: str = None, # Name of port A for the connection. [W] + nexthop6: str = None, # The IPv6 next-hop to use when routing packets out this interface. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + subnets6: str = None, # IPv6 Subnets associated with this link, format: + # aaaa:bbbb::0/64,cccc:dddd:eeee::0/64... + vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add a + # stand-alone endpoint. [W][D:FREE_LIST] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vrcx2(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if local_dev is not None: + data["local_dev"] = local_dev + if nexthop6 is not None: + data["nexthop6"] = nexthop6 + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if subnets6 is not None: + data["subnets6"] = subnets6 + if vr_name is not None: + data["vr_name"] = vr_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_vrcx2", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#add_wl_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class AddWlEndpWleFlags(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + SHOW_WP = 1 # Show WanPaths in wanlink endpoint table in GUI + + def post_add_wl_endp(self, + alias: str = None, # Name of WanPath. [R] + cpu_id: str = None, # The CPU/thread that this process should run on + # (kernel-mode only). + description: str = None, # Description for this endpoint, put in single quotes if it + # contains spaces. + dest_ip: str = None, # Selection filter: Destination IP. + dest_ip_mask: str = None, # Selection filter: Destination IP MASK. + drop_every_xth_pkt: str = None, # YES to periodically drop every Xth pkt, NO to drop packets + # randomly. + drop_freq: str = None, # How often, out of 1,000,000 packets, should we + # purposefully drop a packet. [W] + dup_every_xth_pkt: str = None, # YES to periodically duplicate every Xth pkt, NO to + # duplicate packets randomly. + dup_freq: str = None, # How often, out of 1,000,000 packets, should we + # purposefully duplicate a packet. [W] + extra_buffer: str = None, # The extra amount of bytes to buffer before dropping pkts, + # in units of 1024, use -1 for AUTO. [D:-1] + ignore_bandwidth: str = None, # Should we ignore the bandwidth settings from the playback + # file? YES, NO, or NA. + ignore_dup: str = None, # Should we ignore the Duplicate Packet settings from the + # playback file? YES, NO, or NA. + ignore_latency: str = None, # Should we ignore the latency settings from the playback + # file? YES, NO, or NA. + ignore_loss: str = None, # Should we ignore the packet-loss settings from the + # playback file? YES, NO, or NA. + jitter_freq: str = None, # How often, out of 1,000,000 packets, should we apply + # random jitter. + latency: str = None, # The base latency added to all packets, in milliseconds (or + # add 'us' suffix for microseconds) [W] + max_drop_amt: str = None, # Maximum amount of packets to drop in a row. Default is 1. + # [D:1] + max_jitter: str = None, # The maximum jitter, in milliseconds (or add 'us' suffix + # for microseconds) [W] + max_lateness: str = None, # Maximum amount of un-intentional delay before pkt is + # dropped. Default is AUTO + max_rate: str = None, # Maximum transmit rate (bps) for this WanLink. + max_reorder_amt: str = None, # Maximum amount of packets by which to reorder, Default is + # 10. [D:10] + min_drop_amt: str = None, # Minimum amount of packets to drop in a row. Default is 1. + # [D:1] + min_reorder_amt: str = None, # Minimum amount of packets by which to reorder, Default is + # 1. [D:1] + playback_capture: str = None, # ON or OFF, should we play back a WAN capture file? + playback_capture_file: str = None, # Name of the WAN capture file to play back. + playback_loop: str = None, # Should we loop the playback file, YES or NO or NA. + port: str = None, # Port number. [W] + reorder_every_xth_pkt: str = None, # YES to periodically reorder every Xth pkt, NO to reorder + # packets randomly. + reorder_freq: str = None, # How often, out of 1,000,000 packets, should we make a + # packet out of order. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + source_ip: str = None, # Selection filter: Source IP. + source_ip_mask: str = None, # Selection filter: Source IP MASK. + speed: str = None, # The maximum speed this WanLink will accept (bps). [W] + test_mgr: str = None, # The name of the Test-Manager this WanPath is to use. Leave + # blank for no restrictions. + wanlink: str = None, # Name of WanLink to which we are adding this WanPath. [R] + wle_flags: str = None, # WanLink Endpoint specific flags, see above. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_wl_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if cpu_id is not None: + data["cpu_id"] = cpu_id + if description is not None: + data["description"] = description + if dest_ip is not None: + data["dest_ip"] = dest_ip + if dest_ip_mask is not None: + data["dest_ip_mask"] = dest_ip_mask + if drop_every_xth_pkt is not None: + data["drop_every_xth_pkt"] = drop_every_xth_pkt + if drop_freq is not None: + data["drop_freq"] = drop_freq + if dup_every_xth_pkt is not None: + data["dup_every_xth_pkt"] = dup_every_xth_pkt + if dup_freq is not None: + data["dup_freq"] = dup_freq + if extra_buffer is not None: + data["extra_buffer"] = extra_buffer + if ignore_bandwidth is not None: + data["ignore_bandwidth"] = ignore_bandwidth + if ignore_dup is not None: + data["ignore_dup"] = ignore_dup + if ignore_latency is not None: + data["ignore_latency"] = ignore_latency + if ignore_loss is not None: + data["ignore_loss"] = ignore_loss + if jitter_freq is not None: + data["jitter_freq"] = jitter_freq + if latency is not None: + data["latency"] = latency + if max_drop_amt is not None: + data["max_drop_amt"] = max_drop_amt + if max_jitter is not None: + data["max_jitter"] = max_jitter + if max_lateness is not None: + data["max_lateness"] = max_lateness + if max_rate is not None: + data["max_rate"] = max_rate + if max_reorder_amt is not None: + data["max_reorder_amt"] = max_reorder_amt + if min_drop_amt is not None: + data["min_drop_amt"] = min_drop_amt + if min_reorder_amt is not None: + data["min_reorder_amt"] = min_reorder_amt + if playback_capture is not None: + data["playback_capture"] = playback_capture + if playback_capture_file is not None: + data["playback_capture_file"] = playback_capture_file + if playback_loop is not None: + data["playback_loop"] = playback_loop + if port is not None: + data["port"] = port + if reorder_every_xth_pkt is not None: + data["reorder_every_xth_pkt"] = reorder_every_xth_pkt + if reorder_freq is not None: + data["reorder_freq"] = reorder_freq + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if source_ip is not None: + data["source_ip"] = source_ip + if source_ip_mask is not None: + data["source_ip_mask"] = source_ip_mask + if speed is not None: + data["speed"] = speed + if test_mgr is not None: + data["test_mgr"] = test_mgr + if wanlink is not None: + data["wanlink"] = wanlink + if wle_flags is not None: + data["wle_flags"] = wle_flags + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/add_wl_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#admin + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_admin(self, + arg1: str = None, # Argument 1: xorp-port | scan-rslts-file | iface-name | iface-eid | + # rfgen-message | id + arg2: str = None, # Argument 2: scan key | message | angle | dest-radio + arg3: str = None, # Argument 3: noprobe | migrate-sta-mac-pattern + arg5: str = None, # Argument 4: table-speed + cmd: str = None, # Admin command: + # resync_clock|write_xorp_cfg|scan_complete|ifup_post_complete|flush_complete|req_migrate|rfgen|chamber|clean_logs + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_admin(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if arg1 is not None: + data["arg1"] = arg1 + if arg2 is not None: + data["arg2"] = arg2 + if arg3 is not None: + data["arg3"] = arg3 + if arg5 is not None: + data["arg5"] = arg5 + if cmd is not None: + data["cmd"] = cmd + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/admin", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#apply_vr_cfg + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_apply_vr_cfg(self, + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:ALL] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_apply_vr_cfg(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/apply_vr_cfg", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#blink_attenuator + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_blink_attenuator(self, + resource: str = None, # Resource number. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number, usually 1. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_blink_attenuator(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if serno is not None: + data["serno"] = serno + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/blink_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#c_show_ports + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class CShowPortsProbeFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(CShowPortsProbeFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + BRIDGE = 0x8 # 8 include bridges + EASY_IP_INFO = 0x10 # 16 Everything but gateway information, which is expensive to probe. + ETHTOOL = 0x4 # 4 include ethtool results + GW = 0x20 # 32 include gateway information + GW_FORCE_REFRESH = 0x40 # 64 Force GW (re)probe. Otherwise, cached values *might* be used. + MII = 0x2 # 2 include MII + WIFI = 0x1 # 1 include wifi stations + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("CShowPortsProbeFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_c_show_ports(self, + port: str = None, # Port number, or 'all'. [W] + probe_flags: str = None, # See above, add them together for multiple probings. Leave + # blank if you want stats only. + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_c_show_ports(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if port is not None: + data["port"] = port + if probe_flags is not None: + data["probe_flags"] = probe_flags + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/c_show_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#cancel_vr_cfg + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_cancel_vr_cfg(self, + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:ALL] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_cancel_vr_cfg(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/cancel_vr_cfg", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#clear_cd_counters + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_clear_cd_counters(self, + cd_name: str = None, # Name of Collision Domain, or 'all'. Null argument is same + # as 'all'. [W][D:all] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_cd_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cd_name is not None: + data["cd_name"] = cd_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/clear_cd_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#clear_cx_counters + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_clear_cx_counters(self, + cx_name: str = None, # Name of Cross Connect, or 'all'. Null argument is same as + # 'all'. [W][D:all] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_cx_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cx_name is not None: + data["cx_name"] = cx_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/clear_cx_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#clear_endp_counters + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_clear_endp_counters(self, + endp_name: str = None, # Name of Endpoint, or 'all'. Null argument is same as + # 'all'. [W][D:all] + incr_seqno: str = None, # Enter 'YES' if you want the target to increment the + # cfg-seq-no. + just_latency: str = None, # Enter 'YES' if you only want to clear latency counters, + # and see above for RXGAP. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_endp_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp_name is not None: + data["endp_name"] = endp_name + if incr_seqno is not None: + data["incr_seqno"] = incr_seqno + if just_latency is not None: + data["just_latency"] = just_latency + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/clear_endp_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#clear_group + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_clear_group(self, + name: str = None, # The name of the test group. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/clear_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#clear_port_counters + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class ClearPortCountersExtra(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + dhcp4_lease = "dhcp4_lease" # Remove dhcp lease files for IPv4 DHCP + dhcp6_lease = "dhcp6_lease" # Remove dhcp lease files for IPv6 DHCP + dhcp_leases = "dhcp_leases" # Remove dhcp lease files for IPv4 and IPv6 DHCP + + def post_clear_port_counters(self, + extra: str = None, # Clear something else instead: dhcp4_lease | dhcp6_lease | + # dhcp_leases + port: str = None, # The number of the port in question, or 'ALL'. [W] + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_port_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if extra is not None: + data["extra"] = extra + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/clear_port_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#clear_resource_counters + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_clear_resource_counters(self, + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. + # [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_resource_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/clear_resource_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#clear_wp_counters + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_clear_wp_counters(self, + endp_name: str = None, # Name of WanLink Endpoint. [W] + wp_name: str = None, # Name of WanPath to clear. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_wp_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp_name is not None: + data["endp_name"] = endp_name + if wp_name is not None: + data["wp_name"] = wp_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/clear_wp_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#create_client + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_create_client(self, + name: str = None, # A single name with no white-spaces (15 characters or less) [W] + password: str = None, # Can be blank or 'NA' if no password is set, otherwise must be + # the password. Use IGNORE for no change. + super_user: str = None, # 1 If you want this user to have Administrative powers, 0 or + # blank otherwise. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_create_client(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if password is not None: + data["password"] = password + if super_user is not None: + data["super_user"] = super_user + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/create_client", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#diag + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class DiagType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + NA = "NA" # everything (default) + alerts = "alerts" # alert messages + clients = "clients" # connected clients + counters = "counters" # endpoint counters + endpoints = "endpoints" # list of endpoints + fds = "fds" # file descriptors + iobuffer = "iobuffer" # + license = "license" # license contents + shelf = "shelf" # + + def post_diag(self, + arg1: str = None, # Optional: Endpoint name to diag. + p_type: str = None, # Default (blank) is everything, options: alerts, license, counters, fds, + # clients, endpoints, shelf, iobuffer. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_diag(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if arg1 is not None: + data["arg1"] = arg1 + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/diag", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#discover + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_discover(self, + disconnect: str = None, # Set to 'disconnect' to force disconnect to remote resource process. + resource: str = None, # Resource ID. Use if discovering Attenuators. [W] + shelf: str = None, # Shelf-ID, only used if discovering Attenuators. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_discover(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if disconnect is not None: + data["disconnect"] = disconnect + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/discover", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#do_pesq + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_do_pesq(self, + endp_name: str = None, # Name of Endpoint. [W] + result_file_name: str = None, # The name of the file received by the endpoint. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_do_pesq(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp_name is not None: + data["endp_name"] = endp_name + if result_file_name is not None: + data["result_file_name"] = result_file_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/do_pesq", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#file + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_file(self, + card: str = None, # Resource ID [W] + cmd: str = None, # Only 'Download' supported for now, 'Upload' reserved for future use. + # [W][D:Download] + filename: str = None, # File to transfer. [W] + shelf: str = None, # Shelf ID [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_file(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if card is not None: + data["card"] = card + if cmd is not None: + data["cmd"] = cmd + if filename is not None: + data["filename"] = filename + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/file", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#flash_attenuator + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_flash_attenuator(self, + filename: str = None, # File to use when uploading to attenuator. + resource: str = None, # Resource number. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number, usually 1. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_flash_attenuator(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if filename is not None: + data["filename"] = filename + if resource is not None: + data["resource"] = resource + if serno is not None: + data["serno"] = serno + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/flash_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#getavglatency + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_getavglatency(self, + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getavglatency(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/getavglatency", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#getinrxbps + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_getinrxbps(self, + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getinrxbps(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/getinrxbps", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#getinrxrate + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_getinrxrate(self, + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getinrxrate(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/getinrxrate", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#getintxrate + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_getintxrate(self, + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getintxrate(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/getintxrate", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#getipadd + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_getipadd(self, + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect name [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getipadd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/getipadd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#getmac + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_getmac(self, + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect name [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getmac(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/getmac", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#getmask + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_getmask(self, + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect name + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getmask(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/getmask", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#getpktdrops + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_getpktdrops(self, + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getpktdrops(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/getpktdrops", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#getrxendperrpkts + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_getrxendperrpkts(self, + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getrxendperrpkts(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/getrxendperrpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#getrxpkts + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_getrxpkts(self, + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getrxpkts(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/getrxpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#getrxporterrpkts + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_getrxporterrpkts(self, + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect name [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getrxporterrpkts(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/getrxporterrpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#gettxpkts + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_gettxpkts(self, + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_gettxpkts(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if aorb is not None: + data["aorb"] = aorb + if cx is not None: + data["cx"] = cx + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/gettxpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#gossip + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_gossip(self, + message: str = None, # Message to show to others currently logged on. Unescaped Value [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_gossip(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if message is not None: + data["message"] = message + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/gossip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#help + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_help(self, + command: str = None, # The command to get help for. Can be 'all', or blank. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_help(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if command is not None: + data["command"] = command + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/help", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#init_wiser + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_init_wiser(self, + file_name: str = None, # The WISER file name for the desired emulation, or 'NA' for empty + # string. + node_count: str = None, # The number of WISER nodes for the desired emulation, or 'NA' for + # empty string. + resource: str = None, # The number of the resource in question. [W] + shelf: str = None, # The number of the shelf in question. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_init_wiser(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if file_name is not None: + data["file_name"] = file_name + if node_count is not None: + data["node_count"] = node_count + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/init_wiser", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#licenses + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_licenses(self, + popup: str = None, # If 'popup', then cause a GUI popup msg, otherwise, just show text. + show_file: str = None, # If 'yes', then show the license file, not the parsed license + # information. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_licenses(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if popup is not None: + data["popup"] = popup + if show_file is not None: + data["show_file"] = show_file + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/licenses", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#load + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_load(self, + action: str = None, # Should be 'append' or 'overwrite'. [W] + clean_chambers: str = None, # If yes, then Chambers will be cleaned up when overwrite is selected, + # otherwise they will be kept. + clean_dut: str = None, # If yes, then DUT will be cleaned up when overwrite is selected, + # otherwise they will be kept. + clean_profiles: str = None, # If yes, then clean all profiles when overwrite is selected, otherwise + # they will be kept. + name: str = None, # The name of the database to load. (DFLT is the default) [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_load(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if action is not None: + data["action"] = action + if clean_chambers is not None: + data["clean_chambers"] = clean_chambers + if clean_dut is not None: + data["clean_dut"] = clean_dut + if clean_profiles is not None: + data["clean_profiles"] = clean_profiles + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/load", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#log_level + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class LogLevelLevel(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(LogLevelLevel0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + ALL = 0xffffffff # Log everything + CUST1 = 0x10000 # Cust-1, latency info (65536) + DB = 0x80 # Database related logging (128) + DBG = 0x20 # debug (32) + DBG2 = 0x1000 # very verbose logging (4096) + DIS = 0x1 # disasters (1) + ERR = 0x2 # errors (2) + INF = 0x8 # info (8) + LIO = 0x2000 # IO logging (8192) + LL_PROF = 0x8000 # Profiling information (32768) + OUT1 = 0x4000 # Some std-out logging (16384) + PARSE = 0x800 # PARSE specific (2048) + SCRIPT = 0x400 # Scripting specific stuff (1024) + SEC = 0x40 # log security violations (64) + TRC = 0x10 # function trace (16) + WRN = 0x4 # warnings (4) + XMT = 0x100 # Output going to clients (256) + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("LogLevelLevel has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_log_level(self, + level: str = None, # Integer corresponding to the logging flags. [W] + target: str = None, # Options: 'gnu' | [file-endp-name]. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_log_level(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if level is not None: + data["level"] = level + if target is not None: + data["target"] = target + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/log_level", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#log_msg + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_log_msg(self, + message: str = None, # Message to log. Unescaped Value [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_log_msg(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if message is not None: + data["message"] = message + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/log_msg", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#login + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_login(self, + name: str = None, # A single name with no white-spaces (15 characters or less) [W] + password: str = None, # Can be blank or 'NA' if no password is set, otherwise must be the + # password. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_login(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if password is not None: + data["password"] = password + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/login", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#motd + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_motd(self, + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_motd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + response = self.json_post(url="/cli-json/motd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#nc_show_cd + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_nc_show_cd(self, + collision_domain: str = None, # Name of the Collision Domain, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_cd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if collision_domain is not None: + data["collision_domain"] = collision_domain + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/nc_show_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#nc_show_channel_groups + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_nc_show_channel_groups(self, + channel_name: str = None, # Name of the channel, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_channel_groups(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if channel_name is not None: + data["channel_name"] = channel_name + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/nc_show_channel_groups", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#nc_show_endpoints + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_nc_show_endpoints(self, + endpoint: str = None, # Name of endpoint, or 'all'. [W] + extra: str = None, # See above. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_endpoints(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endpoint is not None: + data["endpoint"] = endpoint + if extra is not None: + data["extra"] = extra + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/nc_show_endpoints", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#nc_show_pesq + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_nc_show_pesq(self, + endpoint: str = None, # Name of endpoint, or 'all'. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_pesq(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endpoint is not None: + data["endpoint"] = endpoint + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/nc_show_pesq", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#nc_show_ports + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class NcShowPortsProbeFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(NcShowPortsProbeFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + BRIDGE = 0x8 # 8 include bridges + EASY_IP_INFO = 0x10 # 16 Everything but gateway information, which is expensive to probe. + ETHTOOL = 0x4 # 4 include ethtool results + GW = 0x20 # 32 include gateway information + GW_FORCE_REFRESH = 0x40 # 64 Force GW (re)probe. Otherwise, cached values *might* be used. + MII = 0x2 # 2 include MII + WIFI = 0x1 # 1 include wifi stations + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("NcShowPortsProbeFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_nc_show_ports(self, + port: str = None, # Port number, or 'all'. [W] + probe_flags: str = None, # See above, add them together for multiple probings. Leave + # blank if you want stats only. + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_ports(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if port is not None: + data["port"] = port + if probe_flags is not None: + data["probe_flags"] = probe_flags + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/nc_show_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#nc_show_ppp_links + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_nc_show_ppp_links(self, + link_num: str = None, # Ppp-Link number of the span, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_ppp_links(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if link_num is not None: + data["link_num"] = link_num + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/nc_show_ppp_links", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#nc_show_spans + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_nc_show_spans(self, + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + span_number: str = None, # Span-Number of the span, or 'all'. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_spans(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if span_number is not None: + data["span_number"] = span_number + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/nc_show_spans", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#nc_show_vr + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_nc_show_vr(self, + resource: str = None, # Resource number, or 'all'. [W] + router: str = None, # Name of the Virtual Router, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if router is not None: + data["router"] = router + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/nc_show_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#nc_show_vrcx + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_nc_show_vrcx(self, + cx_name: str = None, # Name of the Virtual Router Connection, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_vrcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cx_name is not None: + data["cx_name"] = cx_name + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/nc_show_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#notify_dhcp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_notify_dhcp(self, + cmd: str = None, # set/down/timeout/info: What does DHCP want us to do? [W] + netmask: str = None, # New subnet mask. + new_dns: str = None, # New DNS server(s) for use by this interface. + new_ip: str = None, # New IP address. + new_ip6: str = None, # New Global IPv6 address: ipv6/prefix + new_mtu: str = None, # New MTU. + new_router: str = None, # One or more default routers. LANforge will only use the first + # one. + port: str = None, # Interface name. [W] + reason: str = None, # DHCP reason, informational mostly. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_notify_dhcp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cmd is not None: + data["cmd"] = cmd + if netmask is not None: + data["netmask"] = netmask + if new_dns is not None: + data["new_dns"] = new_dns + if new_ip is not None: + data["new_ip"] = new_ip + if new_ip6 is not None: + data["new_ip6"] = new_ip6 + if new_mtu is not None: + data["new_mtu"] = new_mtu + if new_router is not None: + data["new_router"] = new_router + if port is not None: + data["port"] = port + if reason is not None: + data["reason"] = reason + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/notify_dhcp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#port_reset_completed + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_port_reset_completed(self, + extra: str = None, # IP for SECIP, blank for others. + port: str = None, # The port in question. [W] + p_type: str = None, # SUNOS, NORMAL, or SECIP..let us know what kind of reset + # completed. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_port_reset_completed(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if extra is not None: + data["extra"] = extra + if port is not None: + data["port"] = port + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/port_reset_completed", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#probe_port + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_probe_port(self, + key: str = None, # Unique identifier for this request. Usually left blank.
+ port: str = None, # Port number or name [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_probe_port(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if key is not None: + data["key"] = key + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/probe_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#probe_ports + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_probe_ports(self, + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_probe_ports(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/probe_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#quiesce_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_quiesce_endp(self, + endp_name: str = None, # Name of the endpoint, or 'all'. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_quiesce_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp_name is not None: + data["endp_name"] = endp_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/quiesce_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#quiesce_group + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_quiesce_group(self, + name: str = None, # The name of the test group, or 'all' [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_quiesce_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/quiesce_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#quit + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_quit(self, + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_quit(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + response = self.json_post(url="/cli-json/quit", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#reboot_os + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_reboot_os(self, + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_reboot_os(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/reboot_os", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#report + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_report(self, + reporting_on: str = None, # Should we globally enable/disable reporting. (YES, NO or NA) + rpt_dir: str = None, # Directory in which reports should be saved. [W] + save_endps: str = None, # Should we save endpoint reports or not. (YES, NO or NA) + save_ports: str = None, # Should we save Port reports or not. (YES, NO or NA) + save_resource: str = None, # Should we save Resource reports or not. (YES, NO or NA) + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_report(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if reporting_on is not None: + data["reporting_on"] = reporting_on + if rpt_dir is not None: + data["rpt_dir"] = rpt_dir + if save_endps is not None: + data["save_endps"] = save_endps + if save_ports is not None: + data["save_ports"] = save_ports + if save_resource is not None: + data["save_resource"] = save_resource + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/report", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#reset_port + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class ResetPortPreIfdown(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + P_IN = "P-IN" # Only call the portal login (do not reset drivers/supplicant/dhcp) + P_OUT = "P-OUT" # Only call the portal logout (do not reset drivers/supplicant/dhcp) + YES = "YES" # (include logout) Call portal-bot.pl ... --logout before going down. + + def post_reset_port(self, + port: str = None, # Port number to reset, or ALL. [W] + pre_ifdown: str = None, # See above. Leave blank or use NA if unsure. + reset_ospf: str = None, # If set to 'NO' or 'NA', then OSPF will not be updated. Otherwise, + # it will be updated. + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_reset_port(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if port is not None: + data["port"] = port + if pre_ifdown is not None: + data["pre_ifdown"] = pre_ifdown + if reset_ospf is not None: + data["reset_ospf"] = reset_ospf + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/reset_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#reset_serial_span + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_reset_serial_span(self, + resource: str = None, # Resource (machine) number. [W] + shelf: str = None, # Shelf number [R][D:1] + span: str = None, # Serial-Span number to reset. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_reset_serial_span(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if span is not None: + data["span"] = span + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/reset_serial_span", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_attenuator + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_attenuator(self, + resource: str = None, # Resource number [W] + serno: str = None, # Serial number for requested Attenuator. [W] + shelf: str = None, # Shelf number, usually 1 [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_attenuator(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if serno is not None: + data["serno"] = serno + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_cd + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_cd(self, + cd: str = None, # Name of Collision Domain. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_cd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cd is not None: + data["cd"] = cd + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_cd_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_cd_endp(self, + cd: str = None, # Name of Collision Domain. [W] + endp: str = None, # Endpoint name/id. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_cd_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cd is not None: + data["cd"] = cd + if endp is not None: + data["endp"] = endp + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_cd_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_cd_vr + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_cd_vr(self, + cd: str = None, # Name of Collision Domain. [W] + endp: str = None, # Virtual-Router name/id. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_cd_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cd is not None: + data["cd"] = cd + if endp is not None: + data["endp"] = endp + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_cd_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_chamber + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_chamber(self, + chamber: str = None, # Chamber name, or 'ALL' [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_chamber(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if chamber is not None: + data["chamber"] = chamber + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_chamber_path + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_chamber_path(self, + chamber: str = None, # Chamber Name. [W] + path: str = None, # Path Name, use 'ALL' to delete all paths. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_chamber_path(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if chamber is not None: + data["chamber"] = chamber + if path is not None: + data["path"] = path + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_chamber_path", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_channel_group + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_channel_group(self, + channel_name: str = None, # Name of the channel, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_channel_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if channel_name is not None: + data["channel_name"] = channel_name + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_channel_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_client + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_client(self, + client_name: str = None, # Name of the client profile you wish to remove. [W] + client_password: str = None, # Client password. Not required if we are super-user. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_client(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if client_name is not None: + data["client_name"] = client_name + if client_password is not None: + data["client_password"] = client_password + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_client", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_cx + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_cx(self, + cx_name: str = None, # Name of the cross-connect, or 'all'. [W] + test_mgr: str = None, # Name of test-mgr, or 'all'. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_cx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cx_name is not None: + data["cx_name"] = cx_name + if test_mgr is not None: + data["test_mgr"] = test_mgr + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_db + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_db(self, + db_name: str = None, # Name of the database to delete. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_db(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if db_name is not None: + data["db_name"] = db_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_db", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_dut + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_dut(self, + shelf: str = None, # DUT name, or 'ALL' [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_dut(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_dut", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_endp(self, + endp_name: str = None, # Name of the endpoint, or 'YES_ALL'. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp_name is not None: + data["endp_name"] = endp_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_event + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_event(self, + event_id: str = None, # Numeric event-id, or 'all' [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_event(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if event_id is not None: + data["event_id"] = event_id + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_event", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_group + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_group(self, + name: str = None, # The name of the test group. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_ppp_link + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_ppp_link(self, + resource: str = None, # Resource number that holds this PppLink. [W] + shelf: str = None, # Name/id of the shelf. [R][D:1] + unit_num: str = None, # Unit-Number for the PppLink to be deleted. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_ppp_link(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if unit_num is not None: + data["unit_num"] = unit_num + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_profile + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_profile(self, + name: str = None, # Profile name, or 'ALL' [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_resource + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_resource(self, + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_resource(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_resource", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_rfgen + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_rfgen(self, + resource: str = None, # Resource number [W] + shelf: str = None, # Shelf number, usually 1 [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_rfgen(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_rfgen", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_sec_ip + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_sec_ip(self, + ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix, or ALL [W] + port: str = None, # Name of network device (Port) from which these IPs will be removed. + # [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_sec_ip(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if ip_list is not None: + data["ip_list"] = ip_list + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_sec_ip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_span + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_span(self, + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + span_num: str = None, # Span-Number of the channel, or 'all'. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_span(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if span_num is not None: + data["span_num"] = span_num + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_span", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_test_mgr + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_test_mgr(self, + test_mgr: str = None, # Name of the test manager to be removed. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_test_mgr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if test_mgr is not None: + data["test_mgr"] = test_mgr + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_test_mgr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_text_blob + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_text_blob(self, + name: str = None, # Text Blob Name, or 'ALL' [W] + p_type: str = None, # Text Blob type, or 'ALL' [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_text_blob(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_text_blob", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_tgcx + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_tgcx(self, + cxname: str = None, # The name of the CX. [W] + tgname: str = None, # The name of the test group. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_tgcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cxname is not None: + data["cxname"] = cxname + if tgname is not None: + data["tgname"] = tgname + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_tgcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_threshold + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_threshold(self, + endp: str = None, # Endpoint name or ID. [W] + thresh_id: str = None, # Threshold ID to remove. Use 'all' to remove all. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_threshold(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp is not None: + data["endp"] = endp + if thresh_id is not None: + data["thresh_id"] = thresh_id + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_threshold", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_traffic_profile + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_traffic_profile(self, + name: str = None, # Profile name, or 'ALL' [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_traffic_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_traffic_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_venue + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_venue(self, + resource: str = None, # Resource number, or 'ALL' [W] + shelf: str = None, # Shelf number. [R][D:1] + venu_id: str = None, # Number to uniquely identify this venue on this resource, or 'ALL' + # [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_venue(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if venu_id is not None: + data["venu_id"] = venu_id + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_venue", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_vlan + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_vlan(self, + port: str = None, # Port number or name of the virtual interface. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_vlan(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_vlan", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_vr + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_vr(self, + resource: str = None, # Resource number, or 'all'. [W] + router_name: str = None, # Virtual Router name, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if router_name is not None: + data["router_name"] = router_name + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_vrcx + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_vrcx(self, + connection_name: str = None, # Virtual Router Connection name, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + vr_id: str = None, # If not removing from the free-list, then supply the + # virtual-router name/ID here. Leave blank or use NA for free-list. + vrcx_only: str = None, # If we should NOT delete underlying auto-created objects, enter + # 'vrcx_only' here, otherwise leave blank or use NA. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_vrcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if connection_name is not None: + data["connection_name"] = connection_name + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if vr_id is not None: + data["vr_id"] = vr_id + if vrcx_only is not None: + data["vrcx_only"] = vrcx_only + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rm_wanpath + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rm_wanpath(self, + endp_name: str = None, # Name of the endpoint. [W] + wp_name: str = None, # Name of the wanpath. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_wanpath(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp_name is not None: + data["endp_name"] = endp_name + if wp_name is not None: + data["wp_name"] = wp_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rm_wanpath", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#rpt_script + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_rpt_script(self, + endp: str = None, # Endpoint name or ID. [W] + flags: str = None, # See above for description of the defined flags. + group_action: str = None, # All or Sequential. + loop_count: str = None, # How many times to loop before stopping (0 is infinite). + name: str = None, # Script name. [W] + private: str = None, # Private encoding for the particular script. + p_type: str = None, # One of: NONE, Script2544, ScriptHunt, ScriptWL + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rpt_script(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp is not None: + data["endp"] = endp + if flags is not None: + data["flags"] = flags + if group_action is not None: + data["group_action"] = group_action + if loop_count is not None: + data["loop_count"] = loop_count + if name is not None: + data["name"] = name + if private is not None: + data["private"] = private + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/rpt_script", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#scan_wifi + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class ScanWifiExtra(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + NA = "NA" # (or left blank) the system does a full scan + dump = "dump" # then only cached values are returned + trigger_freq__freq_ = "trigger freq [freq]" # scan exactly those frequencies + + def post_scan_wifi(self, + extra: str = None, # Extra arguments to the scan script, see above. + key: str = None, # Unique identifier for this request. Usually left blank. + port: str = None, # Port number or name of the virtual interface. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_scan_wifi(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if extra is not None: + data["extra"] = extra + if key is not None: + data["key"] = key + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/scan_wifi", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_arm_info + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetArmInfoArmFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetArmInfoArmFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + random_payload = 0x10000 # Use random payload sizes instead of linear increase + rel_tstamp = 0x400 # Use Relative Timestamps. This will increase performance + slow_start = 0x2000 # Use slow-start logic. This ramps up + udp_checksum = 0x4000 # Use UDP Checksums. + use_gw_mac = 0x1000 # Use default gateway's MAC for destination MAC. + use_tcp = 0x8000 # Use TCP instead of UDP protocol. (Note this is NOT stateful TCP!) + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetArmInfoArmFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_set_arm_info(self, + arm_flags: str = None, # Armageddon-related flags, see above for details. + burst: str = None, # Burst amount, can significantly improve throughput with some + # modern drivers, similar to 'multi_pkts', and uses the + # 'xmit_more' linux skb option. + dst_mac: str = None, # The destination MAC address. + dst_mac_count: str = None, # How many destination MACs to iterate through. + ip_dst_max: str = None, # Maximum destination IP address to use. + ip_dst_min: str = None, # Minimum destination IP address to use. + ip_src_max: str = None, # Maximum source IP address to use. + ip_src_min: str = None, # Minimum source IP address to use. + max_pkt_size: str = None, # Maximum packet size, including all Ethernet headers (but not + # CRC). + min_pkt_size: str = None, # Minimum packet size, including all Ethernet headers (but not + # CRC). + multi_pkts: str = None, # The number of identical packets to send before creating a new + # one. + name: str = None, # Name of the Endpoint we are setting. [R] + pkts_to_send: str = None, # The number of packets to send. Set to zero for infinite. + src_mac: str = None, # The source MAC address. + src_mac_count: str = None, # How many source MACs to iterate through. + udp_dst_max: str = None, # Minimum destination UDP port. + udp_dst_min: str = None, # Minimum destination UDP port. + udp_src_max: str = None, # Maximum source UDP port. + udp_src_min: str = None, # Minimum source UDP port. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_arm_info(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if arm_flags is not None: + data["arm_flags"] = arm_flags + if burst is not None: + data["burst"] = burst + if dst_mac is not None: + data["dst_mac"] = dst_mac + if dst_mac_count is not None: + data["dst_mac_count"] = dst_mac_count + if ip_dst_max is not None: + data["ip_dst_max"] = ip_dst_max + if ip_dst_min is not None: + data["ip_dst_min"] = ip_dst_min + if ip_src_max is not None: + data["ip_src_max"] = ip_src_max + if ip_src_min is not None: + data["ip_src_min"] = ip_src_min + if max_pkt_size is not None: + data["max_pkt_size"] = max_pkt_size + if min_pkt_size is not None: + data["min_pkt_size"] = min_pkt_size + if multi_pkts is not None: + data["multi_pkts"] = multi_pkts + if name is not None: + data["name"] = name + if pkts_to_send is not None: + data["pkts_to_send"] = pkts_to_send + if src_mac is not None: + data["src_mac"] = src_mac + if src_mac_count is not None: + data["src_mac_count"] = src_mac_count + if udp_dst_max is not None: + data["udp_dst_max"] = udp_dst_max + if udp_dst_min is not None: + data["udp_dst_min"] = udp_dst_min + if udp_src_max is not None: + data["udp_src_max"] = udp_src_max + if udp_src_min is not None: + data["udp_src_min"] = udp_src_min + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_arm_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_attenuator + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetAttenuatorMode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + p_0 = "0" # Normal + p_1 = "1" # Pulse mode (API Tech 4205A modules directly connected via USB only) + + def post_set_attenuator(self, + atten_idx: str = None, # Attenuator index, or 'all'. [W] + mode: str = None, # 0 == normal attenuator, 1 == pulse mode (API Tech 4205A + # modules directly connected via USB only) + pulse_count: str = None, # Number of pulses (0-255) + pulse_interval_ms: str = None, # Time between pulses, in mili-seconds (0-60000). + pulse_time_ms: str = None, # Time interval between pulse groups in miliseconds + # (1-60000) + pulse_width_us5: str = None, # Pulse width in units of 1/2 micro second. So, if you want + # 1.5us, use value 3 (0-60000) + resource: str = None, # Resource number. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number, usually 1. [R][D:1] + val: str = None, # Requested attenution in 1/10ths of dB (ddB). [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_attenuator(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if atten_idx is not None: + data["atten_idx"] = atten_idx + if mode is not None: + data["mode"] = mode + if pulse_count is not None: + data["pulse_count"] = pulse_count + if pulse_interval_ms is not None: + data["pulse_interval_ms"] = pulse_interval_ms + if pulse_time_ms is not None: + data["pulse_time_ms"] = pulse_time_ms + if pulse_width_us5 is not None: + data["pulse_width_us5"] = pulse_width_us5 + if resource is not None: + data["resource"] = resource + if serno is not None: + data["serno"] = serno + if shelf is not None: + data["shelf"] = shelf + if val is not None: + data["val"] = val + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_chamber + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_chamber(self, + chamber: str = None, # Chamber name [W] + cur_rotation: str = None, # Primarily used to store the last known rotation for turntables + # that do not report absolute position. + position: str = None, # Absolute position in degrees. + speed_rpm: str = None, # Speed in rpm (floating point number is accepted + tilt: str = None, # Absolute tilt in degrees. + turntable: str = None, # Turn-table address, for instance: 192.168.1.22:3001 + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_chamber(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if chamber is not None: + data["chamber"] = chamber + if cur_rotation is not None: + data["cur_rotation"] = cur_rotation + if position is not None: + data["position"] = position + if speed_rpm is not None: + data["speed_rpm"] = speed_rpm + if tilt is not None: + data["tilt"] = tilt + if turntable is not None: + data["turntable"] = turntable + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_cx_report_timer + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_cx_report_timer(self, + cx_name: str = None, # Name of cross-connect, or 'all'. [W] + cxonly: str = None, # If you want to set the timer for ONLY the CX, and not + milliseconds: str = None, # Report timer length in milliseconds. + # [W,250-60000][D:5000] + test_mgr: str = None, # Name of the test manager, or 'all'. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_cx_report_timer(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cx_name is not None: + data["cx_name"] = cx_name + if cxonly is not None: + data["cxonly"] = cxonly + if milliseconds is not None: + data["milliseconds"] = milliseconds + if test_mgr is not None: + data["test_mgr"] = test_mgr + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_cx_report_timer", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_cx_state + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetCxStateCxState(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + DELETED = "DELETED" # Deletes the CX(s). + QUIESCE = "QUIESCE" # Stop transmitting and gracefully stop cross-connect. + RUNNING = "RUNNING" # Sets the CX(s) in the running state. + STOPPED = "STOPPED" # Sets the CX(s) in the stopped state. + SWITCH = "SWITCH" # Sets the CX(s) in the running state, stopping any conflicting tests. + + def post_set_cx_state(self, + cx_name: str = None, # Name of the cross-connect, or 'all'. [W] + cx_state: str = None, # One of: RUNNING, SWITCH, QUIESCE, STOPPED, or DELETED. [W] + test_mgr: str = None, # Name of the test-manager, or 'all'. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_cx_state(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cx_name is not None: + data["cx_name"] = cx_name + if cx_state is not None: + data["cx_state"] = cx_state + if test_mgr is not None: + data["test_mgr"] = test_mgr + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_cx_state", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_endp_addr + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_endp_addr(self, + ip: str = None, # The IP Address. Used for TCP/IP and UDP/IP protocols. + mac: str = None, # The MAC address. Only needed for LANforge protocol Endpoints. + max_port: str = None, # The Maximum IP Port. Used for TCP/IP and UDP/IP protocols. + min_port: str = None, # The Minimum IP Port. Used for TCP/IP and UDP/IP protocols. + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_addr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if ip is not None: + data["ip"] = ip + if mac is not None: + data["mac"] = mac + if max_port is not None: + data["max_port"] = max_port + if min_port is not None: + data["min_port"] = min_port + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_endp_addr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_endp_details + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_endp_details(self, + conn_timeout: str = None, # For TCP, the max time in miliseconds to wait for + # connection to establish. + dst_mac: str = None, # Destination MAC address, used for custom Ethernet + # replays. + max_conn_timer: str = None, # The maximum duration (in ms) this connection should run + # before re-establishing. + max_ip_port: str = None, # The maximum IP Port value. (The value for min ip port is + # set through the add_endp/ip_port parameter.) If greater + # than min, each connection will use a random value + # between min and max. + max_reconn_pause: str = None, # The maximum time between re-connects, in ms. + mcast_src_ip: str = None, # Multicast source address (used in SSM mode, multicast + # endpoints only) + mcast_src_port: str = None, # Multicast source address (used in SSM mode, multicast + # endpoints only) + min_conn_timer: str = None, # The minimum duration (in ms) this connection should run + # before re-establishing. + min_reconn_pause: str = None, # The minimum time between re-connects, in ms. + name: str = None, # The name of the endpoint we are configuring. [R] + pkts_to_send: str = None, # Number of packets to send before stopping. 0 means + # infinite. + rcvbuf_size: str = None, # The receive buffer (window) size. Zero for AUTO + sndbuf_size: str = None, # The sending buffer (window) size. Zero for AUTO + tcp_delack_segs: str = None, # NA: No longer supported. + tcp_max_delack: str = None, # NA: No longer supported. + tcp_min_delack: str = None, # NA: No longer supported. + tcp_mss: str = None, # TCP Maximum Segment Size, affects packet size on the + # wire (88 - 32767). + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_details(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if conn_timeout is not None: + data["conn_timeout"] = conn_timeout + if dst_mac is not None: + data["dst_mac"] = dst_mac + if max_conn_timer is not None: + data["max_conn_timer"] = max_conn_timer + if max_ip_port is not None: + data["max_ip_port"] = max_ip_port + if max_reconn_pause is not None: + data["max_reconn_pause"] = max_reconn_pause + if mcast_src_ip is not None: + data["mcast_src_ip"] = mcast_src_ip + if mcast_src_port is not None: + data["mcast_src_port"] = mcast_src_port + if min_conn_timer is not None: + data["min_conn_timer"] = min_conn_timer + if min_reconn_pause is not None: + data["min_reconn_pause"] = min_reconn_pause + if name is not None: + data["name"] = name + if pkts_to_send is not None: + data["pkts_to_send"] = pkts_to_send + if rcvbuf_size is not None: + data["rcvbuf_size"] = rcvbuf_size + if sndbuf_size is not None: + data["sndbuf_size"] = sndbuf_size + if tcp_delack_segs is not None: + data["tcp_delack_segs"] = tcp_delack_segs + if tcp_max_delack is not None: + data["tcp_max_delack"] = tcp_max_delack + if tcp_min_delack is not None: + data["tcp_min_delack"] = tcp_min_delack + if tcp_mss is not None: + data["tcp_mss"] = tcp_mss + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_endp_details", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_endp_file + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetEndpFilePlayback(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + OFF = "OFF" # off + ON = "ON" # on + + def post_set_endp_file(self, + file: str = None, # The file name to read the playback packets from. + name: str = None, # The name of the endpoint we are configuring. [R] + playback: str = None, # Should we playback the capture or not? ON or OFF. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_file(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if file is not None: + data["file"] = file + if name is not None: + data["name"] = name + if playback is not None: + data["playback"] = playback + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_endp_file", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_endp_flag + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetEndpFlagFlag(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + AutoHelper = "AutoHelper" # Automatically run on helper process + ClearPortOnStart = "ClearPortOnStart" # clear stats on start + DoChecksum = "DoChecksum" # Enable checksumming + EnableConcurrentSrcIP = "EnableConcurrentSrcIP" # Concurrent source IPs? + EnableLinearSrcIP = "EnableLinearSrcIP" # linearized source IPs + EnableLinearSrcIPPort = "EnableLinearSrcIPPort" # linearized IP ports + EnableRndSrcIP = "EnableRndSrcIP" # randomize source IP + KernelMode = "KernelMode" # Enable kernel mode + QuiesceAfterDuration = "QuiesceAfterDuration" # quiesce after time period + QuiesceAfterRange = "QuiesceAfterRange" # quiesce after range of bytes + Unmanaged = "Unmanaged" # Set endpoint unmanaged + UseAutoNAT = "UseAutoNAT" # NAT friendly behavior + + def post_set_endp_flag(self, + flag: str = None, # The name of the flag. [R] + name: str = None, # The name of the endpoint we are configuring. [R] + val: str = None, # Either 1 (for on), or 0 (for off). [R,0-1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_flag(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if flag is not None: + data["flag"] = flag + if name is not None: + data["name"] = name + if val is not None: + data["val"] = val + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_endp_flag", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_endp_payload + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetEndpPayloadPayloadType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + PRBS_11_8_10 = "PRBS_11_8_10" # PRBS (see above) + PRBS_15_0_14 = "PRBS_15_0_14" # PRBS (see above) + PRBS_4_0_3 = "PRBS_4_0_3" # Use linear feedback shift register to generate pseudo random sequence. + PRBS_7_0_6 = "PRBS_7_0_6" # PRBS (see above) + custom = "custom" # Enter your own payload with the set_endp_payload + decreasing = "decreasing" # bytes start at FF and decrease, wrapping if needed. + increasing = "increasing" # bytes start at 00 and increase, wrapping if needed. + ones = "ones" # Payload is all ones (FF). + random = "random" # generate a new random payload each time sent. + random_fixed = "random_fixed" # means generate one random payload, and send it over and over again. + zeros = "zeros" # Payload is all zeros (00). + + def post_set_endp_payload(self, + name: str = None, # The name of the endpoint we are configuring. [R] + payload: str = None, # For custom payloads, enter the payload in hex, up to 2048 + # bytes. Unescaped Value + payload_type: str = None, # The payload type. See help for add_endp. [W][D:increasing] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_payload(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if payload is not None: + data["payload"] = payload + if payload_type is not None: + data["payload_type"] = payload_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_endp_payload", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_endp_pld_bounds + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_endp_pld_bounds(self, + is_random: str = None, # YES if random, anything else for NO. + max_pld_size: str = None, # The maximum payload size, in bytes. + min_pld_size: str = None, # The minimum payload size, in bytes. + name: str = None, # The name of the endpoint we are configuring. [R] + use_checksum: str = None, # YES if use checksum on payload, anything else for NO. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_pld_bounds(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if is_random is not None: + data["is_random"] = is_random + if max_pld_size is not None: + data["max_pld_size"] = max_pld_size + if min_pld_size is not None: + data["min_pld_size"] = min_pld_size + if name is not None: + data["name"] = name + if use_checksum is not None: + data["use_checksum"] = use_checksum + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_endp_pld_bounds", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_endp_proxy + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_endp_proxy(self, + enabled: str = None, # YES or NO to enable or disable proxying. + endp_name: str = None, # Name of endpoint. [W] + proxy_ip: str = None, # Proxy IP Address. + proxy_ip_port: str = None, # Proxy IP Port. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_proxy(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if enabled is not None: + data["enabled"] = enabled + if endp_name is not None: + data["endp_name"] = endp_name + if proxy_ip is not None: + data["proxy_ip"] = proxy_ip + if proxy_ip_port is not None: + data["proxy_ip_port"] = proxy_ip_port + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_endp_proxy", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_endp_quiesce + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_endp_quiesce(self, + name: str = None, # The name of the endpoint we are configuring. [R] + quiesce: str = None, # The number of seconds to quiesce this endpoint when told to + # quiesce. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_quiesce(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if quiesce is not None: + data["quiesce"] = quiesce + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_endp_quiesce", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_endp_report_timer + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_endp_report_timer(self, + endp_name: str = None, # Name of endpoint. [R] + milliseconds: str = None, # Report timer length in milliseconds. + # [W,250-60000][D:5000] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_report_timer(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp_name is not None: + data["endp_name"] = endp_name + if milliseconds is not None: + data["milliseconds"] = milliseconds + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_endp_report_timer", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_endp_tos + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetEndpTosTos(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + LOWCOST = "LOWCOST" # + LOWDELAY = "LOWDELAY" # + RELIABILITY = "RELIABILITY" # + THROUGHPUT = "THROUGHPUT" # + + def post_set_endp_tos(self, + name: str = None, # The name of the endpoint we are configuring. [R] + priority: str = None, # The socket priority, can be any positive number. + tos: str = None, # The Type of Service, can be HEX, see above. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_tos(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if priority is not None: + data["priority"] = priority + if tos is not None: + data["tos"] = tos + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_endp_tos", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_endp_tx_bounds + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_endp_tx_bounds(self, + is_bursty: str = None, # YES if bursty, anything else for NO. + max_tx_rate: str = None, # The maximum transmit rate, in bits per second (bps). + min_tx_rate: str = None, # The minimum transmit rate, in bits per second (bps). + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_tx_bounds(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if is_bursty is not None: + data["is_bursty"] = is_bursty + if max_tx_rate is not None: + data["max_tx_rate"] = max_tx_rate + if min_tx_rate is not None: + data["min_tx_rate"] = min_tx_rate + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_endp_tx_bounds", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_event_interest + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetEventInterestEiFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetEventInterestEiFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + CLEAR = 0x0 # will clear interest + SET = 0x1 # set interest flag + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetEventInterestEiFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class SetEventInterestEvents1(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetEventInterestEvents10, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + BAD_TOS = 0x400000 # Endpoint has bad ToS values configured. + Bad_MAC = 0x100000 # Invalid MAC address configured. + Cleared = 0x2000 # Counters were cleared for some entity. + Connect = 0x100 # WiFi interface connected to AP. + Custom = 0x4 # Custom event (generated by USER in GUI or CLI). + DHCP_Fail = 0x8000 # DHCP Failed, maybe out of leases? + DHCP_Timeout = 0x10000 # Timed out talking to DHCP server. + DHCP4_Error = 0x20000 # DHCP gave out duplicated IP address. + DHCP6_Error = 0x40000 # DHCPv6 gave out duplicated IPv6 address. + Disconnect = 0x80 # WiFi interface disconnected from AP. + Endp_Started = 0x40 # Endpoint was started. + Endp_Stopped = 0x20 # Endpoint stopped for some reason. + Link_Down = 0x1 # Notify when Interface Link goes DOWN. + Link_Errors = 0x4000 # Port shows low-level link errors. + Link_Up = 0x2 # Notify when Interface Link goes UP. + Login = 0x400 # CLI/GUI user connected to LANforge. + Logout = 0x200 # CLI/GUI user disconnected from LANforge. + Migrated = 0x200000 # Port (station network interface) migrated. + NO_RX_SINCE = 0x800000 # Endpoint threshold alert. + NO_RX_SINCE_CLEARED = 0x1000000 # Endpoint threshold alert cleared. + RX_BPS_OOR_1M = 0x20000000 # Endpoint threshold alert. + RX_BPS_OOR_1M_CLEARED = 0x40000000 # Endpoint threshold alert cleared. + RX_BPS_OOR_30S = 0x8000000 # Endpoint threshold alert. + RX_BPS_OOR_30S_CLEARED = 0x10000000 # Endpoint threshold alert cleared. + RX_BPS_OOR_3S = 0x2000000 # Endpoint threshold alert. + RX_BPS_OOR_3S_CLEARED = 0x4000000 # Endpoint threshold alert cleared. + Resource_Down = 0x8 # Resource has crashed, rebooted, etc. + Resource_Up = 0x10 # Resource has connected to manager. + Start_Reports = 0x1000 # Start saving report data files (CSV). + Stop_Reports = 0x800 # Stop saving report data files (CSV). + TX_BPS_OOR_3S = 0x80000000 # Endpoint threshold alert. + WiFi_Config = 0x80000 # WiFi Configuration Error. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetEventInterestEvents1 has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class SetEventInterestEvents2(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetEventInterestEvents20, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + FW_CRASH = 0x800 # Firmware for entity has crashed. + FW_FAIL = 0x1000 # Firmware failed powerup, may require reboot. + IFDOWN_FAIL = 0x8000 # IFDOWN-PRE Script (ifup --logout) returned error code. + IFDOWN_OK = 0x10000 # IFDOWN-PRE Script (ifup --logout) completed successfully. + IFUP_FAIL = 0x2000 # IFUP-POST Script returned error code. + IFUP_OK = 0x4000 # IFUP-POST Script completed successfully. + RX_DROP_OOR_1M = 0x200 # Endpoint threshold alert. + RX_DROP_OOR_1M_CLEARED = 0x400 # Endpoint threshold alert cleared. + RX_DROP_OOR_3S = 0x80 # Endpoint threshold alert. + RX_DROP_OOR_3S_CLEARED = 0x100 # Endpoint threshold alert cleared. + RX_LAT_OOR = 0x20 # Endpoint threshold alert. + RX_LAT_OOR_CLEARED = 0x40 # Endpoint threshold alert cleared. + TX_BPS_OOR_1M = 0x8 # Endpoint threshold alert. + TX_BPS_OOR_1M_CLEARED = 0x10 # Endpoint threshold alert cleared. + TX_BPS_OOR_30S = 0x2 # Endpoint threshold alert. + TX_BPS_OOR_30S_CLEARED = 0x4 # Endpoint threshold alert cleared. + TX_BPS_OOR_3S_CLEARED = 0x1 # Endpoint threshold alert cleared. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetEventInterestEvents2 has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_set_event_interest(self, + ei_flags: str = None, # Event Interest flags, see above. [W] + event_cnt: str = None, # Maximum number of events to store. + events1: str = None, # See description for possible values. + events2: str = None, # See description for possible values. + events3: str = None, # See description for possible values. + events4: str = None, # See description for possible values. + var1: str = None, # Currently un-used. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_event_interest(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if ei_flags is not None: + data["ei_flags"] = ei_flags + if event_cnt is not None: + data["event_cnt"] = event_cnt + if events1 is not None: + data["events1"] = events1 + if events2 is not None: + data["events2"] = events2 + if events3 is not None: + data["events3"] = events3 + if events4 is not None: + data["events4"] = events4 + if var1 is not None: + data["var1"] = var1 + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_event_interest", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_event_priority + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetEventPriorityEvent(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + Bad_MAC = 20 # Invalid MAC address configured. + Cleared = 13 # Counters were cleared for some entity. + Connect = 8 # WiFi interface connected to AP. + Custom = 2 # Custom event (generated by USER in GUI or CLI). + DHCP_Fail = 15 # DHCP Failed, maybe out of leases? + DHCP_Timeout = 16 # Timed out talking to DHCP server. + DHCP4_Error = 17 # DHCP gave out duplicated IP address. + DHCP6_Error = 18 # DHCPv6 gave out duplicated IPv6 address. + Disconnect = 7 # WiFi interface disconnected from AP. + Endp_Started = 6 # Endpoint was started. + Endp_Stopped = 5 # Endpoint stopped for some reason. + Link_Down = 0 # Notify when Interface Link goes UP. + Link_Errors = 14 # Port shows low-level link errors. + Link_Up = 1 # Notify when Interface Link goes DOWN. + Login = 10 # CLI/GUI user connected to LANforge. + Logout = 9 # CLI/GUI user disconnected from LANforge. + Migrated = 21 # Port (station network interface) migrated. + Resource_Down = 3 # Resource has crashed, rebooted, etc. + Resource_Up = 4 # Resource has connected to manager. + Start_Reports = 12 # Start saving report data files (CSV). + Stop_Reports = 11 # Stop saving report data files (CSV). + WiFi_Config = 19 # WiFi Configuration Error. + + class SetEventPriorityPriority(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + AUTO = "AUTO" # Let event creator decide the priority. + CRITICAL = "CRITICAL" # + DEBUG = "DEBUG" # + FATAL = "FATAL" # + INFO = "INFO" # + WARNING = "WARNING" # + + def post_set_event_priority(self, + event: str = None, # Number or name for the event, see above. [R,0-21] + priority: str = None, # Number or name for the priority. [R,0-5] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_event_priority(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if event is not None: + data["event"] = event + if priority is not None: + data["priority"] = priority + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_event_priority", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_fe_info + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_fe_info(self, + directory: str = None, # The directory to read/write in. Absolute path suggested. + io_direction: str = None, # Should we be reading or writing: options: read, write + max_file_size: str = None, # The maximum file size, in bytes. + max_rw_sz: str = None, # Maximum read/write size, in bytes. + min_file_size: str = None, # The minimum file size, in bytes. + min_rw_sz: str = None, # Minimum read/write size, in bytes. + name: str = None, # The name of the file endpoint we are configuring. [R] + num_files: str = None, # Number of files to create when writing. + prefix: str = None, # The prefix of the file(s) to read/write. + quiesce_after_files: str = None, # If non-zero, quiesce test after this many files have been + # read/written. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_fe_info(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if directory is not None: + data["directory"] = directory + if io_direction is not None: + data["io_direction"] = io_direction + if max_file_size is not None: + data["max_file_size"] = max_file_size + if max_rw_sz is not None: + data["max_rw_sz"] = max_rw_sz + if min_file_size is not None: + data["min_file_size"] = min_file_size + if min_rw_sz is not None: + data["min_rw_sz"] = min_rw_sz + if name is not None: + data["name"] = name + if num_files is not None: + data["num_files"] = num_files + if prefix is not None: + data["prefix"] = prefix + if quiesce_after_files is not None: + data["quiesce_after_files"] = quiesce_after_files + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_fe_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_flag + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetFlagFlag(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + brief = "brief" # Request more abbreviated output to various commands. + prompt_newlines = "prompt_newlines" # Add a newline after every prompt. Can help with scripts + push_all_rpts = "push_all_rpts" # If enabled, server will send port, endpoint, and other + push_endp_rpts = "push_endp_rpts" # If enabled, server will send endpoint reports without + request_keyed_text = "request_keyed_text" # Normally most keyed-text events are only sent to the GUI + stream_events = "stream_events" # Normally the CLI will not show Events (as seen in the + # +Event + + def post_set_flag(self, + client: str = None, # Specify the user, if it is not the current user. Requires admin + # privileges. + flag: str = None, # The name of the flag. [R] + val: str = None, # Either 1 (for on), or 0 (for off). [R,0-1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_flag(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if client is not None: + data["client"] = client + if flag is not None: + data["flag"] = flag + if val is not None: + data["val"] = val + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_flag", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_gen_cmd + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_gen_cmd(self, + command: str = None, # The rest of the command line arguments. Unescaped Value [R] + name: str = None, # The name of the file endpoint we are configuring. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_gen_cmd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if command is not None: + data["command"] = command + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_gen_cmd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_gps_info + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_gps_info(self, + altitude: str = None, # Altitude, assumes units are Meters. + ew: str = None, # East or west (Longitude). + lattitude: str = None, # The lattitude, as read from a GPS device. + longitude: str = None, # The longitude, as ready from a GPS device. + ns: str = None, # North or South (Latitude). + resource: str = None, # Resource number for the port to be modified. [W] + shelf: str = None, # Shelf number for the port to be modified, or SELF. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_gps_info(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if altitude is not None: + data["altitude"] = altitude + if ew is not None: + data["ew"] = ew + if lattitude is not None: + data["lattitude"] = lattitude + if longitude is not None: + data["longitude"] = longitude + if ns is not None: + data["ns"] = ns + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_gps_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_ifup_script + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_ifup_script(self, + flags: str = None, # Currently un-defined, use NA + port: str = None, # WiFi interface name or number. [W] + post_ifup_script: str = None, # Script name with optional args, will run after interface + # comes up and gets IP. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_ifup_script(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if flags is not None: + data["flags"] = flags + if port is not None: + data["port"] = port + if post_ifup_script is not None: + data["post_ifup_script"] = post_ifup_script + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_ifup_script", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_license + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_license(self, + licenses: str = None, # License keys all appended into a single line. Unescaped Value [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_license(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if licenses is not None: + data["licenses"] = licenses + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_license", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_mc_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_mc_endp(self, + mcast_dest_port: str = None, # Multicast destination IP Port, for example: 55000 + mcast_group: str = None, # Multicast group IP, ie: 224.1.1.2 IPv6 supported as well. + name: str = None, # The name of the endpoint we are configuring. [R] + rcv_mcast: str = None, # Should we attempt to receive? Values: Yes or No + ttl: str = None, # Time to live for the multicast packets generated. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_mc_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if mcast_dest_port is not None: + data["mcast_dest_port"] = mcast_dest_port + if mcast_group is not None: + data["mcast_group"] = mcast_group + if name is not None: + data["name"] = name + if rcv_mcast is not None: + data["rcv_mcast"] = rcv_mcast + if ttl is not None: + data["ttl"] = ttl + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_mc_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_password + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_password(self, + client: str = None, # Specify the client. If left blank, will use current client. + new_password: str = None, # New password, or 'NA' for blank password. [W] + old_password: str = None, # Old password, or 'NA' for blank password. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_password(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if client is not None: + data["client"] = client + if new_password is not None: + data["new_password"] = new_password + if old_password is not None: + data["old_password"] = old_password + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_password", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_poll_mode + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetPollModeMode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + polling = "polling" # + push = "push" # + + def post_set_poll_mode(self, + mode: str = None, # 'polling' or 'push'. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_poll_mode(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if mode is not None: + data["mode"] = mode + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_poll_mode", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_port + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetPortCmdFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetPortCmdFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + abort_if_scripts = 0x400 # Forceably abort all ifup/down scripts on this Port. + force_MII_probe = 0x4 # Force MII probe + from_dhcp = 0x200 # Settings come from DHCP client. + from_user = 0x80 # from_user (Required to change Mgt Port config + new_gw_probe = 0x20 # Force new GW probe + new_gw_probe_dev = 0x40 # Force new GW probe for ONLY this interface + no_hw_probe = 0x8 # Don't probe hardware + probe_wifi = 0x10 # Probe WIFI + reset_transceiver = 0x1 # Reset transciever + restart_link_neg = 0x2 # Restart link negotiation + skip_port_bounce = 0x100 # skip-port-bounce (Don't ifdown/up + use_pre_ifdown = 0x800 # Call pre-ifdown script before bringing interface down. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetPortCmdFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class SetPortCurrentFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetPortCurrentFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + adv_100bt_fd = 0x800000 # advert-100bt-FD + adv_100bt_hd = 0x400000 # advert-100bt-HD + adv_10bt_fd = 0x200000 # advert-10bt-FD + adv_10bt_hd = 0x100000 # advert-10bt-HD + adv_10g_fd = 0x800000000 # advert-10G-FD + adv_2_5g_fd = 0x400000000 # advert-2.5G-FD + adv_5g_fd = 0x400000000000000 # Advertise 5Gbps link speed. + adv_flow_ctl = 0x8000000 # advert-flow-control + auto_neg = 0x100 # auto-negotiate + aux_mgt = 0x800000000000 # Enable Auxillary-Management flag for this port. + fixed_100bt_fd = 0x10 # Fixed-100bt-FD + fixed_100bt_hd = 0x8 # Fixed-100bt-HD + fixed_10bt_fd = 0x4 # Fixed-10bt-FD + fixed_10bt_hd = 0x2 # Fixed-10bt-HD (half duplex) + ftp_enabled = 0x400000000000 # Enable FTP (vsftpd) service for this port. + gro_enabled = 0x4000000000 # GRO-Enabled + gso_enabled = 0x10000000000 # GSO-Enabled + http_enabled = 0x200000000000 # Enable HTTP (nginx) service for this port. + if_down = 0x1 # Interface Down + ignore_dhcp = 0x2000000000000 # Don't set DHCP acquired IP on interface, + ipsec_client = 0x40000000000000 # Enable client IPSEC xfrm on this port. + ipsec_concentrator = 0x80000000000000 # Enable concentrator (upstream) IPSEC xfrm on this port. + lro_enabled = 0x2000000000 # LRO-Enabled + no_dhcp_rel = 0x80000000000 # No-DHCP-Release + no_dhcp_restart = 0x1000000000000 # Disable restart of DHCP on link connect (ie, wifi). + no_ifup_post = 0x4000000000000 # Skip ifup-post script if we can detect that we + promisc = 0x10000000 # PROMISC + radius_enabled = 0x20000000000000 # Enable RADIUS service (using hostapd as radius server) + rxfcs = 0x40000000000 # RXFCS + service_dns = 0x100000000000000 # Enable DNS (dnsmasq) service on this port. + staged_ifup = 0x100000000000 # Staged-IFUP + tso_enabled = 0x1000000000 # TSO-Enabled + ufo_enabled = 0x8000000000 # UFO-Enabled + use_dhcp = 0x80000000 # USE-DHCP + use_dhcpv6 = 0x20000000000 # USE-DHCPv6 + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetPortCurrentFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class SetPortDhcpClientId(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + NA = "NA" # Do not change from current value. + NONE = "NONE" # Do not use dhcp client ID. + p_string_ = "[string]" # Use the string for the client ID. + p__DEVNAME = "__DEVNAME" # Use the interface's name as the client ID. + p__MAC = "__MAC" # Use interface's MAC address for the client ID. + + class SetPortDhcpHostname(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + NA = "NA" # Do not change from current value. + NONE = "NONE" # Do not use dhcp Hostname + p_string_ = "[string]" # Use the string for the Hostname. + p__ALIAS__ = "__ALIAS__" # Use alias if set, or EID behaviour if alias is not set.. + p__EID__ = "__EID__" # Use hostname 'CT-[resource-id].[port-name]' + + class SetPortDhcpVendorId(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + NA = "NA" # Do not change from current value. + NONE = "NONE" # Do not use dhcp vendor ID + p_string_ = "[string]" # Use the string for the vendor ID. + + class SetPortFlags2(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetPortFlags20, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + bypass_disconnect = 0x200 # Logically disconnect the cable (link-down) + bypass_enabled = 0x10 # Enable Bypass Device + bypass_power_down = 0x80 # Should bypass be on when we shutdown or loose power? + bypass_power_on = 0x100 # Should bypass be on when we first power up? + supports_bypass = 0x2 # Support Bypass Devices + use_stp = 0x1 # Use Spanning Tree Protocol + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetPortFlags2 has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class SetPortInterest(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetPortInterest0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + alias = 0x1000 # Port alias + aux_mgt = 0x20000000 # Enable/disable Auxillary-Management for a port + bridge = 0x10000 # BRIDGE + bypass = 0x40000 # Bypass + command_flags = 0x1 # apply command flags + cpu_mask = 0x100000 # CPU Mask, useful for pinning process to CPU core + current_flags = 0x2 # apply current flags + dhcp = 0x4000 # including client-id. + dhcp_rls = 0x4000000 # DHCP release + dhcpv6 = 0x1000000 # Use DHCPv6 + gen_offload = 0x80000 # Generic offload flags, everything but LRO + ifdown = 0x800000 # Down interface + interal_use_1 = 0x800 # (INTERNAL USE) + ip_Mask = 0x8 # IP mask + ip_address = 0x4 # IP address + ip_gateway = 0x10 # IP gateway + ipv6_addrs = 0x20000 # IPv6 Address + link_speed = 0x80 # Link speed + lro_offload = 0x200000 # LRO (Must be disabled when used in Wanlink, + mac_address = 0x20 # MAC address + mtu = 0x100 # MTU + no_apply_dhcp = 0x80000000 # Enable/disable NO-APPLY-DHCP flag for a port + no_dhcp_conn = 0x40000000 # Enable/disable NO-DHCP-ON-CONNECT flag for a port + promisc_mode = 0x400 # PROMISC mode + rpt_timer = 0x8000 # Report Timer + rx_all = 0x2000 # Rx-ALL + rxfcs = 0x2000000 # RXFCS + skip_ifup_roam = 0x100000000 # Enable/disable SKIP-IFUP-ON-ROAM flag for a port + sta_br_id = 0x400000 # WiFi Bridge identifier. 0 means no bridging. + supported_flags = 0x40 # apply supported flags + svc_ftpd = 0x10000000 # Enable/disable FTP Service for a port + svc_httpd = 0x8000000 # Enable/disable HTTP Service for a port + tx_queue_length = 0x200 # TX Queue Length + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetPortInterest has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_set_port(self, + alias: str = None, # A user-defined name for this interface. Can be BLANK or NA. + br_aging_time: str = None, # MAC aging time, in seconds, 32-bit number (or peer IP for + # GRE). + br_forwarding_delay: str = None, # How long to wait until the bridge will start forwarding + # packets. + br_hello_time: str = None, # How often does the bridge send out STP hello packets. + br_max_age: str = None, # How long until STP considers a non-responsive bridge dead. + br_port_cost: str = None, # STP Port cost for a port (this applies only to NON-BRIDGE + # interfaces). + br_port_priority: str = None, # STP Port priority for a port (this applies only to NON-BRIDGE + # interfaces). + br_priority: str = None, # Bridge priority, 16-bit number. + bypass_wdt: str = None, # Watch Dog Timer (in seconds) for this port. Zero (0) to + # disable. + cmd_flags: str = None, # Command Flags: See above, or NA. + cpu_mask: str = None, # CPU Mask for CPUs that should service this interface. Zero is + # don't set (let OS make the decision). This value will be + # applied to the proper /proc/irq/[irq-num]/smp_affinity file by + # the pin_irq.pl script. + current_flags: str = None, # See above, or NA. + current_flags_msk: str = None, # This sets 'interest' for flags 'Enable RADIUS service' and + # higher. See above, or NA. + dhcp_client_id: str = None, # Optional string of up to 63 bytes in length to be passed to + # the dhclient process. See above. + dhcp_hostname: str = None, # Optional string of up to 63 bytes in length to be passed to + # the dhclient process. Option 12, see above. + dhcp_vendor_id: str = None, # Optional string of up to 63 bytes in length to be passed to + # the dhclient process. See above. + dns_servers: str = None, # DNS servers for use by traffic on this port, comma-separated + # list, BLANK means zero-length string. + flags2: str = None, # Bridge & other flags, see above. + gateway: str = None, # IP address of the gateway device - used for IP routing, or NA. + interest: str = None, # Which things are we really interested in setting. Can + # over-ride defaults based on the other arguments. + ip_addr: str = None, # IP address for the port, or NA. + ipsec_concentrator: str = None, # IP Address of IPSec concentrator. + ipsec_local_id: str = None, # Local Identifier for this IPSec tunnel. + ipsec_passwd: str = None, # Password for IPSec, for pubkey, use: pubkey:[pem-file-name], + # for instance: pubkey:station.pem + ipsec_remote_id: str = None, # Remote Identifier for this IPSec tunnel. + ipv6_addr_global: str = None, # Global scoped IPv6 address. + ipv6_addr_link: str = None, # Link scoped IPv6 address. + ipv6_dflt_gw: str = None, # IPv6 default gateway. + mac: str = None, # MAC address to set this port to, or leave blank to not set it, + # or NA. + mtu: str = None, # Maximum Transmit Unit (MTU) for this interface. Can be blank + # or NA. + netmask: str = None, # Netmask which this port should use, or NA. + port: str = None, # Port number for the port to be modified. [W] + report_timer: str = None, # How often, in milliseconds, should we poll stats on this + # interface? + resource: str = None, # Resource number for the port to be modified. [W] + shelf: str = None, # Shelf number for the port to be modified. [R][D:1] + sta_br_id: str = None, # WiFi STAtion bridge ID. Zero means none. + tx_queue_len: str = None, # Transmit Queue Length for this interface. Can be blank or NA. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_port(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if br_aging_time is not None: + data["br_aging_time"] = br_aging_time + if br_forwarding_delay is not None: + data["br_forwarding_delay"] = br_forwarding_delay + if br_hello_time is not None: + data["br_hello_time"] = br_hello_time + if br_max_age is not None: + data["br_max_age"] = br_max_age + if br_port_cost is not None: + data["br_port_cost"] = br_port_cost + if br_port_priority is not None: + data["br_port_priority"] = br_port_priority + if br_priority is not None: + data["br_priority"] = br_priority + if bypass_wdt is not None: + data["bypass_wdt"] = bypass_wdt + if cmd_flags is not None: + data["cmd_flags"] = cmd_flags + if cpu_mask is not None: + data["cpu_mask"] = cpu_mask + if current_flags is not None: + data["current_flags"] = current_flags + if current_flags_msk is not None: + data["current_flags_msk"] = current_flags_msk + if dhcp_client_id is not None: + data["dhcp_client_id"] = dhcp_client_id + if dhcp_hostname is not None: + data["dhcp_hostname"] = dhcp_hostname + if dhcp_vendor_id is not None: + data["dhcp_vendor_id"] = dhcp_vendor_id + if dns_servers is not None: + data["dns_servers"] = dns_servers + if flags2 is not None: + data["flags2"] = flags2 + if gateway is not None: + data["gateway"] = gateway + if interest is not None: + data["interest"] = interest + if ip_addr is not None: + data["ip_addr"] = ip_addr + if ipsec_concentrator is not None: + data["ipsec_concentrator"] = ipsec_concentrator + if ipsec_local_id is not None: + data["ipsec_local_id"] = ipsec_local_id + if ipsec_passwd is not None: + data["ipsec_passwd"] = ipsec_passwd + if ipsec_remote_id is not None: + data["ipsec_remote_id"] = ipsec_remote_id + if ipv6_addr_global is not None: + data["ipv6_addr_global"] = ipv6_addr_global + if ipv6_addr_link is not None: + data["ipv6_addr_link"] = ipv6_addr_link + if ipv6_dflt_gw is not None: + data["ipv6_dflt_gw"] = ipv6_dflt_gw + if mac is not None: + data["mac"] = mac + if mtu is not None: + data["mtu"] = mtu + if netmask is not None: + data["netmask"] = netmask + if port is not None: + data["port"] = port + if report_timer is not None: + data["report_timer"] = report_timer + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if sta_br_id is not None: + data["sta_br_id"] = sta_br_id + if tx_queue_len is not None: + data["tx_queue_len"] = tx_queue_len + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_port_alias + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_port_alias(self, + alias: str = None, # New alias to assign to this virtual interface. [W] + port: str = None, # Physical Port identifier that owns the virtual interface. [R] + resource: str = None, # Resource number for the port to be modified. [W] + shelf: str = None, # Shelf number for the port to be modified. [R][D:1] + vport: str = None, # Virtual port identifier. MAC for MAC-VLANs, VLAN-ID for 802.1Q + # vlans. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_port_alias(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if alias is not None: + data["alias"] = alias + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if vport is not None: + data["vport"] = vport + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_port_alias", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_ppp_link_state + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_ppp_link_state(self, + link: str = None, # Unit Number of the PPP Link, or 'all'. [W] + ppp_state: str = None, # One of: RUNNING, STOPPED, or DELETED. [R] + resource: str = None, # Number of the Resource, or 'all'. [W] + shelf: str = None, # Name of the Shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_ppp_link_state(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if link is not None: + data["link"] = link + if ppp_state is not None: + data["ppp_state"] = ppp_state + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_ppp_link_state", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_resource + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetResourceResourceFlags(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + skip_load_db_on_start = 1 # Should we skip loading the DB on start? + + def post_set_resource(self, + device_profiles: str = None, # List of profiles, see above + max_helper_count: str = None, # Maximum number of helper traffic generation processes. 0 + # means CPU-core-count (AUTO). + max_staged_bringup: str = None, # Maximum amount of interfaces attempting to come up at + # once. Default is 50 + max_station_bringup: str = None, # Maximum amount of stations to bring up per radio per tick. + # Default is 12. + max_trying_ifup: str = None, # Maximum amount of interfaces running the network config + # 'ifup' logic. Default is 15 + resource: str = None, # Number of the Resource, or all. [W] + resource_flags: str = None, # System wide flags, often requires a reboot for changes to + # take effect. + resource_flags_mask: str = None, # What flags to change. If unset, default is all. + shelf: str = None, # Name of the Shelf, or all. [R][D:1] + top_left_x: str = None, # X Location for Chamber View. + top_left_y: str = None, # X Location for Chamber View. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_resource(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if device_profiles is not None: + data["device_profiles"] = device_profiles + if max_helper_count is not None: + data["max_helper_count"] = max_helper_count + if max_staged_bringup is not None: + data["max_staged_bringup"] = max_staged_bringup + if max_station_bringup is not None: + data["max_station_bringup"] = max_station_bringup + if max_trying_ifup is not None: + data["max_trying_ifup"] = max_trying_ifup + if resource is not None: + data["resource"] = resource + if resource_flags is not None: + data["resource_flags"] = resource_flags + if resource_flags_mask is not None: + data["resource_flags_mask"] = resource_flags_mask + if shelf is not None: + data["shelf"] = shelf + if top_left_x is not None: + data["top_left_x"] = top_left_x + if top_left_y is not None: + data["top_left_y"] = top_left_y + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_resource", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_rfgen + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetRfgenRfgenFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetRfgenRfgenFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + one_burst = 0x8 # Run for about 1 second and stop. Uses 5-sec sweep time for single pulse train. + running = 0x2 # Should we start the RF Generator or not? + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetRfgenRfgenFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_set_rfgen(self, + bb_gain: str = None, # RX Gain, 0 - 62 in 2dB steps + freq_khz: str = None, # Center frequency in Khz + gain: str = None, # Main TX/RX Amp, 0 or 14 (dB), default is 14 + p_id: str = None, # RF Generator ID, not used at this time, enter 'NA' or 0. + # [D:NA] + if_gain: str = None, # Fine-tune TX/RX Gain, 0 - 40 dB + pulse_count: str = None, # Number of pulses (0-255) + pulse_interval_us: str = None, # Time between pulses, in micro-seconds. + pulse_width_us: str = None, # Requested pulse width, units are in micro-seconds. + resource: str = None, # Resource number. [W] + rfgen_flags: str = None, # RF Generator flags, see above. + rfgen_flags_mask: str = None, # Mask of what flags to set, see above. + shelf: str = None, # Shelf number, usually 1. [R][D:1] + sweep_time_ms: str = None, # Time interval between pulse groups in miliseconds + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_rfgen(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if bb_gain is not None: + data["bb_gain"] = bb_gain + if freq_khz is not None: + data["freq_khz"] = freq_khz + if gain is not None: + data["gain"] = gain + if p_id is not None: + data["id"] = p_id + if if_gain is not None: + data["if_gain"] = if_gain + if pulse_count is not None: + data["pulse_count"] = pulse_count + if pulse_interval_us is not None: + data["pulse_interval_us"] = pulse_interval_us + if pulse_width_us is not None: + data["pulse_width_us"] = pulse_width_us + if resource is not None: + data["resource"] = resource + if rfgen_flags is not None: + data["rfgen_flags"] = rfgen_flags + if rfgen_flags_mask is not None: + data["rfgen_flags_mask"] = rfgen_flags_mask + if shelf is not None: + data["shelf"] = shelf + if sweep_time_ms is not None: + data["sweep_time_ms"] = sweep_time_ms + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_rfgen", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_script + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetScriptFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetScriptFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + SCR_COMPLETED = 0x80 # Set automatically by LANforge. + SCR_HIDE_CONSTRAINTS = 0x2000 # Hide constraints messages. + SCR_HIDE_CSV = 0x20 # Don't print the CSV data in the report. + SCR_HIDE_HUNT = 0x800 # Hide the individual hunt steps..just show results. + SCR_HIDE_ITER_DETAILS = 0x8 # Hide iteration detail reports. + SCR_HIDE_LAT = 0x1000 # Hide latency distribution reports. + SCR_HIDE_LEGEND = 0x10 # Don't print the legend in the report. + SCR_LOOP = 0x100 # Loop script until manually stopped. + SCR_NO_KEYED_RPT = 0x2 # Script should NOT send reports to the CLI/GUI. + SCR_RUN_ON_MGR = 0x40 # Set automatically by LANforge. + SCR_SHOW_ATTENUATION = 0x4000 # Show attenuation packet stats. + SCR_SHOW_DUPS = 0x200 # Report duplicate packets. + SCR_SHOW_GOLDEN_3P = 0x20000 # Add 'golden' third-party AP graph for comparison (where available). + SCR_SHOW_GOLDEN_LF = 0x10000 # Add 'golden' LANforge graph for comparison (where available). + SCR_SHOW_OOO = 0x400 # Report out-of-order packets. + SCR_STOPPED = 0x1 # Script should NOT have any affect on the endpoint. + SCR_SYMMETRIC = 0x4 # This script should apply settings to the peer endpoing as well. + SCR_USE_MSS = 0x8000 # When setting packet size, set TCP MSS instead if endpoint supports + # +that. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetScriptFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class SetScriptType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + NONE = "NONE" # Delete any existing script. + Script2544 = "Script2544" # For RFC 2544 type testing. + ScriptAtten = "ScriptAtten" # For Attenuators only. + ScriptHunt = "ScriptHunt" # Hunt for maximum speed with constraints. + ScriptWL = "ScriptWL" # For iterating through WanLink settings + + def post_set_script(self, + endp: str = None, # Endpoint, Test Group or Attenuator name or ID. [R] + flags: str = None, # See above for description of the defined flags. + group_action: str = None, # How to handle group script operations: ALL, Sequential + loop_count: str = None, # How many times to loop before stopping (0 is infinite). + name: str = None, # Script name. [W] + private: str = None, # Private encoding for the particular script. + p_type: str = None, # One of: NONE, Script2544, ScriptHunt, ScriptWL, ScriptAtten + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_script(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp is not None: + data["endp"] = endp + if flags is not None: + data["flags"] = flags + if group_action is not None: + data["group_action"] = group_action + if loop_count is not None: + data["loop_count"] = loop_count + if name is not None: + data["name"] = name + if private is not None: + data["private"] = private + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_script", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_sec_ip + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_sec_ip(self, + ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix. [W] + port: str = None, # Name of network device (Port) to which these IPs will be added. + # [R] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_sec_ip(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if ip_list is not None: + data["ip_list"] = ip_list + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_sec_ip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_voip_info + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_voip_info(self, + codec: str = None, # Codec to use for the voice stream, supported values: + # G711U, G711A, SPEEX, g726-16, g726-24, g726-32, g726-40, + # g729a. + first_call_delay: str = None, # How long to wait before making first call, in seconds. + jitter_buffer_sz: str = None, # The size of the jitter buffer in packets. Default value + # is 8. + local_sip_port: str = None, # Local SIP UDP port. Default is min-rtp-port + 2. + loop_call_count: str = None, # How many calls to make, zero means infinite. + loop_wavefile_count: str = None, # How many times to play the wave file, zero means + # infinite. + max_call_duration: str = None, # How long should the call be, in seconds. + max_inter_call_gap: str = None, # Maximum time to wait between calls, in seconds. + messaging_protocol: str = None, # Messaging protocol, supported values: SIP. + min_call_duration: str = None, # How long should the call be, in seconds. + min_inter_call_gap: str = None, # Minimum time to wait between calls, in seconds. + name: str = None, # The name of the endpoint we are configuring. [R] + pesq_server_ip: str = None, # LANforge PESQ server IP address. + pesq_server_passwd: str = None, # LANforge PESQ server password. Default is to use no + # authentication (blank entry). + pesq_server_port: str = None, # LANforge PESQ server port, default is 3998. + reg_expire_timer: str = None, # SIP Registration expire timer, in seconds. + ringing_timer: str = None, # How long (milliseconds) to wait in the ringing state + # before flagging call as no-answer. + sound_dev: str = None, # Which sound device should we play sound to. (see + # set_endp_flags). + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_voip_info(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if codec is not None: + data["codec"] = codec + if first_call_delay is not None: + data["first_call_delay"] = first_call_delay + if jitter_buffer_sz is not None: + data["jitter_buffer_sz"] = jitter_buffer_sz + if local_sip_port is not None: + data["local_sip_port"] = local_sip_port + if loop_call_count is not None: + data["loop_call_count"] = loop_call_count + if loop_wavefile_count is not None: + data["loop_wavefile_count"] = loop_wavefile_count + if max_call_duration is not None: + data["max_call_duration"] = max_call_duration + if max_inter_call_gap is not None: + data["max_inter_call_gap"] = max_inter_call_gap + if messaging_protocol is not None: + data["messaging_protocol"] = messaging_protocol + if min_call_duration is not None: + data["min_call_duration"] = min_call_duration + if min_inter_call_gap is not None: + data["min_inter_call_gap"] = min_inter_call_gap + if name is not None: + data["name"] = name + if pesq_server_ip is not None: + data["pesq_server_ip"] = pesq_server_ip + if pesq_server_passwd is not None: + data["pesq_server_passwd"] = pesq_server_passwd + if pesq_server_port is not None: + data["pesq_server_port"] = pesq_server_port + if reg_expire_timer is not None: + data["reg_expire_timer"] = reg_expire_timer + if ringing_timer is not None: + data["ringing_timer"] = ringing_timer + if sound_dev is not None: + data["sound_dev"] = sound_dev + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_voip_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_vrcx_cost + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_vrcx_cost(self, + interface_cost: str = None, # If using OSPF, this sets the cost for this link (1-65535). + local_dev: str = None, # Name of port A for the local redirect device pair. + local_dev_b: str = None, # Name of port B for the local redirect device pair. + remote_dev: str = None, # Name of port B for the remote redirect device pair. + remote_dev_b: str = None, # Name of port B for the remote redirect device pair. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to + # add a stand-alone endpoint. [W][D:FREE_LIST] + wanlink: str = None, # The name of the WanLink that connects the two B ports. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_vrcx_cost(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if interface_cost is not None: + data["interface_cost"] = interface_cost + if local_dev is not None: + data["local_dev"] = local_dev + if local_dev_b is not None: + data["local_dev_b"] = local_dev_b + if remote_dev is not None: + data["remote_dev"] = remote_dev + if remote_dev_b is not None: + data["remote_dev_b"] = remote_dev_b + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if vr_name is not None: + data["vr_name"] = vr_name + if wanlink is not None: + data["wanlink"] = wanlink + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_vrcx_cost", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wanlink_info + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_wanlink_info(self, + drop_freq: str = None, # How often, out of 1,000,000 packets, should we + # purposefully drop a packet. + dup_freq: str = None, # How often, out of 1,000,000 packets, should we + # purposefully duplicate a packet. + extra_buffer: str = None, # The extra amount of bytes to buffer before dropping + # pkts, in units of 1024. Use -1 for AUTO. + jitter_freq: str = None, # How often, out of 1,000,000 packets, should we apply + # jitter. + latency: str = None, # The base latency added to all packets, in + # milliseconds (or add 'us' suffix for microseconds + max_drop_amt: str = None, # Maximum amount of packets to drop in a row. Default + # is 1. + max_jitter: str = None, # The maximum jitter, in milliseconds (or ad 'us' + # suffix for microseconds) + max_lateness: str = None, # Maximum amount of un-intentional delay before pkt is + # dropped. Default is AUTO + max_reorder_amt: str = None, # Maximum amount of packets by which to reorder, + # Default is 10. + min_drop_amt: str = None, # Minimum amount of packets to drop in a row. Default + # is 1. + min_reorder_amt: str = None, # Minimum amount of packets by which to reorder, + # Default is 1. + name: str = None, # The name of the endpoint we are configuring. [R] + playback_capture_file: str = None, # Name of the WAN capture file to play back. + reorder_freq: str = None, # How often, out of 1,000,000 packets, should we make a + # packet out of order. + speed: str = None, # The maximum speed of traffic this endpoint will + # accept (bps). + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wanlink_info(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if drop_freq is not None: + data["drop_freq"] = drop_freq + if dup_freq is not None: + data["dup_freq"] = dup_freq + if extra_buffer is not None: + data["extra_buffer"] = extra_buffer + if jitter_freq is not None: + data["jitter_freq"] = jitter_freq + if latency is not None: + data["latency"] = latency + if max_drop_amt is not None: + data["max_drop_amt"] = max_drop_amt + if max_jitter is not None: + data["max_jitter"] = max_jitter + if max_lateness is not None: + data["max_lateness"] = max_lateness + if max_reorder_amt is not None: + data["max_reorder_amt"] = max_reorder_amt + if min_drop_amt is not None: + data["min_drop_amt"] = min_drop_amt + if min_reorder_amt is not None: + data["min_reorder_amt"] = min_reorder_amt + if name is not None: + data["name"] = name + if playback_capture_file is not None: + data["playback_capture_file"] = playback_capture_file + if reorder_freq is not None: + data["reorder_freq"] = reorder_freq + if speed is not None: + data["speed"] = speed + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wanlink_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wanlink_pcap + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetWanlinkPcapCapture(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + OFF = "OFF" # stop capturing + ON = "ON" # start capturing + + def post_set_wanlink_pcap(self, + capture: str = None, # Should we capture or not? ON or OFF. [R] + directory: str = None, # The directory name in which packet capture files will be + # written. + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wanlink_pcap(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if capture is not None: + data["capture"] = capture + if directory is not None: + data["directory"] = directory + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wanlink_pcap", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wanpath_corruption + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetWanpathCorruptionFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetWanpathCorruptionFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + BIT_FLIP = 0x4 # Flip a random bit in a byte. + BIT_TRANSPOSE = 0x8 # Transpose two side-by-side bits in a byte. + DO_CHAIN_ON_HIT = 0x10 # Do next corruption if this corruption is applied. + OVERWRITE_FIXED = 0x2 # Write a fixed value to a byte. + OVERWRITE_RANDOM = 0x1 # Write a random value to a byte. + RECALC_CSUMS = 0x20 # Attempt to re-calculate UDP and TCP checksums. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetWanpathCorruptionFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_set_wanpath_corruption(self, + byte: str = None, # The byte to use for OVERWRITE_FIXED (or NA). + flags: str = None, # The flags for this corruption. + index: str = None, # The corruption to modify (0-5). [R,0-5] + max_offset: str = None, # The maximum offset from start of Ethernet packet for + # the byte to be modified. + min_offset: str = None, # The minimum offset from start of Ethernet packet for + # the byte to be modified. + name: str = None, # WanLink name [R] + path: str = None, # WanPath name [R] + rate: str = None, # Specifies how often, per million, this corruption + # should be applied. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wanpath_corruption(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if byte is not None: + data["byte"] = byte + if flags is not None: + data["flags"] = flags + if index is not None: + data["index"] = index + if max_offset is not None: + data["max_offset"] = max_offset + if min_offset is not None: + data["min_offset"] = min_offset + if name is not None: + data["name"] = name + if path is not None: + data["path"] = path + if rate is not None: + data["rate"] = rate + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wanpath_corruption", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wanpath_filter + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_wanpath_filter(self, + defer_flush: str = None, # Enter 'YES' if you do NOT want this flushed to the + # remote. + dst_filter: str = None, # The destination MAC or IP/Mask, 'NA' for PCAP. + filter_type: str = None, # The filter type, one of: MAC, IP, PCAP. + passive: str = None, # Enter 'YES' if you do NOT want to use this filter + # currently. + reverse: str = None, # If you want the logic reversed, use 'ON', otherwise set + # to 'OFF' + src_filter: str = None, # The source MAC or IP/Mask. For PCAP, this is the only + # filter. + wl_name: str = None, # The name of the WanLink endpoint we are configuring. [R] + wp_name: str = None, # The name of the WanPath we are configuring. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wanpath_filter(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if defer_flush is not None: + data["defer_flush"] = defer_flush + if dst_filter is not None: + data["dst_filter"] = dst_filter + if filter_type is not None: + data["filter_type"] = filter_type + if passive is not None: + data["passive"] = passive + if reverse is not None: + data["reverse"] = reverse + if src_filter is not None: + data["src_filter"] = src_filter + if wl_name is not None: + data["wl_name"] = wl_name + if wp_name is not None: + data["wp_name"] = wp_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wanpath_filter", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wanpath_running + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetWanpathRunningRunning(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + AS_PARENT = "AS_PARENT" # then it will be started and stopped as the parent WanLink is. + RUNNING = "RUNNING" # then it will be running at all times + STOPPED = "STOPPED" # then it will not be running at any time. + + def post_set_wanpath_running(self, + running: str = None, # The state, one of: AS_PARENT, RUNNING, STOPPED. [R] + wl_name: str = None, # The name of the WanLink endpoint we are configuring. [R] + wp_name: str = None, # The name of the WanPath we are configuring. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wanpath_running(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if running is not None: + data["running"] = running + if wl_name is not None: + data["wl_name"] = wl_name + if wp_name is not None: + data["wp_name"] = wp_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wanpath_running", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wifi_corruptions + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetWifiCorruptionsCorruptFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetWifiCorruptionsCorruptFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + MSG_TYPE_DEAUTH = 0x2 # de-authentication message + MSG_TYPE_EAPOL = 0x1 # Any EAPOL message + MSG_TYPE_EAPOL_1_OF_2 = 0x40 # EAPOL message 1/2 + MSG_TYPE_EAPOL_1_OF_4 = 0x4 # EAPOL message 1/4 + MSG_TYPE_EAPOL_2_OF_2 = 0x80 # EAPOL message 2/2 + MSG_TYPE_EAPOL_2_OF_4 = 0x8 # EAPOL message 2/4 + MSG_TYPE_EAPOL_3_OF_4 = 0x10 # EAPOL message 3/4 + MSG_TYPE_EAPOL_4_OF_4 = 0x20 # EAPOL message 4/4 + MSG_TYPE_EAPOL_ASSOC = 0x200 # EAP Association + MSG_TYPE_EAPOL_KEY_REQ = 0x100 # EAP Key Request (not sure if this works properly) + MST_TYPE_EAPOL_ID_REQ = 0x400 # EAP Identity request + MST_TYPE_EAPOL_ID_RESP = 0x800 # EAP Identity response + MST_TYPE_EAPOL_OTHER_REQ = 0x1000 # EAP Requests that do not match other things. + MST_TYPE_EAPOL_OTHER_RESP = 0x2000 # EAP Responses that do not match other things. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetWifiCorruptionsCorruptFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_set_wifi_corruptions(self, + corrupt_flags: str = None, # Specify packet types to corrupt (see flags above). + corrupt_per_mil: str = None, # Per-million: Station to randomly corrupt selected + # message types by this amount. + delay_flags: str = None, # Specify packet types to delay (see flags above). + delay_max: str = None, # miliseconds: Station to randomly delay processing + # received messages, max time + delay_min: str = None, # miliseconds: Station to randomly delay processing + # received messages, min time + dup_flags: str = None, # Specify packet types to duplicate (see flags above). + dup_per_65535: str = None, # Percentage, represented as x per 65535 of packets we + # should duplicate. + ignore_flags: str = None, # Specify packet types to ignore (see flags above). + ignore_per_mil: str = None, # Per-million: Station to randomly ignore selected + # message types by this amount. + port: str = None, # WiFi interface name or number. [W] + req_flush: str = None, # Set to 1 if you wish to flush changes to kernel now. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_corruptions(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if corrupt_flags is not None: + data["corrupt_flags"] = corrupt_flags + if corrupt_per_mil is not None: + data["corrupt_per_mil"] = corrupt_per_mil + if delay_flags is not None: + data["delay_flags"] = delay_flags + if delay_max is not None: + data["delay_max"] = delay_max + if delay_min is not None: + data["delay_min"] = delay_min + if dup_flags is not None: + data["dup_flags"] = dup_flags + if dup_per_65535 is not None: + data["dup_per_65535"] = dup_per_65535 + if ignore_flags is not None: + data["ignore_flags"] = ignore_flags + if ignore_per_mil is not None: + data["ignore_per_mil"] = ignore_per_mil + if port is not None: + data["port"] = port + if req_flush is not None: + data["req_flush"] = req_flush + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wifi_corruptions", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wifi_custom + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_wifi_custom(self, + port: str = None, # WiFi interface name or number. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + text: str = None, # [BLANK] will erase all, any other text will be appended to + # existing text. + p_type: str = None, # NA for now, may specify specific locations later. [D:NA] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_custom(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if text is not None: + data["text"] = text + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wifi_custom", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wifi_extra + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_wifi_extra(self, + anonymous_identity: str = None, # Anonymous identity string for EAP. + anqp_3gpp_cell_net: str = None, # 802.11u 3GCPP Cellular Network Info, VAP only. + ca_cert: str = None, # CA-CERT file name. + client_cert: str = None, # 802.11u Client cert file: /etc/wpa_supplicant/ca.pem + domain: str = None, # 802.11u domain: mytelco.com + eap: str = None, # EAP method: MD5, MSCHAPV2, OTP, GTC, TLS, PEAP, TTLS. + group: str = None, # Group cyphers: CCMP, TKIP, WEP104, WEP40, or combination. + hessid: str = None, # 802.11u HESSID (MAC address format) (or peer for WDS + # stations). + identity: str = None, # EAP Identity string. + imsi: str = None, # 802.11u IMSI: 310026-000000000 + ipaddr_type_avail: str = None, # 802.11u network type available, integer, VAP only. + key: str = None, # WEP key0. This should be entered in ascii-hex. Use this + # only for WEP. + key_mgmt: str = None, # Key management: WPA-PSK, WPA-EAP, IEEE8021X, NONE, + # WPA-PSK-SHA256, WPA-EAP-SHA256 or combo. + milenage: str = None, # 802.11u milenage: + # 90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82 + network_auth_type: str = None, # 802.11u network authentication type, VAP only. + network_type: str = None, # 802.11u network type, integer, VAP only. + pac_file: str = None, # EAP-FAST PAC-File name. (For AP, this field is the RADIUS + # secret password) + pairwise: str = None, # Pairwise ciphers: CCMP, TKIP, NONE, or combination. + password: str = None, # EAP Password string. + phase1: str = None, # Outer-authentication, ie TLS tunnel parameters. + phase2: str = None, # Inner authentication with TLS tunnel. + pin: str = None, # EAP-SIM pin string. (For AP, this field is HS20 Operating + # Class) + pk_passwd: str = None, # EAP private key password. (For AP, this field is HS20 + # connection capability) + port: str = None, # WiFi interface name or number. [W] + private_key: str = None, # EAP private key certificate file name. (For AP, this + # field is HS20 WAN Metrics) + psk: str = None, # WPA(2) pre-shared key. If unsure, use this field for any + # password entry. Prepend with 0x for ascii-hex + # representation. + realm: str = None, # 802.11u realm: mytelco.com + resource: str = None, # Resource number. [W] + roaming_consortium: str = None, # 802.11u roaming consortium: 223344 (15 characters max) + shelf: str = None, # Shelf number. [R][D:1] + venue_group: str = None, # 802.11u Venue Group, integer. VAP only. + venue_type: str = None, # 802.11u Venue Type, integer. VAP only. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_extra(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if anonymous_identity is not None: + data["anonymous_identity"] = anonymous_identity + if anqp_3gpp_cell_net is not None: + data["anqp_3gpp_cell_net"] = anqp_3gpp_cell_net + if ca_cert is not None: + data["ca_cert"] = ca_cert + if client_cert is not None: + data["client_cert"] = client_cert + if domain is not None: + data["domain"] = domain + if eap is not None: + data["eap"] = eap + if group is not None: + data["group"] = group + if hessid is not None: + data["hessid"] = hessid + if identity is not None: + data["identity"] = identity + if imsi is not None: + data["imsi"] = imsi + if ipaddr_type_avail is not None: + data["ipaddr_type_avail"] = ipaddr_type_avail + if key is not None: + data["key"] = key + if key_mgmt is not None: + data["key_mgmt"] = key_mgmt + if milenage is not None: + data["milenage"] = milenage + if network_auth_type is not None: + data["network_auth_type"] = network_auth_type + if network_type is not None: + data["network_type"] = network_type + if pac_file is not None: + data["pac_file"] = pac_file + if pairwise is not None: + data["pairwise"] = pairwise + if password is not None: + data["password"] = password + if phase1 is not None: + data["phase1"] = phase1 + if phase2 is not None: + data["phase2"] = phase2 + if pin is not None: + data["pin"] = pin + if pk_passwd is not None: + data["pk_passwd"] = pk_passwd + if port is not None: + data["port"] = port + if private_key is not None: + data["private_key"] = private_key + if psk is not None: + data["psk"] = psk + if realm is not None: + data["realm"] = realm + if resource is not None: + data["resource"] = resource + if roaming_consortium is not None: + data["roaming_consortium"] = roaming_consortium + if shelf is not None: + data["shelf"] = shelf + if venue_group is not None: + data["venue_group"] = venue_group + if venue_type is not None: + data["venue_type"] = venue_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wifi_extra", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wifi_extra2 + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_wifi_extra2(self, + corrupt_gtk_rekey_mic: str = None, # Per-million: AP corrupts GTK Rekey MIC. + freq_24: str = None, # Frequency list for 2.4Ghz band, see above. + freq_5: str = None, # Frequency list for 5Ghz band, see above. + ignore_assoc: str = None, # Per-million: AP ignore assoc request percentage. + ignore_auth: str = None, # Per-million: AP ignore auth request percentage. + ignore_probe: str = None, # Per-million: AP ignore probe percentage. + ignore_reassoc: str = None, # Per-million: AP ignore re-assoc request percentage. + ocsp: str = None, # OCSP settings: 0=disabled, 1=try, but to not require + # response, 2=require valid OCSP stapling response. + port: str = None, # WiFi interface name or number. [W] + post_ifup_script: str = None, # Script name with optional args, will run after + # interface comes up and gets IP. + radius_ip: str = None, # RADIUS server IP Address (AP Only) + radius_port: str = None, # RADIUS server IP Port (AP Only) + req_flush: str = None, # Set to 1 if you wish to flush changes to kernel now. + resource: str = None, # Resource number. [W] + sae_pwe: str = None, # Set SAE-PWE, 0 == hunting-and-pecking, 1 == + # hash-to-element, 2 allow both. + shelf: str = None, # Shelf number. [R][D:1] + venue_id: str = None, # Venue-ID for this wifi device. VAP in same venue will + # share neigh reports as appropriate. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_extra2(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if corrupt_gtk_rekey_mic is not None: + data["corrupt_gtk_rekey_mic"] = corrupt_gtk_rekey_mic + if freq_24 is not None: + data["freq_24"] = freq_24 + if freq_5 is not None: + data["freq_5"] = freq_5 + if ignore_assoc is not None: + data["ignore_assoc"] = ignore_assoc + if ignore_auth is not None: + data["ignore_auth"] = ignore_auth + if ignore_probe is not None: + data["ignore_probe"] = ignore_probe + if ignore_reassoc is not None: + data["ignore_reassoc"] = ignore_reassoc + if ocsp is not None: + data["ocsp"] = ocsp + if port is not None: + data["port"] = port + if post_ifup_script is not None: + data["post_ifup_script"] = post_ifup_script + if radius_ip is not None: + data["radius_ip"] = radius_ip + if radius_port is not None: + data["radius_port"] = radius_port + if req_flush is not None: + data["req_flush"] = req_flush + if resource is not None: + data["resource"] = resource + if sae_pwe is not None: + data["sae_pwe"] = sae_pwe + if shelf is not None: + data["shelf"] = shelf + if venue_id is not None: + data["venue_id"] = venue_id + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wifi_extra2", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wifi_radio + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetWifiRadioFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetWifiRadioFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + ct_sta_mode = 0x40000 # Enable CT-STA mode if radio supports it. Efficiently replaces sw-crypt in + # +some firmware. + firmware_cfg = 0x80000 # Apply firmware config. + hw_sim = 0x1 # Create hw-sim virtual radio if radio does not already exist. + ignore_radar = 0x100000 # Ignore RADAR events reported by firmware. + no_scan_share = 0x40 # Disable sharing scan results. + no_sw_crypt = 0x20000 # Disable software-crypt for this radio. Disables some virtual-station + # +features. + use_syslog = 0x20000000 # Put supplicant logs in syslog instead of a file. + verbose = 0x10000 # Verbose-Debug: Increase debug info in wpa-supplicant and hostapd logs. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetWifiRadioFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + class SetWifiRadioMode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + p_802_11a = 1 # 802.11a + AUTO = 0 # 802.11g + aAX = 15 # 802.11a-AX (6E disables /n and /ac) + abg = 4 # 802.11abg + abgn = 5 # 802.11abgn + abgnAC = 8 # 802.11abgn-AC + abgnAX = 12 # 802.11abgn-AX + an = 10 # 802.11an + anAC = 9 # 802.11an-AC + anAX = 14 # 802.11an-AX + b = 2 # 802.11b + bg = 7 # 802.11bg + bgn = 6 # 802.11bgn + bgnAC = 11 # 802.11bgn-AC + bgnAX = 13 # 802.11bgn-AX + g = 3 # 802.11g + + def post_set_wifi_radio(self, + active_peer_count: str = None, # Number of locally-cached peer objects for this radio. + ampdu_factor: str = None, # ax200/ax210 only, currently. Requires module reload. OS + # Default: 0xFF + antenna: str = None, # Antenna configuration: 0 Diversity/All, 1 Fixed-A (1x1), + # 4 AB (2x2), 7 ABC (3x3), 8 ABCD (4x4), 9 8x8 + channel: str = None, # Channel number for this radio device. Frequency takes + # precedence if both are set to non-default values. + const_tx: str = None, # RF Pattern Generator , encoded as a single 32-bit + # integer. See above. + country: str = None, # Country number for this radio device. + flags: str = None, # Flags for this interface (see above.) + flags_mask: str = None, # If set, only these flags will be considered. + frag_thresh: str = None, # Fragmentation Threshold (256 - 2346, 2346 == disabled). + frequency: str = None, # Frequency for this radio. 0xFFFF, AUTO or + # DEFAULT means ANY. + fwname: str = None, # Firmware name (for example: firmware-5.bin) + fwver: str = None, # Firmware API version (for example, 5 if firmware is based + # on firmware-5.bin + mac: str = None, # Used to identify when name cannot be trusted (2.6.34+ + # kernels). + max_amsdu: str = None, # Maximum number of frames per AMSDU that may be + # transmitted. See above. + mode: str = None, # WiFi mode, see table + peer_count: str = None, # Number of peer objects for this radio. + pref_ap: str = None, # Preferred AP BSSID for all station vdevs on this radio. + pulse2_interval_us: str = None, # Pause between pattern burst for RF noise generator. + pulse_interval: str = None, # RF Pattern generator: interval between pulses in usecs. + pulse_width: str = None, # RF Pattern generator: pulse width in usecs. + radio: str = None, # Name of the physical radio interface, for example: wiphy0 + # [W] + rate: str = None, # No longer used, specify the rate on the virtual + # station(s) instead. + rate_ctrl_count: str = None, # Number of rate-ctrl objects for this radio. + resource: str = None, # Resource number. [W] + rts: str = None, # The RTS Threshold for this radio (off, or 1-2347). + shelf: str = None, # Shelf number. [R][D:1] + skid_limit: str = None, # Firmware hash-table Skid Limit for this radio. + stations_count: str = None, # Number of stations supported by this radio. + tids_count: str = None, # TIDs count for this radio. + tx_pulses: str = None, # Number of pattern pulses per burst for RF noise + # generator. + txdesc_count: str = None, # Transmit descriptor count for this radio. + txpower: str = None, # The transmit power setting for this radio. (AUTO for + # system defaults) + vdev_count: str = None, # Configure radio vdev count. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_radio(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if active_peer_count is not None: + data["active_peer_count"] = active_peer_count + if ampdu_factor is not None: + data["ampdu_factor"] = ampdu_factor + if antenna is not None: + data["antenna"] = antenna + if channel is not None: + data["channel"] = channel + if const_tx is not None: + data["const_tx"] = const_tx + if country is not None: + data["country"] = country + if flags is not None: + data["flags"] = flags + if flags_mask is not None: + data["flags_mask"] = flags_mask + if frag_thresh is not None: + data["frag_thresh"] = frag_thresh + if frequency is not None: + data["frequency"] = frequency + if fwname is not None: + data["fwname"] = fwname + if fwver is not None: + data["fwver"] = fwver + if mac is not None: + data["mac"] = mac + if max_amsdu is not None: + data["max_amsdu"] = max_amsdu + if mode is not None: + data["mode"] = mode + if peer_count is not None: + data["peer_count"] = peer_count + if pref_ap is not None: + data["pref_ap"] = pref_ap + if pulse2_interval_us is not None: + data["pulse2_interval_us"] = pulse2_interval_us + if pulse_interval is not None: + data["pulse_interval"] = pulse_interval + if pulse_width is not None: + data["pulse_width"] = pulse_width + if radio is not None: + data["radio"] = radio + if rate is not None: + data["rate"] = rate + if rate_ctrl_count is not None: + data["rate_ctrl_count"] = rate_ctrl_count + if resource is not None: + data["resource"] = resource + if rts is not None: + data["rts"] = rts + if shelf is not None: + data["shelf"] = shelf + if skid_limit is not None: + data["skid_limit"] = skid_limit + if stations_count is not None: + data["stations_count"] = stations_count + if tids_count is not None: + data["tids_count"] = tids_count + if tx_pulses is not None: + data["tx_pulses"] = tx_pulses + if txdesc_count is not None: + data["txdesc_count"] = txdesc_count + if txpower is not None: + data["txpower"] = txpower + if vdev_count is not None: + data["vdev_count"] = vdev_count + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wifi_radio", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wifi_txo + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_set_wifi_txo(self, + port: str = None, # WiFi interface name or number. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + txo_bw: str = None, # Configure bandwidth: 0 == 20, 1 == 40, 2 == 80, 3 == 160, 4 == + # 80+80. + txo_enable: str = None, # Set to 1 if you wish to enable transmit override, 0 to + # disable. + txo_mcs: str = None, # Configure the MCS (0-3 for CCK, 0-7 for OFDM, 0-7 for HT, 0-9 + # for VHT, 0-11 for HE + txo_nss: str = None, # Configure number of spatial streams (0 == nss1, 1 == nss2, + # ...). + txo_pream: str = None, # Select rate preamble: 0 == OFDM, 1 == CCK, 2 == HT, 3 == VHT, + # 4 == HE_SU. + txo_retries: str = None, # Configure number of retries. 0 or 1 means no retries). + txo_sgi: str = None, # Should rates be sent with short-guard-interval or not? + txo_txpower: str = None, # Configure TX power in db. Use 255 for system defaults. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_txo(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if txo_bw is not None: + data["txo_bw"] = txo_bw + if txo_enable is not None: + data["txo_enable"] = txo_enable + if txo_mcs is not None: + data["txo_mcs"] = txo_mcs + if txo_nss is not None: + data["txo_nss"] = txo_nss + if txo_pream is not None: + data["txo_pream"] = txo_pream + if txo_retries is not None: + data["txo_retries"] = txo_retries + if txo_sgi is not None: + data["txo_sgi"] = txo_sgi + if txo_txpower is not None: + data["txo_txpower"] = txo_txpower + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wifi_txo", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wl_corruption + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetWlCorruptionFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SetWlCorruptionFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + BIT_FLIP = 0x4 # Flip a random bit in a byte. + BIT_TRANSPOSE = 0x8 # Transpose two side-by-side bits in a byte. + DO_CHAIN_ON_HIT = 0x10 # Do next corruption if this corruption is applied. + OVERWRITE_FIXED = 0x2 # Write a fixed value to a byte. + OVERWRITE_RANDOM = 0x1 # Write a random value to a byte. + RECALC_CSUMS = 0x20 # Attempt to re-calculate UDP and TCP checksums. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SetWlCorruptionFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_set_wl_corruption(self, + byte: str = None, # The byte to use for OVERWRITE_FIXED (or NA). + flags: str = None, # The flags for this corruption. + index: str = None, # The corruption to modify (0-5). [R,0-5] + max_offset: str = None, # The maximum offset from start of Ethernet packet for the + # byte to be modified. + min_offset: str = None, # The minimum offset from start of Ethernet packet for the + # byte to be modified. + name: str = None, # WanLink name [R] + rate: str = None, # Specifies how often, per million, this corruption should + # be applied. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wl_corruption(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if byte is not None: + data["byte"] = byte + if flags is not None: + data["flags"] = flags + if index is not None: + data["index"] = index + if max_offset is not None: + data["max_offset"] = max_offset + if min_offset is not None: + data["min_offset"] = min_offset + if name is not None: + data["name"] = name + if rate is not None: + data["rate"] = rate + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wl_corruption", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#set_wl_qdisc + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetWlQdiscQdisc(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + FIFO = "FIFO" # is the default queuing discipline, no arguments + WRR__queue_queue_____ = "WRR,[queue,queue,...]" # Weighted Round Robbin is also available + + def post_set_wl_qdisc(self, + name: str = None, # WanLink name [R] + qdisc: str = None, # FIFO, WRR,a,b,c,d,e,f,g etc [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wl_qdisc(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if qdisc is not None: + data["qdisc"] = qdisc + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/set_wl_qdisc", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_alerts + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class ShowAlertsType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + All = "All" # + CX = "CX" # + Card = "Card" # + Channel_Group = "Channel_Group" # + CollisionDomain = "CollisionDomain" # + Endp = "Endp" # + PESQ = "PESQ" # + PPP_Link = "PPP_Link" # + Port = "Port" # + Shelf = "Shelf" # + Span = "Span" # + Test_Mgr = "Test_Mgr" # + + def post_show_alerts(self, + card: str = None, # Alert resource filter. + endp: str = None, # Alert endpoint filter. + extra: str = None, # Extra filter, currently ignored. + port: str = None, # Alert port filter (can be port name or number). + shelf: str = None, # Alert shelf filter. + p_type: str = None, # Alert type filter. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_alerts(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if card is not None: + data["card"] = card + if endp is not None: + data["endp"] = endp + if extra is not None: + data["extra"] = extra + if port is not None: + data["port"] = port + if shelf is not None: + data["shelf"] = shelf + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_alerts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_attenuators + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_attenuators(self, + resource: str = None, # Resource number, or 'all'. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_attenuators(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if serno is not None: + data["serno"] = serno + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_attenuators", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_cd + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_cd(self, + collision_domain: str = None, # Name of the Collision Domain, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_cd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if collision_domain is not None: + data["collision_domain"] = collision_domain + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_chamber + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_chamber(self, + name: str = None, # Chamber Name or 'ALL'. [W][D:ALL] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_chamber(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_channel_groups + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_channel_groups(self, + channel_name: str = None, # Name of the channel, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_channel_groups(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if channel_name is not None: + data["channel_name"] = channel_name + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_channel_groups", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_clients + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_clients(self, + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_clients(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + response = self.json_post(url="/cli-json/show_clients", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_cx + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_cx(self, + cross_connect: str = None, # Specify cross-connect to act on, or 'all'. [W] + test_mgr: str = None, # Specify test-mgr to act on, or 'all'. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_cx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cross_connect is not None: + data["cross_connect"] = cross_connect + if test_mgr is not None: + data["test_mgr"] = test_mgr + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_cxe + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_cxe(self, + cross_connect: str = None, # Specify cross-connect to show, or 'all'. [W] + test_mgr: str = None, # Specify test-mgr to use, or 'all'. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_cxe(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cross_connect is not None: + data["cross_connect"] = cross_connect + if test_mgr is not None: + data["test_mgr"] = test_mgr + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_cxe", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_dbs + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_dbs(self, + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_dbs(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + response = self.json_post(url="/cli-json/show_dbs", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_dut + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_dut(self, + name: str = None, # DUT Name or 'ALL'. [W][D:ALL] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_dut(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_dut", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_endp_payload + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_endp_payload(self, + max_bytes: str = None, # The max number of payload bytes to print out, default is + # 128. [R][D:128] + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_endp_payload(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if max_bytes is not None: + data["max_bytes"] = max_bytes + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_endp_payload", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_endpoints + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_endpoints(self, + endpoint: str = None, # Name of endpoint, or 'all'. [R] + extra: str = None, # See above. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_endpoints(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endpoint is not None: + data["endpoint"] = endpoint + if extra is not None: + data["extra"] = extra + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_endpoints", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_err + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_err(self, + message: str = None, # Message to show to others currently logged on. Unescaped Value [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_err(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if message is not None: + data["message"] = message + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_err", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_event_interest + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_event_interest(self, + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_event_interest(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + response = self.json_post(url="/cli-json/show_event_interest", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_events + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class ShowEventsType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + All = "All" # + CX = "CX" # + Card = "Card" # + Channel_Group = "Channel_Group" # + CollisionDomain = "CollisionDomain" # + Endp = "Endp" # + PESQ = "PESQ" # + PPP_Link = "PPP_Link" # + Port = "Port" # + Shelf = "Shelf" # + Span = "Span" # + Test_Mgr = "Test_Mgr" # + + def post_show_events(self, + card: str = None, # Event resource filter. + endp: str = None, # Event endpoint filter. + extra: str = None, # Extra filter, currently ignored. + port: str = None, # Event port filter (can be port name or number). + shelf: str = None, # Event shelf filter. + p_type: str = None, # Event type filter. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_events(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if card is not None: + data["card"] = card + if endp is not None: + data["endp"] = endp + if extra is not None: + data["extra"] = extra + if port is not None: + data["port"] = port + if shelf is not None: + data["shelf"] = shelf + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_events", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_files + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_files(self, + dir_flags: str = None, # Determines format of listing, see above. + directory: str = None, # The sub-directory in which to list. + p_filter: str = None, # An optional filter, as used by the 'ls' command. + key: str = None, # A special key, can be used for scripting. + resource: str = None, # The machine to search in. [W] + shelf: str = None, # The virtual shelf to search in. Use 0 for manager machine. + # [R,0-1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_files(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if dir_flags is not None: + data["dir_flags"] = dir_flags + if directory is not None: + data["directory"] = directory + if p_filter is not None: + data["filter"] = p_filter + if key is not None: + data["key"] = key + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_files", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_group + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_group(self, + group: str = None, # Can be name of test group. Use 'all' or leave blank for all groups. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if group is not None: + data["group"] = group + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_pesq + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_pesq(self, + endpoint: str = None, # Name of endpoint, or 'all'. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_pesq(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endpoint is not None: + data["endpoint"] = endpoint + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_pesq", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_ports + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_ports(self, + port: str = None, # Port number, or 'all'. [W] + probe_flags: str = None, # See above, add them together for multiple probings. Leave blank + # if you want stats only. + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_ports(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if port is not None: + data["port"] = port + if probe_flags is not None: + data["probe_flags"] = probe_flags + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_ppp_links + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_ppp_links(self, + link_num: str = None, # Ppp-Link number of the span, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_ppp_links(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if link_num is not None: + data["link_num"] = link_num + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_ppp_links", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_profile + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_profile(self, + name: str = None, # Profile Name or 'ALL'. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_resources + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_resources(self, + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_resources(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_resources", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_rfgen + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_rfgen(self, + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_rfgen(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_rfgen", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_rt + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_rt(self, + key: str = None, # Unique identifier for this request. Usually left blank. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + virtual_router: str = None, # Name of the virtual router. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_rt(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if key is not None: + data["key"] = key + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if virtual_router is not None: + data["virtual_router"] = virtual_router + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_rt", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_script_results + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_script_results(self, + endpoint: str = None, # Name of endpoint, test-group, or 'all'. [R] + key: str = None, # Optional 'key' to be used in keyed-text message result. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_script_results(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endpoint is not None: + data["endpoint"] = endpoint + if key is not None: + data["key"] = key + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_script_results", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_spans + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_spans(self, + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + span_number: str = None, # Span-Number of the span, or 'all'. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_spans(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if span_number is not None: + data["span_number"] = span_number + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_spans", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_text_blob + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_text_blob(self, + brief: str = None, # Set to 'brief' for a brief listing of all text blobs. + name: str = None, # Text Blob Name or 'ALL'. [R] + p_type: str = None, # Text Blob type or 'ALL'. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_text_blob(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if brief is not None: + data["brief"] = brief + if name is not None: + data["name"] = name + if p_type is not None: + data["type"] = p_type + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_text_blob", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_tm + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_tm(self, + test_mgr: str = None, # Can be name of test manager, or 'all'. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_tm(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if test_mgr is not None: + data["test_mgr"] = test_mgr + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_tm", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_traffic_profile + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_traffic_profile(self, + name: str = None, # Profile Name or 'ALL'. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_traffic_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_traffic_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_venue + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_venue(self, + resource: str = None, # Resource number, or 'ALL' [W] + shelf: str = None, # Shelf number. [R][D:1] + venu_id: str = None, # Number to uniquely identify this venue on this resource, or 'ALL' + # [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_venue(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if venu_id is not None: + data["venu_id"] = venu_id + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_venue", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_vr + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_vr(self, + resource: str = None, # Resource number, or 'all'. [W] + router: str = None, # Name of the Virtual Router, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if router is not None: + data["router"] = router + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_vrcx + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_vrcx(self, + cx_name: str = None, # Name of the Virtual Router Connection, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_vrcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cx_name is not None: + data["cx_name"] = cx_name + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#show_wanpaths + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_show_wanpaths(self, + endpoint: str = None, # Name of endpoint, or 'all'. [W] + wanpath: str = None, # Name of wanpath, or 'all'. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_wanpaths(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endpoint is not None: + data["endpoint"] = endpoint + if wanpath is not None: + data["wanpath"] = wanpath + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/show_wanpaths", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#shutdown + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_shutdown(self, + chdir: str = None, # Directory to cd to before dying. Only useful when using gprof to + # debug, or 'NA' to ignore. + really: str = None, # Must be 'YES' for command to really work. + serverctl: str = None, # Enter 'YES' to do a ./serverctl.bash restart to restart all + # LANforge processes. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_shutdown(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if chdir is not None: + data["chdir"] = chdir + if really is not None: + data["really"] = really + if serverctl is not None: + data["serverctl"] = serverctl + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/shutdown", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#shutdown_os + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_shutdown_os(self, + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_shutdown_os(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/shutdown_os", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#shutdown_resource + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_shutdown_resource(self, + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_shutdown_resource(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/shutdown_resource", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#sniff_port + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SniffPortFlags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(SniffPortFlags0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + DUMPCAP = 0x2 # Use command-line dumpcap, more efficient than tshark + MATE_TERMINAL = 0x4 # Launch tshark/dumpcap in mate-terminal + MATE_XTERM = 0x8 # Launch tshark/dumpcap in xterm + TSHARK = 0x1 # Use command-line tshark instead of wireshark + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("SniffPortFlags has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + + def post_sniff_port(self, + display: str = None, # The DISPLAY option, for example: 192.168.1.5:0.0. Will guess if + # left blank. + duration: str = None, # Duration for doing a capture (in seconds). Default is 5 minutes + # for dumpcap/tshark, and forever for wireshark + flags: str = None, # Flags that control how the sniffing is done. + outfile: str = None, # Optional file location for saving a capture. + port: str = None, # The port we are trying to run the packet sniffer on. [R] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_sniff_port(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if display is not None: + data["display"] = display + if duration is not None: + data["duration"] = duration + if flags is not None: + data["flags"] = flags + if outfile is not None: + data["outfile"] = outfile + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/sniff_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#start_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_start_endp(self, + endp_name: str = None, # Name of the cross-connect, or 'all'. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_start_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp_name is not None: + data["endp_name"] = endp_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/start_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#start_group + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_start_group(self, + name: str = None, # The name of the test group. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_start_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/start_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#start_ppp_link + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_start_ppp_link(self, + resource: str = None, # Resource number that holds this PppLink. [W] + shelf: str = None, # Name/id of the shelf. [R][D:1] + unit_num: str = None, # Unit-Number for the PppLink to be started. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_start_ppp_link(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if unit_num is not None: + data["unit_num"] = unit_num + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/start_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#stop_endp + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_stop_endp(self, + endp_name: str = None, # Name of the endpoint, or 'all'. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_stop_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if endp_name is not None: + data["endp_name"] = endp_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/stop_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#stop_group + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_stop_group(self, + name: str = None, # The name of the test group, or 'all' [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_stop_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if name is not None: + data["name"] = name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/stop_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#stop_ppp_link + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_stop_ppp_link(self, + resource: str = None, # Resource number that holds this PppLink. [W] + shelf: str = None, # Name/id of the shelf. [R][D:1] + unit_num: str = None, # Unit-Number for the PppLink to be stopped. [W] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_stop_ppp_link(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if unit_num is not None: + data["unit_num"] = unit_num + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/stop_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#tail + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_tail(self, + cmd: str = None, # Command: start, stop, results + key: str = None, # File-name that we should be tailing. + message: str = None, # The contents to display (for results only) Unescaped Value + resource: str = None, # Resource that holds the file. [W] + shelf: str = None, # Shelf that holds the resource that holds the file. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_tail(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if cmd is not None: + data["cmd"] = cmd + if key is not None: + data["key"] = key + if message is not None: + data["message"] = message + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/tail", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#tm_register + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_tm_register(self, + client_name: str = None, # Name of client to be registered. (dflt is current client) [W] + test_mgr: str = None, # Name of test manager (can be all.) [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_tm_register(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if client_name is not None: + data["client_name"] = client_name + if test_mgr is not None: + data["test_mgr"] = test_mgr + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/tm_register", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#tm_unregister + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_tm_unregister(self, + client_name: str = None, # Name of client to be un-registered. (dflt is current client) + # [W] + test_mgr: str = None, # Name of test manager (can be all.) [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_tm_unregister(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if client_name is not None: + data["client_name"] = client_name + if test_mgr is not None: + data["test_mgr"] = test_mgr + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/tm_unregister", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#version + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_version(self, + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_version(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + response = self.json_post(url="/cli-json/version", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#who + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_who(self, + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_who(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + response = self.json_post(url="/cli-json/who", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#wifi_cli_cmd + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_wifi_cli_cmd(self, + port: str = None, # Name of the WiFi station or AP interface to which this command + # will be directed. [R] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + wpa_cli_cmd: str = None, # Command to pass to wpa_cli or hostap_cli. This must be + # single-quoted. [R] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_wifi_cli_cmd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if port is not None: + data["port"] = port + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if wpa_cli_cmd is not None: + data["wpa_cli_cmd"] = wpa_cli_cmd + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/wifi_cli_cmd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#wifi_event + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_wifi_event(self, + device: str = None, # Interface or PHY in most cases. [R] + event: str = None, # What happened. [R] + msg: str = None, # Entire event in human readable form. + status: str = None, # Status on what happened. + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_wifi_event(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if device is not None: + data["device"] = device + if event is not None: + data["event"] = event + if msg is not None: + data["msg"] = msg + if status is not None: + data["status"] = status + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/wifi_event", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#wiser_reset + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_wiser_reset(self, + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_wiser_reset(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if resource is not None: + data["resource"] = resource + if shelf is not None: + data["shelf"] = shelf + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/wiser_reset", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + https://www.candelatech.com/lfcli_ug.php#write + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def post_write(self, + db_name: str = None, # The name the backup shall be saved as (blank means dflt) + debug=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_write(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + debug |= self.debug_on + data = {} + if db_name is not None: + data["db_name"] = db_name + if len(data) < 1: + raise ValueError(__name__+": no parameters to submit") + response = self.json_post(url="/cli-json/write", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) + return response + # + + + +class LFJsonQuery(JsonQuery): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + LFJsonQuery inherits from JsonQuery. + Queries are used for GET requests. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def __init__(self, + session_obj: object = None, + debug: bool = False, + exit_on_error: bool = False): + super().__init__(session_obj=session_obj, + debug=debug, + exit_on_error=exit_on_error) + + # Auto generated methods follow: + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /attenuator/ + /attenuator/$shelf_id + /attenuator/$shelf_id/$resource_id + /attenuator/$shelf_id/$resource_id/$port_id + /attenuators/ + /attenuators/$shelf_id + /attenuators/$shelf_id/$resource_id + /attenuators/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + entity+id, module+1, module+2, module+3, module+4, module+5, module+6, module+7, + module+8, name, script, state, temperature + Example URL: /attenuator?fields=entity+id,module+1 + + Example py-json call (it knows the URL): + record = LFJsonGet.get_attenuator(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'entity id': # Entity ID + 'module 1': # Reported attenuator dB settings. + 'module 2': # Reported attenuator dB settings. + 'module 3': # Reported attenuator dB settings. + 'module 4': # Reported attenuator dB settings. + 'module 5': # Reported attenuator dB settings. + 'module 6': # Reported attenuator dB settings. + 'module 7': # Reported attenuator dB settings. + 'module 8': # Reported attenuator dB settings. + 'name': # Attenuator module identifier (shelf . resource . serial-num). + 'script': # Attenuator script state. + 'state': # Attenuator state. + 'temperature': # Temperature in degres Farenheight reported in Attenuator unit. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_attenuator(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/attenuator" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="attenuator", + plural_key="attenuators") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /chamber/ + /chamber/$chamber_name + + When requesting specific column names, they need to be URL encoded: + chamber, chamber+connections, chamber+resources, chamber+type, duts, entity+id, + flags, hide, isolation, marked, open, reported+rotation+%28deg%29, reported+rpm, + reported+tilt+%28deg%29, resource, rotation+%28deg%29, rpm, smas, tilt+%28deg%29, turntable, + turntable+type, virtual + Example URL: /chamber?fields=chamber,chamber+connections + + Example py-json call (it knows the URL): + record = LFJsonGet.get_chamber(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'chamber': # - + 'chamber connections': # - + 'chamber resources': # - + 'chamber type': # - + 'duts': # - + 'entity id': # - + 'flags': # - + 'hide': # - + 'isolation': # - + 'marked': # - + 'open': # - + 'reported rotation (deg)': # - + 'reported rpm ': # - + 'reported tilt (deg)': # - + 'resource': # - + 'rotation (deg)': # - + 'rpm': # - + 'smas': # - + 'tilt (deg)': # - + 'turntable': # - + 'turntable type': # - + 'virtual': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_chamber(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/chamber" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="chamber", + plural_key="chambers") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /control/$command + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_control(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_control(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/control" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /cx/ + /cx/$cx_id + + When requesting specific column names, they need to be URL encoded: + avg+rtt, bps+rx+a, bps+rx+b, drop+pkts+a, drop+pkts+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, + entity+id, name, pkt+rx+a, pkt+rx+b, rpt+timer, rx+drop+%25+a, rx+drop+%25+b, + state, type + Example URL: /cx?fields=avg+rtt,bps+rx+a + + Example py-json call (it knows the URL): + record = LFJsonGet.get_cx(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'avg rtt': # Average Round-Trip-Time (latency) for this connection (ms). + 'bps rx a': # Endpoint A's real receive rate (bps). + 'bps rx b': # Endpoint B's real receive rate (bps). + 'drop pkts a': # The number of packets Endpoint B sent minus the number Endpoint A + # received.This number is not 100% correct as long as packets are in + # flight.After a Quiesce of the test, the number should be perfectly + # accurate. + 'drop pkts b': # The number of packets Endpoint A sent minus the number Endpoint B + # received.This number is not 100% correct as long as packets are in + # flight.After a Quiesce of the test, the number should be perfectly + # accurate. + 'eid': # Cross Connect's Name. + 'endpoints (a ↔ b)': # Endpoints that make up this Cross Connect. + 'entity id': # Cross Connect's Name. + 'name': # Cross Connect's Name. + 'pkt rx a': # Endpoint A's Packets Recieved. + 'pkt rx b': # Endpoint B's Packets Recieved. + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'rx drop % a': # Endpoint A percentage packet loss.Calculated using the number of PDUs + # Endpoint B sent minus the number Endpoint A received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'rx drop % b': # Endpoint B percentage packet loss.Calculated using the number of PDUs + # Endpoint A sent minus the number Endpoint B received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'state': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'type': # Cross-Connect type. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_cx(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/cx" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /dut/ + /dut/$name + + When requesting specific column names, they need to be URL encoded: + api+version, bssid-1, bssid-2, bssid-3, bssid-4, bssid-5, bssid-6, bssid-7, + bssid-8, dut, eap-id, entity+id, hw+info, image+file, lan, mgt+ip, model+number, + notes, num+ant+radio+1, num+ant+radio+2, num+ant+radio+3, password-1, password-2, + password-3, password-4, password-5, password-6, password-7, password-8, serial+number, + serial+port, ssid-1, ssid-2, ssid-3, ssid-4, ssid-5, ssid-6, ssid-7, ssid-8, + sw+info, wan + Example URL: /dut?fields=api+version,bssid-1 + + Example py-json call (it knows the URL): + record = LFJsonGet.get_dut(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'api version': # API Version + 'bssid-1': # WiFi BSSID for DUT. + 'bssid-2': # WiFi BSSID for DUT. + 'bssid-3': # WiFi BSSID for DUT. + 'bssid-4': # WiFi BSSID for DUT. + 'bssid-5': # WiFi BSSID for DUT. + 'bssid-6': # WiFi BSSID for DUT. + 'bssid-7': # WiFi BSSID for DUT. + 'bssid-8': # WiFi BSSID for DUT. + 'dut': # Devices Under Test + 'eap-id': # EAP Identifier, only used when one of the EAP options are selected. + 'entity id': # Entity ID + 'hw info': # DUT Hardware Info + 'image file': # Image file name. Relative paths assume directory /home/lanforge. Fully + # qualified pathnames begin with a slash (eg + # /usr/lib/share/icons/icon.png).File format should be PNG, JPG or BMP. + 'lan': # IP/Mask for LAN port (192.168.2.1/24). + 'mgt ip': # DUT Management IP address. + 'model number': # DUT model number or product name + 'notes': # Notes + 'num ant radio 1': # Antenna count for DUT radio(s). + 'num ant radio 2': # Antenna count for DUT radio(s). + 'num ant radio 3': # Antenna count for DUT radio(s). + 'password-1': # WiFi Password needed to connect to DUT. + 'password-2': # WiFi Password needed to connect to DUT. + 'password-3': # WiFi Password needed to connect to DUT. + 'password-4': # WiFi Password needed to connect to DUT. + 'password-5': # WiFi Password needed to connect to DUT. + 'password-6': # WiFi Password needed to connect to DUT. + 'password-7': # WiFi Password needed to connect to DUT. + 'password-8': # WiFi Password needed to connect to DUT. + 'serial number': # DUT Identifier (serial-number, or similar) + 'serial port': # Resource and name of LANforge serial port that connects to this DUT. + # (1.1.ttyS0). Does not need to belong to lan_port or wan_port resource. + 'ssid-1': # WiFi SSID advertised by DUT. + 'ssid-2': # WiFi SSID advertised by DUT. + 'ssid-3': # WiFi SSID advertised by DUT. + 'ssid-4': # WiFi SSID advertised by DUT. + 'ssid-5': # WiFi SSID advertised by DUT. + 'ssid-6': # WiFi SSID advertised by DUT. + 'ssid-7': # WiFi SSID advertised by DUT. + 'ssid-8': # WiFi SSID advertised by DUT. + 'sw info': # DUT Software Info + 'wan': # IP/Mask for WAN port (192.168.3.2/24). + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_dut(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/dut" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="dut", + plural_key="duts") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /endp/ + /endp/$endp_id + + When requesting specific column names, they need to be URL encoded: + 1st+rx, a%2Fb, bursty, crc+fail, cwnd, cx+active, cx+estab, cx+estab%2Fs, cx+to, + delay, destination+addr, dropped, dup+pkts, eid, elapsed, entity+id, jitter, + max+pdu, max+rate, min+pdu, min+rate, mng, name, ooo+pkts, pattern, pdu%2Fs+rx, + pdu%2Fs+tx, pps+rx+ll, pps+tx+ll, rcv+buf, replays, run, rx+ber, rx+bytes, + rx+drop+%25, rx+dup+%25, rx+ooo+%25, rx+pdus, rx+pkts+ll, rx+rate, rx+rate+%281%C2%A0min%29, + rx+rate+%28last%29, rx+rate+ll, rx+wrong+dev, script, send+buf, source+addr, + tcp+mss, tcp+rtx, tx+bytes, tx+pdus, tx+pkts+ll, tx+rate, tx+rate+%281%C2%A0min%29, + tx+rate+%28last%29, tx+rate+ll # hidden columns: + drop-count-5m, latency-5m, rt-latency-5m, rx-silence-5m + Example URL: /endp?fields=1st+rx,a%2Fb + + Example py-json call (it knows the URL): + record = LFJsonGet.get_endp(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + '1st rx': # Miliseconds between starting the endpoint and receiving the first + # packet.Note that LANforge UDP connections (not including multicast) will + # wait 20msbefore sending first frame to make sure receiver has adequate + # time to start. + 'a/b': # Display side (A or B) for the endpoint. + 'bursty': # Is the transmit rate bursty or not? + 'crc fail': # Total packets received with a bad payload CRC. + 'cwnd': # Sender's TCP Current Window Size. In units of Maximum Segment Size. + 'cx active': # Total number of active connections for this endpoint. + 'cx estab': # Total times the connection between the endpoints has been established. + 'cx estab/s': # Connections established per second, averaged over the last 30 seconds. + 'cx to': # Number of TCP connection attemtps timed out by LANforge. + 'delay': # Average latency in milliseconds for packets received by this endpoint. + 'destination addr': # Destination Address (MAC, ip/port, VoIP destination). + 'dropped': # Total dropped packets, as identified by gaps in packet sequence numbers. + 'dup pkts': # Total duplicate packets received. Only an estimate, but never less than + # this value. + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'jitter': # Exponential decaying average jitter calculated per RFC3393(old_jitter * + # 15/16 + new_jitter * 1/16) + 'max pdu': # The maximum write size.For Ethernet protocols, this is the entire + # Ethernet frame. For UDP, it is the UDP payload size, and for TCP, it + # just means the maximum amount of data that is written per socket + # write.In all cases, the packets on the wire will not exceed theport's + # MTU + Ethernet-Header-Size (typically 1514 for Ethernet) + 'max rate': # Maximum desired transmit rate, in bits per second (bps). + 'min pdu': # The minimum write size.For Ethernet protocols, this is the entire + # Ethernet frame. For UDP, it is the UDP payload size, and for TCP, it + # just means the maximum amount of data that is written per socket + # write.In all cases, the packets on the wire will not exceed theport's + # MTU + Ethernet-Header-Size (typically 1514 for Ethernet) + 'min rate': # Minimum desired transmit rate, in bits per second (bps). + 'mng': # Is the Endpoint managed or not? + 'name': # Endpoint's Name. + 'ooo pkts': # Total out of order packets received. Only an estimate, but never less + # than this value. + 'pattern': # Pattern of bytes this endpoint transmits. + 'pdu/s rx': # Received PDU per second.This counts the protocol reads, such as UDP + # PDUs. + 'pdu/s tx': # Transmitted PDU per second.This counts the protocol writes, such as UDP + # PDUs. + 'pps rx ll': # Estimated total received packets per second (on the wire).For TCP, this + # is an estimate.UDP and Ethernet protocols should be quite accurate on + # normal networks. + 'pps tx ll': # Estimated total transmitted packets per second (on the wire).For TCP, + # this is an estimate.UDP and Ethernet protocols should be quite accurate + # on normal networks. + 'rcv buf': # Configured/Actual values for receiving buffer size (bytes). + 'replays': # Total number of files replayed. + 'run': # Is the Endpoint is Running or not. + 'rx ber': # Received bit-errors. These are only calculated in the LANforge payload + # portion starting 28 bytes into the UDP or TCP payload. In addition, the + # bit-errors are only checked when LANforge CRCis enabled and detected to + # be invalid. If the 28-byte header is corrupted, LANforge will not + # detectit, and may also give false positives for other packet errors. + # Bit-Errors are only calculated forcertain payload patterns: Increasing, + # Decreasing, Zeros, Ones, and the PRBS patterns. + 'rx bytes': # Total received bytes count. + 'rx drop %': # Percentage of packets that should have been received by Endpoint, but + # were not, as calculated by the Cross-Connect. + 'rx dup %': # Percentage of duplicate packets, as detected by sequence numbers. + 'rx ooo %': # Percentage of packets received out of order, as detected by sequence + # numbers. + 'rx pdus': # Total received PDU count.This counts the protocol reads, such as UDP + # PDUs (aka goodput). + 'rx pkts ll': # Estimated total received packet count (on the wire).For TCP, this is an + # estimate.UDP and Ethernet protocols should be quite accurate on normal + # networks. + 'rx rate': # Real receive rate (bps) for this run.This includes only the protocol + # payload (goodput). + 'rx rate (1 min)': # Real receive rate (bps) over the last minute.This includes only the + # protocol payload (goodput). + 'rx rate (last)': # Real receive rate (bps) over the last report interval.This includes only + # the protocol payload (goodput). + 'rx rate ll': # Estimated low-level receive rate (bps) over the last minute.This + # includes any Ethernet, IP, TCP, UDP or similar headers. + 'rx wrong dev': # Total packets received on the wrong device (port). + 'script': # Endpoint script state. + 'send buf': # Configured/Actual values for sending buffer size (bytes). + 'source addr': # + 'tcp mss': # Sender's TCP-MSS (max segment size) setting.This cooresponds to the + # TCP_MAXSEGS socket option,and TCP-MSS plus 54 is the maximum packet size + # on the wirefor Ethernet frames.This is a good option to efficiently + # limit TCP packet size. + 'tcp rtx': # Total packets retransmitted by the TCP stack for this connection.These + # were likely dropped or corrupted in transit. + 'tx bytes': # Total transmitted bytes count. + 'tx pdus': # Total transmitted PDU count.This counts the protocol writes, such as UDP + # PDUs (aka goodput). + 'tx pkts ll': # Estimated total transmitted packet count (on the wire).For TCP, this is + # an estimate.UDP and Ethernet protocols should be quite accurate on + # normal networks. + 'tx rate': # Real transmit rate (bps) for this run.This includes only the protocol + # payload (goodput). + 'tx rate (1 min)': # Real transmit rate (bps) over the last minute.This includes only the + # protocol payload (goodput). + 'tx rate (last)': # Real transmit rate (bps) over the last report interval.This includes + # only the protocol payload (goodput). + 'tx rate ll': # Estimated low-level transmit rate (bps) over the last minute.This + # includes any Ethernet, IP, TCP, UDP or similar headers. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_endp(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/endp" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /endsession + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_endsession(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_endsession(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/endsession" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /events/ + /events/$event_id + /events/before/$event_id + /events/between/$start_event_id/$end_event_id + /events/last/$event_count + /events/since/$event_id + + When requesting specific column names, they need to be URL encoded: + eid, entity+id, event, event+description, id, name, priority, time-stamp, + type + Example URL: /events?fields=eid,entity+id + + Example py-json call (it knows the URL): + record = LFJsonGet.get_events(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'eid': # Time at which this event was created.This uses the clock on the source + # machine. + 'entity id': # Entity IdentifierExact format depends on the + # type.(shelf.resource.port.endpoint.extra) + 'event': # Event Type + 'event description': # Text description for this event. + 'id': # Unique ID for this event. + 'name': # Name of the entity associated with this event. + 'priority': # Event priority. + 'time-stamp': # Time at which this event was created.This uses the clock on the source + # machine. + 'type': # Entity type. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_events(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/events" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="alert", + plural_key="alerts") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /fileio/ + /fileio/$endp_id + + When requesting specific column names, they need to be URL encoded: + buf-rd, buf-wr, bytes-rd, bytes-wr, crc+fail, eid, entity+id, files+%23, files-read, + files-wr, io+fail, max-file-sz, max-rd-bps, max-rw-sz, max-wr-bps, min-file-sz, + min-rd-bps, min-rw-sz, min-wr-bps, name, read-bps, rpt+timer, rx-bps-20s, + status, tx-bps-20s, type, write-bps + Example URL: /fileio?fields=buf-rd,buf-wr + + Example py-json call (it knows the URL): + record = LFJsonGet.get_fileio(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'buf-rd': # Buffer reads. When doing CRC, it takes two reads per 'packet', because + # we first read the header, then the payload. Non-CRC reads ignore the + # header. + 'buf-wr': # Buffer writes. + 'bytes-rd': # Bytes read. + 'bytes-wr': # Bytes written. + 'crc fail': # 32-bit CRC Errors detected upon READ. + 'eid': # Entity ID + 'entity id': # Entity ID + 'files #': # Number of files to write. + 'files-read': # Files read. + 'files-wr': # Files written. + 'io fail': # Amount of time in miliseconds this test has been experiencing IO + # failures. + 'max-file-sz': # Maximum configured file size (bytes). + 'max-rd-bps': # Maximum configured read rate (bps). + 'max-rw-sz': # Maximum configured size for each call to read(2) or write(2) (bytes). + 'max-wr-bps': # Maximum configured write rate (bps). + 'min-file-sz': # Minimum configured file size (bytes). + 'min-rd-bps': # Minimum configured read rate (bps). + 'min-rw-sz': # Minimum configured size for each call to read(2) or write(2) (bytes). + 'min-wr-bps': # Minimum configured write rate (bps). + 'name': # File Endpoint's Name. + 'read-bps': # File read rate for this endpoint over the duration of the test. + 'rpt timer': # Report Timer (milliseconds).This is how often the GUI will ask for + # updates from the LANforge processes.If the GUI is sluggish, increasing + # the report timers may help. + 'rx-bps-20s': # File read rate for this endpoint over the last 20 seconds. + 'status': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'tx-bps-20s': # File write rate for this endpoint over the last 20 seconds. + 'type': # The specific type of this File Endpoint. + 'write-bps': # File write rate for this endpoint over the duration of the test. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_fileio(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/fileio" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /generic/ + /generic/$endp_id + + When requesting specific column names, they need to be URL encoded: + bps+rx, bps+tx, command, dropped, eid, elapsed, entity+id, last+results, + name, pdu%2Fs+rx, pdu%2Fs+tx, rpt+timer, rpt%23, rx+bytes, rx+pkts, status, tx+bytes, + tx+pkts, type + Example URL: /generic?fields=bps+rx,bps+tx + + Example py-json call (it knows the URL): + record = LFJsonGet.get_generic(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps rx': # Receive rate reported by this endpoint. + 'bps tx': # Transmit rate reported by this endpoint. + 'command': # The command that this endpoint executes. + 'dropped': # Dropped PDUs reported by this endpoint. + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'last results': # Latest output from the Generic Endpoint. + 'name': # Endpoint's Name. + 'pdu/s rx': # Received packets-per-second reported by this endpoint. + 'pdu/s tx': # Transmitted packets-per-second reported by this endpoint. + 'rpt timer': # Report Timer (milliseconds).This is how often the GUI will ask for + # updates from the LANforge processes.If the GUI is sluggish, increasing + # the report timers may help. + 'rpt#': # The N_th report that we have received. (Some cmds will produce only one + # report, others will produce continuous reports.) + 'rx bytes': # Received bytes reported by this endpoint. + 'rx pkts': # Received PDUs reported by this endpoint. + 'status': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'tx bytes': # Transmitted bytes reported by this endpoint. + 'tx pkts': # Transmitted PDUs reported by this endpoint. + 'type': # The specific type of this Generic Endpoint. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_generic(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/generic" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoints") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /gui-cli/ + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_gui_cli(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_gui_cli(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/gui-cli" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /layer4/ + /layer4/$endp_id + + When requesting specific column names, they need to be URL encoded: + %21conn, acc.+denied, bad-proto, bad-url, bytes-rd, bytes-wr, dns-avg, dns-max, + dns-min, eid, elapsed, entity+id, fb-avg, fb-max, fb-min, ftp-host, ftp-port, + ftp-stor, http-p, http-r, http-t, login-denied, name, nf+%284xx%29, other-err, + read, redir, rpt+timer, rslv-h, rslv-p, rx+rate, rx+rate+%281%C2%A0min%29, status, + timeout, total-err, total-urls, tx+rate, tx+rate+%281%C2%A0min%29, type, uc-avg, + uc-max, uc-min, urls%2Fs, write # hidden columns: + rpt-time + Example URL: /layer4?fields=%21conn,acc.+denied + + Example py-json call (it knows the URL): + record = LFJsonGet.get_layer4(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + '!conn': # Could not establish connection. + 'acc. denied': # Access Access Denied Error.This could be password, user-name, + # file-permissions or other error. + 'bad-proto': # Bad protocol. + 'bad-url': # Bad URL format. + 'bytes-rd': # Bytes read. + 'bytes-wr': # Bytes written. + 'dns-avg': # Average time in milliseconds to complete resolving the DNS lookupfor the + # last 100 requests. + 'dns-max': # Maximum time in milliseconds to complete resolving the DNS lookupfor + # requests made in the last 30 seconds. + 'dns-min': # Minimum time in milliseconds to complete resolving the DNS lookupfor + # requests made in the last 30 seconds. + 'eid': # EID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'fb-avg': # Average time in milliseconds for receiving the first byte of the URLfor + # the last 100 requests. + 'fb-max': # Maximum time in milliseconds for receiving the first byte of the URLfor + # requests made in the last 30 seconds. + 'fb-min': # Minimum time in milliseconds for receiving the first byte of the URLfor + # requests made in the last 30 seconds. + 'ftp-host': # FTP HOST Error + 'ftp-port': # FTP PORT Error. + 'ftp-stor': # FTP STOR Error. + 'http-p': # HTTP Post error. + 'http-r': # HTTP RANGE error. + 'http-t': # HTTP PORT Error. + 'login-denied': # Login attempt was denied.Probable cause is user-name or password errors. + 'name': # Endpoint's Name. + 'nf (4xx)': # File not found.For HTTP, an HTTP 4XX error was returned. This is only + # counted when the endpoint has 'Enable 4XX' selected.Includes 403 + # permission denied and 404 not found errors.For other protocols, it + # should be returned any time a file is not found. + 'other-err': # Error not otherwise specified. The actual error code may be found + # inl4helper logs. Contact support if you see these errors:we would like + # to account for all possible errors. + 'read': # Error attempting to read file or URL. + 'redir': # Noticed redirect loop! + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'rslv-h': # Couldn't resolve host. + 'rslv-p': # Couldn't resolve Proxy. + 'rx rate': # Payload receive rate (bps). + 'rx rate (1 min)': # Payload receive rate over the last minute (bps). + 'status': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'timeout': # Operation timed out. + 'total-err': # Total Errors. + 'total-urls': # URLs processed. + 'tx rate': # Payload transmit rate (bps). + 'tx rate (1 min)': # Payload transmit rate over the last minute (bps). + 'type': # The specific type of this Layer 4-7 Endpoint. + 'uc-avg': # Average time in milliseconds to complete processing of the URLfor the + # last 100 requests. + 'uc-max': # Maximum time in milliseconds to complete processing of the URLfor + # requests made in the last 30 seconds. + 'uc-min': # Minimum time in milliseconds to complete processing of the URLfor + # requests made in the last 30 seconds. + 'urls/s': # URLs processed per second over the last minute. + 'write': # Error attempting to write file or URL. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_layer4(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/layer4" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /newsession + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_newsession(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_newsession(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/newsession" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /port/ + /port/$shelf_id + /port/$shelf_id/$resource_id + /port/$shelf_id/$resource_id/$port_id + /portprobe/ + /portprobe/$shelf_id/$resource_id/$port_id + /ports/ + /ports/$shelf_id + /ports/$shelf_id/$resource_id + /ports/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + 4way+time+%28us%29, activity, alias, anqp+time+%28us%29, ap, beacon, bps+rx, bps+rx+ll, + bps+tx, bps+tx+ll, bytes+rx+ll, bytes+tx+ll, channel, collisions, connections, + crypt, cx+ago, cx+time+%28us%29, device, dhcp+%28ms%29, down, entity+id, gateway+ip, + ip, ipv6+address, ipv6+gateway, key%2Fphrase, login-fail, login-ok, logout-fail, + logout-ok, mac, mask, misc, mode, mtu, no+cx+%28us%29, noise, parent+dev, phantom, + port, port+type, pps+rx, pps+tx, qlen, reset, retry+failed, rx+bytes, rx+crc, + rx+drop, rx+errors, rx+fifo, rx+frame, rx+length, rx+miss, rx+over, rx+pkts, + rx-rate, sec, signal, ssid, status, time-stamp, tx+abort, tx+bytes, tx+crr, + tx+errors, tx+fifo, tx+hb, tx+pkts, tx+wind, tx-failed+%25, tx-rate, wifi+retries, + # hidden columns: + beacon_rx_signal, port_cur_flags_h, port_cur_flags_l, port_supported_flags_h, + port_supported_flags_l, resource, rx_multicast, tx_dropped + Example URL: /port?fields=4way+time+%28us%29,activity + + Example py-json call (it knows the URL): + record = LFJsonGet.get_port(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + '4way time (us)': # TIme (in micro-seconds) it took to complete the last WiFi 4-way + # authentication. + 'activity': # Percent of the channel that is utilized over the last minute.This + # includes locally generated traffic as well as anyother systems active on + # this channel.This is a per-radio value. + 'alias': # User-specified alias for this Port. + 'anqp time (us)': # Time (in micro-seconds) it took to complete the last WiFi ANQP + # request/response session. + 'ap': # BSSID of AP for connected stations. + 'beacon': # Number of Wireless beacons from Cell or AP that have been missed. + 'bps rx': # Average bits per second received for the last 30 seconds. + 'bps rx ll': # Bits per second received, including low-level framing (Ethernet Only). + 'bps tx': # Average bits per second transmitted for the last 30 seconds. + 'bps tx ll': # Bits per second transmitted, including low-level framing (Ethernet + # Only). + 'bytes rx ll': # Bytes received, including low-level framing (Ethernet Only). + 'bytes tx ll': # Bytes transmitted, including low-level framing (Ethernet Only). + 'channel': # Channel at the device is currently on, if known. + 'collisions': # Total number of collisions reported by this Interface.For WiFi devices, + # this is number of re-transmit attempts. + 'connections': # Number of wireless connections completed. + 'crypt': # Number of Wireless packets dropped due to inability to decrypt. + 'cx ago': # How long ago was the last WiFi connection attempt started?This relates + # only to the network interface, not any higher level protocol traffic + # upon it. + 'cx time (us)': # Time (in micro-seconds) it took to complete the last WiFi connection to + # the AP. + 'device': # Ethernet device name, as seen by the kernel. + 'dhcp (ms)': # Time (in miliseconds) it took to acquire DHCP lease,or to time out while + # trying to acquire lease. + 'down': # The interface is configured DOWN. It must be configured UP to be in + # active use. + 'entity id': # Entity ID + 'gateway ip': # Default Router/Gateway IP for the Interface. + 'ip': # IP Address of the Interface. + 'ipv6 address': # IPv6 Address for this interface. If global-scope address exists, it + # will be displayed,otherwise link-local will be displayed. + 'ipv6 gateway': # IPv6 default gateway. + 'key/phrase': # WEP Key or WPA Phrase (if enabled). + 'login-fail': # The 'ifup-post' script reported failure. This is usually used for WiFi + # portallogins, but may be customized by the user for other needs. + 'login-ok': # The 'ifup-post' script reported OK. This is usually used for WiFi + # portallogins, but may be customized by the user for other needs. + 'logout-fail': # The 'ifup-post --logout' script reported failure. This is usually used + # for WiFi portallogouts, but may be customized by the user for other + # needs. + 'logout-ok': # The 'ifup-post --logout' script reported OK. This is usually used for + # WiFi portallogouts, but may be customized by the user for other needs. + 'mac': # Ethernet MAC address of the Interface. + 'mask': # IP Mask of the Interface. + 'misc': # Number of Wireless packets dropped on receive due to unspecified + # reasons. + 'mode': # Wireless radio mode (802.11a/b/g). + 'mtu': # MTU (Maximum Transmit Unit) size, in bytes. + 'no cx (us)': # How long was the WiFi disconnect duration for the last disconnection? + 'noise': # Wireless noise level. + 'parent dev': # Parent device or port of this port. Blank if this device is not a child + # of another device or port. + 'phantom': # Is the port PHANTOM (no hardware found) or not. + 'port': # Entity ID + 'port type': # Ports can be Ethernet, Radio, vAP, vSTA, Redirect, or Bridges + 'pps rx': # Average packets per second received for the last 30 seconds. + 'pps tx': # Average packets per second transmitted for the last 30 seconds. + 'qlen': # "Transmit Queue Length for this Interface. + 'reset': # Current Reset-State. + 'retry failed': # Number of Wireless packets that the interface failed to send due to + # excessive retries. + 'rx bytes': # Total number of bytes received by this Interface. + 'rx crc': # Total number of packets dropped because of a bad CRC/FCS. + 'rx drop': # Total number of dropped packets on recieve. Usually means driver/kernel + # is being over-worked. + 'rx errors': # Total number of all types of Receive Errors. + 'rx fifo': # Total number of packets dropped because driver/kernel queues are full. + 'rx frame': # Total number of packets dropped because of framing errors at the + # physical layer. + 'rx length': # Total number of packets dropped because their length was invalid. + 'rx miss': # Total number of packets dropped because of a missed interrupt. + 'rx over': # Total number of packets dropped because of framing errors at the + # physical layer. + 'rx pkts': # Total number of packets received by this Interface. + 'rx-rate': # Reported network device RX link speed. + 'sec': # Number of secondary IP addresses configured or detected. + 'signal': # Wireless signal strength (RSSI). + 'ssid': # WiFi SSID identifier.Use [BLANK] for empty SSID, which means use any + # available SSID when associating. + 'status': # Wireless link status. + 'time-stamp': # Time-Stamp + 'tx abort': # Total packets dropped on transmit because of driver abort. + 'tx bytes': # Total number of bytes sent by this Interface. + 'tx crr': # Total packets dropped on transmit because of carrier error. + 'tx errors': # Total number of all types of Transmit Errors. + 'tx fifo': # Total packets dropped on transmit because outgoing queue was full. + 'tx hb': # Total packets dropped on transmit because of transceiver heartbeat + # errors. + 'tx pkts': # Total number of packets sent by this Interface. + 'tx wind': # Total number dropped on transmit because of Out-of-Window collision. + 'tx-failed %': # Percentage of transmitted Wireless packets that were not ACKed.They + # might have succeeded on retry. + 'tx-rate': # Reported network device TX link speed. + 'wifi retries': # Number of Wireless packets that the wifi radio retried.One packet may be + # tried multiple times and each try would be counted in this stat.Not all + # radios can properly report this statistic. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_port(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/port" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="interface", + plural_key="interfaces") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /probe/ + /probe/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + entity+id, probe+results + Example URL: /probe?fields=entity+id,probe+results + + Example py-json call (it knows the URL): + record = LFJsonGet.get_probe(eid_list=['1.234', '1.344'], + requested_col_names=['probe results'], + debug=True) + + The record returned will have these members: + { + 'entity id': # Entity ID + 'probe results': # Probe the low level information about the port. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_probe(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/probe" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="probe-results", + plural_key="probe-results") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /quit + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_quit(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_quit(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/quit" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /radiostatus/ + /radiostatus/$eid + /radiostatus/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + _links, antenna, ap, capabilities, channel, country, driver, entity+id, firmware+version, + frag, frequency, max_sta, max_vap, max_vifs, monitors_down, monitors_up, + phantom, port, resource, rts, stations_down, stations_up, tx-power, vaps_down, + vaps_up, verbose+debug + Example URL: /radiostatus?fields=_links,antenna + + Example py-json call (it knows the URL): + record = LFJsonGet.get_radiostatus(eid_list=['1.234', '1.344'], + requested_col_names=['firmware version'], + debug=True) + + The record returned will have these members: + { + '_links': # - + 'antenna': # - + 'ap': # - + 'capabilities': # - + 'channel': # - + 'country': # - + 'driver': # - + 'entity id': # - + 'firmware version': # - + 'frag': # - + 'frequency': # - + 'max_sta': # - + 'max_vap': # - + 'max_vifs': # - + 'monitors_down': # - + 'monitors_up': # - + 'phantom': # - + 'port': # - + 'resource': # - + 'rts': # - + 'stations_down': # - + 'stations_up': # - + 'tx-power': # - + 'vaps_down': # - + 'vaps_up': # - + 'verbose debug': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_radiostatus(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/radiostatus" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="radio", + plural_key="radios") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /resource/ + /resource/$shelf_id + /resource/$shelf_id/$resource_id + + When requesting specific column names, they need to be URL encoded: + bps-rx-3s, bps-tx-3s, cli-port, cpu, ctrl-ip, ctrl-port, eid, entity+id, + free+mem, free+swap, gps, hostname, hw+version, load, max+if-up, max+staged, + mem, phantom, ports, rx+bytes, shelf, sta+up, sw+version, swap, tx+bytes, + # hidden columns: + timestamp + Example URL: /resource?fields=bps-rx-3s,bps-tx-3s + + Example py-json call (it knows the URL): + record = LFJsonGet.get_resource(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps-rx-3s': # Rate in bits-per-second that the manager issending management data to + # the resource, averaged over the last 3 seconds.This is TCP payload data, + # and does not count the IP and Ethernet overhead. + 'bps-tx-3s': # Rate in bits-per-second that the manager isreceiving management data + # from the resource, averaged over the last 3 seconds.This is TCP payload + # data, and does not count the IP and Ethernet overhead. + 'cli-port': # Text (telnet) interface IP Port. + 'cpu': # CPU information for the machine. + 'ctrl-ip': # IP Address of the Control Interface. + 'ctrl-port': # Binary interface IP Port. + 'eid': # Resource EID (Shelf.Resource). + 'entity id': # Entity ID + 'free mem': # Free Memory (Kbytes) in the machine. If this is too low, performance + # will be degraded. + 'free swap': # Free Swap (Kbytes) in the machine. If this is too low, performance will + # be degraded. + 'gps': # GPS Info for this machine, if GPS is attached. + 'hostname': # The name for this resource, as reported by the resource. + 'hw version': # Hardware version on the machine. + 'load': # Unix process load.. + 'max if-up': # Max number of interface-config scripts try to run at once. + 'max staged': # Max number of interfaces the system will try to bringup at once. + 'mem': # Total memory (Kbytes) on the machine. + 'phantom': # Is the resource PHANTOM (undiscovered) or not. + 'ports': # All real and phantom ports on this machine. + 'rx bytes': # Total management TCP payload bytes received from the manager process by + # this resource. + 'shelf': # Number of shelf that this resource belongs to. + 'sta up': # Max number of stations to bring up per radio per 0.25s tick. + 'sw version': # LANforge Software version running on the machine. + 'swap': # Total swap space (Kbytes) on the machine. + 'tx bytes': # Total management TCP payload bytes sent from this resource to the + # manager process. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_resource(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/resource" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="resource", + plural_key="resources") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /scan-results/ + /scan-results/$shelf_id/$resource_id/$port_id + /scan-results/$shelf_id/$resource_id/$port_id/$bssid + /scan/ + /scan/$shelf_id/$resource_id/$port_id + /scan/$shelf_id/$resource_id/$port_id/$bssid + /scanresults/ + /scanresults/$shelf_id/$resource_id/$port_id + /scanresults/$shelf_id/$resource_id/$port_id/$bssid + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_scan(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_scan(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/scan" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="scan-results", + plural_key="scan-results") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /stations/ + /stations/$mac + + When requesting specific column names, they need to be URL encoded: + ap, auth-for, capabilities, entity+id, idle, roam-duration, rx+bytes, rx+pkts, + rx+rate, signal, station+bssid, tx+bytes, tx+pkts, tx+rate, tx+retries, tx-failed, + + Example URL: /stations?fields=ap,auth-for + + Example py-json call (it knows the URL): + record = LFJsonGet.get_stations(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'ap': # The Port that owns this station. + 'auth-for': # Duration in seconds this station has been authenticated. + 'capabilities': # Station's negotiated capabilities. + 'entity id': # Entity ID + 'idle': # Miliseconds since this station last received a frame from the peer. + 'roam-duration': # The difference between the authenticate-time on the new APand the last + # frame received on old AP, in milliseconds.It is not always possible to + # compute this accurately,especially if traffic is not flowing during the + # roam. + 'rx bytes': # RX Byte counter for this station. + 'rx pkts': # RX Packets counter for this station. + 'rx rate': # Station last received encoding rate. + 'signal': # Station signal quality. + 'station bssid': # Station's MAC address (BSSID). + 'tx bytes': # TX Byte counter for this station. + 'tx pkts': # TX Packets counter for this station. + 'tx rate': # Station transmit encoding rate. + 'tx retries': # TX Retries counter for this station.This counts retries at the driver + # level.Retries made by the WiFi hardware and/or firmware is not counted. + 'tx-failed': # TX Failed counter for this station.This counts TX failures at the driver + # level.The hardware and/or firmware may have made several failed attempts + # that are not included in this counter. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_stations(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/stations" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="station", + plural_key="stations") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /status-msg/ + /status-msg/$session + /status-msg/$session/$id + /status-msg/$session/$id/ws-msg,... + /status-msg/$session/all + /status-msg/$session/this + /status-msg/sessions + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_status_msg(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_status_msg(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/status-msg" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="sessions/messages", + plural_key="sessions/messages") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /test-group/ + /test-group/$id + /test-groups/ + /test-groups/$id + + When requesting specific column names, they need to be URL encoded: + cross+connects, entity+id, name, run, script + Example URL: /test-group?fields=cross+connects,entity+id + + Example py-json call (it knows the URL): + record = LFJsonGet.get_test_group(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'cross connects': # List of Test Manager's Cross-Connects. + 'entity id': # Entity ID + 'name': # Test Group's Name. + 'run': # Is Test Group running or not. + 'script': # Endpoint script state. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_test_group(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/test-group" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="groups", + plural_key="groups") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /text/ + /text/$group + /text/$group/$class + /text/$group/$class/$key + + When requesting specific column names, they need to be URL encoded: + eid, name, text, type + Example URL: /text?fields=eid,name + + Example py-json call (it knows the URL): + record = LFJsonGet.get_text(eid_list=['1.234', '1.344'], + requested_col_names=['text'], + debug=True) + + The record returned will have these members: + { + 'eid': # - + 'name': # - + 'text': # - + 'type': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_text(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/text" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="record", + plural_key="records") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /voip-endp/ + /voip-endp/$endp_id + /voip-ep/ + /voip-ep/$endp_id + /voip/ + /voip/$cx_id + /voip_endp/ + /voip_endp/$endp_id + /voip_ep/ + /voip_ep/$endp_id + + When requesting specific column names, they need to be URL encoded: + bps+rx+a, bps+rx+b, delay+a+%E2%86%90+b, delay+a+%E2%86%92+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, + entity+id, jitter+a+%E2%86%90+b, jitter+a+%E2%86%92+b, name, pkt+tx+a%C2%A0%E2%86%90%C2%A0b, + pkt+tx+a%C2%A0%E2%86%92%C2%A0b, rpt+timer, rx+drop+%25+a, rx+drop+%25+b, state, + type + Example URL: /voip?fields=bps+rx+a,bps+rx+b + + Example py-json call (it knows the URL): + record = LFJsonGet.get_voip(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps rx a': # Endpoint B's real transmit rate (bps).Measured at the CX Type layer. + 'bps rx b': # Endpoint A's real transmit rate (bps).Measured at the CX Type layer. + 'delay a ← b': # Average Latency in milliseconds for traffic from Endpoint B to Endpoint + # A + 'delay a → b': # Average Latency in milliseconds for traffic from Endpoint A to Endpoint + # B + 'eid': # Entity ID + 'endpoints (a ↔ b)': # Endpoints that make up this Cross Connect. + 'entity id': # Entity ID + 'jitter a ← b': # Average Jitter in milliseconds for traffic from Endpoint B to Endpoint A + 'jitter a → b': # Average Jitter in milliseconds for traffic from Endpoint A to Endpoint B + 'name': # Cross Connect's Name. + 'pkt tx a ← b': # Endpoint B's Packets Transmitted. + 'pkt tx a → b': # Endpoint A's Packets Transmitted. + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'rx drop % a': # Endpoint A percentage packet loss.Calculated using the number of PDUs + # Endpoint B sent minus the number Endpoint A received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'rx drop % b': # Endpoint B percentage packet loss.Calculated using the number of PDUs + # Endpoint A sent minus the number Endpoint B received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'state': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'type': # Cross-Connect type. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_voip(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/voip" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="connection", + plural_key="connections") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /voip-endp/ + /voip-endp/$endp_id + + When requesting specific column names, they need to be URL encoded: + calls+answered, calls+attempted, calls+completed, calls+failed, cf+404, cf+408, + cf+busy, cf+canceled, delay, destination+addr, dropped, dup+pkts, eid, elapsed, + entity+id, jb+cur, jb+over, jb+silence, jb+under, jitter, mng, name, ooo+pkts, + pesq, pesq+bklg, pesq%23, reg+state, rst, rtp+rtt, run, rx+bytes, rx+pkts, + source+addr, state, tx+bytes, tx+pkts, vad+pkts + Example URL: /voip-endp?fields=calls+answered,calls+attempted + + Example py-json call (it knows the URL): + record = LFJsonGet.get_voip_endp(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'calls answered': # Number of calls that where the remote answered + 'calls attempted': # Number of calls that have been attempted + 'calls completed': # Number of calls that have been successfully completed + 'calls failed': # Number of calls that did not succeed for any reason. + 'cf 404': # Number of calls failed for '404': callee not found. + 'cf 408': # Number of calls failed for '408': callee did not answer. + 'cf busy': # Number of calls failed because callee is busy. + 'cf canceled': # Number of calls failed because they were canceled. + 'delay': # Average latency in milliseconds for packets received by this endpoint. + 'destination addr': # Destination Address (MAC, ip/port, VoIP destination). + 'dropped': # Total dropped packets, as identified by gaps in RTP sequence numbers + # (pre jitter buffer). + 'dup pkts': # Total duplicate packets, as identified by RTP sequence numbers (pre + # jitter buffer). + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'jb cur': # Current number of packets in the jitter buffer waiting to be played / + # Jitter Buffer Size. + 'jb over': # Total times the jitter buffer was given more packets than it could hold. + 'jb silence': # Silence is played when there is no valid voice packet, due to drop, or + # reorder/jitter/latency out of range of the jitter buffer. + 'jb under': # Total times the reader asked for a packet to play but the jitter buffer + # was empty. + 'jitter': # Average interpacket variation, calculated per RFC 1889 A.8. + 'mng': # Is the Endpoint managed or not? + 'name': # Endpoint's Name. + 'ooo pkts': # Total out-of-order packets, as identified by RTP sequence numbers (pre + # jitter buffer). + 'pesq': # PESQ Report score for the PESQ report number (PESQ#). + 'pesq bklg': # PESQ server call processing backlog. + 'pesq#': # The pesq-report-number to which the PESQ value cooresponds. + 'reg state': # Current State of the Endpoint. + 'rst': # How many times has the endpoint been restarted due to abnormal + # termination. + 'rtp rtt': # Round trip latency as reported by RTCP + 'run': # Is the Endpoint is Running or not. + 'rx bytes': # Total received bytes count. + 'rx pkts': # Total received packet count. + 'source addr': # Source Address (MAC, ip/port, VoIP source). + 'state': # Phone registration state + 'tx bytes': # Total transmitted bytes count. + 'tx pkts': # Total transmitted packet count. + 'vad pkts': # Total VAD (Silence Suppression) packets suppressed before transmit. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_voip_endp(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/voip-endp" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoints") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /vr-cx/ + /vr-cx/$shelf_id/$resource_id/$port_id + /vr/ + /vr/$shelf_id/$resource_id + /vrcx/ + /vrcx/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + active+ipv6+router, bgp+4byte+as, bgp+damping, bgp+peers, cluster+id, collision+domain+id, + confederation+id, damping+half+life, damping+max+suppress, damping+reuse, + damping+suppress, entity+id, height, ipv6+radv, is+bgp+reflector, local+as, + multicast+routing, name, netsmith-state, notes, pad, ripv2, router+connections, + router+id, router+id, use+confederation, use+existing+cfg, use+ospf, use+rip+dft+route, + using+bgp, using+olsr, width, x, xorp+sha, y + Example URL: /vr?fields=active+ipv6+router,bgp+4byte+as + + Example py-json call (it knows the URL): + record = LFJsonGet.get_vr(eid_list=['1.234', '1.344'], + requested_col_names=['netsmith-state'], + debug=True) + + The record returned will have these members: + { + 'active ipv6 router': # - + 'bgp 4byte as': # - + 'bgp damping': # lc_key > lc_col_name- + 'bgp peers': # - + 'cluster id': # - + 'collision domain id': # - + 'confederation id': # - + 'damping half life': # - + 'damping max suppress': # - + 'damping reuse': # - + 'damping suppress': # - + 'entity id': # Entity ID + 'height': # - + 'ipv6 radv': # - + 'is bgp reflector': # - + 'local as': # - + 'multicast routing': # - + 'name': # Name + 'netsmith-state': # - + 'notes': # - + 'pad': # - + 'ripv2': # - + 'router connections': # - + 'router id': # - + 'router id': # - + 'use confederation ': # - + 'use existing cfg': # - + 'use ospf': # - + 'use rip dft route': # - + 'using bgp': # - + 'using olsr': # - + 'width': # - + 'x': # - + 'xorp sha': # - + 'y': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_vr(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/vr" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="virtual-routers", + plural_key="virtual-routers") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /vrcx/ + /vrcx/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + entity+id, height, interface+cost, local-a, local-b, netsmith-state, remote-a, + remote-b, resource, rip+metric, vrrp+id, vrrp+interval, vrrp+ip, vrrp+ip-prefix, + vrrp+priority, wan+link, width, x, y + Example URL: /vrcx?fields=entity+id,height + + Example py-json call (it knows the URL): + record = LFJsonGet.get_vrcx(eid_list=['1.234', '1.344'], + requested_col_names=['netsmith-state'], + debug=True) + + The record returned will have these members: + { + 'entity id': # - + 'height': # - + 'interface cost': # - + 'local-a': # - + 'local-b': # - + 'netsmith-state': # - + 'remote-a': # - + 'remote-b': # - + 'resource': # - + 'rip metric': # - + 'vrrp id': # - + 'vrrp interval': # - + 'vrrp ip': # - + 'vrrp ip-prefix': # - + 'vrrp priority': # - + 'wan link': # - + 'width': # - + 'x': # - + 'y': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_vrcx(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/vrcx" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="router-connections", + plural_key="router-connections") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /wl-endp/ + /wl-endp/$wl_ep_id + /wl-ep/ + /wl-ep/$wl_ep_id + /wl/ + /wl/$wl_id + /wl_endp/ + /wl_endp/$wl_ep_id + /wl_ep/ + /wl_ep/$wl_ep_id + /wlendp/$wl_ep_id + + When requesting specific column names, they need to be URL encoded: + bps+rx+a, bps+rx+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, entity+id, k-m, + name, pkt+tx+a%C2%A0%E2%86%90%C2%A0b, pkt+tx+a%C2%A0%E2%86%92%C2%A0b, rpt+timer, + state + Example URL: /wl?fields=bps+rx+a,bps+rx+b + + Example py-json call (it knows the URL): + record = LFJsonGet.get_wl(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps rx a': # Endpoint B's Max transmit rate (bps). + 'bps rx b': # Endpoint A's Max transmit rate (bps). + 'eid': # Entity ID + 'endpoints (a ↔ b)': # Endpoints that make up this WanLink. + 'entity id': # Entity ID + 'k-m': # Whether the WanLink is Kernel-Mode or not. + 'name': # WanLink's Name. + 'pkt tx a ← b': # Packets received on endpoint B and transmitted out endpoint A. + 'pkt tx a → b': # Packets received on endpoint A and transmitted out endpoint B. + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'state': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_wl(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/wl" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /wl-endp/ + /wl-endp/$wl_ep_id + + When requesting specific column names, they need to be URL encoded: + buffer, corrupt+1, corrupt+2, corrupt+3, corrupt+4, corrupt+5, corrupt+6, + delay, dropfreq+%25, dropped, dup+pkts, dupfreq+%25, eid, elapsed, extrabuf, + failed-late, jitfreq+%25, max+rate, maxjitter, maxlate, name, ooo+pkts, qdisc, + reordfrq+%25, run, rx+bytes, rx+pkts, script, serdelay, tx+bytes, tx+drop+%25, + tx+pkts, tx+rate, tx-failed, wps + Example URL: /wl-endp?fields=buffer,corrupt+1 + + Example py-json call (it knows the URL): + record = LFJsonGet.get_wl_endp(eid_list=['1.234', '1.344'], + requested_col_names=['eid'], + debug=True) + + The record returned will have these members: + { + 'buffer': # Maximum size of receive buffer, in bytes.This is the sum of the amount + # needed for the transit buffers (delay * bandwidth)plus the WanLink + # "Backlog Buffer:" queue size which handles bursts. + 'corrupt 1': # Counters for how many times this corruption has been applied. + 'corrupt 2': # Counters for how many times this corruption has been applied. + 'corrupt 3': # Counters for how many times this corruption has been applied. + 'corrupt 4': # Counters for how many times this corruption has been applied. + 'corrupt 5': # Counters for how many times this corruption has been applied. + 'corrupt 6': # Counters for how many times this corruption has been applied. + 'delay': # Base induced latency on received packets, in microseconds. + 'dropfreq %': # Frequency out of 1,000,000 to drop a received packet.Select a preset + # value or enter your own. + 'dropped': # Total dropped packets on receive.This does not include the tx-failed + # counters. + 'dup pkts': # Total duplicate packets generated. + 'dupfreq %': # Frequency out of 1,000,000 to duplicate a received packet.Select a + # preset value or enter your own. + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'extrabuf': # Size of "Backlog Buffer:" setting in WanLink configuration in bytes. + 'failed-late': # Total amount of received packets that could not be transmitted out the + # peer becausethe emulator was overloaded and could not transmit within + # the specified 'lateness' + 'jitfreq %': # Frequency out of 1,000,000 that packets should have jitter applied to + # them.Select a preset value or enter your own. + 'max rate': # Max transmit rate (bps) for this Endpoint. + 'maxjitter': # Maximum additional delay, in microseconds. See Jitter-Frequency as + # well. + 'maxlate': # The maximum lateness in milliseconds allowed before packets will be + # dropped on transmit.If lateness is configured to be automatic, this + # variable will change based onconfigured bandwidth and backlog buffer, + # but will not go below 10ms. + 'name': # Endpoint's Name. + 'ooo pkts': # Total out of order packets generated. + 'qdisc': # Queueing discipline (FIFO, WRR, etc). + 'reordfrq %': # Frequency out of 1,000,000 to re-order a received packet.Select a preset + # value or enter your own. + 'run': # Is the Endpoint is Running or not. + 'rx bytes': # Total received bytes count. + 'rx pkts': # Total received packet count. + 'script': # Endpoint script state. + 'serdelay': # Additional serialization delay for a 1514 byte packet at the configured + # speed (microseconds). + 'tx bytes': # Total transmitted bytes count. + 'tx drop %': # Packet drop percentage over the last 1 minute. + 'tx pkts': # Packets received on the peer interface and transmitted out this + # endpoint's interface. + 'tx rate': # The average speed over the last 30 seconds at which we are + # transmittingout the peer interface.This can be thought of as the actual + # transfer rate for packets entering the interfaceassociated with this + # Endpoint. + 'tx-failed': # Total amount of received packets that could not be transmitted out the + # peer.This includes any tx-failed-late packets. + 'wps': # Enable/Disable showing of WanPaths for individual endpoints. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_wl_endp(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/wl-endp" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /ws-msg/ + /ws-msg/$sessionid + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_ws_msg(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_ws_msg(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/ws-msg" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + +class LFSession(BaseSession): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This subclass of BaseSession knows about LFJsonQuery and LFJsonCommand + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def __init__(self, lfclient_url: str = 'http://localhost:8080', + debug: bool = False, + proxy_map: dict = None, + connection_timeout_sec: float = None, + stream_errors: bool = True, + stream_warnings: bool = False, + require_session: bool = False, + exit_on_error: bool = False): + """ + :param debug: turn on diagnostic information + :param proxy_map: a dict with addresses of proxies to route requests through. + E.G.: { 'http':'http://192.168.1.253:3128', 'https':'https://192.168.1.253:443' } + :param connection_timeout_sec: timeout in second to wait for a connect to the LANforge client (GUI) + This timeout does should not apply to long running client requests, there are individual + timeouts for those conditions, such as max_timeout_sec. + :param stream_errors: print HTTP JSON API errors to system out and logging stream + :param stream_warnings: print HTTP JSON API warnings to system out and logging stream + :param require_session: exit(1) if unable to establish a session_id + :param exit_on_error: on requests failing HTTP requests on besides error 404, + exit(1). This does not include failing to establish a session_id + """ + super().__init__(lfclient_url=lfclient_url, + debug=debug, + proxy_map=proxy_map, + connection_timeout_sec=connection_timeout_sec, + stream_errors=stream_errors, + stream_warnings=stream_warnings, + exit_on_error=exit_on_error) + self.command_instance = LFJsonCommand(session_obj=self, debug=debug, exit_on_error=exit_on_error) + self.query_instance = LFJsonQuery(session_obj=self, debug=debug, exit_on_error=exit_on_error) + self.session_connection_check = \ + self.command_instance.start_session(debug=debug, + die_without_session_id_=require_session) + if self.session_connection_check: + self.session_id = self.command_instance.session_id + self.query_instance.session_id = self.session_id + else: + self.logger.error('LFSession failed to establish session_id') + if require_session and ((not self.command_instance.session_id) or (not self.session_id)): + self.logger.error('LFSession failed to setup session_id correctly') + + def get_command(self) -> LFJsonCommand: + """ + Remember to override this method with your session subclass, it should return LFJsonCommand + :return: registered instance of JsonCommand + """ + if self.command_instance: + return self.command_instance + self.command_instance = LFJsonCommand(session_obj=self) + return self.command_instance + + def get_query(self) -> LFJsonQuery: + """ + Remember to override this method with your session subclass, it should return LFJsonQuery + :return: registered instance of JsonQuery + """ + if self.query_instance: + return self.query_instance + self.query_instance = LFJsonQuery(session_obj=self, debug=self.debug_on) + return self.query_instance From bcbc3bf7a2401ab62bc8ad4e81be1a543f07249b Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 11 Oct 2021 16:13:47 -0700 Subject: [PATCH 124/731] JSON: py-json/LANforge/set_port.py adjusted to lanforge_client/lanforge_api.py --- py-json/LANforge/set_port.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-json/LANforge/set_port.py b/py-json/LANforge/set_port.py index 0bfcc9eb..ad45f354 100644 --- a/py-json/LANforge/set_port.py +++ b/py-json/LANforge/set_port.py @@ -7,12 +7,12 @@ if sys.version_info[0] != 3: exit() -sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) +sys.path.append(os.path.join(os.path.abspath(__file__ + "../../"))) if os.environ.get("LF_USE_AUTOGEN") == 1: - lf_json_autogen = importlib.import_module("py-json.LANforge.lf_json_autogen") - LFJsonCommand = lf_json_autogen.LFJsonCommand + lanforge_api = importlib.import_module("lanforge_client.lanforge_api") + LFJsonCommand = lanforge_api.LFJsonCommand set_port_current_flags = LFJsonCommand.SetPortCurrentFlags.__members__ set_port_cmd_flags = LFJsonCommand.SetPortCmdFlags.__members__ set_port_interest_flags = LFJsonCommand.SetPortInterest.__members__ From 48626608fdd7b9270f6432a472168ad00104a07f Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 11 Oct 2021 16:15:47 -0700 Subject: [PATCH 125/731] JSON: jbr_create_wanlink.py Adjusted to importing lanforge_client/lanforge_api.py Adds another --mgr argument alias --- py-scripts/sandbox/jbr_create_wanlink.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/py-scripts/sandbox/jbr_create_wanlink.py b/py-scripts/sandbox/jbr_create_wanlink.py index a7dcf4a5..742c9f3f 100755 --- a/py-scripts/sandbox/jbr_create_wanlink.py +++ b/py-scripts/sandbox/jbr_create_wanlink.py @@ -22,12 +22,14 @@ if sys.version_info[0] != 3: print("This script requires Python3") exit() -sys.path.insert(1, "../../py-json") +import importlib import argparse import pprint -from LANforge.lf_json_autogen import LFSession -from LANforge.lf_json_autogen import LFJsonCommand -from LANforge.lf_json_autogen import LFJsonQuery +sys.path.insert(1, "../../") +lanforge_api = importlib.import_module("lanforge_client.lanforge_api") +from lanforge_client.lanforge_api import LFSession +from lanforge_client.lanforge_api import LFJsonCommand +from lanforge_client.lanforge_api import LFJsonQuery # import LANforge.lfcli_base @@ -41,7 +43,7 @@ def main(): prog=__file__, formatter_class=argparse.RawTextHelpFormatter, description='tests creating wanlink') - parser.add_argument("--host", help='specify the GUI to connect to, assumes port 8080') + parser.add_argument("--host", "--mgr", help='specify the GUI to connect to, assumes port 8080') parser.add_argument("--wl_name", help='name of the wanlink to create') parser.add_argument("--resource", help='LANforge resource') parser.add_argument("--debug", help='turn on debugging', action="store_true") From 326e2f627fa37370570b029993cdd6e18476030c Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 11 Oct 2021 16:54:29 -0700 Subject: [PATCH 126/731] Cleanup white space in test_ip_connection.py Signed-off-by: Matthew Stidham --- py-scripts/test_ip_connection.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/test_ip_connection.py b/py-scripts/test_ip_connection.py index 0d7c2196..47e92267 100755 --- a/py-scripts/test_ip_connection.py +++ b/py-scripts/test_ip_connection.py @@ -31,7 +31,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -98,7 +97,6 @@ class ConnectTest(LFCliBase): pprint.pprint(self.sta_list) print("---- ~Station List ----- ----- ----- ----- ----- ----- \n") - def build(self): # Build stations self.station_profile.use_security(self.security, self.ssid, self.password) @@ -135,7 +133,8 @@ class ConnectTest(LFCliBase): associated_map[sta_name] = 1 if self.debug: if self.ipv6: - print("Associated", sta_name, sta_status['interface']['ap'], sta_status['interface']['ipv6 address']) + print("Associated", sta_name, sta_status['interface']['ap'], + sta_status['interface']['ipv6 address']) else: print("Associated", sta_name, sta_status['interface']['ap'], sta_status['interface']['ip']) @@ -243,7 +242,7 @@ Generic ipv4 command example: args = parser.parse_args() - if (args.radio is None): + if args.radio is None: raise ValueError("--radio required") num_sta = 2 @@ -290,5 +289,6 @@ Generic ipv4 command example: ip_test.add_event(name="test_ip_connection.py", message="Full test passed, all stations associated and got IP") ip_test.exit_success() + if __name__ == "__main__": main() From 6e91d37afa05dfa679876dedb15ab746fad100ff Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 11 Oct 2021 17:29:12 -0700 Subject: [PATCH 127/731] jbr_create_wanlink.py: uses better type hints and more - changes docstring quotes - changes tuples to lists --- py-scripts/sandbox/jbr_create_wanlink.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/py-scripts/sandbox/jbr_create_wanlink.py b/py-scripts/sandbox/jbr_create_wanlink.py index 742c9f3f..9720c571 100755 --- a/py-scripts/sandbox/jbr_create_wanlink.py +++ b/py-scripts/sandbox/jbr_create_wanlink.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -''' +""" NAME: jbr_create_wanlink.py PURPOSE: create a wanlink @@ -15,7 +15,7 @@ NOTES: TO DO NOTES: -''' +""" import sys if sys.version_info[0] != 3: @@ -68,8 +68,8 @@ def main(): command.post_add_rdd(resource=args.resource, port="rd0a", peer_ifname="rd0b", - report_timer="1000", - shelf="1", + report_timer=1000, + shelf=1, debug=args.debug) command.post_add_rdd(resource=args.resource, @@ -84,12 +84,12 @@ def main(): command.post_add_wl_endp(alias=endp_a, resource=args.resource, port="rd0a", - shelf="1", + shelf=1, debug=args.debug) command.post_add_wl_endp(alias=endp_b, resource=args.resource, port="rd1a", - shelf="1", + shelf=1, debug=args.debug) command.post_add_cx(alias=args.wl_name, rx_endp=endp_a, @@ -97,13 +97,13 @@ def main(): test_mgr="default_tm", debug=args.debug) ewarn_list = [] - result = query.get_wl(eid_list=(args.wl_name), + result = query.get_wl(eid_list=[args.wl_name], wait_sec=0.2, timeout_sec=2.0, errors_warnings=ewarn_list, debug=args.debug) pprint.pprint(result) - result = query.get_wl_endp(eid_list=(args.wl_name+"-A", args.wl_name+"-B"), + result = query.get_wl_endp(eid_list=[args.wl_name+"-A", args.wl_name+"-B"], wait_sec=0.2, timeout_sec=15.0, debug=args.debug) From a3bd009443595ba7ff261e9aed4cc28436f85cae Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 11 Oct 2021 17:42:13 -0700 Subject: [PATCH 128/731] lanforge_api.py: fixes header lookups, status checks, generated whitespace --- lanforge_client/lanforge_api.py | 440 ++++++++++++++++---------------- 1 file changed, 221 insertions(+), 219 deletions(-) diff --git a/lanforge_client/lanforge_api.py b/lanforge_client/lanforge_api.py index e2f16d5d..ee4696a4 100644 --- a/lanforge_client/lanforge_api.py +++ b/lanforge_client/lanforge_api.py @@ -99,6 +99,7 @@ from enum import Enum SESSION_HEADER = 'X-LFJson-Session' LOGGER = Logger('json_api') + def _now_ms() -> int: return round(time.time() * 1000) @@ -217,6 +218,7 @@ def print_diagnostics(url_: str = None, if die_on_error_: exit(1) + class Logg: DEFAULT_LEVEL = logging.WARNING @@ -230,7 +232,7 @@ class Logg: ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" self.level = log_level - self.logger : Logger + self.logger: Logger self.start_time = datetime.now() self.start_time_str = time.strftime("%Y%m%d-%I:%M%:%S") @@ -271,7 +273,6 @@ class Logg: if level == logging.DEBUG: self.logger.debug(message) - def error(self, message: str = None): if not message: return @@ -566,9 +567,9 @@ class BaseLFJsonRequest: self.logger.warning("response headers:") self.logger.warning(pformat(headers)) if SESSION_HEADER in headers: - if self.session_id != headers[SESSION_HEADER]: + if self.session_id != resp.getheader(SESSION_HEADER): self.logger.warning("established session header [%s] different from response session header[%s]" - % (self.session_id, headers[SESSION_HEADER])) + % (self.session_id, resp.getheader(SESSION_HEADER))) if response_json_list is not None: if type(response_json_list) is not list: raise ValueError("reponse_json_list needs to be type list") @@ -968,8 +969,9 @@ class JsonCommand(BaseLFJsonRequest): if die_without_session_id_: exit(1) return False - if _not(first_response.msg): - self.logger.error("no session_response.msg: %s" % pformat(first_response)) + # first_response.msg is HttpMessage not a string + if first_response.status != 200: + self.logger.error("Error starting session msg: %s" % pformat(first_response.headers)) if die_without_session_id_: exit(1) return False @@ -977,8 +979,8 @@ class JsonCommand(BaseLFJsonRequest): if debug: self.logger.debug("%s: newsession: %s" % (__name__, pformat(first_response))) # self.session_instance.session_id = first_response["session_id"] - self.logger.debug(pformat( ("start_session headers:", - first_response.getheaders()))) + self.logger.debug(pformat(("start_session headers:", + first_response.getheaders()))) if SESSION_HEADER not in first_response.headers: self.logger.error("start_session: no %s in response headers:" % SESSION_HEADER) self.logger.error(pformat(first_response.headers)) @@ -1190,8 +1192,8 @@ class LFJsonCommand(JsonCommand): pkt_sz: str = None, # Minimum packet size, including all Ethernet headers. port: str = None, # Port number. [W] pps: str = None, # Packets per second to generate. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf name/id. Required. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf name/id. Required. [R][D:1] tos: str = None, # The Type of Service, can be HEX. See set_endp_tos for details. p_type: str = None, # Endpoint Type : arm_udp. [W] debug=False): @@ -1269,8 +1271,8 @@ class LFJsonCommand(JsonCommand): nexthop6: str = None, # BGP Peer IPv6 Nexthop address. peer_id: str = None, # BGP Peer Identifier: IPv4 Address peer_index: str = None, # Peer index in this virtual router (0-7). - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf name/id. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf name/id. [R][D:1] vr_id: str = None, # Name of virtual router. [R] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -1321,8 +1323,8 @@ class LFJsonCommand(JsonCommand): def post_add_bond(self, network_devs: str = None, # Comma-separated list of network devices: eth1,eth2,eth3... [W] port: str = None, # Name of the bond device. [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -1370,8 +1372,8 @@ class LFJsonCommand(JsonCommand): br_priority: str = None, # Bridge priority, 16-bit number. network_devs: str = None, # Comma-separated list of network devices: eth1,eth2,eth3... port: str = None, # Name of the bridge device. [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -1426,9 +1428,9 @@ class LFJsonCommand(JsonCommand): alias: str = None, # Name of Collision Domain. [W] bps: str = None, # Maximum speed at which this collision domain can run. flags: str = None, # See above. Leave blank or use 'NA' for no default values. - report_timer: str = None, # How often to report stats. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf name/id. [R][D:1] + report_timer: int = None, # How often to report stats. + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf name/id. [R][D:1] state: str = None, # RUNNING or STOPPED (default is RUNNING). Use this to start/stop. p_type: str = None, # CD Type: WIFI, WISER_SURFACE, WISER_SURFACE_AIR, WISER_AIR_AIR, # WISER_NCW @@ -1586,7 +1588,7 @@ class LFJsonCommand(JsonCommand): lanforge3: str = None, # EID of third LANforge Resource in this chamber or NA lanforge4: str = None, # EID of fourth LANforge Resource in this chamber or NA name: str = None, # Name of Chamber, unique identifier. [R] - resource: str = None, # LANforge Resource ID for controlling turn-table via serial + resource: int = None, # LANforge Resource ID for controlling turn-table via serial # protocol. sma_count: str = None, # Number of SMA connectors on this chamber, default is 16. turntable_type: str = None, # Turn-Table type: see above. @@ -1785,8 +1787,8 @@ class LFJsonCommand(JsonCommand): # 0x7e mtu: str = None, # MTU (and MRU) for this channel group. Must be a multiple # of the number of channels if configuring a T1 WanLink. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf name/id. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf name/id. [R][D:1] span_num: str = None, # The span number. First span is 1, second is 2... [W] p_type: str = None, # The channel-type. Use 'clear' for PPP links. debug=False): @@ -2153,10 +2155,10 @@ class LFJsonCommand(JsonCommand): # connections per endpoint. See AUTO_HELPER flag payload_pattern: str = None, # Payload pattern, see above. port: str = None, # Port/Interface name or number. [R] - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] send_bad_crc_per_million: str = None, # If NIC supports it, will randomly send X per million packets # with bad ethernet Frame Check Sum. - shelf: str = None, # Shelf name/id. [R][D:1] + shelf: int = 1, # Shelf name/id. [R][D:1] ttl: str = None, # Time-to-live, used by UDP Multicast Endpoints only. p_type: str = None, # Endpoint Type: See above. [W] use_checksum: str = None, # Yes means checksum the payload, anything else means NO. @@ -2335,12 +2337,12 @@ class LFJsonCommand(JsonCommand): payload_pattern: str = None, # Payload pattern, see above. port: str = None, # Port number. [W] prefix: str = None, # The prefix of the file(s) to read/write. - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] retry_timer: str = None, # Number of miliseconds to retry errored IO calls before # giving up. server_mount: str = None, # The server to mount, ex: # 192.168.100.5/exports/test1 [W] - shelf: str = None, # Shelf name/id. [R][D:1] + shelf: int = 1, # Shelf name/id. [R][D:1] p_type: str = None, # Endpoint Type (like fe_nfs) [W] volume: str = None, # iSCSI volume to mount debug=False): @@ -2404,8 +2406,8 @@ class LFJsonCommand(JsonCommand): def post_add_gen_endp(self, alias: str = None, # Name of endpoint. [R] port: str = None, # Port number. [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf name/id. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf name/id. [R][D:1] p_type: str = None, # Endpoint Type : gen_generic [W][D:gen_generic] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -2443,9 +2445,9 @@ class LFJsonCommand(JsonCommand): local_lower_ip: str = None, # The local lower-level IP to use. port: str = None, # Name of the GRE to create, suggested to start with 'gre' [W] remote_lower_ip: str = None, # The remote lower-level IP to use. - report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + report_timer: int = None, # Report timer for this port, leave blank or use NA for defaults. + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -2621,8 +2623,8 @@ class LFJsonCommand(JsonCommand): proxy_userpwd: str = None, # The user-name and password for proxy authentication, format: # user:passwd. quiesce_after: str = None, # Quiesce test after this many URLs have been processed. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf name/id. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf name/id. [R][D:1] smtp_from: str = None, # SMTP From address. ssl_cert_fname: str = None, # Name of SSL Certs file. timeout: str = None, # How long to wait for a connection, in milliseconds @@ -2726,8 +2728,8 @@ class LFJsonCommand(JsonCommand): flags: str = None, # Flags for this monitor interface. flags_mask: str = None, # Flags mask for this monitor interface. radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -2774,9 +2776,9 @@ class LFJsonCommand(JsonCommand): # xx:xx:xx:*:*:xx [W] old_name: str = None, # The temporary name, used for configuring un-discovered hardware. port: str = None, # Port number of an existing Ethernet interface. [W] - report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + report_timer: int = None, # Report timer for this port, leave blank or use NA for defaults. + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -2818,7 +2820,7 @@ class LFJsonCommand(JsonCommand): def post_add_ppp_link(self, auth: str = None, # YES if you want to authenticate. Default is NO. channel_groups: str = None, # List of channel groups, see above. - p_debug: str = None, # YES for debug, otherwise debugging for the ppp connection + p_debug: bool = False, # YES for debug, otherwise debugging for the ppp connection # is off. down_time_max_ms: str = None, # Maximum length of downtime (ms) for PPP link between runs, # or 0 for the link to be always up. @@ -2835,12 +2837,12 @@ class LFJsonCommand(JsonCommand): persist: str = None, # YES if you want to persist the connection. This is # suggested. pppoe_transport_port: str = None, # Port number (or name) for underlying PPPoE transport. - resource: str = None, # Resource (machine) number. [W] + resource: int = None, # Resource (machine) number. [W] run_time_max_ms: str = None, # Maximum uptime (ms) for PPP link during an experiment, or # 0 for the link to be always up. run_time_min_ms: str = None, # Minimum uptime (ms) for PPP link during an experiment, or # 0 for the link to be always up. - shelf: str = None, # Shelf name/id. [R] + shelf: int = 1, # Shelf name/id. [R] src_ip: str = None, # Source IP address for this PPP connection. transport_type: str = None, # What sort of transport this ppp link uses. tty_transport_device: str = None, # TTY device for PPP links associated with TTYs. @@ -3078,9 +3080,9 @@ class LFJsonCommand(JsonCommand): def post_add_rdd(self, peer_ifname: str = None, # The peer (other) RedirectDevice in this pair. port: str = None, # Name of the Redirect Device to create. [W] - report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + report_timer: int = None, # Report timer for this port, leave blank or use NA for defaults. + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -3117,8 +3119,8 @@ class LFJsonCommand(JsonCommand): ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix. [W] port: str = None, # Name of network device (Port) to which these IPs will be added. # [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -3265,8 +3267,8 @@ class LFJsonCommand(JsonCommand): nickname: str = None, # Nickname for this Virtual STA. (No longer used) radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] rate: str = None, # Max rate, see help above. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] ssid: str = None, # SSID for this Virtual STA. Use [BLANK] for empty SSID. Start with # 0x for HEX interpretation. [W] sta_br_ip: str = None, # IP Address for station bridging. Set to 0.0.0.0 to use MAC @@ -3374,8 +3376,8 @@ class LFJsonCommand(JsonCommand): mtu: str = None, # MTU for this span (used by in-band management, if at all). pci_bus: str = None, # PCI Bus number, needed for Sangoma resources. pci_slot: str = None, # PCI slot number, needed for Sangoma resources. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf name/id. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf name/id. [R][D:1] span_num: str = None, # The span number. First span is 1, second is 2... [W] timing: str = None, # Timing: 0 == do not use, 1 == primary, 2 == secondary.. p_type: str = None, # Currently supported types listed above. [W] @@ -3788,8 +3790,8 @@ class LFJsonCommand(JsonCommand): mode: str = None, # WiFi mode: see table [W] radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] rate: str = None, # Max rate, see help for add_vsta - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] ssid: str = None, # SSID for this Virtual AP. [W] x_coord: str = None, # Floating point number. y_coord: str = None, # Floating point number. @@ -3929,8 +3931,8 @@ class LFJsonCommand(JsonCommand): # 47-characters max. freq_24: str = None, # Frequency list for 2.4Ghz band, see above. freq_5: str = None, # Frequency list for 5Ghz band, see above. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] venu_id: str = None, # Number to uniquely identify this venue on this resource. [W] x1: str = None, # Floating point coordinate for lower-left corner. x2: str = None, # Floating point coordinate for upper-right corner. @@ -3981,9 +3983,9 @@ class LFJsonCommand(JsonCommand): def post_add_vlan(self, old_name: str = None, # The temporary name, used for configuring un-discovered hardware. port: str = None, # Port number of an existing Ethernet interface. [W] - report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + report_timer: int = None, # Report timer for this port, leave blank or use NA for defaults. + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] vid: str = None, # The VLAN-ID for this 802.1Q VLAN interface. [W] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -4032,11 +4034,11 @@ class LFJsonCommand(JsonCommand): phone_num: str = None, # Phone number for Endpoint [W] port: str = None, # Port number or name. [W] proxy_passwd: str = None, # Password to be used when registering with proxy/gateway. - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] rtp_port: str = None, # RTP port to use for send and receive. rx_sound_file: str = None, # File name to save received PCM data to. Will be in WAV # format, or AUTO - shelf: str = None, # Shelf name/id. [R][D:1] + shelf: int = 1, # Shelf name/id. [R][D:1] sip_gateway: str = None, # SIP Gateway/Proxy Name, this is who to register with, or # AUTO tx_sound_file: str = None, # File name containing the sound sample we will be playing. @@ -4136,8 +4138,8 @@ class LFJsonCommand(JsonCommand): height: str = None, # Height to be used when drawn in the LANforge-GUI. notes: str = None, # Notes for this Virtual Router. Put in quotes if the notes include # white-space. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf name/id. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf name/id. [R][D:1] vr_id: str = None, # Leave blank, use NA or 0xFFFF unless you are certain of the value you # want to enter. width: str = None, # Width to be used when drawn in the LANforge-GUI. @@ -4217,9 +4219,9 @@ class LFJsonCommand(JsonCommand): half_life: str = None, # Halflife in minutes for damping configuration. local_as: str = None, # BGP Autonomous System number, 1-65535 max_suppress: str = None, # Maximum hold down time in minutes for damping configuration. - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] reuse: str = None, # Route flag damping reuse threshold, in minutes. - shelf: str = None, # Shelf name/id. [R][D:1] + shelf: int = 1, # Shelf name/id. [R][D:1] suppress: str = None, # Route flag damping cutoff threshold, in minutes. vr_id: str = None, # Name of virtual router. [R] debug=False): @@ -4320,10 +4322,10 @@ class LFJsonCommand(JsonCommand): # Default is 0.0.0.0. remote_dev: str = None, # Name the remote network device. [W] remote_dev_b: str = None, # Name of port B for the remote network device. [W] - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] rip_metric: str = None, # If using RIP, this determines the RIP metric (cost), (1-15, 15 # is infinite). - shelf: str = None, # Shelf name/id. [R][D:1] + shelf: int = 1, # Shelf name/id. [R][D:1] subnets: str = None, # Subnets associated with this link, format: # 1.1.1.1/24,1.1.2.1/16... vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add @@ -4424,8 +4426,8 @@ class LFJsonCommand(JsonCommand): def post_add_vrcx2(self, local_dev: str = None, # Name of port A for the connection. [W] nexthop6: str = None, # The IPv6 next-hop to use when routing packets out this interface. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf name/id. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf name/id. [R][D:1] subnets6: str = None, # IPv6 Subnets associated with this link, format: # aaaa:bbbb::0/64,cccc:dddd:eeee::0/64... vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add a @@ -4522,8 +4524,8 @@ class LFJsonCommand(JsonCommand): # packets randomly. reorder_freq: str = None, # How often, out of 1,000,000 packets, should we make a # packet out of order. [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf name/id. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf name/id. [R][D:1] source_ip: str = None, # Selection filter: Source IP. source_ip_mask: str = None, # Selection filter: Source IP MASK. speed: str = None, # The maximum speed this WanLink will accept (bps). [W] @@ -4668,8 +4670,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#apply_vr_cfg ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_apply_vr_cfg(self, - resource: str = None, # The number of the resource in question, or 'ALL'. [W] - shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:ALL] + resource: int = None, # The number of the resource in question, or 'ALL'. [W] + shelf: int = 1, # The number of the shelf in question, or 'ALL'. [R][D:ALL] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -4697,9 +4699,9 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#blink_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_blink_attenuator(self, - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] - shelf: str = None, # Shelf number, usually 1. [R][D:1] + shelf: int = 1, # Shelf number, usually 1. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -4758,8 +4760,8 @@ class LFJsonCommand(JsonCommand): port: str = None, # Port number, or 'all'. [W] probe_flags: str = None, # See above, add them together for multiple probings. Leave # blank if you want stats only. - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -4791,8 +4793,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#cancel_vr_cfg ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_cancel_vr_cfg(self, - resource: str = None, # The number of the resource in question, or 'ALL'. [W] - shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:ALL] + resource: int = None, # The number of the resource in question, or 'ALL'. [W] + shelf: int = 1, # The number of the shelf in question, or 'ALL'. [R][D:ALL] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -4947,8 +4949,8 @@ class LFJsonCommand(JsonCommand): extra: str = None, # Clear something else instead: dhcp4_lease | dhcp6_lease | # dhcp_leases port: str = None, # The number of the port in question, or 'ALL'. [W] - resource: str = None, # The number of the resource in question, or 'ALL'. [W] - shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:1] + resource: int = None, # The number of the resource in question, or 'ALL'. [W] + shelf: int = 1, # The number of the shelf in question, or 'ALL'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -4980,8 +4982,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#clear_resource_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_resource_counters(self, - resource: str = None, # The number of the resource in question, or 'ALL'. [W] - shelf: str = None, # The number of the shelf in question, or 'ALL'. + resource: int = None, # The number of the resource in question, or 'ALL'. [W] + shelf: int = 1, # The number of the shelf in question, or 'ALL'. # [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -5119,8 +5121,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_discover(self, disconnect: str = None, # Set to 'disconnect' to force disconnect to remote resource process. - resource: str = None, # Resource ID. Use if discovering Attenuators. [W] - shelf: str = None, # Shelf-ID, only used if discovering Attenuators. [R][D:1] + resource: int = None, # Resource ID. Use if discovering Attenuators. [W] + shelf: int = 1, # Shelf-ID, only used if discovering Attenuators. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -5179,11 +5181,11 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#file ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_file(self, - card: str = None, # Resource ID [W] + card: int = None, # Resource ID [W] cmd: str = None, # Only 'Download' supported for now, 'Upload' reserved for future use. # [W][D:Download] filename: str = None, # File to transfer. [W] - shelf: str = None, # Shelf ID [R][D:1] + shelf: int = 1, # Shelf ID [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -5216,9 +5218,9 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_flash_attenuator(self, filename: str = None, # File to use when uploading to attenuator. - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] - shelf: str = None, # Shelf number, usually 1. [R][D:1] + shelf: int = 1, # Shelf number, usually 1. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -5655,8 +5657,8 @@ class LFJsonCommand(JsonCommand): # string. node_count: str = None, # The number of WISER nodes for the desired emulation, or 'NA' for # empty string. - resource: str = None, # The number of the resource in question. [W] - shelf: str = None, # The number of the shelf in question. [R][D:1] + resource: int = None, # The number of the resource in question. [W] + shelf: int = 1, # The number of the shelf in question. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -5902,8 +5904,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_cd(self, collision_domain: str = None, # Name of the Collision Domain, or 'all'. [W] - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -5934,8 +5936,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_channel_groups(self, channel_name: str = None, # Name of the channel, or 'all'. [W] - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6049,8 +6051,8 @@ class LFJsonCommand(JsonCommand): port: str = None, # Port number, or 'all'. [W] probe_flags: str = None, # See above, add them together for multiple probings. Leave # blank if you want stats only. - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6083,8 +6085,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_ppp_links(self, link_num: str = None, # Ppp-Link number of the span, or 'all'. [W] - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6114,8 +6116,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#nc_show_spans ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_spans(self, - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] span_number: str = None, # Span-Number of the span, or 'all'. [W] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -6146,9 +6148,9 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#nc_show_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_vr(self, - resource: str = None, # Resource number, or 'all'. [W] + resource: int = None, # Resource number, or 'all'. [W] router: str = None, # Name of the Virtual Router, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6179,8 +6181,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_vrcx(self, cx_name: str = None, # Name of the Virtual Router Connection, or 'all'. [W] - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6296,8 +6298,8 @@ class LFJsonCommand(JsonCommand): def post_probe_port(self, key: str = None, # Unique identifier for this request. Usually left blank.
port: str = None, # Port number or name [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6329,8 +6331,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#probe_ports ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_probe_ports(self, - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6431,8 +6433,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#reboot_os ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_reboot_os(self, - resource: str = None, # Resource number, or ALL. [W] - shelf: str = None, # Shelf number, or ALL. [R][D:1] + resource: int = None, # Resource number, or ALL. [W] + shelf: int = 1, # Shelf number, or ALL. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6511,8 +6513,8 @@ class LFJsonCommand(JsonCommand): pre_ifdown: str = None, # See above. Leave blank or use NA if unsure. reset_ospf: str = None, # If set to 'NO' or 'NA', then OSPF will not be updated. Otherwise, # it will be updated. - resource: str = None, # Resource number, or ALL. [W] - shelf: str = None, # Shelf number, or ALL. [R][D:1] + resource: int = None, # Resource number, or ALL. [W] + shelf: int = 1, # Shelf number, or ALL. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6546,8 +6548,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#reset_serial_span ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_reset_serial_span(self, - resource: str = None, # Resource (machine) number. [W] - shelf: str = None, # Shelf number [R][D:1] + resource: int = None, # Resource (machine) number. [W] + shelf: int = 1, # Shelf number [R][D:1] span: str = None, # Serial-Span number to reset. [W] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -6578,9 +6580,9 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#rm_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_attenuator(self, - resource: str = None, # Resource number [W] + resource: int = None, # Resource number [W] serno: str = None, # Serial number for requested Attenuator. [W] - shelf: str = None, # Shelf number, usually 1 [R][D:1] + shelf: int = 1, # Shelf number, usually 1 [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6750,8 +6752,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_channel_group(self, channel_name: str = None, # Name of the channel, or 'all'. [W] - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6865,7 +6867,7 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#rm_dut ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_dut(self, - shelf: str = None, # DUT name, or 'ALL' [W] + shelf: int = 1, # DUT name, or 'ALL' [W] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -6969,8 +6971,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#rm_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_ppp_link(self, - resource: str = None, # Resource number that holds this PppLink. [W] - shelf: str = None, # Name/id of the shelf. [R][D:1] + resource: int = None, # Resource number that holds this PppLink. [W] + shelf: int = 1, # Name/id of the shelf. [R][D:1] unit_num: str = None, # Unit-Number for the PppLink to be deleted. [W] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -7027,8 +7029,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#rm_resource ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_resource(self, - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -7056,8 +7058,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#rm_rfgen ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_rfgen(self, - resource: str = None, # Resource number [W] - shelf: str = None, # Shelf number, usually 1 [R][D:1] + resource: int = None, # Resource number [W] + shelf: int = 1, # Shelf number, usually 1 [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -7088,8 +7090,8 @@ class LFJsonCommand(JsonCommand): ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix, or ALL [W] port: str = None, # Name of network device (Port) from which these IPs will be removed. # [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -7121,8 +7123,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#rm_span ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_span(self, - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] span_num: str = None, # Span-Number of the channel, or 'all'. [W] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -7292,8 +7294,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#rm_venue ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_venue(self, - resource: str = None, # Resource number, or 'ALL' [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number, or 'ALL' [W] + shelf: int = 1, # Shelf number. [R][D:1] venu_id: str = None, # Number to uniquely identify this venue on this resource, or 'ALL' # [W] debug=False): @@ -7326,8 +7328,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vlan(self, port: str = None, # Port number or name of the virtual interface. [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -7357,9 +7359,9 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#rm_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vr(self, - resource: str = None, # Resource number, or 'all'. [W] + resource: int = None, # Resource number, or 'all'. [W] router_name: str = None, # Virtual Router name, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -7390,8 +7392,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vrcx(self, connection_name: str = None, # Virtual Router Connection name, or 'all'. [W] - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] vr_id: str = None, # If not removing from the free-list, then supply the # virtual-router name/ID here. Leave blank or use NA for free-list. vrcx_only: str = None, # If we should NOT delete underlying auto-created objects, enter @@ -7514,8 +7516,8 @@ class LFJsonCommand(JsonCommand): extra: str = None, # Extra arguments to the scan script, see above. key: str = None, # Unique identifier for this request. Usually left blank. port: str = None, # Port number or name of the virtual interface. [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -7676,9 +7678,9 @@ class LFJsonCommand(JsonCommand): # (1-60000) pulse_width_us5: str = None, # Pulse width in units of 1/2 micro second. So, if you want # 1.5us, use value 3 (0-60000) - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] - shelf: str = None, # Shelf number, usually 1. [R][D:1] + shelf: int = 1, # Shelf number, usually 1. [R][D:1] val: str = None, # Requested attenution in 1/10ths of dB (ddB). [W] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -8670,8 +8672,8 @@ class LFJsonCommand(JsonCommand): lattitude: str = None, # The lattitude, as read from a GPS device. longitude: str = None, # The longitude, as ready from a GPS device. ns: str = None, # North or South (Latitude). - resource: str = None, # Resource number for the port to be modified. [W] - shelf: str = None, # Shelf number for the port to be modified, or SELF. [R][D:1] + resource: int = None, # Resource number for the port to be modified. [W] + shelf: int = 1, # Shelf number for the port to be modified, or SELF. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -8713,8 +8715,8 @@ class LFJsonCommand(JsonCommand): port: str = None, # WiFi interface name or number. [W] post_ifup_script: str = None, # Script name with optional args, will run after interface # comes up and gets IP. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -9115,10 +9117,10 @@ class LFJsonCommand(JsonCommand): # or NA. netmask: str = None, # Netmask which this port should use, or NA. port: str = None, # Port number for the port to be modified. [W] - report_timer: str = None, # How often, in milliseconds, should we poll stats on this + report_timer: int = None, # How often, in milliseconds, should we poll stats on this # interface? - resource: str = None, # Resource number for the port to be modified. [W] - shelf: str = None, # Shelf number for the port to be modified. [R][D:1] + resource: int = None, # Resource number for the port to be modified. [W] + shelf: int = 1, # Shelf number for the port to be modified. [R][D:1] sta_br_id: str = None, # WiFi STAtion bridge ID. Zero means none. tx_queue_len: str = None, # Transmit Queue Length for this interface. Can be blank or NA. debug=False): @@ -9220,8 +9222,8 @@ class LFJsonCommand(JsonCommand): def post_set_port_alias(self, alias: str = None, # New alias to assign to this virtual interface. [W] port: str = None, # Physical Port identifier that owns the virtual interface. [R] - resource: str = None, # Resource number for the port to be modified. [W] - shelf: str = None, # Shelf number for the port to be modified. [R][D:1] + resource: int = None, # Resource number for the port to be modified. [W] + shelf: int = 1, # Shelf number for the port to be modified. [R][D:1] vport: str = None, # Virtual port identifier. MAC for MAC-VLANs, VLAN-ID for 802.1Q # vlans. debug=False): @@ -9259,8 +9261,8 @@ class LFJsonCommand(JsonCommand): def post_set_ppp_link_state(self, link: str = None, # Unit Number of the PPP Link, or 'all'. [W] ppp_state: str = None, # One of: RUNNING, STOPPED, or DELETED. [R] - resource: str = None, # Number of the Resource, or 'all'. [W] - shelf: str = None, # Name of the Shelf, or 'all'. [R][D:1] + resource: int = None, # Number of the Resource, or 'all'. [W] + shelf: int = 1, # Name of the Shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -9308,11 +9310,11 @@ class LFJsonCommand(JsonCommand): # Default is 12. max_trying_ifup: str = None, # Maximum amount of interfaces running the network config # 'ifup' logic. Default is 15 - resource: str = None, # Number of the Resource, or all. [W] + resource: int = None, # Number of the Resource, or all. [W] resource_flags: str = None, # System wide flags, often requires a reboot for changes to # take effect. resource_flags_mask: str = None, # What flags to change. If unset, default is all. - shelf: str = None, # Name of the Shelf, or all. [R][D:1] + shelf: int = 1, # Name of the Shelf, or all. [R][D:1] top_left_x: str = None, # X Location for Chamber View. top_left_y: str = None, # X Location for Chamber View. debug=False): @@ -9390,10 +9392,10 @@ class LFJsonCommand(JsonCommand): pulse_count: str = None, # Number of pulses (0-255) pulse_interval_us: str = None, # Time between pulses, in micro-seconds. pulse_width_us: str = None, # Requested pulse width, units are in micro-seconds. - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] rfgen_flags: str = None, # RF Generator flags, see above. rfgen_flags_mask: str = None, # Mask of what flags to set, see above. - shelf: str = None, # Shelf number, usually 1. [R][D:1] + shelf: int = 1, # Shelf number, usually 1. [R][D:1] sweep_time_ms: str = None, # Time interval between pulse groups in miliseconds debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -9539,8 +9541,8 @@ class LFJsonCommand(JsonCommand): ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix. [W] port: str = None, # Name of network device (Port) to which these IPs will be added. # [R] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -9661,8 +9663,8 @@ class LFJsonCommand(JsonCommand): local_dev_b: str = None, # Name of port B for the local redirect device pair. remote_dev: str = None, # Name of port B for the remote redirect device pair. remote_dev_b: str = None, # Name of port B for the remote redirect device pair. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf name/id. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf name/id. [R][D:1] vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to # add a stand-alone endpoint. [W][D:FREE_LIST] wanlink: str = None, # The name of the WanLink that connects the two B ports. @@ -10045,8 +10047,8 @@ class LFJsonCommand(JsonCommand): # message types by this amount. port: str = None, # WiFi interface name or number. [W] req_flush: str = None, # Set to 1 if you wish to flush changes to kernel now. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -10097,8 +10099,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_custom(self, port: str = None, # WiFi interface name or number. [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] text: str = None, # [BLANK] will erase all, any other text will be appended to # existing text. p_type: str = None, # NA for now, may specify specific locations later. [D:NA] @@ -10172,9 +10174,9 @@ class LFJsonCommand(JsonCommand): # password entry. Prepend with 0x for ascii-hex # representation. realm: str = None, # 802.11u realm: mytelco.com - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] roaming_consortium: str = None, # 802.11u roaming consortium: 223344 (15 characters max) - shelf: str = None, # Shelf number. [R][D:1] + shelf: int = 1, # Shelf number. [R][D:1] venue_group: str = None, # 802.11u Venue Group, integer. VAP only. venue_type: str = None, # 802.11u Venue Type, integer. VAP only. debug=False): @@ -10279,10 +10281,10 @@ class LFJsonCommand(JsonCommand): radius_ip: str = None, # RADIUS server IP Address (AP Only) radius_port: str = None, # RADIUS server IP Port (AP Only) req_flush: str = None, # Set to 1 if you wish to flush changes to kernel now. - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] sae_pwe: str = None, # Set SAE-PWE, 0 == hunting-and-pecking, 1 == # hash-to-element, 2 allow both. - shelf: str = None, # Shelf number. [R][D:1] + shelf: int = 1, # Shelf number. [R][D:1] venue_id: str = None, # Venue-ID for this wifi device. VAP in same venue will # share neigh reports as appropriate. debug=False): @@ -10425,9 +10427,9 @@ class LFJsonCommand(JsonCommand): rate: str = None, # No longer used, specify the rate on the virtual # station(s) instead. rate_ctrl_count: str = None, # Number of rate-ctrl objects for this radio. - resource: str = None, # Resource number. [W] + resource: int = None, # Resource number. [W] rts: str = None, # The RTS Threshold for this radio (off, or 1-2347). - shelf: str = None, # Shelf number. [R][D:1] + shelf: int = 1, # Shelf number. [R][D:1] skid_limit: str = None, # Firmware hash-table Skid Limit for this radio. stations_count: str = None, # Number of stations supported by this radio. tids_count: str = None, # TIDs count for this radio. @@ -10527,8 +10529,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_txo(self, port: str = None, # WiFi interface name or number. [W] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] txo_bw: str = None, # Configure bandwidth: 0 == 20, 1 == 40, 2 == 80, 3 == 160, 4 == # 80+80. txo_enable: str = None, # Set to 1 if you wish to enable transmit override, 0 to @@ -10714,11 +10716,11 @@ class LFJsonCommand(JsonCommand): Test_Mgr = "Test_Mgr" # def post_show_alerts(self, - card: str = None, # Alert resource filter. + card: int = None, # Alert resource filter. endp: str = None, # Alert endpoint filter. extra: str = None, # Extra filter, currently ignored. port: str = None, # Alert port filter (can be port name or number). - shelf: str = None, # Alert shelf filter. + shelf: int = 1, # Alert shelf filter. p_type: str = None, # Alert type filter. [R] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -10755,9 +10757,9 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#show_attenuators ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_attenuators(self, - resource: str = None, # Resource number, or 'all'. [W] + resource: int = None, # Resource number, or 'all'. [W] serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] - shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + shelf: int = 1, # Shelf number or alias, can be 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -10788,8 +10790,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_cd(self, collision_domain: str = None, # Name of the Collision Domain, or 'all'. [W] - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -10846,8 +10848,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_channel_groups(self, channel_name: str = None, # Name of the channel, or 'all'. [W] - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -11128,11 +11130,11 @@ class LFJsonCommand(JsonCommand): Test_Mgr = "Test_Mgr" # def post_show_events(self, - card: str = None, # Event resource filter. + card: int = None, # Event resource filter. endp: str = None, # Event endpoint filter. extra: str = None, # Extra filter, currently ignored. port: str = None, # Event port filter (can be port name or number). - shelf: str = None, # Event shelf filter. + shelf: int = 1, # Event shelf filter. p_type: str = None, # Event type filter. [R] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -11173,8 +11175,8 @@ class LFJsonCommand(JsonCommand): directory: str = None, # The sub-directory in which to list. p_filter: str = None, # An optional filter, as used by the 'ls' command. key: str = None, # A special key, can be used for scripting. - resource: str = None, # The machine to search in. [W] - shelf: str = None, # The virtual shelf to search in. Use 0 for manager machine. + resource: int = None, # The machine to search in. [W] + shelf: int = 1, # The virtual shelf to search in. Use 0 for manager machine. # [R,0-1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -11266,8 +11268,8 @@ class LFJsonCommand(JsonCommand): port: str = None, # Port number, or 'all'. [W] probe_flags: str = None, # See above, add them together for multiple probings. Leave blank # if you want stats only. - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -11300,8 +11302,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_ppp_links(self, link_num: str = None, # Ppp-Link number of the span, or 'all'. [W] - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -11357,8 +11359,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#show_resources ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_resources(self, - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Shelf number or alias, can be 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -11386,8 +11388,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#show_rfgen ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_rfgen(self, - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Shelf number or alias, can be 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -11416,8 +11418,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_rt(self, key: str = None, # Unique identifier for this request. Usually left blank. - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] virtual_router: str = None, # Name of the virtual router. [W] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -11479,8 +11481,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#show_spans ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_spans(self, - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] span_number: str = None, # Span-Number of the span, or 'all'. [W] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -11595,8 +11597,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#show_venue ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_venue(self, - resource: str = None, # Resource number, or 'ALL' [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number, or 'ALL' [W] + shelf: int = 1, # Shelf number. [R][D:1] venu_id: str = None, # Number to uniquely identify this venue on this resource, or 'ALL' # [W] debug=False): @@ -11628,9 +11630,9 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#show_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_vr(self, - resource: str = None, # Resource number, or 'all'. [W] + resource: int = None, # Resource number, or 'all'. [W] router: str = None, # Name of the Virtual Router, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -11661,8 +11663,8 @@ class LFJsonCommand(JsonCommand): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_vrcx(self, cx_name: str = None, # Name of the Virtual Router Connection, or 'all'. [W] - resource: str = None, # Resource number, or 'all'. [W] - shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + resource: int = None, # Resource number, or 'all'. [W] + shelf: int = 1, # Name/id of the shelf, or 'all'. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -11755,8 +11757,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#shutdown_os ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown_os(self, - resource: str = None, # Resource number, or ALL. [W] - shelf: str = None, # Shelf number, or ALL. [R][D:1] + resource: int = None, # Resource number, or ALL. [W] + shelf: int = 1, # Shelf number, or ALL. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -11784,8 +11786,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#shutdown_resource ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown_resource(self, - resource: str = None, # Resource number, or ALL. [W] - shelf: str = None, # Shelf number, or ALL. [R][D:1] + resource: int = None, # Resource number, or ALL. [W] + shelf: int = 1, # Shelf number, or ALL. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -11843,8 +11845,8 @@ class LFJsonCommand(JsonCommand): flags: str = None, # Flags that control how the sniffing is done. outfile: str = None, # Optional file location for saving a capture. port: str = None, # The port we are trying to run the packet sniffer on. [R] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -11934,8 +11936,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#start_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_start_ppp_link(self, - resource: str = None, # Resource number that holds this PppLink. [W] - shelf: str = None, # Name/id of the shelf. [R][D:1] + resource: int = None, # Resource number that holds this PppLink. [W] + shelf: int = 1, # Name/id of the shelf. [R][D:1] unit_num: str = None, # Unit-Number for the PppLink to be started. [R] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -12018,8 +12020,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#stop_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_stop_ppp_link(self, - resource: str = None, # Resource number that holds this PppLink. [W] - shelf: str = None, # Name/id of the shelf. [R][D:1] + resource: int = None, # Resource number that holds this PppLink. [W] + shelf: int = 1, # Name/id of the shelf. [R][D:1] unit_num: str = None, # Unit-Number for the PppLink to be stopped. [W] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -12054,8 +12056,8 @@ class LFJsonCommand(JsonCommand): key: str = None, # File-name that we should be tailing. message: str = None, # The contents to display (for results only) Unescaped Value - resource: str = None, # Resource that holds the file. [W] - shelf: str = None, # Shelf that holds the resource that holds the file. [R][D:1] + resource: int = None, # Resource that holds the file. [W] + shelf: int = 1, # Shelf that holds the resource that holds the file. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -12192,8 +12194,8 @@ class LFJsonCommand(JsonCommand): def post_wifi_cli_cmd(self, port: str = None, # Name of the WiFi station or AP interface to which this command # will be directed. [R] - resource: str = None, # Resource number. [W] - shelf: str = None, # Shelf number. [R][D:1] + resource: int = None, # Resource number. [W] + shelf: int = 1, # Shelf number. [R][D:1] wpa_cli_cmd: str = None, # Command to pass to wpa_cli or hostap_cli. This must be # single-quoted. [R] debug=False): @@ -12262,8 +12264,8 @@ class LFJsonCommand(JsonCommand): https://www.candelatech.com/lfcli_ug.php#wiser_reset ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_wiser_reset(self, - resource: str = None, # Resource number, or ALL. [W] - shelf: str = None, # Shelf number, or ALL. [R][D:1] + resource: int = None, # Resource number, or ALL. [W] + shelf: int = 1, # Shelf number, or ALL. [R][D:1] debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: @@ -12312,7 +12314,6 @@ class LFJsonCommand(JsonCommand): # - class LFJsonQuery(JsonQuery): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- LFJsonQuery inherits from JsonQuery. @@ -15314,6 +15315,7 @@ class LFJsonQuery(JsonQuery): plural_key="") # + class LFSession(BaseSession): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- This subclass of BaseSession knows about LFJsonQuery and LFJsonCommand @@ -15350,7 +15352,7 @@ class LFSession(BaseSession): self.query_instance = LFJsonQuery(session_obj=self, debug=debug, exit_on_error=exit_on_error) self.session_connection_check = \ self.command_instance.start_session(debug=debug, - die_without_session_id_=require_session) + die_without_session_id_=require_session) if self.session_connection_check: self.session_id = self.command_instance.session_id self.query_instance.session_id = self.session_id From 5761164bc04a90e282fdcfa683e5696cee7aee99 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 12 Oct 2021 07:19:47 -0600 Subject: [PATCH 129/731] ct_tests.json, ct_test_rig.json, ct_AX88U_dut.json , cookbook examples Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_AX88U_dut.json | 18 +++++++++ py-scripts/tools/ct_test_rig.json | 26 +++++++++++++ py-scripts/tools/ct_tests.json | 60 ++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 py-scripts/tools/ct_AX88U_dut.json create mode 100644 py-scripts/tools/ct_test_rig.json create mode 100644 py-scripts/tools/ct_tests.json diff --git a/py-scripts/tools/ct_AX88U_dut.json b/py-scripts/tools/ct_AX88U_dut.json new file mode 100644 index 00000000..5ed1d62c --- /dev/null +++ b/py-scripts/tools/ct_AX88U_dut.json @@ -0,0 +1,18 @@ +{ + "ct_AX88U_dut":{ + "Notes":[ + "This json file describes the device undertest as input to ./lf_check.py", + "The variables that are capitalize are used for configuration", + "The dut related configuration is contained in this file" + ] + }, + "test_dut":{ + "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", + "DUT_NAME": "ASUSRT-AX88U", + "wireless_network_dict":{ + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} + } + } +} + \ No newline at end of file diff --git a/py-scripts/tools/ct_test_rig.json b/py-scripts/tools/ct_test_rig.json new file mode 100644 index 00000000..44178cfd --- /dev/null +++ b/py-scripts/tools/ct_test_rig.json @@ -0,0 +1,26 @@ +{ + "test_rig":{ + "Notes":[ + "This json file describes LANforge system and test run configuration" + ] + }, + "test_rig_parameters":{ + "TEST_BED": "CT-TEST-001", + "TEST_RIG": "CT-TEST-001", + "DATABASE_SQLITE": "./tools/qa_sqlite3.db", + "LF_MGR_IP": "192.168.100.116", + "LF_MGR_PORT": "8080", + "LF_MGR_USER": "lanforge", + "LF_MGR_PASS": "lanforge", + "UPSTREAM_PORT":"1.1.eth2", + "TEST_TIMEOUT": 600, + "LOAD_BLANK_DB": false, + "LOAD_FACTORY_DEFAULT_DB": false, + "LOAD_CUSTOM_DB": false, + "CUSTOM_DB": "DFLT_ETH1_GEN", + "EMAIL_LIST_PRODUCTION": "support@candelatech.com", + "EMAIL_LIST_TEST": "support@candelatech.com", + "EMAIL_TITLE_TXT": "Lanforge QA Testing", + "EMAIL_TXT": "Lanforge QA Testing" + } +} \ No newline at end of file diff --git a/py-scripts/tools/ct_tests.json b/py-scripts/tools/ct_tests.json new file mode 100644 index 00000000..763c4152 --- /dev/null +++ b/py-scripts/tools/ct_tests.json @@ -0,0 +1,60 @@ +{ + "ct_tests_001":{ + "Notes":[ + "This json file describes tests to be run by LANforge system" + ] + }, + "test_suites":{ + "suite_wc_dp_shorter":{ + "create_chamberview_dut_mt7915e_wc":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" + ] + }, + "create_chamberview_mt7915e_wc":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario mt7915e_wc", + " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" + ] + }, + "wifi_capacity_mt7915e":{ + "enabled":"TRUE", + "timeout":"600", + "iterations":"1", + "load_db":"skip", + "command":"lf_wifi_capacity_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name mt7915e_wc", + " --upstream UPSTREAM_PORT --batch_size 1,10,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + } + } +} From 37c4fe1235bc48aca5743637d9d462ce0bd3644f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 12 Oct 2021 07:26:32 -0600 Subject: [PATCH 130/731] ct_test.json removed the radio Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_tests.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/ct_tests.json b/py-scripts/tools/ct_tests.json index 763c4152..25114cea 100644 --- a/py-scripts/tools/ct_tests.json +++ b/py-scripts/tools/ct_tests.json @@ -1,12 +1,12 @@ { - "ct_tests_001":{ + "ct_wifi_capacity_test":{ "Notes":[ "This json file describes tests to be run by LANforge system" ] }, "test_suites":{ - "suite_wc_dp_shorter":{ - "create_chamberview_dut_mt7915e_wc":{ + "suite_wc":{ + "create_chamberview_dut_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview_dut.py", @@ -18,7 +18,7 @@ " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME" ] }, - "create_chamberview_mt7915e_wc":{ + "create_chamberview_wc":{ "enabled":"TRUE", "load_db":"skip", "command":"create_chamberview.py", @@ -30,7 +30,7 @@ " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, - "wifi_capacity_mt7915e":{ + "wifi_capacity":{ "enabled":"TRUE", "timeout":"600", "iterations":"1", From 25b7ddfcbe8f2dd8b184f91abea5c7d461b6cf89 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 12 Oct 2021 07:26:32 -0600 Subject: [PATCH 131/731] ct_test.json removed the radio Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_tests.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/tools/ct_tests.json b/py-scripts/tools/ct_tests.json index 25114cea..59be48b7 100644 --- a/py-scripts/tools/ct_tests.json +++ b/py-scripts/tools/ct_tests.json @@ -25,7 +25,7 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario mt7915e_wc", + " --create_scenario scenario_wpa2_wc", " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] @@ -38,9 +38,9 @@ "command":"lf_wifi_capacity_test.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name mt7915e_wc", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name scenario_wpa2_wc", " --upstream UPSTREAM_PORT --batch_size 1,10,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'wpa2_wc'", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] From 4c78040e4953963355b79dd12e9fed2b1ecde8d3 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 12 Oct 2021 10:35:43 -0600 Subject: [PATCH 132/731] Updated the radios on the media-tech radio Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_tests.json | 2 +- py-scripts/tools/ct_us_001_tests.json | 2 +- py-scripts/tools/ct_us_002_tests.json | 2 +- py-scripts/tools/ct_us_003_tests.json | 2 +- py-scripts/tools/ct_us_004_tests.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/ct_tests.json b/py-scripts/tools/ct_tests.json index 59be48b7..0e747ee8 100644 --- a/py-scripts/tools/ct_tests.json +++ b/py-scripts/tools/ct_tests.json @@ -26,7 +26,7 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario scenario_wpa2_wc", - " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 9955fcbf..6d82ee73 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -64,7 +64,7 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario mt7915e_wc", - " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index c301111a..ec36fbae 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -52,7 +52,7 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario ap_auto ", - " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-1' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: DUT_NAME Radio-2' NA wiphy4,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index 015006ee..1fb29ce6 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -64,7 +64,7 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario mt7915e_wc ", - " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy1,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index ebd9104d..0cec55a6 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -64,7 +64,7 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario mt7915e_wc", - " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, From 346fa3f78d8c21975f6a01eedd7d33eeaf9557f7 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 12 Oct 2021 10:59:20 -0600 Subject: [PATCH 133/731] lf_check.py , updated conditional to not use == True Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index c92ddbfc..062d28e4 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -374,7 +374,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) else: mail_subject = "Regression Test [{hostname}] {date}".format(hostname=hostname, date=datetime.datetime.now()) try: - if self.production_run == True: + if self.production_run: msg = message_txt.format(ip=ip) # for postfix from command line echo "My message" | mail -s subject user@candelatech.com command = "echo \"{message}\" | mail -s \"{subject}\" {address}".format( From 3da1b702c2d3d0a6496728e14ec8923716a6a62a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 12 Oct 2021 11:01:44 -0600 Subject: [PATCH 134/731] lf_check.py : white space only , pep8 (line length 150) Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 296 ++++++++++++++++++----------------- 1 file changed, 155 insertions(+), 141 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 062d28e4..1f6e01ab 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1,16 +1,17 @@ #!/usr/bin/python3 ''' -NAME: lf_check.py +NAME: lf_check.py -PURPOSE: lf_check.py run tests based on test rig json input, test dut json input, and test command line inputs +PURPOSE: lf_check.py run tests based on test rig json input, test dut json input, and test command line inputs -EXAMPLE: +EXAMPLE: -./lf_check.py --json_rig --json_dut --json_test --test_suite --path -./lf_check.py --json_rig --json_dut --json_test --test_suite --path --production +./lf_check.py --json_rig --json_dut --json_test --test_suite --path +./lf_check.py --json_rig --json_dut --json_test --test_suite --path --production -./lf_check.py --json_rig ct_us_001_rig.json --json_dut ct_001_AX88U_dut.json --json_test ct_us_001_tests.json --suite "suite_wc_dp" --path '/home/lanforge/html-reports/ct-us-001' +./lf_check.py --json_rig ct_us_001_rig.json --json_dut ct_001_AX88U_dut.json + --json_test ct_us_001_tests.json --suite "suite_wc_dp" --path '/home/lanforge/html-reports/ct-us-001' rig is the LANforge @@ -21,22 +22,22 @@ NOTES: Create three json files: 1. discribes rig (lanforge), dut (device under test) and other for the description of the tests Starting LANforge: - On local or remote system: /home/lanforge/LANforgeGUI/lfclient.bash -cli-socket 3990 -s LF_MGR + On local or remote system: /home/lanforge/LANforgeGUI/lfclient.bash -cli-socket 3990 -s LF_MGR On local system the -s LF_MGR will be local_host if not provided ### Below are development Notes ### NOTES: getting radio information: -1. (Using Curl) curl -H 'Accept: application/json' http://localhost:8080/radiostatus/all | json_pp +1. (Using Curl) curl -H 'Accept: application/json' http://localhost:8080/radiostatus/all | json_pp 2. , where --user "USERNAME:PASSWORD" # https://itnext.io/curls-just-want-to-have-fun-9267432c4b55 3. (using Python) response = self.json_get("/radiostatus/all"), Currently lf_check.py is independent of py-json libraries 4. if the connection to 8080 is rejected check : pgrep -af java , to see the number of GUI instances running -5. getting the lanforge GUI version -curl -H 'Accept: application/json' http://localhost:8080/ | json_pp +5. getting the lanforge GUI version +curl -H 'Accept: application/json' http://localhost:8080/ | json_pp { "VersionInfo" : { "BuildDate" : "Sun 19 Sep 2021 02:36:51 PM PDT", @@ -47,14 +48,14 @@ curl -H 'Accept: application/json' http://localhost:8080/ | json_pp "JsonVersion" : "1.0.25931" }, -curl -u 'user:pass' -H 'Accept: application/json' http://:8080 | json_pp | grep -A 7 "VersionInfo" +curl -u 'user:pass' -H 'Accept: application/json' http://:8080 | json_pp | grep -A 7 "VersionInfo" 6. for Fedora you can do a: dnf group list , to see what all is installed dnf group install "Development Tools" for example, to install a group -GENERIC NOTES: +GENERIC NOTES: Starting LANforge: - On local or remote system: /home/lanforge/LANforgeGUI/lfclient.bash -cli-socket 3990 -s LF_MGR + On local or remote system: /home/lanforge/LANforgeGUI/lfclient.bash -cli-socket 3990 -s LF_MGR On local system the -s LF_MGR will be local_host if not provided Saving stdout and stderr to find LANforge issues ./lfclient.bash -cli-socket 3990 > >(tee -a stdout.log) 2> >(tee -a stderr.log >&2) @@ -63,13 +64,13 @@ Starting LANforge: On LANforge ~lanforge/.config/autostart/LANforge-auto.desktop is used to restart lanforge on boot. http://www.candelatech.com/cookbook.php?vol=misc&book=Automatically+starting+LANforge+GUI+on+login -1. add server (telnet localhost 4001) build info, GUI build sha, and Kernel version to the output. +1. add server (telnet localhost 4001) build info, GUI build sha, and Kernel version to the output. A. for build information on LANforgeGUI : /home/lanforge ./btserver --version B. for the kernel version uname -r (just verion ), uname -a build date - C. for getting the radio firmware: ethtool -i wlan0 + C. for getting the radio firmware: ethtool -i wlan0 # may need to build in a testbed reboot at the beginning of a day's testing... -# seeing some dhcp exhaustion and high latency values for testbeds that have been running +# seeing some dhcp exhaustion and high latency values for testbeds that have been running # for a while that appear to clear up once the entire testbed is power cycled # Capture the LANforge client output sdtout and stdwrr @@ -79,13 +80,14 @@ Starting LANforge: # Build Chamber View Scenario in the GUI and then # copy/tweak what it shows in the 'Text Output' tab after saving and re-opening # the scenario # issue a shutdown command on the lanforge(s) -# ssh root@lanforge reboot (need to verify) or do a shutdown +# ssh root@lanforge reboot (need to verify) or do a shutdown # send curl command to remote power switch to reboot testbed # curl -s http://admin:lanforge@192.168.100.237/outlet?1=CCL -o /dev/null 2>&1 -# - +# + ''' + import datetime import sys import traceback @@ -112,7 +114,7 @@ import requests dir_path = os.path.dirname(os.path.realpath(__file__)) parent_dir_path = os.path.abspath(os.path.join(dir_path, os.pardir)) sys.path.insert(0, parent_dir_path) - +# NOTE leave this line here for now from lf_report import lf_report sys.path.append('/') @@ -124,16 +126,16 @@ FORMAT = '%(asctime)s %(name)s %(levelname)s: %(message)s' # lf_check class contains verificaiton configuration and ocastrates the testing. class lf_check(): def __init__(self, - _json_rig, - _json_dut, - _json_test, - _test_suite, - _production, - _csv_results, - _outfile, - _outfile_name, - _report_path, - _log_path): + _json_rig, + _json_dut, + _json_test, + _test_suite, + _production, + _csv_results, + _outfile, + _outfile_name, + _report_path, + _log_path): self.json_rig = _json_rig self.json_dut = _json_dut self.json_test = _json_test @@ -170,14 +172,13 @@ class lf_check(): # meta.txt self.meta_data_path = "" - # lanforge configuration + # lanforge configuration self.lf_mgr_ip = "192.168.0.102" self.lf_mgr_port = "8080" self.lf_mgr_user = "lanforge" self.lf_mgr_pass = "lanforge" self.upstream_port = "" - # results self.database_sqlite = "" self.test_start_time = "" @@ -189,7 +190,7 @@ class lf_check(): self.test_ip = "" # section DUT - # dut selection + # dut selection self.dut_set_name = 'DUT_NAME ASUSRT-AX88U' # note the name will be set as --set DUT_NAME ASUSRT-AX88U, this is not dut_name (see above) self.dut_name = "DUT_NAME_NA" # "ASUSRT-AX88U" note this is not dut_set_name self.dut_hw = "DUT_HW_NA" @@ -244,12 +245,15 @@ class lf_check(): self.lf_mgr_user = "lanforge" self.lf_mgr_pass = "lanforge" ''' + def get_lanforge_radio_information(self): # https://docs.python-requests.org/en/latest/ # https://stackoverflow.com/questions/26000336/execute-curl-command-within-a-python-script - use requests - # curl --user "lanforge:lanforge" -H 'Accept: application/json' http://192.168.100.116:8080/radiostatus/all | json_pp , where --user "USERNAME:PASSWORD" - request_command = 'http://{lfmgr}:{port}/radiostatus/all'.format(lfmgr=self.lf_mgr_ip,port=self.lf_mgr_port) - request = requests.get(request_command, auth=(self.lf_mgr_user,self.lf_mgr_pass)) + # curl --user "lanforge:lanforge" -H 'Accept: application/json' + # http://192.168.100.116:8080/radiostatus/all | json_pp , where --user + # "USERNAME:PASSWORD" + request_command = 'http://{lfmgr}:{port}/radiostatus/all'.format(lfmgr=self.lf_mgr_ip, port=self.lf_mgr_port) + request = requests.get(request_command, auth=(self.lf_mgr_user, self.lf_mgr_pass)) print("radio request command: {request_command}".format(request_command=request_command)) print("radio request status_code {status}".format(status=request.status_code)) lanforge_radio_json = request.json() @@ -257,7 +261,6 @@ class lf_check(): lanforge_radio_text = request.text print("radio request.test: {text}".format(text=lanforge_radio_text)) return lanforge_radio_json, lanforge_radio_text - def get_lanforge_system_node_version(self): ssh = paramiko.SSHClient() # creating shh client object we use this object to connect to router @@ -292,7 +295,7 @@ class lf_check(): self.lanforge_server_version_full = stdout.readlines() self.lanforge_server_version_full = [line.replace('\n', '') for line in self.lanforge_server_version_full] print("lanforge_server_version_full: {lanforge_server_version_full}".format(lanforge_server_version_full=self.lanforge_server_version_full)) - self.lanforge_server_version = self.lanforge_server_version_full[0].split('Version:',maxsplit=1)[-1].split(maxsplit=1)[0] + self.lanforge_server_version = self.lanforge_server_version_full[0].split('Version:', maxsplit=1)[-1].split(maxsplit=1)[0] self.lanforge_server_version = self.lanforge_server_version.strip() print("lanforge_server_version: {lanforge_server_version}".format(lanforge_server_version=self.lanforge_server_version)) ssh.close() @@ -304,31 +307,31 @@ class lf_check(): ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # automatically adds the missing host key ssh.connect(hostname=self.lf_mgr_ip, port=22, username=self.lf_mgr_user, password=self.lf_mgr_pass, allow_agent=False, look_for_keys=False, banner_timeout=600) - stdin, stdout, stderr = ssh.exec_command('curl -H "Accept: application/json" http://{lanforge_ip}:8080 | json_pp | grep -A 7 "VersionInfo"'.format(lanforge_ip=self.lf_mgr_ip)) + stdin, stdout, stderr = ssh.exec_command( + 'curl -H "Accept: application/json" http://{lanforge_ip}:8080 | json_pp | grep -A 7 "VersionInfo"'.format(lanforge_ip=self.lf_mgr_ip)) self.lanforge_gui_version_full = stdout.readlines() - #print("lanforge_gui_version_full pre: {lanforge_gui_version_full}".format(lanforge_gui_version_full=self.lanforge_gui_version_full)) + # print("lanforge_gui_version_full pre: {lanforge_gui_version_full}".format(lanforge_gui_version_full=self.lanforge_gui_version_full)) self.lanforge_gui_version_full = [line.replace('\n', '') for line in self.lanforge_gui_version_full] - #print("lanforge_gui_version_full: {lanforge_gui_version_full}".format(lanforge_gui_version_full=self.lanforge_gui_version_full)) + # print("lanforge_gui_version_full: {lanforge_gui_version_full}".format(lanforge_gui_version_full=self.lanforge_gui_version_full)) for element in self.lanforge_gui_version_full: if "BuildVersion" in element: ver_str = str(element) - self.lanforge_gui_version = ver_str.split(':',maxsplit=1)[-1].replace(',','') - self.lanforge_gui_version = self.lanforge_gui_version.strip().replace('"','') + self.lanforge_gui_version = ver_str.split(':', maxsplit=1)[-1].replace(',', '') + self.lanforge_gui_version = self.lanforge_gui_version.strip().replace('"', '') print("BuildVersion {}".format(self.lanforge_gui_version)) if "BuildDate" in element: gui_str = str(element) - self.lanforge_gui_build_date = gui_str.split(':',maxsplit=1)[-1].replace(',','') + self.lanforge_gui_build_date = gui_str.split(':', maxsplit=1)[-1].replace(',', '') print("BuildDate {}".format(self.lanforge_gui_build_date)) if "GitVersion" in element: git_sha_str = str(element) - self.lanforge_gui_git_sha = git_sha_str.split(':',maxsplit=1)[-1].replace(',','') + self.lanforge_gui_git_sha = git_sha_str.split(':', maxsplit=1)[-1].replace(',', '') print("GitVersion {}".format(self.lanforge_gui_git_sha)) ssh.close() time.sleep(1) return self.lanforge_gui_version_full, self.lanforge_gui_version, self.lanforge_gui_build_date, self.lanforge_gui_git_sha - def send_results_email(self, report_file=None): if (report_file is None): print("No report file, not sending email.") @@ -336,10 +339,10 @@ class lf_check(): report_url = report_file.replace('/home/lanforge/', '') if report_url.startswith('/'): report_url = report_url[1:] - qa_url = self.qa_report_html.replace('home/lanforge','') + qa_url = self.qa_report_html.replace('home/lanforge', '') if qa_url.startswith('/'): qa_url = qa_url[1:] - # following recommendation + # following recommendation # NOTE: https://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-from-nic-in-python # Mail # command to check if mail running : systemctl status postfix @@ -352,21 +355,21 @@ class lf_check(): if hostname.find('.') < 1: hostname = ip - message_txt ="" + message_txt = "" if (self.email_txt != ""): message_txt = """{email_txt} lanforge target {lf_mgr_ip} Results from {hostname}: http://{hostname}/{report} -""".format(email_txt=self.email_txt,lf_mgr_ip=self.lf_mgr_ip,hostname=hostname,report=report_url) +""".format(email_txt=self.email_txt, lf_mgr_ip=self.lf_mgr_ip, hostname=hostname, report=report_url) else: message_txt = """Results from {hostname}: -http://{hostname}/{report}""".format(hostname=hostname,report=report_url) +http://{hostname}/{report}""".format(hostname=hostname, report=report_url) - # Put in report information current two methods supported, - message_txt +=""" + # Put in report information current two methods supported, + message_txt += """ QA Report Dashboard: http://{ip_qa}/{qa_url} -NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) +NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if (self.email_title_txt != ""): mail_subject = "{} [{hostname}] {date}".format(self.email_title_txt, hostname=hostname, @@ -391,7 +394,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) print("running:[{}]".format(command)) process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) - # have email on separate timeout + # have email on separate timeout process.wait(timeout=int(self.test_timeout)) except subprocess.TimeoutExpired: print("send email timed out") @@ -435,7 +438,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url)
""" - # Read the json configuration + # Read the json configuration # Read the test rig configuration, which is the LANforge system configuration # Read the dut configuration, which is the specific configuration for the AP / VAP or other device under test # Read the test configuration, replace the wide card parameters @@ -479,7 +482,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.logger.info("EXITING ERROR test_suites not in json test") exit(1) - #TODO change code so if parameter is not present then implied to be false + # TODO change code so if parameter is not present then implied to be false def read_test_rig_parameters(self): if "TEST_RIG" in self.json_rig["test_rig_parameters"]: self.test_rig = self.json_rig["test_rig_parameters"]["TEST_RIG"] @@ -554,14 +557,14 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.email_txt = self.json_rig["test_rig_parameters"]["EMAIL_TXT"] else: self.logger.info("EMAIL_TXT not in test_rig_parameters json") - + # dut_set_name selectes the DUT to test against , it is different then dut_name # this value gets set in the test def read_dut_parameters(self): if "DUT_SET_NAME" in self.json_dut["test_dut"]: self.dut_set_name = self.json_dut["test_dut"]["DUT_SET_NAME"] else: - self.logger.info("DUT_SET_NAME not in test_dut json") + self.logger.info("DUT_SET_NAME not in test_dut json") # dut name will set a chamberview scenerio for a DUT which can be selected with dut_set_name if "DUT_NAME" in self.json_dut["test_dut"]: self.dut_name = self.json_dut["test_dut"]["DUT_NAME"] @@ -600,7 +603,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) try: os.chdir(self.scripts_wd) # self.logger.info("Current Working Directory {}".format(os.getcwd())) - except: + except BaseException: self.logger.info("failed to change to {}".format(self.scripts_wd)) # no spaces after FACTORY_DFLT @@ -619,7 +622,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) def load_BLANK_database(self): try: os.chdir(self.scripts_wd) - except: + except BaseException: self.logger.info("failed to change to {}".format(self.scripts_wd)) # no spaces after FACTORY_DFLT @@ -638,7 +641,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) def load_custom_database(self, custom_db): try: os.chdir(self.scripts_wd) - except: + except BaseException: self.logger.info("failed to change to {}".format(self.scripts_wd)) # no spaces after FACTORY_DFLT @@ -661,51 +664,54 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) for test in self.test_dict: if self.test_dict[test]['enabled'] == "FALSE": self.logger.info("test: {} skipped".format(test)) - # load the default database + # load the default database elif self.test_dict[test]['enabled'] == "TRUE": - #TODO Place test interations here + # TODO Place test interations here if 'iterations' in self.test_dict[test]: self.logger.info("iterations : {}".format(self.test_dict[test]['iterations'])) self.test_iterations = int(self.test_dict[test]['iterations']) else: self.test_iterations = self.test_iterations_default - iteration = 0 + iteration = 0 for iteration in range(self.test_iterations): iteration += 1 # The network arguments need to be changed when in a list for index, args_list_element in enumerate(self.test_dict[test]['args_list']): if 'ssid_idx=' in args_list_element: - #print("args_list_element {}".format(args_list_element)) + # print("args_list_element {}".format(args_list_element)) # get ssid_idx used in the test as an index for the dictionary - ssid_idx_number = args_list_element.split('ssid_idx=')[-1].split()[0] + ssid_idx_number = args_list_element.split('ssid_idx=')[-1].split()[0] print("ssid_idx_number: {}".format(ssid_idx_number)) - idx = "ssid_idx={}".format(ssid_idx_number) # index into the DUT network index + idx = "ssid_idx={}".format(ssid_idx_number) # index into the DUT network index print("idx: {}".format(idx)) if 'SSID_USED' in args_list_element: - self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('SSID_USED', self.wireless_network_dict[idx]['SSID_USED']) + self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace( + 'SSID_USED', self.wireless_network_dict[idx]['SSID_USED']) if 'SECURITY_USED' in args_list_element: - self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('SECURITY_USED', self.wireless_network_dict[idx]['SECURITY_USED']) + self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace( + 'SECURITY_USED', self.wireless_network_dict[idx]['SECURITY_USED']) if 'SSID_PW_USED' in args_list_element: - self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('SSID_PW_USED', self.wireless_network_dict[idx]['SSID_PW_USED']) + self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace( + 'SSID_PW_USED', self.wireless_network_dict[idx]['SSID_PW_USED']) if 'BSSID' in args_list_element: - self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace('BSSID', self.wireless_network_dict[idx]['BSSID']) + self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace( + 'BSSID', self.wireless_network_dict[idx]['BSSID']) # use_ssid_idx is ephemeral and used only for variable replacement , remove tmp_idx = "use_ssid_idx={}".format(ssid_idx_number) if tmp_idx in args_list_element: - self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace(tmp_idx,'') + self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace(tmp_idx, '') # leave in for checking the command line arguments - print("self.test_dict[test]['args_list']: {}".format(self.test_dict[test]['args_list'])) - + print("self.test_dict[test]['args_list']: {}".format(self.test_dict[test]['args_list'])) # Walk all the args in the args list then construct the arguments if self.test_dict[test]['args'] == "": self.test_dict[test]['args'] = self.test_dict[test]['args'].replace(self.test_dict[test]['args'], ''.join(self.test_dict[test][ - 'args_list'])) + 'args_list'])) if 'DATABASE_SQLITE' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_SQLITE', self.database_sqlite) if 'HTTP_TEST_IP' in self.test_dict[test]['args']: @@ -740,7 +746,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) if 'UPSTREAM_PORT' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('UPSTREAM_PORT', self.upstream_port) - # lf_dataplane_test.py and lf_wifi_capacity_test.py use a parameter --local_path for the location + # lf_dataplane_test.py and lf_wifi_capacity_test.py use a parameter --local_path for the location # of the reports when the reports are pulled. if 'REPORT_PATH' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('REPORT_PATH', self.report_path) @@ -755,7 +761,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) if self.test_dict[test]['args'] == "": self.test_dict[test]['args'] = self.test_dict[test]['args'].replace(self.test_dict[test]['args'], ''.join(self.test_dict[test][ - 'args_list'])) + 'args_list'])) if 'timeout' in self.test_dict[test]: self.logger.info("timeout : {}".format(self.test_dict[test]['timeout'])) @@ -769,7 +775,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.test_dict[test]['load_db']).lower() != "skip": try: self.load_custom_database(self.test_dict[test]['load_db']) - except: + except BaseException: self.logger.info("custom database failed to load check existance and location: {}".format( self.test_dict[test]['load_db'])) else: @@ -783,8 +789,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) if self.use_custom_db == "TRUE": try: self.load_custom_database(self.custom_db) - self.logger.info("{} loaded between tests with scenario.py --load {}".format(self.custom_db,self.custom_db)) - except: + self.logger.info("{} loaded between tests with scenario.py --load {}".format(self.custom_db, self.custom_db)) + except BaseException: self.logger.info("custom database failed to load check existance and location: {}".format(self.custom_db)) else: self.logger.info("no db loaded between tests: {}".format(self.use_custom_db)) @@ -792,7 +798,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) try: os.chdir(self.scripts_wd) # self.logger.info("Current Working Directory {}".format(os.getcwd())) - except: + except BaseException: self.logger.info("failed to change to {}".format(self.scripts_wd)) cmd_args = "{}".format(self.test_dict[test]['args']) command = "./{} {}".format(self.test_dict[test]['command'], cmd_args) @@ -800,24 +806,24 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.logger.info("cmd_args {}".format(cmd_args)) if self.outfile_name is not None: - stdout_log_txt = os.path.join(self.log_path, "{}-{}-stdout.txt".format(self.outfile_name,test)) + stdout_log_txt = os.path.join(self.log_path, "{}-{}-stdout.txt".format(self.outfile_name, test)) self.logger.info("stdout_log_txt: {}".format(stdout_log_txt)) stdout_log = open(stdout_log_txt, 'a') - stderr_log_txt = os.path.join(self.log_path, "{}-{}-stderr.txt".format(self.outfile_name,test)) + stderr_log_txt = os.path.join(self.log_path, "{}-{}-stderr.txt".format(self.outfile_name, test)) self.logger.info("stderr_log_txt: {}".format(stderr_log_txt)) stderr_log = open(stderr_log_txt, 'a') - # need to take into account --raw_line parameters thus need to use shlex.split + # need to take into account --raw_line parameters thus need to use shlex.split # need to preserve command to have correct command syntax in command output command_to_run = command command_to_run = shlex.split(command_to_run) print("running {command_to_run}".format(command_to_run=command_to_run)) - self.test_start_time = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")).replace(':','-') + self.test_start_time = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")).replace(':', '-') print("Test start: {time}".format(time=self.test_start_time)) start_time = datetime.datetime.now() try: process = subprocess.Popen(command_to_run, shell=False, stdout=stdout_log, stderr=stderr_log, - universal_newlines=True) + universal_newlines=True) # if there is a better solution please propose, the TIMEOUT Result is different then FAIL try: if int(self.test_timeout != 0): @@ -828,17 +834,17 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) process.terminate() self.test_result = "TIMEOUT" - except: + except BaseException: print("No such file or directory with command: {}".format(command)) self.logger.info("No such file or directory with command: {}".format(command)) end_time = datetime.datetime.now() - self.test_end_time = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")).replace(':','-') + self.test_end_time = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")).replace(':', '-') print("Test end time {time}".format(time=self.test_end_time)) time_delta = end_time - start_time self.duration = "{day}d {seconds}s {msec} ms".format( - day=time_delta.days,seconds=time_delta.seconds,msec=time_delta.microseconds) + day=time_delta.days, seconds=time_delta.seconds, msec=time_delta.microseconds) # If collect meta data is set meta_data_path = "" @@ -846,19 +852,19 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) stdout_log_size = os.path.getsize(stdout_log_txt) if stdout_log_size > 0: stdout_log_fd = open(stdout_log_txt) - #"Report Location:::/home/lanforge/html-reports/wifi-capacity-2021-08-17-04-02-56" + # "Report Location:::/home/lanforge/html-reports/wifi-capacity-2021-08-17-04-02-56" # for line in stdout_log_fd: if "Report Location" in line: - meta_data_path = line.replace('"','') - meta_data_path = meta_data_path.replace('Report Location:::','') + meta_data_path = line.replace('"', '') + meta_data_path = meta_data_path.replace('Report Location:::', '') meta_data_path = meta_data_path.split('/')[-1] meta_data_path = meta_data_path.strip() meta_data_path = self.report_path + '/' + meta_data_path + '/meta.txt' break stdout_log_fd.close() if meta_data_path != "": - meta_data_fd = open(meta_data_path,'w+') + meta_data_fd = open(meta_data_path, 'w+') meta_data_fd.write('$ Generated by Candela Technologies LANforge network testing tool\n') meta_data_fd.write("test_run {test_run}\n".format(test_run=self.report_path)) meta_data_fd.write("file_meta {path}\n".format(path=meta_data_path)) @@ -867,16 +873,24 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) meta_data_fd.write('$ LANforge command\n') meta_data_fd.write("command {command}\n".format(command=command)) # split command at test-tag , at rest of string once at the actual test-tag value - test_tag = command.split('test_tag',maxsplit=1)[-1].split(maxsplit=1)[0] - test_tag = test_tag.replace("'","") + test_tag = command.split('test_tag', maxsplit=1)[-1].split(maxsplit=1)[0] + test_tag = test_tag.replace("'", "") meta_data_fd.write('$ LANforge test tag\n') meta_data_fd.write("test_tag {test_tag}\n".format(test_tag=test_tag)) # LANforge information is a list thus [0] meta_data_fd.write('$ LANforge Information\n') - meta_data_fd.write("lanforge_system_node {lanforge_system_node}\n".format(lanforge_system_node=self.lanforge_system_node_version[0])) - meta_data_fd.write("lanforge_kernel_version {lanforge_kernel_version}\n".format(lanforge_kernel_version=self.lanforge_kernel_version[0])) - meta_data_fd.write("lanforge_gui_version_full {lanforge_gui_version_full}\n".format(lanforge_gui_version_full=self.lanforge_gui_version_full)) - meta_data_fd.write("lanforge_server_version_full {lanforge_server_version_full}\n".format(lanforge_server_version_full=self.lanforge_server_version_full[0])) + meta_data_fd.write( + "lanforge_system_node {lanforge_system_node}\n".format( + lanforge_system_node=self.lanforge_system_node_version[0])) + meta_data_fd.write( + "lanforge_kernel_version {lanforge_kernel_version}\n".format( + lanforge_kernel_version=self.lanforge_kernel_version[0])) + meta_data_fd.write( + "lanforge_gui_version_full {lanforge_gui_version_full}\n".format( + lanforge_gui_version_full=self.lanforge_gui_version_full)) + meta_data_fd.write( + "lanforge_server_version_full {lanforge_server_version_full}\n".format( + lanforge_server_version_full=self.lanforge_server_version_full[0])) meta_data_fd.close() stderr_log_size = os.path.getsize(stderr_log_txt) @@ -912,7 +926,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) self.test_resut = "Failure" background = self.background_red - # if there was a + # if there was a if self.test_result == "TIMEOUT": self.logger.info("TIMEOUT FAILURE, Check LANforge Radios") self.test_result = "Time Out" @@ -926,7 +940,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url) print("html_report: {report}".format(report=self.qa_report_html)) break - self.qa_report_html = self.qa_report_html.replace('html report: ','') + self.qa_report_html = self.qa_report_html.replace('html report: ', '') # stdout_log_link is used for the email reporting to have the corrected path stdout_log_link = str(stdout_log_txt).replace('/home/lanforge', '') @@ -942,7 +956,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url)
- """ if self.test_result == "Failure": self.html_results += """""" else: self.html_results += """""" - + self.html_results += """""" - #TODO - plase copy button at end and selectable , so individual sections may be copied + # TODO - plase copy button at end and selectable , so individual sections may be copied if command != short_cmd: '''self.html_results += f""" """.format(command=command) - #nocopy + # nocopy ''' self.html_results += f""" """.format(command=command) - ''' + ''' row = [test, command, self.test_result, stdout_log_txt, stderr_log_txt] self.csv_results_writer.writerow(row) @@ -992,7 +1006,7 @@ def main(): prog='lf_check.py', formatter_class=argparse.RawTextHelpFormatter, epilog='''\ - lf_check.py : running scripts + lf_check.py : running scripts ''', description='''\ lf_check.py @@ -1000,9 +1014,9 @@ lf_check.py Summary : --------- -running scripts +running scripts -Example : +Example : ./lf_check.py --json_rig rig.json --json_dut dut.json --json_test tests.json --suite suite_test note if all json data (rig,dut,tests) in same json file pass same json in for all 3 inputs --------- @@ -1029,23 +1043,23 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a print("args.json_rig {rig}".format(rig=args.json_rig)) with open(args.json_rig, 'r') as json_rig_config: json_rig = json.load(json_rig_config) - except: - print("Error reading {}".format(args.json_rig)) + except BaseException: + print("Error reading {}".format(args.json_rig)) json_dut = "" try: print("args.json_dut {dut}".format(dut=args.json_dut)) with open(args.json_dut, 'r') as json_dut_config: json_dut = json.load(json_dut_config) - except: - print("Error reading {}".format(args.json_dut)) + except BaseException: + print("Error reading {}".format(args.json_dut)) json_test = "" try: print("args.json_test {}".format(args.json_test)) with open(args.json_test, 'r') as json_test_config: json_test = json.load(json_test_config) - except: + except BaseException: print("Error reading {}".format(args.json_test)) # Test-rig information information @@ -1054,7 +1068,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a lanforge_kernel_version = 'NO_KERNEL_VER' lanforge_server_version_full = 'NO_LF_SERVER_VER' - # select test suite + # select test suite test_suite = args.suite __dir = args.dir __path = args.path @@ -1067,7 +1081,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a print("Email to email list") # create report class for reporting - report = lf_report(_path = __path, + report = lf_report(_path=__path, _results_dir_name=__dir, _output_html="lf_check.html", _output_pdf="lf-check.pdf") @@ -1088,7 +1102,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a _production=production, _csv_results=csv_results, _outfile=outfile, - _outfile_name = outfile_name, + _outfile_name=outfile_name, _report_path=report_path, _log_path=log_path) @@ -1107,72 +1121,72 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a logger.addHandler(logging.StreamHandler(sys.stdout)) # allows to logging to file and stdout # read config and run tests - check.read_json_rig() #check.read_config + check.read_json_rig() # check.read_config check.read_json_dut() check.read_json_test() - + # get sha and lanforge information for results # Need to do this after reading the configuration try: scripts_git_sha = check.get_scripts_git_sha() print("git_sha {sha}".format(sha=scripts_git_sha)) - except: + except BaseException: print("git_sha read exception ") try: lanforge_system_node_version = check.get_lanforge_system_node_version() print("lanforge_system_node_version {system_node_ver}".format(system_node_ver=lanforge_system_node_version)) - except: + except BaseException: print("lanforge_system_node_version exception") try: lanforge_kernel_version = check.get_lanforge_kernel_version() print("lanforge_kernel_version {kernel_ver}".format(kernel_ver=lanforge_kernel_version)) - except: + except BaseException: print("lanforge_kernel_version exception, tests aborted check lanforge ip") exit(1) try: lanforge_server_version_full = check.get_lanforge_server_version() print("lanforge_server_version_full {lanforge_server_version_full}".format(lanforge_server_version_full=lanforge_server_version_full)) - except: + except BaseException: print("lanforge_server_version exception, tests aborted check lanforge ip") exit(1) try: - lanforge_gui_version_full, lanforge_gui_version, lanforge_gui_build_date, lanforge_gui_git_sha = check.get_lanforge_gui_version() + lanforge_gui_version_full, lanforge_gui_version, lanforge_gui_build_date, lanforge_gui_git_sha = check.get_lanforge_gui_version() print("lanforge_gui_version_full {lanforge_gui_version_full}".format(lanforge_gui_version_full=lanforge_gui_version_full)) - except: + except BaseException: print("lanforge_gui_version exception, tests aborted check lanforge ip") exit(1) try: lanforge_radio_json, lanforge_radio_text = check.get_lanforge_radio_information() - lanforge_radio_formatted_str = json.dumps(lanforge_radio_json, indent = 2) + lanforge_radio_formatted_str = json.dumps(lanforge_radio_json, indent=2) print("lanforge_radio_json: {lanforge_radio_json}".format(lanforge_radio_json=lanforge_radio_formatted_str)) # note put into the meta data - lf_radio_df = pd.DataFrame(columns = ['Radio','WIFI-Radio Driver','Radio Capabilities','Firmware Version','max_sta','max_vap','max_vifs']) + lf_radio_df = pd.DataFrame(columns=['Radio', 'WIFI-Radio Driver', 'Radio Capabilities', 'Firmware Version', 'max_sta', 'max_vap', 'max_vifs']) for key in lanforge_radio_json: - if 'wiphy' in key: - #print("key {}".format(key)) - #print("lanforge_radio_json[{}]: {}".format(key,lanforge_radio_json[key])) - driver = lanforge_radio_json[key]['driver'].split('Driver:',maxsplit=1)[-1].split(maxsplit=1)[0] + if 'wiphy' in key: + # print("key {}".format(key)) + # print("lanforge_radio_json[{}]: {}".format(key,lanforge_radio_json[key])) + driver = lanforge_radio_json[key]['driver'].split('Driver:', maxsplit=1)[-1].split(maxsplit=1)[0] try: firmware_version = lanforge_radio_json[key]['firmware version'] - except: + except BaseException: print("5.4.3 radio fw version not in /radiostatus/all") firmware_version = "5.4.3 N/A" lf_radio_df = lf_radio_df.append( - {'Radio':lanforge_radio_json[key]['entity id'], - 'WIFI-Radio Driver': driver, - 'Radio Capabilities':lanforge_radio_json[key]['capabilities'], - 'Firmware Version':firmware_version, - 'max_sta':lanforge_radio_json[key]['max_sta'], - 'max_vap':lanforge_radio_json[key]['max_vap'], - 'max_vifs':lanforge_radio_json[key]['max_vifs']}, ignore_index = True) + {'Radio': lanforge_radio_json[key]['entity id'], + 'WIFI-Radio Driver': driver, + 'Radio Capabilities': lanforge_radio_json[key]['capabilities'], + 'Firmware Version': firmware_version, + 'max_sta': lanforge_radio_json[key]['max_sta'], + 'max_vap': lanforge_radio_json[key]['max_vap'], + 'max_vifs': lanforge_radio_json[key]['max_vifs']}, ignore_index=True) print("lf_radio_df:: {lf_radio_df}".format(lf_radio_df=lf_radio_df)) except Exception as error: @@ -1221,7 +1235,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a print("html report: {}".format(html_report)) try: report.write_pdf_with_timestamp() - except: + except BaseException: print("exception write_pdf_with_timestamp()") print("lf_check_html_report: " + html_report) From 13a28c7b55f34eb6b9026bb4c427cb0ae8c1f08f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 12 Oct 2021 11:38:19 -0600 Subject: [PATCH 135/731] test_l3_longevity.py : white space only , pep8, line length 150 Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 716 +++++++++++++++++--------------- 1 file changed, 375 insertions(+), 341 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index fcfce6f4..02c595fd 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -2,7 +2,7 @@ ''' NAME: test_l3_longevity.py -PURPOSE: +PURPOSE: Supports creating user-specified amount stations on multiple radios Supports configuring upload and download requested rates and PDU sizes. @@ -36,8 +36,8 @@ Example command using attenuator --attenuators 1.1..1 \ --atten_vals 20,21,40,41 -Example using upsteam eth1 downstream eth2 - ./test_l3_longevity.py --test_duration 20s --polling_interval 1s --upstream_port eth1 --downstream_port eth2 +Example using upsteam eth1 downstream eth2 + ./test_l3_longevity.py --test_duration 20s --polling_interval 1s --upstream_port eth1 --downstream_port eth2 --endp_type lf --rates_are_totals --side_a_min_bps=10000000,0 --side_a_min_pdu=1000 --side_b_min_bps=0,300000000 --side_b_min_pdu=1000 COPYRIGHT: @@ -61,7 +61,7 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - + sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lf_report = importlib.import_module("py-scripts.lf_report") @@ -75,24 +75,24 @@ influx_add_parser_args = InfluxRequest.influx_add_parser_args # This class handles running the test and generating reports. class L3VariableTime(Realm): - def __init__(self, - endp_types, - args, - tos, + def __init__(self, + endp_types, + args, + tos, side_b, - side_a, - radio_name_list, + side_a, + radio_name_list, number_of_stations_per_radio_list, - ssid_list, - ssid_password_list, - ssid_security_list, - station_lists, - name_prefix, + ssid_list, + ssid_password_list, + ssid_security_list, + station_lists, + name_prefix, outfile, reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list, - side_a_min_rate=[56000], + side_a_min_rate=[56000], side_a_max_rate=[0], side_b_min_rate=[56000], side_b_max_rate=[0], @@ -105,11 +105,11 @@ class L3VariableTime(Realm): mconn=1, attenuators=[], atten_vals=[], - number_template="00", + number_template="00", test_duration="256s", polling_interval="60s", - lfclient_host="localhost", - lfclient_port=8080, + lfclient_host="localhost", + lfclient_port=8080, debug=False, influxdb=None, ap_scheduler_stats=False, @@ -141,13 +141,13 @@ class L3VariableTime(Realm): self.side_b = side_b self.side_a = side_a # if it is a dataplane test the side_a is not none and an ethernet port - if self.side_a != None: + if self.side_a is not None: self.dataplane = True else: self.dataplane = False self.ssid_list = ssid_list self.ssid_password_list = ssid_password_list - self.station_lists = station_lists + self.station_lists = station_lists self.ssid_security_list = ssid_security_list self.reset_port_enable_list = reset_port_enable_list self.reset_port_time_min_list = reset_port_time_min_list @@ -156,12 +156,12 @@ class L3VariableTime(Realm): self.name_prefix = name_prefix self.test_duration = test_duration self.radio_name_list = radio_name_list - self.number_of_stations_per_radio_list = number_of_stations_per_radio_list + self.number_of_stations_per_radio_list = number_of_stations_per_radio_list #self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=debug_on) self.polling_interval_seconds = self.duration_time_to_seconds(polling_interval) self.cx_profile = self.new_l3_cx_profile() self.multicast_profile = self.new_multicast_profile() - self.multicast_profile.name_prefix = "MLT-"; + self.multicast_profile.name_prefix = "MLT-" self.station_profiles = [] self.args = args self.outfile = outfile @@ -170,8 +170,6 @@ class L3VariableTime(Realm): self.debug = debug self.mconn = mconn self.user_tags = user_tags - - self.side_a_min_rate = side_a_min_rate self.side_a_max_rate = side_a_max_rate @@ -230,7 +228,7 @@ class L3VariableTime(Realm): "Retries", "bw", "mcs", "Nss", "ofdma", "mu-mimo", "channel utilization"] dur = self.duration_time_to_seconds(self.test_duration) - + if (self.polling_interval_seconds > dur + 1): self.polling_interval_seconds = dur - 1 @@ -240,13 +238,13 @@ class L3VariableTime(Realm): kpi = kpi + "-kpi.csv" self.csv_kpi_file = open(kpi, "w") self.csv_kpi_writer = csv.writer(self.csv_kpi_file, delimiter=",") - + # if side_a is None then side_a is radios if self.dataplane == False: - for (radio_, ssid_, ssid_password_, ssid_security_,\ - reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ - in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list,\ - reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): + for (radio_, ssid_, ssid_password_, ssid_security_, + reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ + in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, + reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): self.station_profile = self.new_station_profile() self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = ssid_ @@ -254,15 +252,14 @@ class L3VariableTime(Realm): self.station_profile.security = ssid_security_ self.station_profile.number_template = self.number_template self.station_profile.mode = 0 - self.station_profile.set_reset_extra(reset_port_enable=reset_port_enable_,\ - test_duration=self.duration_time_to_seconds(self.test_duration),\ - reset_port_min_time=self.duration_time_to_seconds(reset_port_time_min_),\ - reset_port_max_time=self.duration_time_to_seconds(reset_port_time_max_)) + self.station_profile.set_reset_extra(reset_port_enable=reset_port_enable_, + test_duration=self.duration_time_to_seconds(self.test_duration), + reset_port_min_time=self.duration_time_to_seconds(reset_port_time_min_), + reset_port_max_time=self.duration_time_to_seconds(reset_port_time_max_)) self.station_profiles.append(self.station_profile) else: pass - self.multicast_profile.host = self.lfclient_host self.cx_profile.host = self.lfclient_host self.cx_profile.port = self.lfclient_port @@ -295,7 +292,6 @@ class L3VariableTime(Realm): def get_ap_ofdma_24g(self): return self.ap_ofdma_24g - def get_kpi_csv(self): #print("self.csv_kpi_file {}".format(self.csv_kpi_file.name)) return self.csv_kpi_file.name @@ -315,7 +311,7 @@ class L3VariableTime(Realm): #print("endp-stats-for-port, port-eid: {}".format(eid_name)) eid = self.name_to_eid(eid_name) - print("eid_name: {eid_name} eid: {eid}".format(eid_name=eid_name,eid=eid)) + print("eid_name: {eid_name} eid: {eid}".format(eid_name=eid_name, eid=eid)) # Convert all eid elements to strings eid[0] = str(eid[0]) @@ -325,26 +321,25 @@ class L3VariableTime(Realm): for endp in endps: pprint(endp) eid_endp = endp["eid"].split(".") - print("Comparing eid:{eid} to endp-id {eid_endp}".format(eid=eid,eid_endp=eid_endp)) + print("Comparing eid:{eid} to endp-id {eid_endp}".format(eid=eid, eid_endp=eid_endp)) # Look through all the endpoints (endps), to find the port the eid_name is using. # The eid_name that has the same Shelf, Resource, and Port as the eid_endp (looking at all the endps) # Then read the eid_endp to get the delay, jitter and rx rate - # Note: the endp eid is shelf.resource.port.endp-id, the eid can be treated somewhat as + # Note: the endp eid is shelf.resource.port.endp-id, the eid can be treated somewhat as # child class of port-eid , and look up the port the eid is using. if eid[0] == eid_endp[0] and eid[1] == eid_endp[1] and eid[2] == eid_endp[2]: lat += int(endp["delay"]) jit += int(endp["jitter"]) name = endp["name"] print("endp name {name}".format(name=name)) - sta_name = name.replace('-A','') - #only the -A endpoint will be found so need to look - + sta_name = name.replace('-A', '') + # only the -A endpoint will be found so need to look count += 1 - print("Matched: name: {name} eid:{eid} to endp-id {eid_endp}".format(name=name,eid=eid,eid_endp=eid_endp)) + print("Matched: name: {name} eid:{eid} to endp-id {eid_endp}".format(name=name, eid=eid, eid_endp=eid_endp)) else: name = endp["name"] - print("No Match: name: {name} eid:{eid} to endp-id {eid_endp}".format(name=name,eid=eid,eid_endp=eid_endp)) + print("No Match: name: {name} eid:{eid} to endp-id {eid_endp}".format(name=name, eid=eid, eid_endp=eid_endp)) if count > 1: lat = int(lat / count) @@ -359,13 +354,12 @@ class L3VariableTime(Realm): total_dl_rate += int(endp["rx rate"]) total_dl_rate_ll += int(endp["rx rate ll"]) total_dl_pkts_ll += int(endp["rx pkts ll"]) - # -B upload side - else: + # -B upload side + else: total_ul_rate += int(endp["rx rate"]) total_ul_rate_ll += int(endp["rx rate ll"]) total_ul_pkts_ll += int(endp["rx pkts ll"]) - return lat, jit, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll # Query all endpoints to generate rx and other stats, returned @@ -383,9 +377,9 @@ class L3VariableTime(Realm): total_dl_ll = 0 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(): @@ -393,7 +387,7 @@ class L3VariableTime(Realm): endps.append(value) print("endpoint: ", item, " value:\n") pprint(value) - + for value_name, value in value.items(): if value_name == 'rx bytes': endp_rx_map[item] = value @@ -419,7 +413,6 @@ class L3VariableTime(Realm): else: total_ul_ll += int(value) - #print("total-dl: ", total_dl, " total-ul: ", total_ul, "\n") return endp_rx_map, endp_rx_drop_map, endps, total_dl, total_ul, total_dl_ll, total_ul_ll @@ -453,11 +446,11 @@ class L3VariableTime(Realm): def gather_port_eids(self): rv = [self.side_b] - + for station_profile in self.station_profiles: rv = rv + station_profile.station_names - return rv; + return rv # Create stations and connections/endpoints. If rebuild is true, then # only update connections/endpoints. @@ -480,13 +473,13 @@ class L3VariableTime(Realm): if self.dataplane: for etype in self.endp_types: for _tos in self.tos: - print("Creating connections for endpoint type: %s TOS: %s cx-count: %s"%(etype, _tos, self.cx_profile.get_cx_count())) + print("Creating connections for endpoint type: %s TOS: %s cx-count: %s" % (etype, _tos, self.cx_profile.get_cx_count())) # use brackes on [self.side_a] to make it a list these_cx, these_endp = self.cx_profile.create(endp_type=etype, side_a=[self.side_a], - side_b=self.side_b, sleep_time=0, tos=_tos) + side_b=self.side_b, sleep_time=0, tos=_tos) if (etype == "lf_udp" or etype == "lf_udp6"): self.udp_endps = self.udp_endps + these_endp - elif(etype=="lf"): + elif(etype == "lf"): self.lf_endps = self.eth_endps + these_endp else: self.tcp_endps = self.tcp_endps + these_endp @@ -496,7 +489,7 @@ class L3VariableTime(Realm): if not rebuild: station_profile.use_security(station_profile.security, station_profile.ssid, station_profile.ssid_pass) station_profile.set_number_template(station_profile.number_template) - print("Creating stations on radio %s"%(self.radio_name_list[index])) + print("Creating stations on radio %s" % (self.radio_name_list[index])) station_profile.create(radio=self.radio_name_list[index], sta_names_=self.station_lists[index], debug=self.debug, sleep_time=0) index += 1 @@ -506,73 +499,73 @@ class L3VariableTime(Realm): # Build/update connection types for etype in self.endp_types: if etype == "mc_udp" or etype == "mc_udp6": - print("Creating Multicast connections for endpoint type: %s"%(etype)) + print("Creating Multicast connections for endpoint type: %s" % (etype)) self.multicast_profile.create_mc_tx(etype, self.side_b, etype) self.multicast_profile.create_mc_rx(etype, side_rx=station_profile.station_names) else: for _tos in self.tos: - print("Creating connections for endpoint type: %s TOS: %s cx-count: %s"%(etype, _tos, self.cx_profile.get_cx_count())) + print("Creating connections for endpoint type: %s TOS: %s cx-count: %s" % (etype, _tos, self.cx_profile.get_cx_count())) these_cx, these_endp = self.cx_profile.create(endp_type=etype, side_a=station_profile.station_names, - side_b=self.side_b, sleep_time=0, tos=_tos) + side_b=self.side_b, sleep_time=0, tos=_tos) if (etype == "lf_udp" or etype == "lf_udp6"): - self.udp_endps = self.udp_endps + these_endp; + self.udp_endps = self.udp_endps + these_endp else: - self.tcp_endps = self.tcp_endps + these_endp; + self.tcp_endps = self.tcp_endps + these_endp self.cx_count = self.cx_profile.get_cx_count() if self.dataplane == True: - self._pass("PASS: CX build finished: created/updated: %s connections."%(self.cx_count)) + self._pass("PASS: CX build finished: created/updated: %s connections." % (self.cx_count)) else: - self._pass("PASS: Stations & CX build finished: created/updated: %s stations and %s connections."%(self.station_count, self.cx_count)) + self._pass("PASS: Stations & CX build finished: created/updated: %s stations and %s connections." % (self.station_count, self.cx_count)) - def ap_custom_cmd(self,ap_custom_cmd): + def ap_custom_cmd(self, ap_custom_cmd): ap_results = "" try: # configure the serial interface ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(ap_custom_cmd)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output - ap_results = ss.before.decode('utf-8','ignore') + ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + ap_results = ss.before.decode('utf-8', 'ignore') print("ap_custom_cmd: {} ap_results {}".format(ap_custom_cmd, ap_results)) - except: + except BaseException: print("ap_custom_cmd: {} WARNING unable to read AP ".format(ap_custom_cmd)) return ap_results def read_ap_stats_6g(self): - # 6ghz: wl -i wl2 bs_data + # 6ghz: wl -i wl2 bs_data ap_stats_6g = "" try: # configure the serial interface ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_cmd_6g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output - ap_stats_6g = ss.before.decode('utf-8','ignore') + ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + ap_stats_6g = ss.before.decode('utf-8', 'ignore') print("ap_stats_6g from AP: {}".format(ap_stats_6g)) - except: + except BaseException: print("WARNING: ap_stats_6g unable to read AP") - + return ap_stats_6g def read_ap_stats_5g(self): - # 5ghz: wl -i wl1 bs_data + # 5ghz: wl -i wl1 bs_data ap_stats_5g = "" try: # configure the serial interface ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_cmd_5g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output - ap_stats_5g = ss.before.decode('utf-8','ignore') + ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + ap_stats_5g = ss.before.decode('utf-8', 'ignore') print("ap_stats_5g from AP: {}".format(ap_stats_5g)) - except: + except BaseException: print("WARNING: ap_stats_5g unable to read AP") - + return ap_stats_5g def read_ap_stats_2g(self): @@ -583,48 +576,47 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_cmd_2g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output - ap_stats_2g = ss.before.decode('utf-8','ignore') + ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + ap_stats_2g = ss.before.decode('utf-8', 'ignore') print("ap_stats_2g from AP: {}".format(ap_stats_2g)) - except: + except BaseException: print("WARNING: ap_stats_2g unable to read AP") - + return ap_stats_2g def read_ap_chanim_stats_6g(self): - # 5ghz: wl -i wl1 chanim_stats + # 5ghz: wl -i wl1 chanim_stats ap_chanim_stats_6g = "" try: # configure the serial interface ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_chanim_cmd_6g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output - ap_chanim_stats_6g = ss.before.decode('utf-8','ignore') + ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + ap_chanim_stats_6g = ss.before.decode('utf-8', 'ignore') print("read_ap_chanim_stats_6g {}".format(ap_chanim_stats_6g)) - except: + except BaseException: print("WARNING: read_ap_chanim_stats_6g unable to read AP") return ap_chanim_stats_6g - def read_ap_chanim_stats_5g(self): - # 5ghz: wl -i wl1 chanim_stats + # 5ghz: wl -i wl1 chanim_stats ap_chanim_stats_5g = "" try: # configure the serial interface ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_chanim_cmd_5g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output - ap_chanim_stats_5g = ss.before.decode('utf-8','ignore') + ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + ap_chanim_stats_5g = ss.before.decode('utf-8', 'ignore') print("read_ap_chanim_stats_5g {}".format(ap_chanim_stats_5g)) - except: + except BaseException: print("WARNING: read_ap_chanim_stats_5g unable to read AP") - + return ap_chanim_stats_5g def read_ap_chanim_stats_2g(self): @@ -635,22 +627,22 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_chanim_cmd_2g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output - ap_chanim_stats_2g = ss.before.decode('utf-8','ignore') + ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + ap_chanim_stats_2g = ss.before.decode('utf-8', 'ignore') print("read_ap_chanim_stats_2g {}".format(ap_chanim_stats_2g)) - except: + except BaseException: print("WARNING: read_ap_chanim_stats_2g unable to read AP") - + return ap_chanim_stats_2g # Run the main body of the test logic. def start(self, print_pass=False, print_fail=False): print("Bringing up stations") - self.admin_up(self.side_b) + self.admin_up(self.side_b) for station_profile in self.station_profiles: for sta in station_profile.station_names: - print("Bringing up station %s"%(sta)) + print("Bringing up station %s" % (sta)) self.admin_up(sta) temp_stations_list = [] @@ -665,7 +657,7 @@ class L3VariableTime(Realm): print("print failed to get IP's") csv_header = self.csv_generate_column_headers() - #print(csv_header) + # print(csv_header) self.csv_add_column_headers(csv_header) port_eids = self.gather_port_eids() for eid_name in port_eids: @@ -699,8 +691,8 @@ class L3VariableTime(Realm): if (dl_pdu == "AUTO" or dl_pdu == "MTU"): dl_pdu = "-1" - print("ul: %s dl: %s cx-count: %s rates-are-totals: %s\n"%(ul, dl, self.cx_count, self.rates_are_totals)) - + print("ul: %s dl: %s cx-count: %s rates-are-totals: %s\n" % (ul, dl, self.cx_count, self.rates_are_totals)) + # Set rate and pdu size config self.cx_profile.side_a_min_bps = ul self.cx_profile.side_a_max_bps = ul @@ -738,7 +730,7 @@ class L3VariableTime(Realm): end_time = self.parse_time(self.test_duration) + cur_time - print("Monitoring throughput for duration: %s"%(self.test_duration)) + print("Monitoring throughput for duration: %s" % (self.test_duration)) # Monitor test for the interval duration. passes = 0 @@ -765,29 +757,37 @@ class L3VariableTime(Realm): self.epoch_time = int(time.time()) new_rx_values, rx_drop_percent, endps, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps = self.__get_rx_values() - print("main loop, total-dl: ", total_dl_bps, " total-ul: ", total_ul_bps, " total-dl-ll: ", total_dl_ll_bps," total-ul-ll: ", total_ul_ll_bps) + print( + "main loop, total-dl: ", + total_dl_bps, + " total-ul: ", + total_ul_bps, + " total-dl-ll: ", + total_dl_ll_bps, + " total-ul-ll: ", + total_ul_ll_bps) # AP OUTPUT if self.ap_read: # 6G test mode if self.ap_test_mode: # Create the test data as a continuous string - ap_stats_6g="{}{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 bs_data\n", - "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", - "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", - "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", - "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", - "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n", - "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") + ap_stats_6g = "{}{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 bs_data\n", + "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", + "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", + "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", + "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", + "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n", + "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") print("ap_stats 6g{}".format(ap_stats_6g)) # Create the test data as a continuous string ap_chanim_stats_6g = "{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 chanim_stats\n", - "version: 3\n", - "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", - #`"0xe06a 61 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") - '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') - #"0xe06a 1.67 15.00 0.00 17.00 0.00 0.00 97.33 53.00 2.00 0 0 -91 65 343370578\n") + "version: 3\n", + "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", + # `"0xe06a 61 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") + '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') + # "0xe06a 1.67 15.00 0.00 17.00 0.00 0.00 97.33 53.00 2.00 0 0 -91 65 343370578\n") else: # read from the AP 6g @@ -806,11 +806,11 @@ class L3VariableTime(Realm): port_eids = self.gather_port_eids() for eid_name in port_eids: eid = self.name_to_eid(eid_name) - url = "/port/%s/%s/%s"%(eid[0], eid[1], eid[2]) + url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("6g query-port: %s: incomplete response:"%(url)) + print("6g query-port: %s: incomplete response:" % (url)) pprint(response) else: # print("response".format(response)) @@ -818,7 +818,7 @@ class L3VariableTime(Realm): p = response['interface'] print("#### 6g From LANforge: p, response['insterface']:{}".format(p)) mac = p['mac'] - #print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) + # print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_6g_rows: @@ -831,12 +831,12 @@ class L3VariableTime(Realm): mac_found_6g = True else: try: - # split_row[0].lower() , mac from AP + # split_row[0].lower() , mac from AP # mac.lower() , mac from LANforge if split_row[0].lower() == mac.lower(): ap_row = split_row mac_found_6g = True - except: + except BaseException: print("6g 'No stations are currently associated.'? from AP") print(" since possibly no stations: excption on compare split_row[0].lower() ") if mac_found_6g == True: @@ -844,7 +844,8 @@ class L3VariableTime(Realm): print("6g selected ap_row (from split_row): {}".format(ap_row)) # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port(p["port"], endps) + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( + p["port"], endps) # now report the ap_chanim_stats along side of the ap_stats_6g xtop_reported = False @@ -856,13 +857,13 @@ class L3VariableTime(Realm): try: xtop = split_row[7] print("6g xtop {xtop}".format(xtop=xtop)) - except: + except BaseException: print("6g detected chanspec with reading chanim_stats, exception reading xtop") try: channel_utilization = float(100) - float(xtop) print("6g channel_utilization {utilization}".format(utilization=channel_utilization)) - except: + except BaseException: print("6g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") # should be only one channel utilization break @@ -871,60 +872,61 @@ class L3VariableTime(Realm): if split_row[0].lower() == 'chanspec': print("6g chanspec found xtop_reported = True") xtop_reported = True - except: + except BaseException: print("6g Error reading xtop") # ap information is passed with ap_row so all information needs to be contained in ap_row ap_row.append(str(channel_utilization)) print("6g channel_utilization {channel_utilization}".format(channel_utilization=channel_utilization)) print("6g ap_row {ap_row}".format(ap_row=ap_row)) - ap_stats_6g_col_titles = ['Station Address','PHY Mbps','Data Mbps','Air Use','Data Use','Retries','bw','mcs','Nss','ofdma','mu-mimo','channel_utilization'] + ap_stats_6g_col_titles = ['Station Address', 'PHY Mbps', 'Data Mbps', 'Air Use', + 'Data Use', 'Retries', 'bw', 'mcs', 'Nss', 'ofdma', 'mu-mimo', 'channel_utilization'] self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll , ap_row, ap_stats_6g_col_titles) #ap_stats_5g_col_titles used as a length + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row, ap_stats_6g_col_titles) # ap_stats_5g_col_titles used as a length # 5G test mode if self.ap_test_mode: # Create the test data as a continuous string - ap_stats_5g="{}{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 bs_data\n", - "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", - "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", - "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", - "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", - "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n", - "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") + ap_stats_5g = "{}{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 bs_data\n", + "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", + "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", + "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", + "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", + "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n", + "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") print("ap_stats 5g {}".format(ap_stats_5g)) # Create the test data as a continuous string ap_chanim_stats_5g = "{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 chanim_stats\n", - "version: 3\n", - "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", - #`"0xe06a 61 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") - '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') - #"0xe06a 1.67 15.00 0.00 17.00 0.00 0.00 97.33 53.00 2.00 0 0 -91 65 343370578\n") + "version: 3\n", + "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", + # `"0xe06a 61 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") + '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') + # "0xe06a 1.67 15.00 0.00 17.00 0.00 0.00 97.33 53.00 2.00 0 0 -91 65 343370578\n") else: # read from the AP ap_stats_5g = self.read_ap_stats_5g() ap_chanim_stats_5g = self.read_ap_chanim_stats_5g() - + ap_stats_5g_rows = ap_stats_5g.splitlines() print("From AP stats: ap_stats_5g_rows {}".format(ap_stats_5g_rows)) ap_chanim_stats_rows_5g = ap_chanim_stats_5g.splitlines() print("From AP chanim: ap_chanim_stats_rows_5g {}".format(ap_chanim_stats_rows_5g)) channel_utilization = 0 - + # Query all of our ports # Note: the endp eid is the shelf.resource.port.endp-id port_eids = self.gather_port_eids() for eid_name in port_eids: eid = self.name_to_eid(eid_name) - url = "/port/%s/%s/%s"%(eid[0], eid[1], eid[2]) + url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("query-port 5g: %s: incomplete response:"%(url)) + print("query-port 5g: %s: incomplete response:" % (url)) pprint(response) else: # print("response".format(response)) @@ -932,8 +934,8 @@ class L3VariableTime(Realm): p = response['interface'] print("#### From LANforge: p, response['insterface']:{}".format(p)) mac = p['mac'] - #print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) - + # print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) + # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_5g_rows: split_row = row.split() @@ -945,20 +947,21 @@ class L3VariableTime(Realm): mac_found_5g = True else: try: - # split_row[0].lower() , mac from AP + # split_row[0].lower() , mac from AP # mac.lower() , mac from LANforge if split_row[0].lower() == mac.lower(): ap_row = split_row mac_found_5g = True - except: + except BaseException: print("5g 'No stations are currently associated.'? from AP") print("5g since possibly no stations: excption on compare split_row[0].lower() ") if mac_found_5g == True: - mac_found_5g = False + mac_found_5g = False print("5g selected ap_row (from split_row): {}".format(ap_row)) # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port(p["port"], endps) + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( + p["port"], endps) # now report the ap_chanim_stats along side of the ap_stats_5g xtop_reported = False @@ -970,83 +973,84 @@ class L3VariableTime(Realm): try: xtop = split_row[7] print("5g xtop {xtop}".format(xtop=xtop)) - except: + except BaseException: print("5g detected chanspec with reading chanim_stats, exception reading xtop") - try: + try: channel_utilization = float(100) - float(xtop) print("5g channel_utilization {utilization}".format(utilization=channel_utilization)) - except: + except BaseException: print("5g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") - # should be only one channel utilization - break + # should be only one channel utilization + break else: try: if split_row[0].lower() == 'chanspec': print("5g chanspec found xtop_reported = True") xtop_reported = True - except: + except BaseException: print("5g Error reading xtop") # ap information is passed with ap_row so all information needs to be contained in ap_row ap_row.append(str(channel_utilization)) print("5g channel_utilization {channel_utilization}".format(channel_utilization=channel_utilization)) print("5g ap_row {ap_row}".format(ap_row=ap_row)) - ap_stats_5g_col_titles = ['Station Address','PHY Mbps','Data Mbps','Air Use','Data Use','Retries','bw','mcs','Nss','ofdma','mu-mimo','channel_utilization'] + ap_stats_5g_col_titles = ['Station Address', 'PHY Mbps', 'Data Mbps', 'Air Use', + 'Data Use', 'Retries', 'bw', 'mcs', 'Nss', 'ofdma', 'mu-mimo', 'channel_utilization'] self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll , ap_row, ap_stats_5g_col_titles) #ap_stats_5g_col_titles used as a length + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row, ap_stats_5g_col_titles) # ap_stats_5g_col_titles used as a length # 2g test mode if self.ap_test_mode: # Create the test data as a continuous string - ap_stats_2g="{}{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl0 bs_data\n", - "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", - "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", - "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", - "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", - "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n", - "- note the MAC will match ap_stats_2g.append((overall) - 200.2 26.5% - - \n") + ap_stats_2g = "{}{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl0 bs_data\n", + "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", + "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", + "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", + "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", + "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n", + "- note the MAC will match ap_stats_2g.append((overall) - 200.2 26.5% - - \n") print("ap_stats_2g {}".format(ap_stats_2g)) # Create the test data as a continuous string ap_chanim_stats_2g = "{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 chanim_stats\n", - "version: 3\n", - "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", - #"0xe06a 62 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") - '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') - #"0xe06a 1.67 15.00 0.00 17.00 0.00 0.00 97.33 53.00 2.00 0 0 -91 65 343370578\n") + "version: 3\n", + "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", + # "0xe06a 62 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") + '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') + # "0xe06a 1.67 15.00 0.00 17.00 0.00 0.00 97.33 53.00 2.00 0 0 -91 65 343370578\n") else: # read from the AP ap_stats_2g = self.read_ap_stats_2g() ap_chanim_stats_2g = self.read_ap_chanim_stats_2g() - + ap_stats_2g_rows = ap_stats_2g.splitlines() print("From AP stats: ap_stats_2g_rows {}".format(ap_stats_2g_rows)) ap_chanim_stats_rows_2g = ap_chanim_stats_2g.splitlines() print("From AP chanim: ap_chanim_stats_rows_2g {}".format(ap_chanim_stats_rows_2g)) channel_utilization = 0 - + # Query all of our ports # Note: the endp eid is the shelf.resource.port.endp-id port_eids = self.gather_port_eids() for eid_name in port_eids: eid = self.name_to_eid(eid_name) - url = "/port/%s/%s/%s"%(eid[0], eid[1], eid[2]) + url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("2g query-port: %s: incomplete response:"%(url)) + print("2g query-port: %s: incomplete response:" % (url)) pprint(response) else: # print("response".format(response)) pprint(response) p = response['interface'] - #print("#### From LANforge: p, response['insterface']:{}".format(p)) + # print("#### From LANforge: p, response['insterface']:{}".format(p)) mac = p['mac'] - #print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) - + # print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) + # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_2g_rows: split_row = row.split() @@ -1058,20 +1062,21 @@ class L3VariableTime(Realm): mac_found_2g = True else: try: - # split_row[0].lower() , mac from AP + # split_row[0].lower() , mac from AP # mac.lower() , mac from LANforge if split_row[0].lower() == mac.lower(): ap_row = split_row mac_found_2g = True - except: + except BaseException: print("2g 'No stations are currently associated.'? from AP") print("2g since possibly no stations: excption on compare split_row[0].lower() ") if mac_found_2g == True: - mac_found_2g = False + mac_found_2g = False print("2g selected ap_row (from split_row): {}".format(ap_row)) # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port(p["port"], endps) + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( + p["port"], endps) # now report the ap_chanim_stats along side of the ap_stats_2g xtop_reported = False @@ -1083,33 +1088,34 @@ class L3VariableTime(Realm): try: xtop = split_row[7] print("2g xtop {xtop}".format(xtop=xtop)) - except: + except BaseException: print("2g detected chanspec with reading chanim_stats, exception reading xtop") try: channel_utilization = float(100) - float(xtop) print("2g channel_utilization {utilization}".format(utilization=channel_utilization)) - except: + except BaseException: print("2g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") - # should be only one channel utilization - break + # should be only one channel utilization + break else: try: if split_row[0].lower() == 'chanspec': print("2g chanspec found xtop_reported = True") xtop_reported = True - except: + except BaseException: print("2g Error reading xtop") # ap information is passed with ap_row so all information needs to be contained in ap_row ap_row.append(str(channel_utilization)) print("2g channel_utilization {channel_utilization}".format(channel_utilization=channel_utilization)) print("2g ap_row {ap_row}".format(ap_row=ap_row)) - ap_stats_2g_col_titles = ['Station Address','PHY Mbps','Data Mbps','Air Use','Data Use','Retries','bw','mcs','Nss','ofdma','mu-mimo','channel_utilization'] + ap_stats_2g_col_titles = ['Station Address', 'PHY Mbps', 'Data Mbps', 'Air Use', + 'Data Use', 'Retries', 'bw', 'mcs', 'Nss', 'ofdma', 'mu-mimo', 'channel_utilization'] self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row, ap_stats_2g_col_titles) #ap_stats_2g_col_titles used as a length + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row, ap_stats_2g_col_titles) # ap_stats_2g_col_titles used as a length else: @@ -1118,22 +1124,32 @@ class L3VariableTime(Realm): port_eids = self.gather_port_eids() for eid_name in port_eids: eid = self.name_to_eid(eid_name) - url = "/port/%s/%s/%s"%(eid[0], eid[1], eid[2]) + url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) response = self.json_get(url) if (response is None) or ("interface" not in response): - print("query-port: %s: incomplete response:"%(url)) + print("query-port: %s: incomplete response:" % (url)) pprint(response) else: p = response['interface'] - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll= self.get_endp_stats_for_port(p["port"], endps) - - self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row, ap_stats_col_titles) #ap_stats_col_titles used as a length + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( + p["port"], endps) + self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row, ap_stats_col_titles) # ap_stats_col_titles used as a length # At end of test step, record KPI information. This is different the kpi.csv - self.record_kpi(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps) + self.record_kpi( + len(temp_stations_list), + ul, + dl, + ul_pdu_str, + dl_pdu_str, + atten_val, + total_dl_bps, + total_ul_bps, + total_dl_ll_bps, + total_ul_ll_bps) # At end of test if requested store upload and download stats if self.ap_scheduler_stats: @@ -1152,7 +1168,6 @@ class L3VariableTime(Realm): # get the (DL) Download 24g schduler staticstics self.ap_24g_msched += self.ap_custom_cmd('wl -i wl0 dump msched') - if self.ap_ofdma_stats: # provide OFDMA stats 6GHz self.ap_ofdma_6g += self.ap_custom_cmd('wl -i wl2 muinfo -v') @@ -1170,19 +1185,19 @@ class L3VariableTime(Realm): cur_time = datetime.datetime.now() if passes == expected_passes: - self._pass("PASS: Requested-Rate: %s <-> %s PDU: %s <-> %s All tests passed" % (ul, dl, ul_pdu, dl_pdu), print_pass) + self._pass("PASS: Requested-Rate: %s <-> %s PDU: %s <-> %s All tests passed" % (ul, dl, ul_pdu, dl_pdu), print_pass) - def write_port_csv(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, eid_name, port_data, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row, ap_stats_col_titles): + def write_port_csv(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, eid_name, port_data, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row, ap_stats_col_titles): row = [self.epoch_time, self.time_stamp(), sta_count, ul, ul, dl, dl, dl_pdu, dl_pdu, ul_pdu, ul_pdu, atten, eid_name ] row = row + [port_data['bps rx'], port_data['bps tx'], port_data['rx-rate'], port_data['tx-rate'], - port_data['signal'], port_data['ap'], port_data['mode'], latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll] + port_data['signal'], port_data['ap'], port_data['mode'], latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll] - #Add in info queried from AP. NOTE: do not need to pass in the ap_stats_col_titles + # Add in info queried from AP. NOTE: do not need to pass in the ap_stats_col_titles #print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) #print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) if len(ap_row) == len(self.ap_stats_col_titles): @@ -1195,8 +1210,8 @@ class L3VariableTime(Realm): writer.writerow(row) self.port_csv_files[eid_name].flush() - # Submit data to the influx db if configured to do so. + def record_kpi(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps): tags = dict() @@ -1214,7 +1229,8 @@ class L3VariableTime(Realm): now = str(datetime.datetime.utcnow().isoformat()) - print("NOTE: Adding kpi to influx, total-download-bps: %s upload: %s bi-directional: %s\n"%(total_dl_bps, total_ul_bps, (total_ul_bps + total_dl_bps))) + print("NOTE: Adding kpi to influx, total-download-bps: %s upload: %s bi-directional: %s\n" % + (total_dl_bps, total_ul_bps, (total_ul_bps + total_dl_bps))) if self.influxdb is not None: self.influxdb.post_to_influx("total-download-bps", total_dl_bps, tags, now) @@ -1251,17 +1267,17 @@ class L3VariableTime(Realm): station_profile.cleanup() def csv_generate_column_headers(self): - csv_rx_headers = ['Time epoch','Time','Monitor', - 'UL-Min-Requested','UL-Max-Requested','DL-Min-Requested','DL-Max-Requested', - 'UL-Min-PDU','UL-Max-PDU','DL-Min-PDU','DL-Max-PDU', + csv_rx_headers = ['Time epoch', 'Time', 'Monitor', + 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', + 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', ] csv_rx_headers.append("average_rx_data_bytes") return csv_rx_headers def csv_generate_port_column_headers(self): csv_rx_headers = ['Time epoch', 'Time', 'Station-Count', - 'UL-Min-Requested','UL-Max-Requested','DL-Min-Requested','DL-Max-Requested', - 'UL-Min-PDU','UL-Max-PDU','DL-Min-PDU','DL-Max-PDU','Attenuation', + 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', + 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', 'Attenuation', 'Name', 'Rx-Bps', 'Tx-Bps', 'Rx-Link-Rate', 'Tx-Link-Rate', 'RSSI', 'AP', 'Mode', 'Rx-Latency', 'Rx-Jitter', 'Ul-Rx-Goodput-bps', 'Ul-Rx-Rate-ll', 'Ul-Rx-Pkts-ll', 'Dl-Rx-Goodput-bps', 'Dl-Rx-Rate-ll', 'Dl-Rx-Pkts-ll' ] @@ -1273,10 +1289,10 @@ class L3VariableTime(Realm): def csv_generate_kpi_column_headers(self): csv_rx_headers = ['Time epoch', 'Time', 'Station-Count', - 'UL-Min-Requested','UL-Max-Requested','DL-Min-Requested','DL-Max-Requested', - 'UL-Min-PDU','UL-Max-PDU','DL-Min-PDU','DL-Max-PDU','Attenuation', + 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', + 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', 'Attenuation', 'Total-Download-Bps', 'Total-Upload-Bps', 'Total-UL/DL-Bps', - 'Total-Download-LL-Bps', 'Total-Upload-LL-Bps','Total-UL/DL-LL-Bps' + 'Total-Download-LL-Bps', 'Total-Upload-LL-Bps', 'Total-UL/DL-LL-Bps' ] for k in self.user_tags: csv_rx_headers.append(k[0]) @@ -1284,30 +1300,30 @@ class L3VariableTime(Realm): return csv_rx_headers # Write initial headers to csv file. - def csv_add_column_headers(self,headers): + def csv_add_column_headers(self, headers): if self.csv_kpi_file is not None: self.csv_kpi_writer.writerow(self.csv_generate_kpi_column_headers()) self.csv_kpi_file.flush() # Write initial headers to port csv file. def csv_add_port_column_headers(self, eid_name, headers): - #if self.csv_file is not None: + # if self.csv_file is not None: fname = self.outfile[:-4] # Strip '.csv' from file name fname = fname + "-" + eid_name + ".csv" pfile = open(fname, "w") port_csv_writer = csv.writer(pfile, delimiter=",") self.port_csv_files[eid_name] = pfile self.port_csv_writers[eid_name] = port_csv_writer - + port_csv_writer.writerow(headers) pfile.flush() def csv_validate_list(self, csv_list, length): if len(csv_list) < length: - csv_list = csv_list + [('no data','no data')] * (length - len(csv_list)) + csv_list = csv_list + [('no data', 'no data')] * (length - len(csv_list)) return csv_list - def csv_add_row(self,row,writer,csv_file): + def csv_add_row(self, row, writer, csv_file): if csv_file is not None: writer.writerow(row) csv_file.flush() @@ -1315,10 +1331,12 @@ class L3VariableTime(Realm): # End of the main class. # Check some input values. + + def valid_endp_types(_endp_type): etypes = _endp_type.split(',') for endp_type in etypes: - valid_endp_type=['lf','lf_udp','lf_udp6','lf_tcp','lf_tcp6','mc_udp','mc_udp6'] + valid_endp_type = ['lf', 'lf_udp', 'lf_udp6', 'lf_tcp', 'lf_tcp6', 'mc_udp', 'mc_udp6'] if not (str(endp_type) in valid_endp_type): print('invalid endp_type: %s. Valid types lf, lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6' % endp_type) exit(1) @@ -1334,29 +1352,29 @@ def main(): parser = argparse.ArgumentParser( prog='test_l3_longevity.py', - #formatter_class=argparse.RawDescriptionHelpFormatter, + # formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawTextHelpFormatter, epilog='''\ Useful Information: 1. Polling interval for checking traffic is fixed at 1 minute - 2. The test will generate csv file + 2. The test will generate csv file 3. The tx/rx rates are fixed at 256000 bits per second 4. Maximum stations per radio based on radio ''', - + description='''\ test_l3_longevity.py: -------------------- -Summary : +Summary : ---------- -create stations, create traffic between upstream port and stations, run traffic. +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 received. Generic command layout: ----------------------- -python .\\test_l3_longevity.py --test_duration --endp_type --upstream_port +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 @@ -1366,13 +1384,13 @@ Multiple radios may be entered with individual --radio switches --radio "radio==1.1.wiphy2 stations==1 ssid==ASUS_70 ssid_pw==[BLANK] security==open" \ --test_duration 30s -: number followed by one of the following +: number followed by one of the following d - days h - hours m - minutes s - seconds -: +: lf_udp : IPv4 UDP traffic lf_tcp : IPv4 TCP traffic lf_udp6 : IPv6 UDP traffic @@ -1380,7 +1398,7 @@ 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. ################################# @@ -1398,7 +1416,7 @@ BK, BE, VI, VO: Optional wifi related Tos Settings. Or, use your preferred num ######################################### # Examples -# ####################################### +# ####################################### Example #1 running traffic with two radios 1. Test duration 4 minutes 2. Traffic IPv4 TCP @@ -1408,37 +1426,43 @@ Example #1 running traffic with two radios 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 +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" ''') - parser.add_argument('--local_lf_report_dir', help='--local_lf_report_dir override the report path, primary use when running test in test suite',default="") - parser.add_argument('-o','--csv_outfile', help="--csv_outfile ", default="") + parser.add_argument( + '--local_lf_report_dir', + help='--local_lf_report_dir override the report path, primary use when running test in test suite', + default="") + parser.add_argument('-o', '--csv_outfile', help="--csv_outfile ", default="") - parser.add_argument('--tty', help='--tty \"/dev/ttyUSB2\" the serial interface to the AP',default="") - parser.add_argument('--baud', help='--baud \"9600\" AP baud rate for the serial interface',default="9600") + parser.add_argument('--tty', help='--tty \"/dev/ttyUSB2\" the serial interface to the AP', default="") + parser.add_argument('--baud', help='--baud \"9600\" AP baud rate for the serial interface', default="9600") parser.add_argument('--amount_ports_to_reset', help='--amount_ports_to_reset \" \" ', default=None) parser.add_argument('--port_reset_seconds', help='--ports_reset_seconds \" \" ', default="10 30") - parser.add_argument('--lfmgr', help='--lfmgr ',default='localhost') - parser.add_argument('--test_duration', help='--test_duration example --time 5d (5 days) default: 3m options: number followed by d, h, m or s',default='3m') - parser.add_argument('--tos', help='--tos: Support different ToS settings: BK | BE | VI | VO | numeric',default="BE") - parser.add_argument('--debug', help='--debug flag present debug on enable debugging',action='store_true') + parser.add_argument('--lfmgr', help='--lfmgr ', default='localhost') + parser.add_argument( + '--test_duration', + help='--test_duration example --time 5d (5 days) default: 3m options: number followed by d, h, m or s', + default='3m') + parser.add_argument('--tos', help='--tos: Support different ToS settings: BK | BE | VI | VO | numeric', default="BE") + parser.add_argument('--debug', help='--debug flag present debug on enable debugging', action='store_true') 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('-u', '--upstream_port', help='--upstream_port example: --upstream_port eth1', default='eth1') parser.add_argument('--downstream_port', help='--downstream_port example: --downstream_port eth2') parser.add_argument('--polling_interval', help="--polling_interval ", default='60s') - parser.add_argument('-r','--radio', action='append', nargs=1, help='--radio \ + parser.add_argument('-r', '--radio', action='append', nargs=1, help='--radio \ \"radio== ssid== ssid_pw== security==\" ') parser.add_argument('--ap_read', help='--ap_read flag present enable reading ap', action='store_true') - parser.add_argument('--ap_port', help='--ap_port \'/dev/ttyUSB0\'',default='/dev/ttyUSB0') - parser.add_argument('--ap_baud', help='--ap_baud \'115200\'',default='115200') + parser.add_argument('--ap_port', help='--ap_port \'/dev/ttyUSB0\'', default='/dev/ttyUSB0') + parser.add_argument('--ap_baud', help='--ap_baud \'115200\'', default='115200') # note wl2 is the 6G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection (default may be eth8) parser.add_argument('--ap_cmd_6g', help='ap_cmd_5g \'wl -i wl2 bs_data\'', default="wl -i wl2 bs_data") # note wl1 is the 5G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection (default may be eth7) @@ -1448,32 +1472,40 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m parser.add_argument('--ap_chanim_cmd_6g', help='ap_chanim_cmd_6g \'wl -i wl2 chanim_stats\'', default="wl -i wl2 chanim_stats") parser.add_argument('--ap_chanim_cmd_5g', help='ap_chanim_cmd_5g \'wl -i wl1 chanim_stats\'', default="wl -i wl1 chanim_stats") parser.add_argument('--ap_chanim_cmd_2g', help='ap_chanim_cmd_2g \'w1 -i wl0 chanim_stats\'', default="wl -i wl0 chanim_stats") - parser.add_argument('--ap_scheduler_stats', help='--ap_scheduler_stats flag to clear stats run test then dump ul and dl stats to file', action='store_true') - parser.add_argument('--ap_ofdma_stats', help='--ap_ofdma_stats flag to clear stats run test then dumps wl -i wl1 muinfo -v and wl 0i wl0 muinof -v to file', action='store_true') + parser.add_argument( + '--ap_scheduler_stats', + help='--ap_scheduler_stats flag to clear stats run test then dump ul and dl stats to file', + action='store_true') + parser.add_argument( + '--ap_ofdma_stats', + help='--ap_ofdma_stats flag to clear stats run test then dumps wl -i wl1 muinfo -v and wl 0i wl0 muinof -v to file', + action='store_true') parser.add_argument('--ap_test_mode', help='ap_test_mode flag present use ap canned data', action='store_true') - parser.add_argument('-amr','--side_a_min_bps', + parser.add_argument('-amr', '--side_a_min_bps', help='--side_a_min_bps, requested downstream min tx rate, comma separated list for multiple iterations. Default 256k', default="256000") - parser.add_argument('-amp','--side_a_min_pdu', + parser.add_argument('-amp', '--side_a_min_pdu', help='--side_a_min_pdu, downstream pdu size, comma separated list for multiple iterations. Default MTU', default="MTU") - parser.add_argument('-bmr','--side_b_min_bps', + parser.add_argument('-bmr', '--side_b_min_bps', help='--side_b_min_bps, requested upstream min tx rate, comma separated list for multiple iterations. Default 256000', default="256000") - parser.add_argument('-bmp','--side_b_min_pdu', + parser.add_argument('-bmp', '--side_b_min_pdu', help='--side_b_min_pdu, upstream pdu size, comma separated list for multiple iterations. Default MTU', default="MTU") parser.add_argument("--rates_are_totals", default=False, help="Treat configured rates as totals instead of using the un-modified rate for every connection.", action='store_true') parser.add_argument("--multiconn", default=1, help="Configure multi-conn setting for endpoints. Default is 1 (auto-helper is enabled by default as well).") - parser.add_argument('--attenuators', help='--attenuators, comma separated list of attenuator module eids: shelf.resource.atten-serno.atten-idx', default="") + parser.add_argument( + '--attenuators', + help='--attenuators, comma separated list of attenuator module eids: shelf.resource.atten-serno.atten-idx', + default="") parser.add_argument('--atten_vals', help='--atten_vals, comma separated list of attenuator settings in ddb units (1/10 of db)', default="") influx_add_parser_args(parser) - parser.add_argument("--cap_ctl_out", help="--cap_ctl_out, switch the controller output will be captured", action='store_true') - parser.add_argument("--wait", help="--wait - - ") + + ") else echo "No errors detected" results+=(" - + ") fi } From 3e2def4e5f3e3b1490b271d6519562017dc6e0f2 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 3 Nov 2021 14:28:35 -0700 Subject: [PATCH 232/731] Correct links in regression_test.sh Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index ec0ccf80..93bd3541 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -20,7 +20,7 @@ Help() echo "If using the help flag, put the H flag at the end of the command after other flags." } -while getopts ":h:s:p:w:m:A:r:F:B:U:D:L:H:" option; do +while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:L:H:" option; do case "${option}" in h) # display Help Help @@ -29,6 +29,9 @@ while getopts ":h:s:p:w:m:A:r:F:B:U:D:L:H:" option; do s) SSID_USED=${OPTARG} ;; + S) + SHORT="yes" + ;; p) PASSWD_USED=${OPTARG} ;; @@ -136,7 +139,7 @@ fi TEST_DIR="${REPORT_DATA}/${NOW}" function run_l3_longevity() { - ./test_l3_longevity.py --test_duration 15s --upstream_port eth1 --radio "radio==wiphy0 stations==4 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY" --radio "radio==wiphy1 stations==4 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY" --mgr "$MGR" + ./test_l3_longevity.py --test_duration 15s --upstream_port eth1 --radio "radio==wiphy0 stations==4 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY" --radio "radio==wiphy1 stations==4 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY" --lfmgr "$MGR" } function testgroup_list_groups() { ./scenario.py --load test_l3_scenario_throughput @@ -152,10 +155,10 @@ function testgroup_delete_group() { ./testgroup.py --group_name group1--del_group --debug --mgr "$MGR" } -if [[ $MGR == "short" ]]; then +if [[ ${#SHORT} -gt 0 ]]; then testCommands=( run_l3_longevity - "./test_ipv4_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format excel --layer3_cols $COL_NAMES --debug --mgr $MGR" + "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" ) else testCommands=( @@ -462,13 +465,13 @@ function test() { echo "Errors detected" results+=(" - - ") + + ") else echo "No errors detected" results+=(" - + ") fi } @@ -548,9 +551,9 @@ function html_generator() { rm -f "${HOMEPATH}/html-reports/latest.html" fi ln -s "${fname}" "${HOMEPATH}/html-reports/latest.html" - HOSTNAME=$(ip -4 addr show enp3s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}') - content="View the latest regression report at ${HOSTNAME}/html-reports/latest.html" - echo "${content}" + #HOSTNAME=$(ip -4 addr show enp3s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}') + #content="View the latest regression report at /html-reports/latest.html" + #echo "${content}" #mail -s "Regression Results" scripters@candelatech.com <<<$content } @@ -558,7 +561,7 @@ results=() NOW=$(date +"%Y-%m-%d-%H-%M") NOW="${NOW/:/-}" TEST_DIR="${REPORT_DATA}/${NOW}" -URL2="${HOMEPATH}/report-data/${NOW}" +URL2="/report-data/${NOW}" mkdir "${TEST_DIR}" echo "Recording data to $TEST_DIR" From 861e9b127c6208c64c2e741dd22f0aabdf53a792 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 3 Nov 2021 15:44:08 -0700 Subject: [PATCH 233/731] Improve sta_name argparse variable Signed-off-by: Matthew Stidham --- py-scripts/sta_scan_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-scripts/sta_scan_test.py b/py-scripts/sta_scan_test.py index 6b5d3f0a..f75aba01 100755 --- a/py-scripts/sta_scan_test.py +++ b/py-scripts/sta_scan_test.py @@ -131,7 +131,8 @@ def main(): ''') parser.add_argument('--mode', help='Used to force mode of stations') - parser.add_argument('--sta_name', help='Name of station to be used', default=["sta0000"]) + parser.add_argument('--sta_name', help='Optional: User defined station names, can be a comma or space separated list', nargs='+', + default=["sta0000"]) args = parser.parse_args() From 25d40a7a6a470624c55fc4cdd06fa1cef206cca5 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 3 Nov 2021 12:53:29 -0700 Subject: [PATCH 234/731] JAG: logging class and string util methods extracted to independent modules This allows py-scripts and py-json modules to access this logic independent of the lanforge_api.py module. Signed-off-by: Jed Reynolds --- lanforge_client/lanforge_api.py | 236 +----------------------------- lanforge_client/logg.py | 247 ++++++++++++++++++++++++++++++++ lanforge_client/strutil.py | 20 +++ 3 files changed, 271 insertions(+), 232 deletions(-) create mode 100644 lanforge_client/logg.py create mode 100644 lanforge_client/strutil.py diff --git a/lanforge_client/lanforge_api.py b/lanforge_client/lanforge_api.py index 7e4357f6..c61f08e5 100644 --- a/lanforge_client/lanforge_api.py +++ b/lanforge_client/lanforge_api.py @@ -86,6 +86,9 @@ import inspect import json import logging from logging import Logger +# from lanforge_client.logg import Logg +# from lanforge_client.strutil import * +from logg import Logg from pprint import pprint, pformat import time import traceback @@ -216,237 +219,6 @@ def print_diagnostics(url_: str = None, exit(1) -class Logg: - """ - This method presently defines various log "levels" but does not yet express - ability to log "areas" or "keywords". - - TODO: - - LOG BUFFER a list that only holds last 100 lines logged to it. This is useful - for emitting when an exception happens in a loop and you are not interested - in the first 10e6 log entries - - - KEYWORD LOGGING: pair a --debug_kw=keyword,keyword set on the command line to only - recieve log output from log statements matching those keywords - - - CLASS/METHOD/FUNCTION logging: --debug_fn=class.method,module.func set on the command - line that activates logging in the method or function listed. See inspection techniques - listed near this SO question https://stackoverflow.com/a/5104943/11014343 - - - BITWISE LOG LEVELS: --log_level=DEBUG|FILEIO|JSON|HTTP a maskable combination of enum_bitmask - names that combine to a value that can trigger logging. - - These reserved words may not be used as tags: - debug, debugging, debug_log, digest, file, gui, http, json, log, method, tag - - Please also consider how log messages can be formatted: - https://stackoverflow.com/a/20112491/11014343: - logging.basicConfig(format="[%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s") - """ - DEFAULT_LEVEL = logging.WARNING - DefaultLogger = LOGGER - method_name_list: list[str] = [] - tag_list: list[str] = [] - reserved_tags: list[str] = [ - "debug", - "debugging", - "debug_log", - "digest", - "file", - "gui", - "http", - "json", - "log", - "method", - "tag" - ] - - def __init__(self, - log_level: int = DEFAULT_LEVEL, - name: str = None, - filename: str = None, - debug: bool = False): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Base class that can be used to send logging messages elsewhere. extend this - in order to send log messages from this framework elsewhere. - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - self.level = log_level - self.logger: Logger - - self.start_time = datetime.now() - self.start_time_str = time.strftime("%Y%m%d-%I:%M%:%S") - if name: - self.name = name - if "@" in name: - self.name = name.replace('@', self.start_time_str) - else: - self.name = "started-" + self.start_time_str - - self.logger = Logger(name, level=log_level) - if filename: - logging.basicConfig(filename=filename, filemode="a") - if debug: - self.logg(level=logging.WARNING, - msg="Logger {name} begun to {filename}".format(name=name, - filename=filename)) - - @classmethod - def logg(cls, - level: int = logging.WARNING, - msg: str = None): - """ - Use this *class method* to send logs to the DefaultLogger instance created when this class was created - :param level: - :param msg: - :return: - """ - if _not(msg): - return - if level == logging.CRITICAL: - cls.DefaultLogger.critical(msg) - return - if level == logging.ERROR: - cls.DefaultLogger.error(msg) - return - if level == logging.WARNING: - cls.DefaultLogger.warning(msg) - return - if level == logging.INFO: - cls.DefaultLogger.info(msg) - return - if level == logging.DEBUG: - cls.DefaultLogger.debug(msg) - return - - def by_level(self, - level: int = logging.WARNING, - msg: str = None): - """ - Use this *instance* version of the method for logging when you have a specific logger - customized for a purpose. Otherwise please use Logg.logg(). - :param level: python logging priority - :param msg: text to send to logging channel - :return: None - """ - if _not(msg): - return - - if level == logging.CRITICAL: - self.logger.critical(msg) - return - - if level == logging.ERROR: - self.logger.error(msg) - return - - if level == logging.WARNING: - self.logger.warning(msg) - return - - if level == logging.INFO: - self.logger.info(msg) - return - - if level == logging.DEBUG: - self.logger.debug(msg) - return - print("UNKNOWN: " + msg) - - def error(self, message: str = None): - if not message: - return - self.logg(level=logging.ERROR, msg=message) - - def warning(self, message: str = None): - if not message: - return - self.logg(level=logging.WARNING, msg=message) - - def info(self, message: str = None): - if not message: - return - self.logg(level=logging.INFO, msg=message) - - def debug(self, message: str = None): - if not message: - return - self.logg(level=logging.DEBUG, msg=message) - - @classmethod - def register_method_name(cls, methodname: str = None) -> None: - """ - Use this method to register names of functions you want to allow logging from - :param methodname: - :return: - """ - if not methodname: - return - cls.method_name_list.append(methodname) - if methodname not in cls.tag_list: - cls.tag_list.append(methodname) - - @classmethod - def register_tag(cls, tag: str = None) -> None: - """ - Use this method to register keywords you want to allow logging from. - There are a list of reserved tags which will not be accepted. - :return: - """ - if not tag: - return - if tag in cls.tag_list: - return - if tag in cls.reserved_tags: - cls.logg(level=logging.ERROR, - msg=f"tag [{tag}] is reserved, ignoring") - # note: add directly to tag_list to append a reserved tag - cls.tag_list.append(tag) - - @classmethod - def by_method(cls, msg: str = None) -> None: - """ - should only log if we're in the method_list - reminder: https://stackoverflow.com/a/13514318/11014343 - import inspect - import types - from typing import cast - this_fn_name = cat(types.FrameType, inspect.currentframe()).f_code.co_name - :return: None - """ - try: - caller = inspect.currentframe().f_back.f_code.co_name - - if caller in cls.method_name_list: - cls.logg(level=cls.DEFAULT_LEVEL, msg=f"[{caller}] {msg}") - - except Exception as e: - pprint(e) - pass - - @classmethod - def by_tag(cls, tag: str = None, msg: str = None) -> None: - """ - should only log if we're in the method_list - reminder: https://stackoverflow.com/a/13514318/11014343 - import inspect - import types - from typing import cast - this_fn_name = cat(types.FrameType, inspect.currentframe()).f_code.co_name - :return: - """ - if (not cls.tag_list) or (tag not in cls.tag_list): - return - - cls.logg(level=cls.DEFAULT_LEVEL, msg=f"[{tag}] {msg}") - - def enable(self, reserved_tag: str = None) -> None: - if (not reserved_tag) or (reserved_tag not in self.reserved_tags): - return - if reserved_tag in self.tag_list: - return - self.tag_list.append(reserved_tag) - class BaseLFJsonRequest: """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- @@ -477,7 +249,7 @@ class BaseLFJsonRequest: self.stream_warnings: bool = False if not session_obj: - LOGGER.warning("BaseLFJsonRequest: no session instance") + logging.getLogger(__name__).warning("BaseLFJsonRequest: no session instance") else: self.session_instance = session_obj self.session_id = session_obj.get_session_id() diff --git a/lanforge_client/logg.py b/lanforge_client/logg.py new file mode 100644 index 00000000..9c39eebc --- /dev/null +++ b/lanforge_client/logg.py @@ -0,0 +1,247 @@ +import sys + +if sys.version_info[0] != 3: + print("This script requires Python 3") + exit() + +import logging +from logging import Logger +import time +import datetime +import inspect +import traceback +from typing import Optional +from pprint import pprint, pformat +from strutil import nott, iss + +class Logg: + """ + This method presently defines various log "levels" but does not yet express + ability to log "areas" or "keywords". + + TODO: + - LOG BUFFER a list that only holds last 100 lines logged to it. This is useful + for emitting when an exception happens in a loop and you are not interested + in the first 10e6 log entries + + - KEYWORD LOGGING: pair a --debug_kw=keyword,keyword set on the command line to only + recieve log output from log statements matching those keywords + + - CLASS/METHOD/FUNCTION logging: --debug_fn=class.method,module.func set on the command + line that activates logging in the method or function listed. See inspection techniques + listed near this SO question https://stackoverflow.com/a/5104943/11014343 + + - BITWISE LOG LEVELS: --log_level=DEBUG|FILEIO|JSON|HTTP a maskable combination of enum_bitmask + names that combine to a value that can trigger logging. + + These reserved words may not be used as tags: + debug, debugging, debug_log, digest, file, gui, http, json, log, method, tag + + Please also consider how log messages can be formatted: + https://stackoverflow.com/a/20112491/11014343: + logging.basicConfig(format="[%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s") + """ + DEFAULT_LEVEL = logging.WARNING + DefaultLogger = logging.getLogger(__name__) + method_name_list: list[str] = [] + tag_list: list[str] = [] + reserved_tags: list[str] = [ + "debug", + "debugging", + "debug_log", + "digest", + "file", + "gui", + "http", + "json", + "log", + "method", + "tag" + ] + + def __init__(self, + log_level: int = DEFAULT_LEVEL, + name: str = None, + filename: str = None, + debug: bool = False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Base class that can be used to send logging messages elsewhere. extend this + in order to send log messages from this framework elsewhere. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + self.level = log_level + self.logger: Logger + + self.start_time = datetime.now() + self.start_time_str = time.strftime("%Y%m%d-%I:%M%:%S") + if name: + self.name = name + if "@" in name: + self.name = name.replace('@', self.start_time_str) + else: + self.name = "started-" + self.start_time_str + + self.logger = Logger(name, level=log_level) + if filename: + logging.basicConfig(filename=filename, filemode="a") + if debug: + self.logg(level=logging.WARNING, + msg="Logger {name} begun to {filename}".format(name=name, + filename=filename)) + + @classmethod + def logg(cls, + level: int = logging.WARNING, + msg: str = None): + """ + Use this *class method* to send logs to the DefaultLogger instance created when this class was created + :param level: + :param msg: + :return: + """ + if nott(msg): + return + if level == logging.CRITICAL: + cls.DefaultLogger.critical(msg) + return + if level == logging.ERROR: + cls.DefaultLogger.error(msg) + return + if level == logging.WARNING: + cls.DefaultLogger.warning(msg) + return + if level == logging.INFO: + cls.DefaultLogger.info(msg) + return + if level == logging.DEBUG: + cls.DefaultLogger.debug(msg) + return + + def by_level(self, + level: int = logging.WARNING, + msg: str = None): + """ + Use this *instance* version of the method for logging when you have a specific logger + customized for a purpose. Otherwise please use Logg.logg(). + :param level: python logging priority + :param msg: text to send to logging channel + :return: None + """ + if nott(msg): + return + + if level == logging.CRITICAL: + self.logger.critical(msg) + return + + if level == logging.ERROR: + self.logger.error(msg) + return + + if level == logging.WARNING: + self.logger.warning(msg) + return + + if level == logging.INFO: + self.logger.info(msg) + return + + if level == logging.DEBUG: + self.logger.debug(msg) + return + print("UNKNOWN: " + msg) + + def error(self, message: str = None): + if not message: + return + self.logg(level=logging.ERROR, msg=message) + + def warning(self, message: str = None): + if not message: + return + self.logg(level=logging.WARNING, msg=message) + + def info(self, message: str = None): + if not message: + return + self.logg(level=logging.INFO, msg=message) + + def debug(self, message: str = None): + if not message: + return + self.logg(level=logging.DEBUG, msg=message) + + @classmethod + def register_method_name(cls, methodname: str = None) -> None: + """ + Use this method to register names of functions you want to allow logging from + :param methodname: + :return: + """ + if not methodname: + return + cls.method_name_list.append(methodname) + if methodname not in cls.tag_list: + cls.tag_list.append(methodname) + + @classmethod + def register_tag(cls, tag: str = None) -> None: + """ + Use this method to register keywords you want to allow logging from. + There are a list of reserved tags which will not be accepted. + :return: + """ + if not tag: + return + if tag in cls.tag_list: + return + if tag in cls.reserved_tags: + cls.logg(level=logging.ERROR, + msg=f"tag [{tag}] is reserved, ignoring") + # note: add directly to tag_list to append a reserved tag + cls.tag_list.append(tag) + + @classmethod + def by_method(cls, msg: str = None) -> None: + """ + should only log if we're in the method_list + reminder: https://stackoverflow.com/a/13514318/11014343 + import inspect + import types + from typing import cast + this_fn_name = cat(types.FrameType, inspect.currentframe()).f_code.co_name + :return: None + """ + try: + caller = inspect.currentframe().f_back.f_code.co_name + + if caller in cls.method_name_list: + cls.logg(level=cls.DEFAULT_LEVEL, msg=f"[{caller}] {msg}") + + except Exception as e: + pprint(e) + pass + + @classmethod + def by_tag(cls, tag: str = None, msg: str = None) -> None: + """ + should only log if we're in the method_list + reminder: https://stackoverflow.com/a/13514318/11014343 + import inspect + import types + from typing import cast + this_fn_name = cat(types.FrameType, inspect.currentframe()).f_code.co_name + :return: + """ + if (not cls.tag_list) or (tag not in cls.tag_list): + return + + cls.logg(level=cls.DEFAULT_LEVEL, msg=f"[{tag}] {msg}") + + def enable(self, reserved_tag: str = None) -> None: + if (not reserved_tag) or (reserved_tag not in self.reserved_tags): + return + if reserved_tag in self.tag_list: + return + self.tag_list.append(reserved_tag) + diff --git a/lanforge_client/strutil.py b/lanforge_client/strutil.py new file mode 100644 index 00000000..0a9dac1b --- /dev/null +++ b/lanforge_client/strutil.py @@ -0,0 +1,20 @@ +def iss(text: str) -> bool: + """ + + :param text: string to test + :return: true if text is at lease one non-whitespace character + """ + if text is None: + return False + if (len(text) == 0) or (text.strip() == ""): + return False + return True + + +def nott(text: str) -> bool: + """ + + :param text: + :return: opposite of is + """ + return not iss(text=text) From ba008b496882c1e151a3f7e7690840fb1b7e0074 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 3 Nov 2021 14:14:25 -0700 Subject: [PATCH 235/731] JAG: logg.py: fixes strutil import, adds tag parameter and return type to logg() Signed-off-by: Jed Reynolds --- lanforge_client/logg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lanforge_client/logg.py b/lanforge_client/logg.py index 9c39eebc..34a96be9 100644 --- a/lanforge_client/logg.py +++ b/lanforge_client/logg.py @@ -12,7 +12,7 @@ import inspect import traceback from typing import Optional from pprint import pprint, pformat -from strutil import nott, iss +from .strutil import nott, iss class Logg: """ @@ -92,7 +92,8 @@ class Logg: @classmethod def logg(cls, level: int = logging.WARNING, - msg: str = None): + tag: str = None, + msg: str = None) -> None: """ Use this *class method* to send logs to the DefaultLogger instance created when this class was created :param level: From 3a17f699cc5327f4cbc6e55e336205cd455f58d2 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 3 Nov 2021 14:14:52 -0700 Subject: [PATCH 236/731] LFUtils.py can now import Logg Signed-off-by: Jed Reynolds --- py-json/LANforge/LFUtils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index e5d7bb35..95d97270 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -12,6 +12,7 @@ from time import sleep from random import seed, randint import re import ipaddress +import logging if sys.version_info[0] != 3: print("This script requires Python 3") @@ -21,6 +22,7 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) LFRequest = importlib.import_module("py-json.LANforge.LFRequest") +Logg = importlib.import_module("lanforge_client.logg") # .Logg debug_printer = pprint.PrettyPrinter(indent=2) From 4f2fe934a3162854e0e2cb220a4163d7feb31ba2 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 3 Nov 2021 14:16:29 -0700 Subject: [PATCH 237/731] JAG: refactoring extracted string methods to strutil.py module Signed-off-by: Jed Reynolds --- lanforge_client/lanforge_api.py | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/lanforge_client/lanforge_api.py b/lanforge_client/lanforge_api.py index c61f08e5..8a02c04e 100644 --- a/lanforge_client/lanforge_api.py +++ b/lanforge_client/lanforge_api.py @@ -82,13 +82,11 @@ from enum import Enum from enum import IntFlag import http.client from http.client import HTTPResponse -import inspect import json import logging from logging import Logger -# from lanforge_client.logg import Logg -# from lanforge_client.strutil import * -from logg import Logg +from .logg import Logg +from .strutil import nott, iss from pprint import pprint, pformat import time import traceback @@ -108,17 +106,6 @@ def _now_sec() -> int: return round(time.time() * 1000 * 1000) -def _is(text: str) -> bool: - if text is None: - return False - if (len(text) == 0) or (text.strip() == ""): - return False - return True - - -def _not(text: str) -> bool: - return not _is(text=text) - def default_proxies() -> dict: return { @@ -277,7 +264,8 @@ class BaseLFJsonRequest: :param debug: turn on debugging :return: full url prepended with """ - if _not(url): + + if nott(url): raise Exception("%s: Bad url[%s]" % (__name__, url)) corrected_url: str = url @@ -288,7 +276,7 @@ class BaseLFJsonRequest: else: corrected_url = self.session_instance.get_lfclient_url() + '/' + url - if _not(corrected_url): + if nott(corrected_url): raise Exception("%s: Bad url[%s]" % (__name__, url)) if corrected_url.find('//'): @@ -479,9 +467,9 @@ class BaseLFJsonRequest: myrequest.headers['Content-type'] = 'application/json' sess_id = self.session_instance.get_session_id() - if _is(sess_id): + if iss(sess_id): myrequest.headers[SESSION_HEADER] = str(sess_id) - elif _is(session_id_): + elif iss(session_id_): myrequest.headers[SESSION_HEADER] = str(session_id_) else: self.logger.warning("Request sent without X-LFJson-ID header: " + url) @@ -769,7 +757,7 @@ class BaseLFJsonRequest: if not max_timeout_sec: max_timeout_sec = self.session_instance.max_timeout_sec - if _not(url): + if nott(url): raise ValueError("json_get called withou url") url = self.get_corrected_url(url=url) From 2f7baf2987c958b4d8acc7985f3544156530c65e Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 3 Nov 2021 14:17:16 -0700 Subject: [PATCH 238/731] lfcli_base.py: can now import lanforge_client.logg Adds notes on where present logg() function is being used Signed-off-by: Jed Reynolds --- py-json/LANforge/lfcli_base.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 16ca1bc8..14d251c6 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -17,15 +17,19 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit() - + sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) debug_printer = pprint.PrettyPrinter(indent=2) LFRequest = importlib.import_module("py-json.LANforge.LFRequest") +LFUtils = importlib.import_module("py-json.LANforge.LFUtils") +Logg = importlib.import_module("lanforge_client.logg") + if os.environ.get("LF_USE_AUTOGEN") == 1: lanforge_api = importlib.import_module("lanforge_client.lanforge_api") LFSession = lanforge_api.LFSession - Logg = lanforge_api.Logg + + class LFCliBase: @@ -34,11 +38,8 @@ class LFCliBase: SHOULD_HALT = 2 # indicates to quit loops, send SIGABRT to threads and exit # - LOGGING - - _logger = None - if os.environ.get("LF_USE_AUTOGEN") == 1: - _logger = Logg.logger - _method_name_list = [] - _tag_list = [] + _logger = logging.getLogger(__name__) + # do not use `super(LFCLiBase,self).__init__(self, host, port, _debug) # that is py2 era syntax and will force self into the host variable, making you @@ -523,6 +524,14 @@ class LFCliBase: mesg=None, filename=None, scriptname=None): + """ + This method is used by vr_profile2, lf_create_bcast, and shadowed by base_profile.py + :param level: + :param mesg: + :param filename: + :param scriptname: + :return: + """ if (mesg is None) or (mesg == "") or (level is None): return userhome=os.path.expanduser('~') From 8a0b5c22f097fcfbdc0fbe9cd6ea313d49bd26ec Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 3 Nov 2021 19:53:19 -0700 Subject: [PATCH 239/731] LFRequest.py: converting if(debug):print() to self.logger.debug() statements This change hooks into the global python logging instance and exercises level based logging without more advanced logic like "digest/json/http/gui" as documented elsewhere. Need to establish the correctness of this usage before moving forward. Signed-off-by: Jed Reynolds --- py-json/LANforge/LFRequest.py | 104 ++++++++++++++++------------------ 1 file changed, 50 insertions(+), 54 deletions(-) diff --git a/py-json/LANforge/LFRequest.py b/py-json/LANforge/LFRequest.py index 491557c0..7de51adc 100644 --- a/py-json/LANforge/LFRequest.py +++ b/py-json/LANforge/LFRequest.py @@ -3,9 +3,10 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Class holds default settings for json requests - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +import logging import sys import os -import pprint +from pprint import pprint, pformat, PrettyPrinter import urllib from urllib import request import json @@ -17,7 +18,7 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) -debug_printer = pprint.PrettyPrinter(indent=2) +debug_printer = PrettyPrinter(indent=2) class LFRequest: Default_Base_URL = "http://localhost:8080" @@ -26,6 +27,7 @@ class LFRequest: post_data = No_Data default_headers = { 'Accept': 'application/json'} proxies = None + logger = logging.getLogger(__name__) def __init__(self, url=None, uri=None, @@ -61,7 +63,7 @@ class LFRequest: # pprint.pprint(self.proxies) if not url.startswith("http://") and not url.startswith("https://"): - print("No http:// or https:// found, prepending http:// to "+url) + self.logger.warning("No http:// or https:// found, prepending http:// to "+url) url = "http://" + url if uri is not None: if not url.endswith('/') and not uri.startswith('/'): @@ -83,8 +85,7 @@ class LFRequest: self.requested_url = self.requested_url.replace('#', '%23') if (self.requested_url.find(' ') >= 1): self.requested_url = self.requested_url.replace(' ', '+') - if self.debug: - print("new LFRequest[%s]" % self.requested_url ) + self.logger.debug("new LFRequest[%s]" % self.requested_url ) # request first url on stack def formPost(self, show_error=True, debug=False, die_on_error_=False): @@ -104,19 +105,17 @@ class LFRequest: request.install_opener(opener) - if (debug): - print("formPost: url: "+self.requested_url) + self.logger.debug("formPost: url: "+self.requested_url) if ((self.post_data != None) and (self.post_data is not self.No_Data)): urlenc_data = urllib.parse.urlencode(self.post_data).encode("utf-8") - if (debug): - print("formPost: data looks like:" + str(urlenc_data)) - print("formPost: url: "+self.requested_url) + self.logger.debug("formPost: data looks like:" + str(urlenc_data)) + self.logger.debug("formPost: url: "+self.requested_url) myrequest = request.Request(url=self.requested_url, data=urlenc_data, headers=self.default_headers) else: myrequest = request.Request(url=self.requested_url, headers=self.default_headers) - print("No data for this formPost?") + self.logger.error("No data for this formPost?") myrequest.headers['Content-type'] = 'application/x-www-form-urlencoded' @@ -166,7 +165,7 @@ class LFRequest: headers=self.default_headers) else: myrequest = request.Request(url=self.requested_url, headers=self.default_headers) - print("No data for this jsonPost?") + self.logger.error("No data for this jsonPost?") myrequest.headers['Content-type'] = 'application/json' @@ -176,22 +175,22 @@ class LFRequest: resp = urllib.request.urlopen(myrequest) resp_data = resp.read().decode('utf-8') if (debug and die_on_error_): - print("----- LFRequest::json_post:128 debug: --------------------------------------------") - print("URL: %s :%d "% (self.requested_url, resp.status)) + self.logger.debug("----- LFRequest::json_post:128 debug: --------------------------------------------") + self.logger.debug("URL: %s :%d "% (self.requested_url, resp.status)) if resp.status != 200: - debug_printer.pprint(resp.getheaders()) - print("----- resp_data:128 -------------------------------------------------") - print(resp_data) - print("-------------------------------------------------") + self.logger.debug(pformat(resp.getheaders())) + self.logger.debug("----- resp_data:128 -------------------------------------------------") + self.logger.debug(resp_data) + self.logger.debug("-------------------------------------------------") responses.append(resp) if response_json_list_ is not None: if type(response_json_list_) is not list: raise ValueError("reponse_json_list_ needs to be type list") j = json.loads(resp_data) if debug: - print("----- LFRequest::json_post:140 debug: --------------------------------------------") - debug_printer.pprint(j) - print("-------------------------------------------------") + self.logger.debug("----- LFRequest::json_post:140 debug: --------------------------------------------") + self.logger.debug(pformat(j)) + self.logger.debug("-------------------------------------------------") response_json_list_.append(j) return responses[0] @@ -231,7 +230,7 @@ class LFRequest: if self.die_on_error == True: die_on_error_ = True if debug: - print("LFUtils.get: url: "+self.requested_url) + self.logger.debug("LFUtils.get: url: "+self.requested_url) # https://stackoverflow.com/a/59635684/11014343 if (self.proxies is not None) and (len(self.proxies) > 0): @@ -279,8 +278,7 @@ class LFRequest: self.print_errors() return None if responses[0] == None: - if debug_: - print("No response from "+self.requested_url) + self.logger.debug("No response from "+self.requested_url) return None json_data = json.loads(responses[0].read().decode('utf-8')) return json_data @@ -301,10 +299,10 @@ class LFRequest: def print_errors(self): if not self.has_errors: - print("---------- no errors ----------") + self.logger.debug("---------- no errors ----------") return for err in self.error_list: - print("error: %s" % err) + self.logger.error("error: %s" % err) def plain_get(url_=None, debug_=False, die_on_error_=False, proxies_=None): """ @@ -345,16 +343,16 @@ def plain_get(url_=None, debug_=False, die_on_error_=False, proxies_=None): def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, error_list_=None, debug_=False): - if debug_: - print("LFRequest::print_diagnostics: error_.__class__: %s"%error_.__class__) - debug_printer.pprint(error_) + logger = logging.getLogger(__name__) + #logger.error("LFRequest::print_diagnostics: error_.__class__: %s"%error_.__class__) + #logger.error(pformat(error_)) if url_ is None: - print("WARNING LFRequest::print_diagnostics: url_ is None") + logger.warning("WARNING LFRequest::print_diagnostics: url_ is None") if request_ is None: - print("WARNING LFRequest::print_diagnostics: request_ is None") + logger.warning("WARNING LFRequest::print_diagnostics: request_ is None") if error_ is None: - print("WARNING LFRequest::print_diagnostics: error_ is None") + logger.warning("WARNING LFRequest::print_diagnostics: error_ is None") method = 'NA' if (hasattr(request_, 'method')): @@ -380,48 +378,46 @@ def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, er if headername.startswith("X-Error-"): xerrors.append("%s: %s" % (headername, err_headers.get(headername))) if len(xerrors) > 0: - print(" = = LANforge Error Messages = =") - print(" = = URL: %s" % err_full_url) + logger.error(" = = LANforge Error Messages = =") + logger.error(" = = URL: %s" % err_full_url) for xerr in xerrors: - print(xerr) + logger.error(xerr) if (error_list_ is not None) and isinstance(error_list_, list): error_list_.append(xerr) - print(" = = = = = = = = = = = = = = = =") + logger.error(" = = = = = = = = = = = = = = = =") if (error_.__class__ is urllib.error.HTTPError): - if debug_: - print("----- LFRequest: HTTPError: --------------------------------------------") - print("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) + logger.debug("----- LFRequest: HTTPError: --------------------------------------------") + logger.debug("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) if err_code == 404: if (error_list_ is not None) and isinstance(error_list_, list): error_list_.append("[%s HTTP %s] <%s> : %s" % (method, err_code, err_full_url, err_reason)) else: - if debug_: - print(" Content-type:[%s] Accept[%s]" % (request_.get_header('Content-type'), request_.get_header('Accept'))) + logger.debug(" Content-type:[%s] Accept[%s]" % (request_.get_header('Content-type'), request_.get_header('Accept'))) if hasattr(request_, "data") and (request_.data is not None): - print(" Data:") - debug_printer.pprint(request_.data) + logger.debug(" Data:") + logger.debug(debug_printer.pformat(request_.data)) elif debug_: - print(" ") + logger.debug(" ") - if debug_ and (len(err_headers) > 0): + if len(err_headers) > 0: # the HTTPError is of type HTTPMessage a subclass of email.message - print(" Response Headers: ") + logger.debug(" Response Headers: ") for headername in sorted(err_headers.keys()): - print(" %s: %s" % (headername, err_headers.get(headername))) + logger.debug(" %s: %s" % (headername, err_headers.get(headername))) if len(responses_) > 0: - print("----- Response: --------------------------------------------------------") - debug_printer.pprint(responses_[0].reason) - if debug_: - print("------------------------------------------------------------------------") + logger.debug("----- Response: --------------------------------------------------------") + logger.debug(debug_printer.pformat(responses_[0].reason)) + + logger.debug("------------------------------------------------------------------------") return if (error_.__class__ is urllib.error.URLError): - print("----- LFRequest: URLError: ---------------------------------------------") - print("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) - print("------------------------------------------------------------------------") + logger.error("----- LFRequest: URLError: ---------------------------------------------") + logger.error("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) + logger.error("------------------------------------------------------------------------") # ~LFRequest From c469fa542616f59bff3e398497083e5565d0d662 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 3 Nov 2021 22:11:27 -0700 Subject: [PATCH 240/731] check_large_files: fixes neglected disk status of /boot2 Ignoring this partition made kinstall fail with a disk-full error. Important to update kinstall to handle /boot2 refresh as well. Signed-off-by: Jed Reynolds --- check_large_files.bash | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/check_large_files.bash b/check_large_files.bash index 888f6695..bdf83b60 100755 --- a/check_large_files.bash +++ b/check_large_files.bash @@ -339,6 +339,14 @@ clean_old_kernels() { echo "/lib/modules/$f" done | xargs rm -rf fi + if [ -d "/boot2" ]; then + rm -rf /boot2/* + rsync -a /boot/. /boot2/ + local dev2=`df /boot2/ |awk '/dev/{print $1}'` + if [ x$dev2 != x ]; then + /usr/sbin/grub2-install $dev2 ||: + fi + fi } clean_core_files() { @@ -348,7 +356,7 @@ clean_core_files() { return 0 fi - local counter=0 + local counter=0 if [ ! -f "$lf_core_log" ]; then touch "$lf_core_log" fi From abc422ddf8f393116f02a2d6c42cd1e306a02143 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Thu, 4 Nov 2021 00:07:36 -0700 Subject: [PATCH 241/731] jbr_monitor_bssids.py: removes typing subscripts not present in python 3.7.7 Signed-off-by: Jed Reynolds --- py-scripts/sandbox/jbr_monitor_bssids.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/py-scripts/sandbox/jbr_monitor_bssids.py b/py-scripts/sandbox/jbr_monitor_bssids.py index 03234d6e..19d81851 100755 --- a/py-scripts/sandbox/jbr_monitor_bssids.py +++ b/py-scripts/sandbox/jbr_monitor_bssids.py @@ -85,10 +85,10 @@ class BssidMonitor(Realm): test_duration_min: str = "5m", report_file: str = None, output_format: str = None, - layer3_cols: list[str] = None, + layer3_cols: list = None, # p3.9 list[str] port_mgr_cols=None, monitor_interval_sec: int = 10, - bssid_list: list[str] = None): + bssid_list: list = None): # p3.9 list[str] """ lfclient_host="localhost", lfclient_port=8080, @@ -131,14 +131,15 @@ class BssidMonitor(Realm): self.test_duration = test_duration_min self.report_file: str = report_file self.output_format: str = output_format - self.port_mgr_cols: list[str] = port_mgr_cols - self.layer3_cols: tuple[Optional[list[str]]] = layer3_cols, + self.port_mgr_cols: list = port_mgr_cols # p3.9 list[str] + self.layer3_cols = layer3_cols # py 3.9.x tuple[Optional[list[str]]] + # self.layer3_cols: tuple = layer3_cols # py 3.7.7 self.monitor_interval_sec: int = monitor_interval_sec if not bssid_list: raise ValueError("bssid list necessary to continue") - self.bssid_list: list[str] = bssid_list - self.bssid_sta_profiles: dict[str, str] = {} + self.bssid_list: list = bssid_list # p 3.9: list[str] + self.bssid_sta_profiles: dict = {} #p3.9: dict[str,str] ''' session = LFSession(lfclient_url="http://localhost:8080", @@ -273,7 +274,7 @@ def main(): parser.add_argument('--mode', help='Used to force mode of stations') parser.add_argument('--bssid', - action='extend', + action='append', # action='extend' appears in py 3.9 type=str, nargs="+", help='Add an AP to the list of APs to test connections to') @@ -302,10 +303,10 @@ def main(): type=int, help='duration of the test in minutes') parser.add_argument('--layer3_cols', - type=list[str], + type=list, # py3.9 list[str] help='titles of columns to report') parser.add_argument('--port_mgr_cols', - type=list[str], + type=list, # py3.9 list[str] help='titles of columns to report') args = parser.parse_args() From 59b18ea38f348ceed58b663537505ea04b7556cc Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Thu, 4 Nov 2021 00:08:16 -0700 Subject: [PATCH 242/731] logg.py: removes typing not present in python 3.7.7 fixes datetime.now reference Signed-off-by: Jed Reynolds --- lanforge_client/logg.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lanforge_client/logg.py b/lanforge_client/logg.py index 34a96be9..ed165089 100644 --- a/lanforge_client/logg.py +++ b/lanforge_client/logg.py @@ -9,10 +9,10 @@ from logging import Logger import time import datetime import inspect -import traceback -from typing import Optional -from pprint import pprint, pformat -from .strutil import nott, iss +# import traceback +# from typing import Optional +from pprint import pprint # pformat +from .strutil import nott # iss class Logg: """ @@ -43,9 +43,9 @@ class Logg: """ DEFAULT_LEVEL = logging.WARNING DefaultLogger = logging.getLogger(__name__) - method_name_list: list[str] = [] - tag_list: list[str] = [] - reserved_tags: list[str] = [ + method_name_list: list = [] # list[str] + tag_list: list = [] # list[str] + reserved_tags: list = [ # list[str] "debug", "debugging", "debug_log", @@ -72,7 +72,8 @@ class Logg: self.level = log_level self.logger: Logger - self.start_time = datetime.now() + # self.start_time = datetime.now() # py 3.9 maybe? + self.start_time = datetime.datetime.now() # py 3.9 maybe? self.start_time_str = time.strftime("%Y%m%d-%I:%M%:%S") if name: self.name = name From 189da24e6fcc089b22648c7195c0dd804b5eb928 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Thu, 4 Nov 2021 00:10:27 -0700 Subject: [PATCH 243/731] lanforge_api.py: removes typing subscripts not present in python 3.7.7 new flag for add_sta_flags Signed-off-by: Jed Reynolds --- lanforge_client/lanforge_api.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lanforge_client/lanforge_api.py b/lanforge_client/lanforge_api.py index 8a02c04e..be1d6d46 100644 --- a/lanforge_client/lanforge_api.py +++ b/lanforge_client/lanforge_api.py @@ -106,7 +106,6 @@ def _now_sec() -> int: return round(time.time() * 1000 * 1000) - def default_proxies() -> dict: return { # 'http': 'http://example.com', @@ -206,7 +205,6 @@ def print_diagnostics(url_: str = None, exit(1) - class BaseLFJsonRequest: """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Perform HTTP get/post/put/delete with extensions specific to LANforge JSON @@ -414,10 +412,10 @@ class BaseLFJsonRequest: connection_timeout_sec: float = None, max_timeout_sec: float = None, die_on_error: bool = False, - errors_warnings: list[str] = None, + errors_warnings: list = None, # p3.9 list[str] response_json_list: list = None, method_: str = 'POST', - session_id_: str = "") -> Optional[HTTPResponse]: + session_id_: str = "") -> Optional: # p3.9 Optional[HTTPResponse] """ :param url: URL to post to @@ -442,7 +440,7 @@ class BaseLFJsonRequest: % (self.session_id, self.session_instance.get_session_id())) if die_on_error: exit(1) - responses: list[HTTPResponse] = [] + responses: list = [] # p3.9 list[HTTPResponse] url = self.get_corrected_url(url) self.logger.by_method("url: "+url) if (post_data is not None) and (post_data is not self.No_Data): @@ -580,7 +578,7 @@ class BaseLFJsonRequest: max_timeout_sec: float = None, errors_warnings: list = None, die_on_error: bool = False, - response_json_list: list = None) -> Optional[HTTPResponse]: + response_json_list: list = None) -> Optional: # Optional[HTTPResponse] if not url: raise ValueError("json_put requires url") return self.json_post(url=url, @@ -627,7 +625,7 @@ class BaseLFJsonRequest: debug: bool = False, die_on_error: bool = False, method_: str = 'GET', - connection_timeout_sec: int = None) -> Optional[HTTPResponse]: + connection_timeout_sec: int = None) -> Optional: # Optional[HTTPResponse] """ Makes a HTTP GET request with specified timeout. :param url: Fully qualified URL to request @@ -658,7 +656,7 @@ class BaseLFJsonRequest: if connection_timeout_sec: myrequest.timeout = connection_timeout_sec - myresponses: list[HTTPResponse] = [] + myresponses: list = [] # list[HTTPResponse] try: myresponses.append(request.urlopen(myrequest)) return myresponses[0] @@ -3184,6 +3182,7 @@ class LFJsonCommand(JsonCommand): p_8021x_radius = 0x2000000 # Use 802.1x (RADIUS for AP). create_admin_down = 0x1000000000 # Station should be created admin-down. custom_conf = 0x20 # Use Custom wpa_supplicant config file. + disable_obss_scan = 0x400000000000 # Disable OBSS SCAN feature in supplicant. disable_ofdma = 0x200000000000 # Disable OFDMA mode disable_twt = 0x100000000000 # Disable TWT mode disable_fast_reauth = 0x200000000 # Disable fast_reauth option for virtual stations. From 5e7e7e744f8836ca65047dd5d594f3dd6645b734 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Thu, 4 Nov 2021 00:22:49 -0700 Subject: [PATCH 244/731] jbr_monitor_bssids.py: this timing works better for retrieving events maybe on APU2 hardware this just takes significantly longer Signed-off-by: Jed Reynolds --- py-scripts/sandbox/jbr_monitor_bssids.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/py-scripts/sandbox/jbr_monitor_bssids.py b/py-scripts/sandbox/jbr_monitor_bssids.py index 19d81851..3f53dc2b 100755 --- a/py-scripts/sandbox/jbr_monitor_bssids.py +++ b/py-scripts/sandbox/jbr_monitor_bssids.py @@ -201,14 +201,19 @@ class BssidMonitor(Realm): card='all', port='all', endp='all') - time.sleep(0.1) + time.sleep(0.2) event_response = self.lf_query.events_last_events(event_count=1, debug=self.debug, + wait_sec=1, + max_timeout_sec=120, errors_warnings=err_warn_list) if not event_response: - Logg.logg(level=logging.ERROR, msg="No event_response") + Logg.logg(level=logging.ERROR, msg="No event_response, we should have retried that") + return + # pprint(("event_response:", event_response)) if "id" not in event_response: pprint(("event_response:", event_response)) + return return event_response["id"] def wait_for_load_to_finish(self, since_id: int = None): From eddbc319013d626bccfafa93e31979e0ed41d8cb Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 4 Nov 2021 12:53:35 -0700 Subject: [PATCH 245/731] Update to_pip so it doesn't import non-existent files and removes all remaning importlib commands Signed-off-by: Matthew Stidham --- to_pip.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/to_pip.sh b/to_pip.sh index f2c4aced..e18acbe6 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -92,8 +92,6 @@ from .csv_convert import CSVParcer from .csv_processor import L3CSVParcer from .csv_to_influx import CSVtoInflux from .csv_to_grafana import UseGrafana -from .event_breaker import EventBreaker -from .event_flood import EventBreaker as EventFlood from .example_security_connection import IPv4Test from .grafana_profile import UseGrafana from .influx import RecordInflux @@ -101,7 +99,7 @@ from .layer3_test import Layer3Test from .layer4_test import HTTPTest from .lf_ap_auto_test import ApAutoTest from .lf_atten_mod_test import CreateAttenuator -from .lf_csv import lf_csv, lf_kpi_csv +from .lf_csv import lf_csv from .lf_dataplane_test import DataplaneTest from .lf_dfs_test import FileAdapter, CreateCtlr, L3VariableTime from .lf_dut_sta_vap_test import Login_DUT, LoadScenario, CreateSTA_CX @@ -318,6 +316,7 @@ sed -i -- 's/LFCliBase = lfcli_base.LFCliBase/ /g' *.py sed -i -- 's/pandas_extensions = importlib.import_module("py-json.LANforge.pandas_extensions")/from .LANforge.pandas_extensions import pandas_extensions/g' *.py sed -i -- 's/pandas_extensions.pandas_extensions/pandas_extensions/g' *.py sed -i -- 's/vr_profile2 = importlib.import_module("py-json.vr_profile2")/from ..py_json import vr_profile2/g' *.py +sed -i -- 's/port_probe = importlib.import_module("py-json.port_probe")/from ..py_json import port_probe/g' *.py # fix py_dashboard files sed -i -- 's/from GrafanaRequest/from ..py_dashboard.GrafanaRequest/g' *.py From ee120b43e238d21fc41dab26e053addc08ad4063 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 4 Nov 2021 13:13:01 -0700 Subject: [PATCH 246/731] python_requires statement correction Signed-off-by: Matthew Stidham --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1230ff73..d4e08a43 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ setup( 'scp', 'dash', 'kaleido'], - python_required='>=3.6, <4', + python_requires='>=3.6, <4', classifiers=[ "Programming Language :: Python :: 3", "Operating System :: OS Independent", From 8340b0419e38b95a34304b7c6419768922677c98 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 4 Nov 2021 13:29:49 -0700 Subject: [PATCH 247/731] Don't rename parent folder, create wheel at end of process. Signed-off-by: Matthew Stidham --- to_pip.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/to_pip.sh b/to_pip.sh index e18acbe6..952fb049 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -34,10 +34,6 @@ while getopts ":h:a:t:" option; do ;; esac done -#Rename repository so it can be imported as a package -cd .. -mv lanforge-scripts lanforge_scripts -cd lanforge_scripts mv py-scripts/ py_scripts mv py-json/ py_json @@ -443,8 +439,9 @@ if [[ $ARCHIVE -eq 1 ]]; then rm speedtest-cli rm WlanPro.desktop mv wifi_diag lanforge_scripts - tar -zcvf ${TARGET_DIR}/lanforge_scripts.tar.gz * - zip ${TARGET_DIR}/lanforge_scripts.zip * + #tar -zcvf ${TARGET_DIR}/lanforge_scripts.tar.gz * + #zip ${TARGET_DIR}/lanforge_scripts.zip * + python3 -m build --wheel else echo "Not saving archive" fi \ No newline at end of file From 878fa04d159b3f9bb91b542139678995686b3230 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 4 Nov 2021 14:01:33 -0700 Subject: [PATCH 248/731] need to ensure build is installed and up to date Signed-off-by: Matthew Stidham --- to_pip.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/to_pip.sh b/to_pip.sh index 952fb049..5cd3d0d2 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -441,7 +441,8 @@ if [[ $ARCHIVE -eq 1 ]]; then mv wifi_diag lanforge_scripts #tar -zcvf ${TARGET_DIR}/lanforge_scripts.tar.gz * #zip ${TARGET_DIR}/lanforge_scripts.zip * + python3 -m pip install --upgrade build python3 -m build --wheel else echo "Not saving archive" -fi \ No newline at end of file +fi From b1b6173d143c6da06af4a0237714feb7a891f1f5 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 4 Nov 2021 14:24:27 -0700 Subject: [PATCH 249/731] Create python wheel by default. Move current folder to lanforge_scripts Signed-off-by: Matthew Stidham --- to_pip.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/to_pip.sh b/to_pip.sh index 5cd3d0d2..9290cc0c 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -11,11 +11,11 @@ Help() echo "" echo "EXPORT TO TAR FILE" echo "./to_pip.sh -a -t TARGET_DIR" - echo "The 't' flag tells to_pip where to store the tar file, -a tells it to make a tar file." + echo "The 't' flag tells to_pip where to store the tar file, -a tells it to not make a python wheel." echo "When the archive is made, you can install it on any computer with `pip install lanforge_scripts.tar.gz`" } -ARCHIVE=0 +ARCHIVE=1 TARGET_DIR='..' while getopts ":h:a:t:" option; do @@ -25,7 +25,7 @@ while getopts ":h:a:t:" option; do exit 1 ;; a) #Archive - ARCHIVE=1 + ARCHIVE=0 ;; t) #target dir TARGET_DIR=${OPTARG} @@ -35,6 +35,11 @@ while getopts ":h:a:t:" option; do esac done +BASE=$(basename "$PWD") +cd .. +cp -r ${BASE} lanforge_scripts +cd lanforge_scripts + mv py-scripts/ py_scripts mv py-json/ py_json mv py-dashboard/ py_dashboard From 95ab91df2eddff2fb4efced6f13388128720e6b0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 4 Nov 2021 15:13:36 -0700 Subject: [PATCH 250/731] Improve exit commands in to_pip.sh Signed-off-by: Matthew Stidham --- to_pip.sh | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/to_pip.sh b/to_pip.sh index 9290cc0c..fbc70f87 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -12,7 +12,7 @@ Help() echo "EXPORT TO TAR FILE" echo "./to_pip.sh -a -t TARGET_DIR" echo "The 't' flag tells to_pip where to store the tar file, -a tells it to not make a python wheel." - echo "When the archive is made, you can install it on any computer with `pip install lanforge_scripts.tar.gz`" + echo "When the archive is made, you can install it on any computer with $(pip install lanforge_scripts.tar.gz)" } ARCHIVE=1 @@ -37,8 +37,14 @@ done BASE=$(basename "$PWD") cd .. -cp -r ${BASE} lanforge_scripts -cd lanforge_scripts +if [ -d "lanforge_scripts" ] +then + echo "lanforge_scripts exists, please remove or rename that folder" + exit 1 +else + cp -r "${BASE}" lanforge_scripts || exit 1 + cd lanforge_scripts || exit 1 +fi mv py-scripts/ py_scripts mv py-json/ py_json @@ -70,14 +76,14 @@ __all__ = ['LFRequest', 'LFUtils', 'LANforge','LFCliBase'] __title__ = 'lanforge_scripts' __version__ = '0.0.1' -__author__ = 'Candela Technologies ' +__author__ = 'Candela Technologies ' __license__ = ''" > __init__.py #fix files in root sed -i -- 's/from LANforge/from py_json.LANforge/g' *.py sed -i -- 's/from py_json/from .py_json/g' *.py -cd py_scripts +cd py_scripts || exit 1 echo "#from .connection_test import ConnectionTest from .create_bond import CreateBond @@ -258,7 +264,7 @@ sed -i -- 's/from wlan_theoretical_sta/from ..py_json.wlan_theoretical_sta/g' *. sed -i -- 's/from ws_generic_monitor/from ..py_json.ws_generic_monitor/g' *.py sed -i -- 's/from port_utils/from ..py_json.port_utils/g' *.py -cd ../py_json +cd ../py_json || exit 1 #Fix files in py_json sed -i -- 's/import realm/from realm import PortUtils/g' test_utility.py @@ -364,7 +370,7 @@ sed -i -- 's/from lf_graph/from ..py_scripts.lf_graph/g' *.py sed -i -- 's/from create_station/from ..py_scripts.create_station/g' *.py sed -i -- 's/from cv_test_reports/from .cv_test_reports/g' *.py -cd LANforge +cd LANforge || exit 1 echo " from .add_dut import dut_params, dut_flags from .add_file_endp import fe_fstype, fe_payload_list, fe_fio_flags, fe_base_endpoint_types @@ -399,7 +405,7 @@ sed -i -- 's/LFUtils.debug_printer/debug_printer/g' *.py sed -i -- 's/lf_json_autogen = importlib.import_module("py-json.LANforge.lf_json_autogen")/from .lf_json_autogen import LFJsonPost/g' *.py sed -i -- 's/LFJsonPost = lf_json_autogen.LFJsonPost/ /g' *.py -cd ../../py_dashboard +cd ../../py_dashboard || exit 1 echo " from .GrafanaRequest import GrafanaRequest from .InfluxRequest import RecordInflux @@ -430,16 +436,17 @@ if [[ $ARCHIVE -eq 1 ]]; then mv py_dashboard lanforge_scripts mv py_scripts lanforge_scripts mv label-printer lanforge_scripts/label_printer + mv "auto-install-gui.py" "auto_install_gui.py" for i in "${py_modules[@]}"; do - mv $i lanforge_scripts + mv "$i.py" lanforge_scripts || exit 1 done - rm *.pl - rm *.bash + rm ./*.pl + rm ./*.bash rm -r gui rm -r json rm -r LANforge rm -r __pycache__ - mv *.py lanforge_scripts + mv ./*.py lanforge_scripts mv lanforge_scripts/setup.py . rm speedtest-cli rm WlanPro.desktop @@ -451,3 +458,4 @@ if [[ $ARCHIVE -eq 1 ]]; then else echo "Not saving archive" fi +exit 0 \ No newline at end of file From 468279aef2c3b326461d28e18d0fb82ef870704e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 4 Nov 2021 15:23:58 -0700 Subject: [PATCH 251/731] Remove reference to non-existant file and add in text at the bottom of the script telling where to find the whl Signed-off-by: Matthew Stidham --- to_pip.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/to_pip.sh b/to_pip.sh index fbc70f87..b62dd8ab 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -159,7 +159,7 @@ from .ws_generic_monitor_test import WS_Listener" > __init__.py sed -i -- 's/import realm/ /g' create_vap.py lf_dut_sta_vap_test.py lf_sniff_radio.py run_cv_scenario.py sta_connect.py station_layer3.py test_client_admission.py sed -i -- 's/import realm/from realm import Realm/g' layer4_test.py lf_atten_mod_test.py lf_multipsk.py test_fileio.py test_ip_connection.py test_ipv4_ttls.py test_l3_WAN_LAN.py test_l3_unicast_traffic_gen.py test_l4.py testgroup.py sed -i -- 's/realm.Realm/Realm/g' layer4_test.py lf_atten_mod_test.py lf_multipsk.py lf_sniff_radio.py station_layer3.py test_client_admission.py test_fileio.py test_ip_connection.py -sed -i -- 's/import realm/from realm import Realm, PortUtils/g' lf_ftp.py lf_ftp_test.py lf_webpage.py +sed -i -- 's/import realm/from realm import Realm, PortUtils/g' lf_ftp.py lf_webpage.py sed -i -- 's/import realm/from realm import Realm, WifiMonitor/g' test_ipv4_ps.py sed -i -- 's/import l3_cxprofile/from l3_cxprofile import L3CXProfile/g' test_l3_powersave_traffic.py sed -i -- 's/import realm/from realm import Realm, StationProfile, WifiMonitor/g' test_l3_powersave_traffic.py @@ -455,6 +455,7 @@ if [[ $ARCHIVE -eq 1 ]]; then #zip ${TARGET_DIR}/lanforge_scripts.zip * python3 -m pip install --upgrade build python3 -m build --wheel + echo "You can find the wheel in ../lanforge_scripts/dist/*.whl" else echo "Not saving archive" fi From cce2d2245675364a52e1605c2e63f95d099ab95f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 4 Nov 2021 17:33:04 -0700 Subject: [PATCH 252/731] Only import ap_ctl if Pexpect_serial is installed, because of Windows incompatibility issues Signed-off-by: Matthew Stidham --- to_pip.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/to_pip.sh b/to_pip.sh index b62dd8ab..28959a2c 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -58,7 +58,10 @@ from .py_dashboard import * from .py_json import * from .py_json import LANforge from .py_json.LANforge import * -from . import ap_ctl +try: + from . import ap_ctl +except ImportError: + print('Pexpect_serial is not installed') from . import emailHelper from . import lf_mail from . import lf_tos_plus_test From ec1374c9477fd198b0e662e4e73c654180437ab4 Mon Sep 17 00:00:00 2001 From: jitendracandela Date: Fri, 5 Nov 2021 17:16:50 +0530 Subject: [PATCH 253/731] fixed lanforge error message --- py-scripts/lf_cleanup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py-scripts/lf_cleanup.py b/py-scripts/lf_cleanup.py index 40e05b99..8b3face8 100755 --- a/py-scripts/lf_cleanup.py +++ b/py-scripts/lf_cleanup.py @@ -84,6 +84,8 @@ class lf_clean(Realm): print("Removing old endpoints") for name in list(endp_json['endpoint']): print(list(name)[0]) + if name[list(name)[0]]["name"] == '': + continue req_url = "cli-json/rm_endp" data = { "endp_name": list(name)[0] From 3fee19c2e6329f4c8690ce4fee80ae8ac9294ded Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 5 Nov 2021 09:35:41 -0700 Subject: [PATCH 254/731] setup.py was missing pyjwt Signed-off-by: Matthew Stidham --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d4e08a43..a633a3fc 100755 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ setup( 'pexpect-serial', 'scp', 'dash', - 'kaleido'], + 'pyjwt'], python_requires='>=3.6, <4', classifiers=[ "Programming Language :: Python :: 3", From 266118cc63abea8b0a134bb06ac653331d90ed98 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 5 Nov 2021 10:08:36 -0700 Subject: [PATCH 255/731] Requirements.txt initial commit Signed-off-by: Matthew Stidham --- requirements.txt | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..a0f0990b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,67 @@ +bcrypt==3.2.0 +beautifulsoup4==4.10.0 +bokeh==2.4.1 +Brotli==1.0.9 +bs4==0.0.1 +certifi==2021.10.8 +cffi==1.15.0 +charset-normalizer==2.0.7 +click==8.0.3 +colorama==0.4.4 +commonmark==0.9.1 +cryptography==35.0.0 +cycler==0.11.0 +dash==2.0.0 +dash-core-components==2.0.0 +dash-html-components==2.0.0 +dash-table==5.0.0 +Flask==2.0.2 +Flask-Compress==1.10.1 +idna==3.3 +influxdb==5.3.1 +influxdb-client==1.23.0 +itsdangerous==2.0.1 +Jinja2==3.0.2 +jwt==1.3.1 +kaleido==0.2.1 +kiwisolver==1.3.2 +lanforge-scripts==0.0.2 +lxml==4.6.4 +MarkupSafe==2.0.1 +matplotlib==3.4.3 +msgpack==1.0.2 +numpy==1.21.4 +packaging==21.2 +pandas==1.3.4 +paramiko==2.8.0 +pdfkit==0.6.1 +pexpect==4.8.0 +pexpect-serial==0.1.0 +Pillow==8.4.0 +pip-search==0.0.7 +plotly==5.3.1 +ptyprocess==0.7.0 +py==1.11.0 +pyarrow==6.0.0 +pycparser==2.20 +Pygments==2.10.0 +PyNaCl==1.4.0 +pyparsing==2.4.7 +pyserial==3.5 +pyshark==0.4.3 +python-dateutil==2.8.2 +pytz==2021.3 +PyYAML==6.0 +requests==2.26.0 +rich==10.12.0 +Rx==3.2.0 +scp==0.14.1 +six==1.16.0 +soupsieve==2.3 +tenacity==8.0.1 +tornado==6.1 +typing-extensions==3.10.0.2 +urllib3==1.26.7 +websocket-client==1.2.1 +Werkzeug==2.0.2 +XlsxWriter==3.0.2 From 5879f64646a1613c3824be0eb89ba7dfab1f361f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 5 Nov 2021 10:20:23 -0700 Subject: [PATCH 256/731] update_dependencies needs to ensure pip is up to date before running updates Signed-off-by: Matthew Stidham --- py-scripts/update_dependencies.py | 1 + 1 file changed, 1 insertion(+) diff --git a/py-scripts/update_dependencies.py b/py-scripts/update_dependencies.py index 281b76c5..9236438a 100755 --- a/py-scripts/update_dependencies.py +++ b/py-scripts/update_dependencies.py @@ -33,6 +33,7 @@ def main(): packages_installed = [] packages_failed =[] subprocess.call("pip3 uninstall jwt", shell=True) + subprocess.call('pip3 install --upgrade pip', shell=True) for package in packages: if os.name == 'nt': command = "pip3 install {} ".format(package) From 52ded1c08bf316658cc57542dc57df95ca6b3d06 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 5 Nov 2021 10:29:03 -0700 Subject: [PATCH 257/731] We don't want to downgrade any systems Signed-off-by: Matthew Stidham --- requirements.txt | 134 +++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/requirements.txt b/requirements.txt index a0f0990b..49595926 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,67 +1,67 @@ -bcrypt==3.2.0 -beautifulsoup4==4.10.0 -bokeh==2.4.1 -Brotli==1.0.9 -bs4==0.0.1 -certifi==2021.10.8 -cffi==1.15.0 -charset-normalizer==2.0.7 -click==8.0.3 -colorama==0.4.4 -commonmark==0.9.1 -cryptography==35.0.0 -cycler==0.11.0 -dash==2.0.0 -dash-core-components==2.0.0 -dash-html-components==2.0.0 -dash-table==5.0.0 -Flask==2.0.2 -Flask-Compress==1.10.1 -idna==3.3 -influxdb==5.3.1 -influxdb-client==1.23.0 -itsdangerous==2.0.1 -Jinja2==3.0.2 -jwt==1.3.1 -kaleido==0.2.1 -kiwisolver==1.3.2 -lanforge-scripts==0.0.2 -lxml==4.6.4 -MarkupSafe==2.0.1 -matplotlib==3.4.3 -msgpack==1.0.2 -numpy==1.21.4 -packaging==21.2 -pandas==1.3.4 -paramiko==2.8.0 -pdfkit==0.6.1 -pexpect==4.8.0 -pexpect-serial==0.1.0 -Pillow==8.4.0 -pip-search==0.0.7 -plotly==5.3.1 -ptyprocess==0.7.0 -py==1.11.0 -pyarrow==6.0.0 -pycparser==2.20 -Pygments==2.10.0 -PyNaCl==1.4.0 -pyparsing==2.4.7 -pyserial==3.5 -pyshark==0.4.3 -python-dateutil==2.8.2 -pytz==2021.3 -PyYAML==6.0 -requests==2.26.0 -rich==10.12.0 -Rx==3.2.0 -scp==0.14.1 -six==1.16.0 -soupsieve==2.3 -tenacity==8.0.1 -tornado==6.1 -typing-extensions==3.10.0.2 -urllib3==1.26.7 -websocket-client==1.2.1 -Werkzeug==2.0.2 -XlsxWriter==3.0.2 +bcrypt>=3.2.0 +beautifulsoup4>=4.10.0 +bokeh>=2.4.1 +Brotli>=1.0.9 +bs4>=0.0.1 +certifi>=2021.10.8 +cffi>=1.15.0 +charset-normalizer>=2.0.7 +click>=8.0.3 +colorama>=0.4.4 +commonmark>=0.9.1 +cryptography>=35.0.0 +cycler>=0.11.0 +dash>=2.0.0 +dash-core-components>=2.0.0 +dash-html-components>=2.0.0 +dash-table>=5.0.0 +Flask>=2.0.2 +Flask-Compress>=1.10.1 +idna>=3.3 +influxdb>=5.3.1 +influxdb-client>=1.23.0 +itsdangerous>=2.0.1 +Jinja2>=3.0.2 +jwt>=1.3.1 +kaleido>=0.2.1 +kiwisolver>=1.3.2 +lanforge-scripts>=0.0.2 +lxml>=4.6.4 +MarkupSafe>=2.0.1 +matplotlib>=3.4.3 +msgpack>=1.0.2 +numpy>=1.21.4 +packaging>=21.2 +pandas>=1.3.4 +paramiko>=2.8.0 +pdfkit>=0.6.1 +pexpect>=4.8.0 +pexpect-serial>=0.1.0 +Pillow>=8.4.0 +pip-search>=0.0.7 +plotly>=5.3.1 +ptyprocess>=0.7.0 +py>=1.11.0 +pyarrow>=6.0.0 +pycparser>=2.20 +Pygments>=2.10.0 +PyNaCl>=1.4.0 +pyparsing>=2.4.7 +pyserial>=3.5 +pyshark>=0.4.3 +python-dateutil>=2.8.2 +pytz>=2021.3 +PyYAML>=6.0 +requests>=2.26.0 +rich>=10.12.0 +Rx>=3.2.0 +scp>=0.14.1 +six>=1.16.0 +soupsieve>=2.3 +tenacity>=8.0.1 +tornado>=6.1 +typing-extensions>=3.10.0.2 +urllib3>=1.26.7 +websocket-client>=1.2.1 +Werkzeug>=2.0.2 +XlsxWriter>=3.0.2 From 5983a8add50d245c55e548ee44060f8dc15aed8a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 5 Nov 2021 10:34:16 -0700 Subject: [PATCH 258/731] Remove lanforge-scripts pip recursion Signed-off-by: Matthew Stidham --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 49595926..ecf16a2e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,7 +25,6 @@ Jinja2>=3.0.2 jwt>=1.3.1 kaleido>=0.2.1 kiwisolver>=1.3.2 -lanforge-scripts>=0.0.2 lxml>=4.6.4 MarkupSafe>=2.0.1 matplotlib>=3.4.3 From 0347f70a898c4eb096e96515424d50734998f71a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 5 Nov 2021 10:46:05 -0700 Subject: [PATCH 259/731] regression_test always hangs on test_1k Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 93bd3541..0d443c7d 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -278,16 +278,16 @@ else --radio $RADIO_USED" #station_layer3.py #stations_connected.py - "./test_1k_clients_jedtest.py - --mgr $MGR - --mgr_port 8080 - --sta_per_radio 300 - --test_duration 3m - --a_min 1000 - --b_min 1000 - --a_max 0 - --b_max 0 - --debug" + #"./test_1k_clients_jedtest.py + # --mgr $MGR + # --mgr_port 8080 + # --sta_per_radio 300 + # --test_duration 3m + # --a_min 1000 + # --b_min 1000 + # --a_max 0 + # --b_max 0 + # --debug" #test_client_admission.py "./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 --test_duration 30s --mgr $MGR" # Better tested on Kelly, where VRF is turned off #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug --mgr $MGR" From 9963b32ba91116ec52b9dc48b5c44f395141d3ef Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 5 Nov 2021 11:58:11 -0700 Subject: [PATCH 260/731] Set default min_bps in l3cxprofile in order to make it easier to use in command line. Signed-off-by: Matthew Stidham --- py-json/l3_cxprofile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-json/l3_cxprofile.py b/py-json/l3_cxprofile.py index d3545a16..bb42d87a 100644 --- a/py-json/l3_cxprofile.py +++ b/py-json/l3_cxprofile.py @@ -21,8 +21,8 @@ class L3CXProfile(LFCliBase): lfclient_host, lfclient_port, local_realm, - side_a_min_bps=None, - side_b_min_bps=None, + side_a_min_bps=256000, + side_b_min_bps=256000, side_a_max_bps=0, side_b_max_bps=0, side_a_min_pdu=-1, From 6e2900e4e8f38a000e2b3a9a029ebb9c3eb832db Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 5 Nov 2021 12:11:02 -0700 Subject: [PATCH 261/731] Fix LFRequest queries Signed-off-by: Matthew Stidham --- to_pip.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/to_pip.sh b/to_pip.sh index 28959a2c..46a96536 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -327,6 +327,7 @@ sed -i -- 's/pandas_extensions = importlib.import_module("py-json.LANforge.panda sed -i -- 's/pandas_extensions.pandas_extensions/pandas_extensions/g' *.py sed -i -- 's/vr_profile2 = importlib.import_module("py-json.vr_profile2")/from ..py_json import vr_profile2/g' *.py sed -i -- 's/port_probe = importlib.import_module("py-json.port_probe")/from ..py_json import port_probe/g' *.py +sed -i -- 's/LFRequest.LFRequest/LFRequest/g' *.py # fix py_dashboard files sed -i -- 's/from GrafanaRequest/from ..py_dashboard.GrafanaRequest/g' *.py From d50907c8b34566112e6857d16bde273d767d0a26 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 5 Nov 2021 12:39:55 -0700 Subject: [PATCH 262/731] Deprecating l3_cxprofile2.py Signed-off-by: Matthew Stidham --- py-json/{ => old-examples}/l3_cxprofile2.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-json/{ => old-examples}/l3_cxprofile2.py (100%) diff --git a/py-json/l3_cxprofile2.py b/py-json/old-examples/l3_cxprofile2.py similarity index 100% rename from py-json/l3_cxprofile2.py rename to py-json/old-examples/l3_cxprofile2.py From f2a6ab15bdc98ea5aeab5c4de2fd426f2fea5bed Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 5 Nov 2021 13:33:21 -0700 Subject: [PATCH 263/731] Revert "Deprecating l3_cxprofile2.py" This reverts commit d50907c8b34566112e6857d16bde273d767d0a26. --- py-json/{old-examples => }/l3_cxprofile2.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-json/{old-examples => }/l3_cxprofile2.py (100%) diff --git a/py-json/old-examples/l3_cxprofile2.py b/py-json/l3_cxprofile2.py similarity index 100% rename from py-json/old-examples/l3_cxprofile2.py rename to py-json/l3_cxprofile2.py From 20be39a531132e8fc5c47c8c36ab06221cc3f9b7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 5 Nov 2021 15:29:58 -0700 Subject: [PATCH 264/731] improve regression_test bycommenting test which freezes test Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 0d443c7d..5f017d5d 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -255,7 +255,7 @@ else #--influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ #--influx_bucket ben \ #"./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --debug --report_file measure_station_time_up.txt" - "./modify_station.py + "./create_stations.py --radio $RADIO_USED --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED && ./modify_station.py --radio $RADIO_USED --station 1.1.sta0000 --security $SECURITY @@ -311,7 +311,7 @@ else --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 \ --influx_tag testbed regression_test --influx_tag DUT ROG -o longevity.csv" "./test_l3_powersave_traffic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - "./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput -m $MGR" + #"./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput -m $MGR" #./test_l3_unicast_traffic_gen #./test_l3_unicast_traffic_gen #./test_l3_WAN_LAN From b4a9608d3f5c699ac8f657032a314cc3c6ad9a45 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 6 Nov 2021 06:21:34 -0600 Subject: [PATCH 265/731] lf_check.py : added db_override to put in unique db from command line ct_us_00X_rig.json : generic name for db in json Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_rig.json | 2 +- py-scripts/tools/ct_us_002_rig.json | 2 +- py-scripts/tools/ct_us_003_rig.json | 2 +- py-scripts/tools/ct_us_004_rig.json | 2 +- py-scripts/tools/lf_check.py | 25 ++++++++++++++++++------- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/py-scripts/tools/ct_us_001_rig.json b/py-scripts/tools/ct_us_001_rig.json index 37f9ced7..092017d7 100644 --- a/py-scripts/tools/ct_us_001_rig.json +++ b/py-scripts/tools/ct_us_001_rig.json @@ -7,7 +7,7 @@ "test_rig_parameters":{ "TEST_BED": "CT-US-001", "TEST_RIG": "CT-US-001", - "DATABASE_SQLITE": "./tools/qa_001_Oct.db", + "DATABASE_SQLITE": "./tools/qa_001.db", "LF_MGR_IP": "192.168.100.116", "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", diff --git a/py-scripts/tools/ct_us_002_rig.json b/py-scripts/tools/ct_us_002_rig.json index 56586dcb..a145500b 100644 --- a/py-scripts/tools/ct_us_002_rig.json +++ b/py-scripts/tools/ct_us_002_rig.json @@ -7,7 +7,7 @@ "test_rig_parameters":{ "TEST_BED": "CT-US-002", "TEST_RIG": "CT-US-002", - "DATABASE_SQLITE": "./tools/qa_002_Oct.db", + "DATABASE_SQLITE": "./tools/qa_002.db", "LF_MGR_IP": "192.168.100.200", "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", diff --git a/py-scripts/tools/ct_us_003_rig.json b/py-scripts/tools/ct_us_003_rig.json index 37ef1d5e..4bc7b556 100644 --- a/py-scripts/tools/ct_us_003_rig.json +++ b/py-scripts/tools/ct_us_003_rig.json @@ -7,7 +7,7 @@ "test_rig_parameters":{ "TEST_BED": "CT-US-003", "TEST_RIG": "CT-US-003", - "DATABASE_SQLITE": "./tools/qa_003_Oct.db", + "DATABASE_SQLITE": "./tools/qa_003.db", "LF_MGR_IP": "192.168.100.233", "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", diff --git a/py-scripts/tools/ct_us_004_rig.json b/py-scripts/tools/ct_us_004_rig.json index e91d3eff..61cc0075 100644 --- a/py-scripts/tools/ct_us_004_rig.json +++ b/py-scripts/tools/ct_us_004_rig.json @@ -7,7 +7,7 @@ "test_rig_parameters":{ "TEST_BED": "CT-US-004", "TEST_RIG": "CT-US-004", - "DATABASE_SQLITE": "./tools/qa_004_Oct.db", + "DATABASE_SQLITE": "./tools/qa_004.db", "LF_MGR_IP": "192.168.100.194", "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 5950228f..2bb458f6 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -130,6 +130,7 @@ class lf_check(): _json_dut, _json_test, _test_suite, + _db_override, _production, _csv_results, _outfile, @@ -140,6 +141,7 @@ class lf_check(): self.json_dut = _json_dut self.json_test = _json_test self.test_suite = _test_suite + self.db_override = _db_override self.production_run = _production self.report_path = _report_path self.log_path = _log_path @@ -360,12 +362,14 @@ class lf_check(): message_txt = """{email_txt} lanforge target {lf_mgr_ip} Results from {hostname}: Suite: {suite} +Database: {db} http://{hostname}/{report} -""".format(email_txt=self.email_txt, lf_mgr_ip=self.lf_mgr_ip, suite=self.test_suite, hostname=hostname, report=report_url) +""".format(email_txt=self.email_txt, lf_mgr_ip=self.lf_mgr_ip, suite=self.test_suite, db=self.database_sqlite, hostname=hostname, report=report_url) else: message_txt = """Results from {hostname}: Suite: {suite} -http://{hostname}/{report}""".format(hostname=hostname, suite=self.test_suite, report=report_url) +Database: {db} +http://{hostname}/{report}""".format(hostname=hostname, suite=self.test_suite, db=self.database_sqlite, report=report_url) # Put in report information current two methods supported, message_txt += """ @@ -375,10 +379,10 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if (self.email_title_txt != ""): mail_subject = "{email} [{hostname}] {suite} {date}".format(email=self.email_title_txt, hostname=hostname, - suite=self.test_suite, date=datetime.datetime.now()) + suite=self.test_suite, db=self.database_sqlite, date=datetime.datetime.now()) else: mail_subject = "Regression Test [{hostname}] {suite} {date}".format(hostname=hostname, - suite = self.test_suite, date=datetime.datetime.now()) + suite = self.test_suite, db = self.database_sqlite, date=datetime.datetime.now()) try: if self.production_run: msg = message_txt.format(ip=ip) @@ -491,10 +495,13 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.test_rig = self.json_rig["test_rig_parameters"]["TEST_RIG"] else: self.logger.info("test_rig not in test_rig_parameters json") - if "DATABASE_SQLITE" in self.json_rig["test_rig_parameters"]: - self.database_sqlite = self.json_rig["test_rig_parameters"]["DATABASE_SQLITE"] + if self.db_override is None: + if "DATABASE_SQLITE" in self.json_rig["test_rig_parameters"]: + self.database_sqlite = self.json_rig["test_rig_parameters"]["DATABASE_SQLITE"] + else: + self.logger.info("DATABASE_SQLITE not in test_rig_parameters json") else: - self.logger.info("DATABASE_SQLITE not in test_rig_parameters json") + self.database_sqlite = self.db_override if "LF_MGR_IP" in self.json_rig["test_rig_parameters"]: self.lf_mgr_ip = self.json_rig["test_rig_parameters"]["LF_MGR_IP"] else: @@ -962,6 +969,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a parser.add_argument('--json_dut', help="--json_dut ", default="", required=True) parser.add_argument('--json_test', help="--json_test ", default="", required=True) parser.add_argument('--suite', help="--suite default TEST_DICTIONARY", default="TEST_DICTIONARY") + parser.add_argument('--db_override', help="--db_override override for json DATABASE_SQLITE''", default=None) parser.add_argument('--production', help="--production stores true, sends email results to production email list", action='store_true') parser.add_argument('--outfile', help="--outfile used as base name for all files generated", @@ -1007,6 +1015,8 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a __dir = args.dir __path = args.path + db_override = args.db_override + if args.production: production = True print("Email to production list") @@ -1033,6 +1043,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a _json_dut=json_dut, _json_test=json_test, _test_suite=test_suite, + _db_override=db_override, _production=production, _csv_results=csv_results, _outfile=outfile, From f9c9efdd4e1fd1237a48eabbc20143c3b3e9a90e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 6 Nov 2021 11:26:45 -0600 Subject: [PATCH 266/731] lf_check.py : load custom db prior to each test, fixed call to scenario.py updated rig.json for current db handling Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_test_rig.json | 4 ---- py-scripts/tools/ct_us_001_rig.json | 4 ---- py-scripts/tools/ct_us_002_rig.json | 4 ---- py-scripts/tools/ct_us_003_rig.json | 4 ---- py-scripts/tools/ct_us_004_rig.json | 4 ---- py-scripts/tools/lf_check.py | 6 +++--- 6 files changed, 3 insertions(+), 23 deletions(-) diff --git a/py-scripts/tools/ct_test_rig.json b/py-scripts/tools/ct_test_rig.json index 44178cfd..53343414 100644 --- a/py-scripts/tools/ct_test_rig.json +++ b/py-scripts/tools/ct_test_rig.json @@ -14,10 +14,6 @@ "LF_MGR_PASS": "lanforge", "UPSTREAM_PORT":"1.1.eth2", "TEST_TIMEOUT": 600, - "LOAD_BLANK_DB": false, - "LOAD_FACTORY_DEFAULT_DB": false, - "LOAD_CUSTOM_DB": false, - "CUSTOM_DB": "DFLT_ETH1_GEN", "EMAIL_LIST_PRODUCTION": "support@candelatech.com", "EMAIL_LIST_TEST": "support@candelatech.com", "EMAIL_TITLE_TXT": "Lanforge QA Testing", diff --git a/py-scripts/tools/ct_us_001_rig.json b/py-scripts/tools/ct_us_001_rig.json index 092017d7..ef67ceed 100644 --- a/py-scripts/tools/ct_us_001_rig.json +++ b/py-scripts/tools/ct_us_001_rig.json @@ -14,10 +14,6 @@ "LF_MGR_PASS": "lanforge", "UPSTREAM_PORT":"1.1.eth2", "TEST_TIMEOUT": 600, - "LOAD_BLANK_DB": false, - "LOAD_FACTORY_DEFAULT_DB": false, - "LOAD_CUSTOM_DB": false, - "CUSTOM_DB": "DFLT_ETH1_GEN", "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-001", diff --git a/py-scripts/tools/ct_us_002_rig.json b/py-scripts/tools/ct_us_002_rig.json index a145500b..43819d0d 100644 --- a/py-scripts/tools/ct_us_002_rig.json +++ b/py-scripts/tools/ct_us_002_rig.json @@ -14,10 +14,6 @@ "LF_MGR_PASS": "lanforge", "UPSTREAM_PORT": "1.1.eth2", "TEST_TIMEOUT": 600, - "LOAD_BLANK_DB": false, - "LOAD_FACTORY_DEFAULT_DB": true, - "LOAD_CUSTOM_DB": false, - "CUSTOM_DB": "DFLT_ETH1_GEN", "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-002", diff --git a/py-scripts/tools/ct_us_003_rig.json b/py-scripts/tools/ct_us_003_rig.json index 4bc7b556..053ea38f 100644 --- a/py-scripts/tools/ct_us_003_rig.json +++ b/py-scripts/tools/ct_us_003_rig.json @@ -14,10 +14,6 @@ "LF_MGR_PASS": "lanforge", "UPSTREAM_PORT":"1.1.eth1", "TEST_TIMEOUT": 600, - "LOAD_BLANK_DB": false, - "LOAD_FACTORY_DEFAULT_DB": false, - "LOAD_CUSTOM_DB": false, - "CUSTOM_DB": "DFLT_ETH1_GEN", "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-003", diff --git a/py-scripts/tools/ct_us_004_rig.json b/py-scripts/tools/ct_us_004_rig.json index 61cc0075..6d386d46 100644 --- a/py-scripts/tools/ct_us_004_rig.json +++ b/py-scripts/tools/ct_us_004_rig.json @@ -14,10 +14,6 @@ "LF_MGR_PASS": "lanforge", "UPSTREAM_PORT": "1.1.eth2", "TEST_TIMEOUT": 300, - "LOAD_BLANK_DB": false, - "LOAD_FACTORY_DEFAULT_DB": true, - "LOAD_CUSTOM_DB": false, - "CUSTOM_DB": "DFLT_ETH1_GEN", "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", "EMAIL_TITLE_TXT": "Lanforge QA Testing CT-US-004", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 2bb458f6..bad307ec 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -597,15 +597,15 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.logger.info("failed to change to {}".format(self.scripts_wd)) # no spaces after FACTORY_DFLT - command = "./{} {}".format("scenario.py", "--load {}".format(custom_db)) + command = "./scenario.py --mgr {mgr} --load {db} --action {action}".format(mgr=self.lf_mgr_ip,db=custom_db,action="overwrite") process = subprocess.Popen((command).split(' '), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) # wait for the process to terminate out, err = process.communicate() errcode = process.returncode - print("load_custome_database errcode: {errcode}".format(errcode=errcode)) + print("load_custom_database out: {out} errcode: {errcode} err: {err}".format(out=out,errcode=errcode,err=err)) # DO NOT REMOVE 15 second sleep. - # After every DB load, the loed changes are applied, and part of the apply is to re-build + # After every DB load, the load changes are applied, and part of the apply is to re-build # The underlying netsmith objects sleep(15) From 2899eddb07d0009474ae932d916e2ebc397339fb Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 6 Nov 2021 12:10:39 -0600 Subject: [PATCH 267/731] lf_check.py : verify the scenerio.py is called with the correct parameters Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index bad307ec..54c7c167 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -596,8 +596,12 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) except BaseException: self.logger.info("failed to change to {}".format(self.scripts_wd)) - # no spaces after FACTORY_DFLT - command = "./scenario.py --mgr {mgr} --load {db} --action {action}".format(mgr=self.lf_mgr_ip,db=custom_db,action="overwrite") + # WARNING do not simplify the following constructed command + #command = "./{} {} {} {}".format("scenario.py", "--mgr {mgr}"\ + # .format(mgr=self.lf_mgr_ip),"--load {db}".format(db=custom_db),"--action {action}".format(action="overwrite")) + command = "./{cmd} --mgr {mgr} --load {db} --action {action}".format(cmd="scenario.py",mgr=self.lf_mgr_ip,db=custom_db,action="overwrite") + print("command: {command}".format(command=command)) + process = subprocess.Popen((command).split(' '), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) # wait for the process to terminate From ae5b49d4d5de1f1ffb7bb221670cce6512f046bb Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 6 Nov 2021 12:18:06 -0600 Subject: [PATCH 268/731] lf_check.py : pep8 and white space Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 481 ++++++++++++++++++++++++----------- 1 file changed, 337 insertions(+), 144 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 54c7c167..32f5673d 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -123,7 +123,8 @@ sys.path.insert(0, parent_dir_path) FORMAT = '%(asctime)s %(name)s %(levelname)s: %(message)s' -# lf_check class contains verificaiton configuration and ocastrates the testing. +# lf_check class contains verificaiton configuration and ocastrates the +# testing. class lf_check(): def __init__(self, _json_rig, @@ -153,7 +154,8 @@ class lf_check(): self.outfile = _outfile self.outfile_name = _outfile_name self.test_result = "Failure" - self.results_col_titles = ["Test", "Command", "Result", "STDOUT", "STDERR"] + self.results_col_titles = [ + "Test", "Command", "Result", "STDOUT", "STDERR"] self.html_results = "" self.background_green = "background-color:green" self.background_red = "background-color:red" @@ -193,7 +195,9 @@ class lf_check(): # section DUT # dut selection - self.dut_set_name = 'DUT_NAME ASUSRT-AX88U' # note the name will be set as --set DUT_NAME ASUSRT-AX88U, this is not dut_name (see above) + # note the name will be set as --set DUT_NAME ASUSRT-AX88U, this is not + # dut_name (see above) + self.dut_set_name = 'DUT_NAME ASUSRT-AX88U' self.use_dut_name = "DUT_NAME_NA" # "ASUSRT-AX88U" note this is not dut_set_name self.dut_hw = "DUT_HW_NA" self.dut_sw = "DUT_SW_NA" @@ -234,10 +238,13 @@ class lf_check(): def get_scripts_git_sha(self): # get git sha - process = subprocess.Popen(["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE) + process = subprocess.Popen( + ["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE) (commit_hash, err) = process.communicate() exit_code = process.wait() - print("get_scripts_get_sha exit_code: {exit_code}".format(exit_code=exit_code)) + print( + "get_scripts_get_sha exit_code: {exit_code}".format( + exit_code=exit_code)) scripts_git_sha = commit_hash.decode('utf-8', 'ignore') return scripts_git_sha @@ -254,10 +261,17 @@ class lf_check(): # curl --user "lanforge:lanforge" -H 'Accept: application/json' # http://192.168.100.116:8080/radiostatus/all | json_pp , where --user # "USERNAME:PASSWORD" - request_command = 'http://{lfmgr}:{port}/radiostatus/all'.format(lfmgr=self.lf_mgr_ip, port=self.lf_mgr_port) - request = requests.get(request_command, auth=(self.lf_mgr_user, self.lf_mgr_pass)) - print("radio request command: {request_command}".format(request_command=request_command)) - print("radio request status_code {status}".format(status=request.status_code)) + request_command = 'http://{lfmgr}:{port}/radiostatus/all'.format( + lfmgr=self.lf_mgr_ip, port=self.lf_mgr_port) + request = requests.get( + request_command, auth=( + self.lf_mgr_user, self.lf_mgr_pass)) + print( + "radio request command: {request_command}".format( + request_command=request_command)) + print( + "radio request status_code {status}".format( + status=request.status_code)) lanforge_radio_json = request.json() print("radio request.json: {json}".format(json=lanforge_radio_json)) lanforge_radio_text = request.text @@ -265,69 +279,88 @@ class lf_check(): return lanforge_radio_json, lanforge_radio_text def get_lanforge_system_node_version(self): - ssh = paramiko.SSHClient() # creating shh client object we use this object to connect to router - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # automatically adds the missing host key + # creating shh client object we use this object to connect to router + ssh = paramiko.SSHClient() + # automatically adds the missing host key + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname=self.lf_mgr_ip, port=22, username=self.lf_mgr_user, password=self.lf_mgr_pass, allow_agent=False, look_for_keys=False, banner_timeout=600) stdin, stdout, stderr = ssh.exec_command('uname -n') self.lanforge_system_node_version = stdout.readlines() - self.lanforge_system_node_version = [line.replace('\n', '') for line in self.lanforge_system_node_version] + self.lanforge_system_node_version = [line.replace( + '\n', '') for line in self.lanforge_system_node_version] ssh.close() time.sleep(1) return self.lanforge_system_node_version def get_lanforge_kernel_version(self): - ssh = paramiko.SSHClient() # creating shh client object we use this object to connect to router - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # automatically adds the missing host key + # creating shh client object we use this object to connect to router + ssh = paramiko.SSHClient() + # automatically adds the missing host key + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname=self.lf_mgr_ip, port=22, username=self.lf_mgr_user, password=self.lf_mgr_pass, allow_agent=False, look_for_keys=False, banner_timeout=600) stdin, stdout, stderr = ssh.exec_command('uname -r') self.lanforge_kernel_version = stdout.readlines() - self.lanforge_kernel_version = [line.replace('\n', '') for line in self.lanforge_kernel_version] + self.lanforge_kernel_version = [line.replace( + '\n', '') for line in self.lanforge_kernel_version] ssh.close() time.sleep(1) return self.lanforge_kernel_version def get_lanforge_server_version(self): - ssh = paramiko.SSHClient() # creating shh client object we use this object to connect to router - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # automatically adds the missing host key + # creating shh client object we use this object to connect to router + ssh = paramiko.SSHClient() + # automatically adds the missing host key + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname=self.lf_mgr_ip, port=22, username=self.lf_mgr_user, password=self.lf_mgr_pass, allow_agent=False, look_for_keys=False, banner_timeout=600) - stdin, stdout, stderr = ssh.exec_command('./btserver --version | grep Version') + stdin, stdout, stderr = ssh.exec_command( + './btserver --version | grep Version') self.lanforge_server_version_full = stdout.readlines() - self.lanforge_server_version_full = [line.replace('\n', '') for line in self.lanforge_server_version_full] - print("lanforge_server_version_full: {lanforge_server_version_full}".format(lanforge_server_version_full=self.lanforge_server_version_full)) - self.lanforge_server_version = self.lanforge_server_version_full[0].split('Version:', maxsplit=1)[-1].split(maxsplit=1)[0] + self.lanforge_server_version_full = [line.replace( + '\n', '') for line in self.lanforge_server_version_full] + print("lanforge_server_version_full: {lanforge_server_version_full}".format( + lanforge_server_version_full=self.lanforge_server_version_full)) + self.lanforge_server_version = self.lanforge_server_version_full[0].split( + 'Version:', maxsplit=1)[-1].split(maxsplit=1)[0] self.lanforge_server_version = self.lanforge_server_version.strip() - print("lanforge_server_version: {lanforge_server_version}".format(lanforge_server_version=self.lanforge_server_version)) + print("lanforge_server_version: {lanforge_server_version}".format( + lanforge_server_version=self.lanforge_server_version)) ssh.close() time.sleep(1) return self.lanforge_server_version_full def get_lanforge_gui_version(self): - ssh = paramiko.SSHClient() # creating shh client object we use this object to connect to router - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # automatically adds the missing host key + # creating shh client object we use this object to connect to router + ssh = paramiko.SSHClient() + # automatically adds the missing host key + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname=self.lf_mgr_ip, port=22, username=self.lf_mgr_user, password=self.lf_mgr_pass, allow_agent=False, look_for_keys=False, banner_timeout=600) stdin, stdout, stderr = ssh.exec_command( 'curl -H "Accept: application/json" http://{lanforge_ip}:8080 | json_pp | grep -A 7 "VersionInfo"'.format(lanforge_ip=self.lf_mgr_ip)) self.lanforge_gui_version_full = stdout.readlines() # print("lanforge_gui_version_full pre: {lanforge_gui_version_full}".format(lanforge_gui_version_full=self.lanforge_gui_version_full)) - self.lanforge_gui_version_full = [line.replace('\n', '') for line in self.lanforge_gui_version_full] + self.lanforge_gui_version_full = [line.replace( + '\n', '') for line in self.lanforge_gui_version_full] # print("lanforge_gui_version_full: {lanforge_gui_version_full}".format(lanforge_gui_version_full=self.lanforge_gui_version_full)) for element in self.lanforge_gui_version_full: if "BuildVersion" in element: ver_str = str(element) - self.lanforge_gui_version = ver_str.split(':', maxsplit=1)[-1].replace(',', '') + self.lanforge_gui_version = ver_str.split( + ':', maxsplit=1)[-1].replace(',', '') self.lanforge_gui_version = self.lanforge_gui_version.strip().replace('"', '') print("BuildVersion {}".format(self.lanforge_gui_version)) if "BuildDate" in element: gui_str = str(element) - self.lanforge_gui_build_date = gui_str.split(':', maxsplit=1)[-1].replace(',', '') + self.lanforge_gui_build_date = gui_str.split( + ':', maxsplit=1)[-1].replace(',', '') print("BuildDate {}".format(self.lanforge_gui_build_date)) if "GitVersion" in element: git_sha_str = str(element) - self.lanforge_gui_git_sha = git_sha_str.split(':', maxsplit=1)[-1].replace(',', '') + self.lanforge_gui_git_sha = git_sha_str.split( + ':', maxsplit=1)[-1].replace(',', '') print("GitVersion {}".format(self.lanforge_gui_git_sha)) ssh.close() @@ -353,20 +386,21 @@ class lf_check(): ip = socket.gethostbyname(hostname) # a hostname lacking dots by definition lacks a domain name - # this is not useful for hyperlinks outside the known domain, so an IP address should be preferred + # this is not useful for hyperlinks outside the known domain, so an IP + # address should be preferred if hostname.find('.') < 1: hostname = ip message_txt = "" if (self.email_txt != ""): message_txt = """{email_txt} lanforge target {lf_mgr_ip} -Results from {hostname}: +Results from {hostname}: Suite: {suite} Database: {db} http://{hostname}/{report} """.format(email_txt=self.email_txt, lf_mgr_ip=self.lf_mgr_ip, suite=self.test_suite, db=self.database_sqlite, hostname=hostname, report=report_url) else: - message_txt = """Results from {hostname}: + message_txt = """Results from {hostname}: Suite: {suite} Database: {db} http://{hostname}/{report}""".format(hostname=hostname, suite=self.test_suite, db=self.database_sqlite, report=report_url) @@ -379,14 +413,15 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if (self.email_title_txt != ""): mail_subject = "{email} [{hostname}] {suite} {date}".format(email=self.email_title_txt, hostname=hostname, - suite=self.test_suite, db=self.database_sqlite, date=datetime.datetime.now()) + suite=self.test_suite, db=self.database_sqlite, date=datetime.datetime.now()) else: - mail_subject = "Regression Test [{hostname}] {suite} {date}".format(hostname=hostname, - suite = self.test_suite, db = self.database_sqlite, date=datetime.datetime.now()) + mail_subject = "Regression Test [{hostname}] {suite} {date}".format(hostname=hostname, + suite=self.test_suite, db=self.database_sqlite, date=datetime.datetime.now()) try: if self.production_run: msg = message_txt.format(ip=ip) - # for postfix from command line echo "My message" | mail -s subject user@candelatech.com + # for postfix from command line echo "My message" | mail -s + # subject user@candelatech.com command = "echo \"{message}\" | mail -s \"{subject}\" {address}".format( message=msg, subject=mail_subject, @@ -410,8 +445,10 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) def start_csv_results(self): print("self.csv_results") self.csv_results_file = open(self.csv_results, "w") - self.csv_results_writer = csv.writer(self.csv_results_file, delimiter=",") - self.csv_results_column_headers = ['Test', 'Command', 'Result', 'STDOUT', 'STDERR'] + self.csv_results_writer = csv.writer( + self.csv_results_file, delimiter=",") + self.csv_results_column_headers = [ + 'Test', 'Command', 'Result', 'STDOUT', 'STDERR'] self.csv_results_writer.writerow(self.csv_results_column_headers) self.csv_results_file.flush() @@ -458,8 +495,11 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) # self.logger.info("test_rig_parameters {}".format(self.json_rig["test_rig_parameters"])) self.read_test_rig_parameters() else: - self.logger.info("EXITING test_rig_parameters not in json {}".format(self.json_rig)) - self.logger.info("EXITING ERROR test_rig_parameters not in rig json") + self.logger.info( + "EXITING test_rig_parameters not in json {}".format( + self.json_rig)) + self.logger.info( + "EXITING ERROR test_rig_parameters not in rig json") exit(1) # read dut configuration @@ -468,24 +508,34 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.logger.info("json: read test_dut") self.read_dut_parameters() else: - self.logger.info("EXITING test_dut not in json {}".format(self.json_dut)) + self.logger.info( + "EXITING test_dut not in json {}".format( + self.json_dut)) self.logger.info("EXITING ERROR test_dut not in dut json {}") exit(1) # Top Level for reading the tests to run def read_json_test(self): if "test_suites" in self.json_test: - self.logger.info("json: read test_suites looking for: {}".format(self.test_suite)) + self.logger.info( + "json: read test_suites looking for: {}".format( + self.test_suite)) # self.logger.info("test_suites {}".format(self.json_test["test_suites"])) if self.test_suite in self.json_test["test_suites"]: self.test_dict = self.json_test["test_suites"][self.test_suite] # self.logger.info("self.test_dict {}".format(self.test_dict)) else: - self.logger.info("EXITING test_suite {} Not Present in json test_suites: {}".format(self.test_suite, self.json_test["test_suites"])) - self.logger.info("EXITING ERROR test_suite {} Not Present in json test_suites".format(self.test_suite)) + self.logger.info( + "EXITING test_suite {} Not Present in json test_suites: {}".format( + self.test_suite, self.json_test["test_suites"])) + self.logger.info( + "EXITING ERROR test_suite {} Not Present in json test_suites".format( + self.test_suite)) exit(1) else: - self.logger.info("EXITING test_suites not in json {}".format(self.json_test)) + self.logger.info( + "EXITING test_suites not in json {}".format( + self.json_test)) self.logger.info("EXITING ERROR test_suites not in json test") exit(1) @@ -499,7 +549,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if "DATABASE_SQLITE" in self.json_rig["test_rig_parameters"]: self.database_sqlite = self.json_rig["test_rig_parameters"]["DATABASE_SQLITE"] else: - self.logger.info("DATABASE_SQLITE not in test_rig_parameters json") + self.logger.info( + "DATABASE_SQLITE not in test_rig_parameters json") else: self.database_sqlite = self.db_override if "LF_MGR_IP" in self.json_rig["test_rig_parameters"]: @@ -531,7 +582,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if "EMAIL_LIST_PRODUCTION" in self.json_rig["test_rig_parameters"]: self.email_list_production = self.json_rig["test_rig_parameters"]["EMAIL_LIST_PRODUCTION"] else: - self.logger.info("EMAIL_LIST_PRODUCTION not in test_rig_parameters json") + self.logger.info( + "EMAIL_LIST_PRODUCTION not in test_rig_parameters json") exit(1) if "EMAIL_LIST_TEST" in self.json_rig["test_rig_parameters"]: self.email_list_test = self.json_rig["test_rig_parameters"]["EMAIL_LIST_TEST"] @@ -555,7 +607,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.dut_set_name = self.json_dut["test_dut"]["DUT_SET_NAME"] else: self.logger.info("DUT_SET_NAME not in test_dut json") - # dut name will set a chamberview scenerio for a DUT which can be selected with dut_set_name + # dut name will set a chamberview scenerio for a DUT which can be + # selected with dut_set_name if "USE_DUT_NAME" in self.json_dut["test_dut"]: self.use_dut_name = self.json_dut["test_dut"]["USE_DUT_NAME"] else: @@ -583,12 +636,14 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if "wireless_network_dict" in self.json_dut["test_dut"]: self.wireless_network_dict = self.json_dut["test_dut"]["wireless_network_dict"] - self.logger.info("self.wireless_network_dict {}".format(self.wireless_network_dict)) + self.logger.info( + "self.wireless_network_dict {}".format( + self.wireless_network_dict)) else: self.logger.info("wireless_network_dict not in test_dut json") exit(1) - # custom will accept --load FACTORY_DFLT and --load BLANK + # custom will accept --load FACTORY_DFLT and --load BLANK # TODO make a list def load_custom_database(self, custom_db): try: @@ -596,18 +651,23 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) except BaseException: self.logger.info("failed to change to {}".format(self.scripts_wd)) - # WARNING do not simplify the following constructed command - #command = "./{} {} {} {}".format("scenario.py", "--mgr {mgr}"\ + # WARNING do not simplify the following constructed command + # command = "./{} {} {} {}".format("scenario.py", "--mgr {mgr}"\ # .format(mgr=self.lf_mgr_ip),"--load {db}".format(db=custom_db),"--action {action}".format(action="overwrite")) - command = "./{cmd} --mgr {mgr} --load {db} --action {action}".format(cmd="scenario.py",mgr=self.lf_mgr_ip,db=custom_db,action="overwrite") + command = "./{cmd} --mgr {mgr} --load {db} --action {action}".format( + cmd="scenario.py", mgr=self.lf_mgr_ip, db=custom_db, action="overwrite") print("command: {command}".format(command=command)) - + process = subprocess.Popen((command).split(' '), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) # wait for the process to terminate out, err = process.communicate() errcode = process.returncode - print("load_custom_database out: {out} errcode: {errcode} err: {err}".format(out=out,errcode=errcode,err=err)) + print( + "load_custom_database out: {out} errcode: {errcode} err: {err}".format( + out=out, + errcode=errcode, + err=err)) # DO NOT REMOVE 15 second sleep. # After every DB load, the load changes are applied, and part of the apply is to re-build # The underlying netsmith objects @@ -624,24 +684,34 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) elif self.test_dict[test]['enabled'] == "TRUE": # TODO Place test interations here if 'iterations' in self.test_dict[test]: - self.logger.info("iterations : {}".format(self.test_dict[test]['iterations'])) - self.test_iterations = int(self.test_dict[test]['iterations']) + self.logger.info( + "iterations : {}".format( + self.test_dict[test]['iterations'])) + self.test_iterations = int( + self.test_dict[test]['iterations']) else: self.test_iterations = self.test_iterations_default iteration = 0 - report_index = 0 # log may contain multiple runs - this helps put the meta.txt in right directory + # log may contain multiple runs - this helps put the meta.txt + # in right directory + report_index = 0 for iteration in range(self.test_iterations): iteration += 1 # The network arguments need to be changed when in a list - for index, args_list_element in enumerate(self.test_dict[test]['args_list']): + for index, args_list_element in enumerate( + self.test_dict[test]['args_list']): if 'ssid_idx=' in args_list_element: # print("args_list_element {}".format(args_list_element)) - # get ssid_idx used in the test as an index for the dictionary - ssid_idx_number = args_list_element.split('ssid_idx=')[-1].split()[0] - print("ssid_idx_number: {}".format(ssid_idx_number)) - idx = "ssid_idx={}".format(ssid_idx_number) # index into the DUT network index + # get ssid_idx used in the test as an index for the + # dictionary + ssid_idx_number = args_list_element.split( + 'ssid_idx=')[-1].split()[0] + print( + "ssid_idx_number: {}".format(ssid_idx_number)) + # index into the DUT network index + idx = "ssid_idx={}".format(ssid_idx_number) print("idx: {}".format(idx)) if 'SSID_USED' in args_list_element: self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace( @@ -656,49 +726,67 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace( 'BSSID', self.wireless_network_dict[idx]['BSSID']) - # use_ssid_idx is ephemeral and used only for variable replacement , remove + # use_ssid_idx is ephemeral and used only for + # variable replacement , remove tmp_idx = "use_ssid_idx={}".format(ssid_idx_number) if tmp_idx in args_list_element: - self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace(tmp_idx, '') + self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace( + tmp_idx, '') # leave in for checking the command line arguments - print("self.test_dict[test]['args_list']: {}".format(self.test_dict[test]['args_list'])) + print( + "self.test_dict[test]['args_list']: {}".format( + self.test_dict[test]['args_list'])) - # Walk all the args in the args list then construct the arguments + # Walk all the args in the args list then construct the + # arguments if self.test_dict[test]['args'] == "": self.test_dict[test]['args'] = self.test_dict[test]['args'].replace(self.test_dict[test]['args'], ''.join(self.test_dict[test][ 'args_list'])) if 'DATABASE_SQLITE' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_SQLITE', self.database_sqlite) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'DATABASE_SQLITE', self.database_sqlite) if 'HTTP_TEST_IP' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('HTTP_TEST_IP', self.http_test_ip) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'HTTP_TEST_IP', self.http_test_ip) if 'FTP_TEST_IP' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('FTP_TEST_IP', self.ftp_test_ip) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'FTP_TEST_IP', self.ftp_test_ip) if 'TEST_IP' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('TEST_IP', self.test_ip) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'TEST_IP', self.test_ip) if 'LF_MGR_USER' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('LF_MGR_USER', self.lf_mgr_user) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'LF_MGR_USER', self.lf_mgr_user) if 'LF_MGR_PASS' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('LF_MGR_PASS', self.lf_mgr_pass) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'LF_MGR_PASS', self.lf_mgr_pass) if 'LF_MGR_IP' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('LF_MGR_IP', self.lf_mgr_ip) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'LF_MGR_IP', self.lf_mgr_ip) if 'LF_MGR_PORT' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('LF_MGR_PORT', self.lf_mgr_port) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'LF_MGR_PORT', self.lf_mgr_port) # DUT Configuration if 'USE_DUT_NAME' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('USE_DUT_NAME', self.use_dut_name) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'USE_DUT_NAME', self.use_dut_name) if 'DUT_HW' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_HW', self.dut_hw) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'DUT_HW', self.dut_hw) if 'DUT_SW' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_SW', self.dut_sw) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'DUT_SW', self.dut_sw) if 'DUT_MODEL' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_MODEL', self.dut_model) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'DUT_MODEL', self.dut_model) if 'DUT_SERIAL' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_SERIAL', self.dut_serial) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'DUT_SERIAL', self.dut_serial) if 'UPSTREAM_PORT' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('UPSTREAM_PORT', @@ -706,13 +794,15 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) # lf_dataplane_test.py and lf_wifi_capacity_test.py use a parameter --local_path for the location # of the reports when the reports are pulled. if 'REPORT_PATH' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('REPORT_PATH', self.report_path) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'REPORT_PATH', self.report_path) if 'DUT_SET_NAME' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_SET_NAME', self.dut_set_name) if 'TEST_RIG' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('TEST_RIG', self.test_rig) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'TEST_RIG', self.test_rig) # END of command line arg processing if self.test_dict[test]['args'] == "": @@ -721,17 +811,23 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) 'args_list'])) if 'timeout' in self.test_dict[test]: - self.logger.info("timeout : {}".format(self.test_dict[test]['timeout'])) - self.test_timeout = int(self.test_dict[test]['timeout']) + self.logger.info( + "timeout : {}".format( + self.test_dict[test]['timeout'])) + self.test_timeout = int( + self.test_dict[test]['timeout']) else: self.test_timeout = self.test_timeout_default if 'load_db' in self.test_dict[test]: - self.logger.info("load_db : {}".format(self.test_dict[test]['load_db'])) + self.logger.info( + "load_db : {}".format( + self.test_dict[test]['load_db'])) if str(self.test_dict[test]['load_db']).lower() != "none" and str( self.test_dict[test]['load_db']).lower() != "skip": try: - self.load_custom_database(self.test_dict[test]['load_db']) + self.load_custom_database( + self.test_dict[test]['load_db']) except BaseException: self.logger.info("custom database failed to load check existance and location: {}".format( self.test_dict[test]['load_db'])) @@ -740,32 +836,46 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) os.chdir(self.scripts_wd) # self.logger.info("Current Working Directory {}".format(os.getcwd())) except BaseException: - self.logger.info("failed to change to {}".format(self.scripts_wd)) + self.logger.info( + "failed to change to {}".format( + self.scripts_wd)) cmd_args = "{}".format(self.test_dict[test]['args']) - command = "./{} {}".format(self.test_dict[test]['command'], cmd_args) + command = "./{} {}".format( + self.test_dict[test]['command'], cmd_args) self.logger.info("command: {}".format(command)) self.logger.info("cmd_args {}".format(cmd_args)) if self.outfile_name is not None: - stdout_log_txt = os.path.join(self.log_path, "{}-{}-stdout.txt".format(self.outfile_name, test)) - self.logger.info("stdout_log_txt: {}".format(stdout_log_txt)) + stdout_log_txt = os.path.join( + self.log_path, "{}-{}-stdout.txt".format(self.outfile_name, test)) + self.logger.info( + "stdout_log_txt: {}".format(stdout_log_txt)) stdout_log = open(stdout_log_txt, 'a') - stderr_log_txt = os.path.join(self.log_path, "{}-{}-stderr.txt".format(self.outfile_name, test)) - self.logger.info("stderr_log_txt: {}".format(stderr_log_txt)) + stderr_log_txt = os.path.join( + self.log_path, "{}-{}-stderr.txt".format(self.outfile_name, test)) + self.logger.info( + "stderr_log_txt: {}".format(stderr_log_txt)) stderr_log = open(stderr_log_txt, 'a') # need to take into account --raw_line parameters thus need to use shlex.split - # need to preserve command to have correct command syntax in command output + # need to preserve command to have correct command syntax + # in command output command_to_run = command command_to_run = shlex.split(command_to_run) - print("running {command_to_run}".format(command_to_run=command_to_run)) - self.test_start_time = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")).replace(':', '-') - print("Test start: {time}".format(time=self.test_start_time)) + print( + "running {command_to_run}".format( + command_to_run=command_to_run)) + self.test_start_time = str(datetime.datetime.now().strftime( + "%Y-%m-%d-%H-%M-%S")).replace(':', '-') + print( + "Test start: {time}".format( + time=self.test_start_time)) start_time = datetime.datetime.now() try: process = subprocess.Popen(command_to_run, shell=False, stdout=stdout_log, stderr=stderr_log, universal_newlines=True) - # if there is a better solution please propose, the TIMEOUT Result is different then FAIL + # if there is a better solution please propose, the + # TIMEOUT Result is different then FAIL try: if int(self.test_timeout != 0): process.wait(timeout=int(self.test_timeout)) @@ -776,12 +886,17 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.test_result = "TIMEOUT" except BaseException: - print("No such file or directory with command: {}".format(command)) - self.logger.info("No such file or directory with command: {}".format(command)) + print( + "No such file or directory with command: {}".format(command)) + self.logger.info( + "No such file or directory with command: {}".format(command)) end_time = datetime.datetime.now() - self.test_end_time = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")).replace(':', '-') - print("Test end time {time}".format(time=self.test_end_time)) + self.test_end_time = str(datetime.datetime.now().strftime( + "%Y-%m-%d-%H-%M-%S")).replace(':', '-') + print( + "Test end time {time}".format( + time=self.test_end_time)) time_delta = end_time - start_time self.duration = "{day}d {seconds}s {msec} ms".format( @@ -789,38 +904,56 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) # If collect meta data is set meta_data_path = "" - # Will gather data even on a TIMEOUT condition as there is some results on longer tests + # Will gather data even on a TIMEOUT condition as there is + # some results on longer tests stdout_log_size = os.path.getsize(stdout_log_txt) if stdout_log_size > 0: stdout_log_fd = open(stdout_log_txt) # "Report Location:::/home/lanforge/html-reports/wifi-capacity-2021-08-17-04-02-56" # - + for line in stdout_log_fd: if "Report Location" in line: report_index += 1 if iteration == report_index: meta_data_path = line.replace('"', '') - meta_data_path = meta_data_path.replace('Report Location:::', '') - meta_data_path = meta_data_path.split('/')[-1] + meta_data_path = meta_data_path.replace( + 'Report Location:::', '') + meta_data_path = meta_data_path.split( + '/')[-1] meta_data_path = meta_data_path.strip() meta_data_path = self.report_path + '/' + meta_data_path + '/meta.txt' break stdout_log_fd.close() if meta_data_path != "": meta_data_fd = open(meta_data_path, 'w+') - meta_data_fd.write('$ Generated by Candela Technologies LANforge network testing tool\n') - meta_data_fd.write("test_run {test_run}\n".format(test_run=self.report_path)) - meta_data_fd.write("file_meta {path}\n".format(path=meta_data_path)) - meta_data_fd.write('lanforge_gui_version: {gui_version} \n'.format(gui_version=self.lanforge_gui_version)) - meta_data_fd.write('lanforge_server_version: {server_version} \n'.format(server_version=self.lanforge_server_version)) + meta_data_fd.write( + '$ Generated by Candela Technologies LANforge network testing tool\n') + meta_data_fd.write( + "test_run {test_run}\n".format( + test_run=self.report_path)) + meta_data_fd.write( + "file_meta {path}\n".format( + path=meta_data_path)) + meta_data_fd.write( + 'lanforge_gui_version: {gui_version} \n'.format( + gui_version=self.lanforge_gui_version)) + meta_data_fd.write( + 'lanforge_server_version: {server_version} \n'.format( + server_version=self.lanforge_server_version)) meta_data_fd.write('$ LANforge command\n') - meta_data_fd.write("command {command}\n".format(command=command)) - # split command at test-tag , at rest of string once at the actual test-tag value - test_tag = command.split('test_tag', maxsplit=1)[-1].split(maxsplit=1)[0] + meta_data_fd.write( + "command {command}\n".format( + command=command)) + # split command at test-tag , at rest of string once at + # the actual test-tag value + test_tag = command.split( + 'test_tag', maxsplit=1)[-1].split(maxsplit=1)[0] test_tag = test_tag.replace("'", "") meta_data_fd.write('$ LANforge test tag\n') - meta_data_fd.write("test_tag {test_tag}\n".format(test_tag=test_tag)) + meta_data_fd.write( + "test_tag {test_tag}\n".format( + test_tag=test_tag)) # LANforge information is a list thus [0] meta_data_fd.write('$ LANforge Information\n') meta_data_fd.write( @@ -839,7 +972,9 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) stderr_log_size = os.path.getsize(stderr_log_txt) if stderr_log_size > 0: - self.logger.info("File: {} is not empty: {}".format(stderr_log_txt, str(stderr_log_size))) + self.logger.info( + "File: {} is not empty: {}".format( + stderr_log_txt, str(stderr_log_size))) text = open(stderr_log_txt).read() if 'Error' in text: self.text_result = "Failure" @@ -848,7 +983,9 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.text_result = "Success" background = self.background_green else: - self.logger.info("File: {} is empty: {}".format(stderr_log_txt, str(stderr_log_size))) + self.logger.info( + "File: {} is empty: {}".format( + stderr_log_txt, str(stderr_log_size))) self.test_result = "Success" background = self.background_green @@ -859,7 +996,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if 'ERROR: Could not find component: TestTag' in text: self.test_result = "Success" background = self.background_green - # leave the space in after error to not pick up tx errors or rx errors + # leave the space in after error to not pick up tx + # errors or rx errors elif 'error ' in text.lower(): self.test_result = "Test Fail" background = self.background_orange @@ -873,7 +1011,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) # if there was a if self.test_result == "TIMEOUT": - self.logger.info("TIMEOUT FAILURE, Check LANforge Radios") + self.logger.info( + "TIMEOUT FAILURE, Check LANforge Radios") self.test_result = "Time Out" background = self.background_purple @@ -882,14 +1021,20 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) for line in line_list: if 'html report:' in line: self.qa_report_html = line - print("html_report: {report}".format(report=self.qa_report_html)) + print( + "html_report: {report}".format( + report=self.qa_report_html)) break - self.qa_report_html = self.qa_report_html.replace('html report: ', '') + self.qa_report_html = self.qa_report_html.replace( + 'html report: ', '') - # stdout_log_link is used for the email reporting to have the corrected path - stdout_log_link = str(stdout_log_txt).replace('/home/lanforge', '') - stderr_log_link = str(stderr_log_txt).replace('/home/lanforge', '') + # stdout_log_link is used for the email reporting to have + # the corrected path + stdout_log_link = str(stdout_log_txt).replace( + '/home/lanforge', '') + stderr_log_link = str(stderr_log_txt).replace( + '/home/lanforge', '') if command.find(' ') > 1: short_cmd = command[0:command.find(' ')] else: @@ -913,7 +1058,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.html_results += """""" self.html_results += """""" - # TODO - plase copy button at end and selectable , so individual sections may be copied + # TODO - plase copy button at end and selectable , so + # individual sections may be copied if command != short_cmd: '''self.html_results += f""" + ") else echo "No errors detected" results+=(" + ") fi @@ -536,6 +541,7 @@ function html_generator() { + " From ac34a5316c4bb9a8ccd30d2f1da5b63cfd34bfbd Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 11 Nov 2021 11:47:39 -0700 Subject: [PATCH 310/731] ct_us_001_tests.json : updated for using the wifi_mode and wifi_settings per radio Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 0d2524e0..d9a64bd8 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -40,6 +40,33 @@ ] } }, + "suite_l3_wifi":{ + "test_l3_longevity":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 1s --upstream_port eth2 ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_wiphy_4_5_6_7_AX'" + ] + }, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + }, "suite_l3_ap":{ "test_l3_longevity":{ "enabled":"TRUE", From e128b2d44fffb68c82663e5012029b68282619d0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 11 Nov 2021 10:48:03 -0800 Subject: [PATCH 311/731] Remove single letter variables in regression_test Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 113 ++++++++++++++++++++++++---------- 1 file changed, 80 insertions(+), 33 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index d981af75..fbe4593e 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -157,18 +157,45 @@ function testgroup_delete_group() { if [[ ${#SHORT} -gt 0 ]]; then testCommands=( - run_l3_longevity - "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" + # run_l3_longevity + # "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" + "./lf_ap_auto_test.py + --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ + --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ + --dut5_0 '$DUT5 (2)' \ + --dut2_0 '$DUT2 (1)' \ + --max_stations_2 100 \ + --max_stations_5 100 \ + --max_stations_dual 200 \ + --radio2 1.1.wiphy0 \ + --radio2 1.1.wiphy1 \ + --set 'Basic Client Connectivity' 1 \ + --set 'Multi Band Performance' 1 \ + --set 'Skip 2.4Ghz Tests' 1 \ + --set 'Skip 5Ghz Tests' 1 + --set 'Throughput vs Pkt Size' 0 \ + --set 'Capacity' 0 \ + --set 'Stability' 0 \ + --set 'Band-Steering' 0 \ + --set 'Multi-Station Throughput vs Pkt Size' 0 \ + --set 'Long-Term' 0 \ + --pull_report \ + --influx_host c7-graphana \ + --influx_port 8086 \ + --influx_org Candela \ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ + --influx_bucket ben \ + --influx_tag testbed Ferndale-01" ) else testCommands=( "./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" "./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug --mgr $MGR" - "./create_chamberview.py -m $MGR -cs \"regression_test\" \ - --line \"Resource=1.1 Profile=STA-AC Amount=1 Uses-1 $RADIO_USED Freq=-1 DUT=TEST DUT_RADIO=$RADIO_USED Traffic=http\" \ - --line \"Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=Test DUT_RADIO=$RADIO_USED Traffic=http\"" + "./create_chamberview.py -m $MGR -cs 'regression_test' \ + --line 'Resource=1.1 Profile=STA-AC Amount=1 Uses-1 $RADIO_USED Freq=-1 DUT=TEST DUT_RADIO=$RADIO_USED Traffic=http' \ + --line 'Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=Test DUT_RADIO=$RADIO_USED Traffic=http'" "./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ - --ssid \"ssid_idx=0 ssid=\"$SSID_USED\" security=\"$SECURITY\" password=\"$PASSWD_USED\" bssid=04:f0:21:2c:41:84\"" + --ssid 'ssid_idx=0 ssid='$SSID_USED' security='$SECURITY' password='$PASSWD_USED' bssid=04:f0:21:2c:41:84'" "./create_l3.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR --endp_a wiphy0 --endp_b wiphy1" "./create_l3_stations.py --mgr $MGR --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug" "./create_l4.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR" @@ -191,15 +218,33 @@ else #./grafana_profile "./layer3_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED" "./layer4_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" - "./lf_ap_auto_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ + "./lf_ap_auto_test.py + --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ - --dut5_0 \"$DUT5 (2)\" --dut2_0 \"$DUT2 (1)\" --max_stations_2 100 --max_stations_5 100 --max_stations_dual 200 \ - --radio2 1.1.wiphy0 --radio2 1.1.wiphy1 --set \"Basic Client Connectivity\" 1 --set \"Multi Band Performance\" 1 \ - --set \"Skip 2.4Ghz Tests\" 1 --set \"Skip 5Ghz Tests\" 1 --set \"Throughput vs Pkt Size\" 0 --set \"Capacity\" 0 \ - --set \"Stability\" 0 --set \"Band-Steering\" 0 --set \"Multi-Station Throughput vs Pkt Size\" 0 \ - --set \"Long-Term\" 0 --pull_report --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ + --dut5_0 '$DUT5 (2)' \ + --dut2_0 '$DUT2 (1)' \ + --max_stations_2 100 \ + --max_stations_5 100 \ + --max_stations_dual 200 \ + --radio2 1.1.wiphy0 \ + --radio2 1.1.wiphy1 \ + --set 'Basic Client Connectivity' 1 \ + --set 'Multi Band Performance' 1 \ + --set 'Skip 2.4Ghz Tests' 1 \ + --set 'Skip 5Ghz Tests' 1 + --set 'Throughput vs Pkt Size' 0 \ + --set 'Capacity' 0 \ + --set 'Stability' 0 \ + --set 'Band-Steering' 0 \ + --set 'Multi-Station Throughput vs Pkt Size' 0 \ + --set 'Long-Term' 0 \ + --pull_report \ + --influx_host c7-graphana \ + --influx_port 8086 \ + --influx_org Candela \ --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ - --influx_bucket ben --influx_tag testbed Ferndale-01" + --influx_bucket ben \ + --influx_tag testbed Ferndale-01" "./lf_atten_mod_test.py --host $MGR --debug" #./lf_csv #./lf_dataplane_config @@ -216,7 +261,7 @@ else #--num_sta 1 --sta_id 1 --ssid $SSID_USED --security $SECURITY --upstream $UPSTREAM \ #--protocol lf_udp --min_mbps 1000 --max_mbps 10000 --duration 1" "./lf_graph.py --mgr $MGR" - "./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line \"selected_dut2 RootAP wactest $BSSID\"" + "./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line 'selected_dut2 RootAP wactest $BSSID'" #"./lf_multipsk.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --debug" "./lf_report.py" "./lf_report_test.py" @@ -225,13 +270,13 @@ else --instance_name rx-sensitivity-instance --config_name test_con --upstream 1.1.eth2 \ --dut linksys-8450 --duration 15s --station 1.1.sta01500 \ --download_speed 85% --upload_speed 0 \ - --raw_line \"txo_preamble\: VHT\" \ - --raw_line \"txo_mcs\: 4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT\" \ - --raw_line \"spatial_streams\: 3\" \ - --raw_line \"bandw_options\: 80\" \ - --raw_line \"txo_sgi\: ON\" \ - --raw_line \"txo_retries\: No Retry\" \ - --raw_line \"txo_txpower\: 17\" \ + --raw_line 'txo_preamble\: VHT' \ + --raw_line 'txo_mcs\: 4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT' \ + --raw_line 'spatial_streams\: 3' \ + --raw_line 'bandw_options\: 80' \ + --raw_line 'txo_sgi\: ON' \ + --raw_line 'txo_retries\: No Retry' \ + --raw_line 'txo_txpower\: 17' \ --test_rig Testbed-01 --pull_report \ --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ @@ -304,8 +349,8 @@ else "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_udp lf_tcp' --upstream_port 1.1.$UPSTREAM \ - --radio \"radio==1.1.wiphy0 stations==10 ssid==ASUS_70 ssid_pw==[BLANK] security==open\" \ - --radio \"radio==1.1.wiphy1 stations==1 ssid==ASUS_70 ssid_pw==[BLANK] security==open\" \ + --radio 'radio==1.1.wiphy0 stations==10 ssid==ASUS_70 ssid_pw==[BLANK] security==open' \ + --radio 'radio==1.1.wiphy1 stations==1 ssid==ASUS_70 ssid_pw==[BLANK] security==open' \ --test_duration 5s --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 \ @@ -457,23 +502,25 @@ function test() { echo "Test $CURR_TEST_NAME" echo_print - echo "$i" + echo "$testcommand" start=$(date +%s) - $i > "${TEST_DIR}/${NAME}.txt" 2> "${TEST_DIR}/${NAME}_stderr.txt" + $testcommand > "${TEST_DIR}/${NAME}.txt" 2> "${TEST_DIR}/${NAME}_stderr.txt" chmod 664 "${TEST_DIR}/${NAME}.txt" FILESIZE=$(stat -c%s "${TEST_DIR}/${NAME}_stderr.txt") || 0 end=$(date +%s) execution="$((end-start))" if (( FILESIZE > 0)); then echo "Errors detected" - results+=(" + results+=(" + ") else echo "No errors detected" - results+=(" + results+=(" + @@ -481,11 +528,11 @@ function test() { fi } -function run_test() { +function start_tests() { if [[ ${#A} -gt 0 ]]; then - for i in "${testCommands[@]}"; do + for testcommand in "${testCommands[@]}"; do NAME=$(cat < /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) - CURR_TEST_NAME=${i%%.py*} + CURR_TEST_NAME=${testcommand%%.py*} CURR_TEST_NAME=${CURR_TEST_NAME#./*} #CURR_TEST_NUM="${name_to_num[$CURR_TEST_NAME]}" if [[ $A == "$CURR_TEST_NAME" ]]; then @@ -493,9 +540,9 @@ function run_test() { fi done else - for i in "${testCommands[@]}"; do + for testcommand in "${testCommands[@]}"; do NAME=$(cat < /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) - CURR_TEST_NAME=${i%%.py*} + CURR_TEST_NAME=${testcommand%%.py*} CURR_TEST_NAME=${CURR_TEST_NAME#./*} #CURR_TEST_NUM="${name_to_num[$CURR_TEST_NAME]}" test @@ -571,5 +618,5 @@ URL2="/report-data/${NOW}" mkdir "${TEST_DIR}" echo "Recording data to $TEST_DIR" -run_test +start_tests html_generator From 47bdaf3a4d710eea25c8af7337a6e0258428c649 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 11 Nov 2021 11:24:59 -0800 Subject: [PATCH 312/731] add eval to run_test method Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 61 ++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index fbe4593e..8a76d1ab 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -159,33 +159,35 @@ if [[ ${#SHORT} -gt 0 ]]; then testCommands=( # run_l3_longevity # "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" - "./lf_ap_auto_test.py - --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ - --dut5_0 '$DUT5 (2)' \ - --dut2_0 '$DUT2 (1)' \ - --max_stations_2 100 \ - --max_stations_5 100 \ - --max_stations_dual 200 \ - --radio2 1.1.wiphy0 \ - --radio2 1.1.wiphy1 \ - --set 'Basic Client Connectivity' 1 \ - --set 'Multi Band Performance' 1 \ - --set 'Skip 2.4Ghz Tests' 1 \ - --set 'Skip 5Ghz Tests' 1 - --set 'Throughput vs Pkt Size' 0 \ - --set 'Capacity' 0 \ - --set 'Stability' 0 \ - --set 'Band-Steering' 0 \ - --set 'Multi-Station Throughput vs Pkt Size' 0 \ - --set 'Long-Term' 0 \ - --pull_report \ - --influx_host c7-graphana \ - --influx_port 8086 \ - --influx_org Candela \ - --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ - --influx_bucket ben \ - --influx_tag testbed Ferndale-01" + "./lf_ap_auto_test.py \ + --mgr ${MGR} --port 8080 --lf_user lanforge --lf_password lanforge \ + --instance_name ap-auto-instance \ + --config_name test_con \ + --upstream 1.1.eth2 \ + --dut5_0 'linksys-8450 Default-SSID-5gl c4:41:1e:f5:3f:25 (2)' \ + --dut2_0 'linksys-8450 Default-SSID-2g c4:41:1e:f5:3f:24 (1)' \ + --max_stations_2 100 \ + --max_stations_5 100 \ + --max_stations_dual 200 \ + --radio2 1.1.wiphy0 \ + --radio2 1.1.wiphy1 \ + --set 'Basic Client Connectivity' 1 \ + --set 'Multi Band Performance' 1 \ + --set 'Skip 2.4Ghz Tests' 1 \ + --set 'Skip 5Ghz Tests' 1 \ + --set 'Throughput vs Pkt Size' 0 \ + --set 'Capacity' 0 \ + --set 'Stability' 0 \ + --set 'Band-Steering' 0 \ + --set 'Multi-Station Throughput vs Pkt Size' 0 \ + --set 'Long-Term' 0 \ + --pull_report \ + --influx_host c7-graphana \ + --influx_port 8086 \ + --influx_org Candela \ + --influx_token=-u_Wd-8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ + --influx_bucket ben \ + --influx_tag testbed Ferndale-01" ) else testCommands=( @@ -218,7 +220,7 @@ else #./grafana_profile "./layer3_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED" "./layer4_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" - "./lf_ap_auto_test.py + "./lf_ap_auto_test.py \ --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ --dut5_0 '$DUT5 (2)' \ @@ -504,7 +506,7 @@ function test() { echo_print echo "$testcommand" start=$(date +%s) - $testcommand > "${TEST_DIR}/${NAME}.txt" 2> "${TEST_DIR}/${NAME}_stderr.txt" + eval "$testcommand" 1> "${TEST_DIR}/${NAME}.txt" 2> "${TEST_DIR}/${NAME}_stderr.txt" chmod 664 "${TEST_DIR}/${NAME}.txt" FILESIZE=$(stat -c%s "${TEST_DIR}/${NAME}_stderr.txt") || 0 end=$(date +%s) @@ -604,6 +606,7 @@ function html_generator() { rm -f "${HOMEPATH}/html-reports/latest.html" fi ln -s "${fname}" "${HOMEPATH}/html-reports/latest.html" + echo "Saving HTML file to disk" #HOSTNAME=$(ip -4 addr show enp3s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}') #content="View the latest regression report at /html-reports/latest.html" #echo "${content}" From 6d1fdae76d5c39af23ce04bace9133c2384c6d01 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 11 Nov 2021 13:40:48 -0800 Subject: [PATCH 313/731] Fix --set error in bash Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 18 +++--------------- py-scripts/sortabletable.js | 0 2 files changed, 3 insertions(+), 15 deletions(-) create mode 100644 py-scripts/sortabletable.js diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 8a76d1ab..2f27f3f7 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -159,9 +159,7 @@ if [[ ${#SHORT} -gt 0 ]]; then testCommands=( # run_l3_longevity # "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" - "./lf_ap_auto_test.py \ - --mgr ${MGR} --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name ap-auto-instance \ + "./lf_ap_auto_test.py --mgr ${MGR} --port 8080 --lf_user lanforge --lf_password lanforge --instance_name ap-auto-instance \ --config_name test_con \ --upstream 1.1.eth2 \ --dut5_0 'linksys-8450 Default-SSID-5gl c4:41:1e:f5:3f:25 (2)' \ @@ -170,17 +168,7 @@ if [[ ${#SHORT} -gt 0 ]]; then --max_stations_5 100 \ --max_stations_dual 200 \ --radio2 1.1.wiphy0 \ - --radio2 1.1.wiphy1 \ - --set 'Basic Client Connectivity' 1 \ - --set 'Multi Band Performance' 1 \ - --set 'Skip 2.4Ghz Tests' 1 \ - --set 'Skip 5Ghz Tests' 1 \ - --set 'Throughput vs Pkt Size' 0 \ - --set 'Capacity' 0 \ - --set 'Stability' 0 \ - --set 'Band-Steering' 0 \ - --set 'Multi-Station Throughput vs Pkt Size' 0 \ - --set 'Long-Term' 0 \ + --radio2 1.1.wiphy1 --set 'Basic Client Connectivity' 1 --set 'Multi Band Performance' 1 --set 'Skip 2.4Ghz Tests' 1 --set 'Skip 5Ghz Tests' 1 --set 'Throughput vs Pkt Size' 0 --set 'Capacity' 0 --set 'Stability' 0 --set 'Band-Steering' 0 --set 'Multi-Station Throughput vs Pkt Size' 0 --set 'Long-Term' 0 \ --pull_report \ --influx_host c7-graphana \ --influx_port 8086 \ @@ -506,7 +494,7 @@ function test() { echo_print echo "$testcommand" start=$(date +%s) - eval "$testcommand" 1> "${TEST_DIR}/${NAME}.txt" 2> "${TEST_DIR}/${NAME}_stderr.txt" + { eval "$testcommand" 2>&1 >&3 3>&- | tee "${TEST_DIR}/${NAME}_stderr.txt" 3>&-; } > "${TEST_DIR}/${NAME}.txt" 3>&1 chmod 664 "${TEST_DIR}/${NAME}.txt" FILESIZE=$(stat -c%s "${TEST_DIR}/${NAME}_stderr.txt") || 0 end=$(date +%s) diff --git a/py-scripts/sortabletable.js b/py-scripts/sortabletable.js new file mode 100644 index 00000000..e69de29b From 79d4f09e9ddd169b32948c6e74c788676d769e4c Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 11 Nov 2021 14:12:19 -0800 Subject: [PATCH 314/731] Explain logic for parsing output of command Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 2f27f3f7..ffbb2dd5 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -494,6 +494,8 @@ function test() { echo_print echo "$testcommand" start=$(date +%s) + # this command saves stdout and stderr to the stdout file, and has a special file for stderr text. + # Modified from https://unix.stackexchange.com/a/364176/327076 { eval "$testcommand" 2>&1 >&3 3>&- | tee "${TEST_DIR}/${NAME}_stderr.txt" 3>&-; } > "${TEST_DIR}/${NAME}.txt" 3>&1 chmod 664 "${TEST_DIR}/${NAME}.txt" FILESIZE=$(stat -c%s "${TEST_DIR}/${NAME}_stderr.txt") || 0 From 5ddc46460acda7872e9ec3270258979467072011 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 11 Nov 2021 17:45:49 -0800 Subject: [PATCH 315/731] Save sortabletable.js in lanforge-scripts and make it so regression_test works with it Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 57 +++++++++++++++-------------------- py-scripts/sortabletable.js | 41 +++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 33 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index ffbb2dd5..1e4e8bc5 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -272,12 +272,12 @@ else --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ --influx_bucket ben \ --influx_tag testbed Ferndale-01" - "./lf_sniff_radio.py - --mgr $MGR - --mgr_port 8080 - --outfile /home/lanforge/test_sniff.pcap - --duration 20 - --channel 52 + "./lf_sniff_radio.py \ + --mgr $MGR \ + --mgr_port 8080 \ + --outfile /home/lanforge/test_sniff.pcap \ + --duration 20 \ + --channel 52 \ --radio_mode AUTO" "./lf_snp_test.py --mgr $MGR" "./lf_tr398_test.py --mgr $MGR" @@ -290,27 +290,24 @@ else #--influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ #--influx_bucket ben \ #"./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --debug --report_file measure_station_time_up.txt" - "./create_stations.py --radio $RADIO_USED --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED && ./modify_station.py - --radio $RADIO_USED - --station 1.1.sta0000 - --security $SECURITY - --ssid $SSID_USED - --passwd $PASSWD_USED - --enable_flag osen_enable - --disable_flag ht160_enable + "./create_stations.py --radio $RADIO_USED --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED && ./modify_station.py \ + --radio $RADIO_USED \ + --station 1.1.sta0000 \ + --security $SECURITY \ + --ssid $SSID_USED \ + --passwd $PASSWD_USED \ + --enable_flag osen_enable \ + --disable_flag ht160_enable \ --debug" - "./modify_vap.py --radio $RADIO_USED --vap 1.1.vap0000 --security $SECURITY --ssid $SSID_USED \ - --passwd $PASSWD_USED --enable_flag osen_enable --disable_flag ht160_enable --debug" + "./modify_vap.py --radio $RADIO_USED --vap 1.1.vap0000 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --enable_flag osen_enable --disable_flag ht160_enable --debug" #recordinflux.py - "./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test Dataplane \ - --test_profile http --cv_scenario ct-us-001" + "./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test Dataplane --test_profile http --cv_scenario ct-us-001" #scenario.py #"./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C" #./sta_connect_bssid_mac.py "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED" #sta_connect.py - "./sta_scan_test.py --ssid $SSID_USED --security $SECURITY --passwd $PASSWD_USED \ - --radio $RADIO_USED" + "./sta_scan_test.py --ssid $SSID_USED --security $SECURITY --passwd $PASSWD_USED --radio $RADIO_USED" #station_layer3.py #stations_connected.py #"./test_1k_clients_jedtest.py @@ -338,13 +335,7 @@ else "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_udp lf_tcp' --upstream_port 1.1.$UPSTREAM \ - --radio 'radio==1.1.wiphy0 stations==10 ssid==ASUS_70 ssid_pw==[BLANK] security==open' \ - --radio 'radio==1.1.wiphy1 stations==1 ssid==ASUS_70 ssid_pw==[BLANK] security==open' \ - --test_duration 5s --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ - --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ - --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 \ - --influx_tag testbed regression_test --influx_tag DUT ROG -o longevity.csv" + "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_udp lf_tcp' --upstream_port 1.1.$UPSTREAM --radio 'radio==1.1.wiphy0 stations==10 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --radio 'radio==1.1.wiphy1 stations==1 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --test_duration 5s --influx_host c7-graphana --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --influx_tag testbed regression_test --influx_tag DUT ROG -o longevity.csv" "./test_l3_powersave_traffic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" #"./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput -m $MGR" #./test_l3_unicast_traffic_gen @@ -577,12 +568,12 @@ function html_generator() {

$LAST_COMMIT

- + """ + str(self.duration) + """ """ + str(self.test_start_time) + """ """ + str(self.test_end_time) + """""" + str(self.test_result) + """ + """ + str(self.test_result) + """ STDOUTSTDERR
Copy @@ -966,13 +980,13 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url)
{command}
${CURR_TEST_NAME}${i} FailureSTDOUTSTDERR
STDOUTSTDERR
${CURR_TEST_NAME}${i} SuccessSTDOUTSTDOUT
${CURR_TEST_NAME}${i} FailureSTDOUTSTDERR
STDOUTSTDERR
${CURR_TEST_NAME}${i} SuccessSTDOUTSTDOUT
Copy @@ -933,7 +1079,12 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) """.format(command=command) ''' - row = [test, command, self.test_result, stdout_log_txt, stderr_log_txt] + row = [ + test, + command, + self.test_result, + stdout_log_txt, + stderr_log_txt] self.csv_results_writer.writerow(row) self.csv_results_file.flush() # self.logger.info("row: {}".format(row)) @@ -967,13 +1118,37 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a --------- ''') - parser.add_argument('--dir', help="--dir ", default="lf_check") - parser.add_argument('--path', help="--path ", default="/home/lanforge/html-results") - parser.add_argument('--json_rig', help="--json_rig ", default="", required=True) - parser.add_argument('--json_dut', help="--json_dut ", default="", required=True) - parser.add_argument('--json_test', help="--json_test ", default="", required=True) - parser.add_argument('--suite', help="--suite default TEST_DICTIONARY", default="TEST_DICTIONARY") - parser.add_argument('--db_override', help="--db_override override for json DATABASE_SQLITE''", default=None) + parser.add_argument( + '--dir', + help="--dir ", + default="lf_check") + parser.add_argument( + '--path', + help="--path ", + default="/home/lanforge/html-results") + parser.add_argument( + '--json_rig', + help="--json_rig ", + default="", + required=True) + parser.add_argument( + '--json_dut', + help="--json_dut ", + default="", + required=True) + parser.add_argument( + '--json_test', + help="--json_test ", + default="", + required=True) + parser.add_argument( + '--suite', + help="--suite default TEST_DICTIONARY", + default="TEST_DICTIONARY") + parser.add_argument( + '--db_override', + help="--db_override override for json DATABASE_SQLITE''", + default=None) parser.add_argument('--production', help="--production stores true, sends email results to production email list", action='store_true') parser.add_argument('--outfile', help="--outfile used as base name for all files generated", @@ -1030,9 +1205,9 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # create report class for reporting report = lf_report.lf_report(_path=__path, - _results_dir_name=__dir, - _output_html="lf_check.html", - _output_pdf="lf_check.pdf") + _results_dir_name=__dir, + _output_html="lf_check.html", + _output_pdf="lf_check.pdf") current_time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime()) csv_results = "lf_check{}-{}.csv".format(args.outfile, current_time) @@ -1067,7 +1242,8 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a file_handler = logging.FileHandler(logfile, "w") file_handler.setFormatter(formatter) logger.addHandler(file_handler) - logger.addHandler(logging.StreamHandler(sys.stdout)) # allows to logging to file and stdout + # allows to logging to file and stdout + logger.addHandler(logging.StreamHandler(sys.stdout)) # read config and run tests check.read_json_rig() # check.read_config @@ -1084,44 +1260,59 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a try: lanforge_system_node_version = check.get_lanforge_system_node_version() - print("lanforge_system_node_version {system_node_ver}".format(system_node_ver=lanforge_system_node_version)) + print("lanforge_system_node_version {system_node_ver}".format( + system_node_ver=lanforge_system_node_version)) except BaseException: print("lanforge_system_node_version exception") try: lanforge_kernel_version = check.get_lanforge_kernel_version() - print("lanforge_kernel_version {kernel_ver}".format(kernel_ver=lanforge_kernel_version)) + print("lanforge_kernel_version {kernel_ver}".format( + kernel_ver=lanforge_kernel_version)) except BaseException: print("lanforge_kernel_version exception, tests aborted check lanforge ip") exit(1) try: lanforge_server_version_full = check.get_lanforge_server_version() - print("lanforge_server_version_full {lanforge_server_version_full}".format(lanforge_server_version_full=lanforge_server_version_full)) + print("lanforge_server_version_full {lanforge_server_version_full}".format( + lanforge_server_version_full=lanforge_server_version_full)) except BaseException: print("lanforge_server_version exception, tests aborted check lanforge ip") exit(1) try: lanforge_gui_version_full, lanforge_gui_version, lanforge_gui_build_date, lanforge_gui_git_sha = check.get_lanforge_gui_version() - print("lanforge_gui_version_full {lanforge_gui_version_full}".format(lanforge_gui_version_full=lanforge_gui_version_full)) + print("lanforge_gui_version_full {lanforge_gui_version_full}".format( + lanforge_gui_version_full=lanforge_gui_version_full)) except BaseException: print("lanforge_gui_version exception, tests aborted check lanforge ip") exit(1) try: lanforge_radio_json, lanforge_radio_text = check.get_lanforge_radio_information() - lanforge_radio_formatted_str = json.dumps(lanforge_radio_json, indent=2) - print("lanforge_radio_json: {lanforge_radio_json}".format(lanforge_radio_json=lanforge_radio_formatted_str)) + lanforge_radio_formatted_str = json.dumps( + lanforge_radio_json, indent=2) + print("lanforge_radio_json: {lanforge_radio_json}".format( + lanforge_radio_json=lanforge_radio_formatted_str)) # note put into the meta data - lf_radio_df = pd.DataFrame(columns=['Radio', 'WIFI-Radio Driver', 'Radio Capabilities', 'Firmware Version', 'max_sta', 'max_vap', 'max_vifs']) + lf_radio_df = pd.DataFrame( + columns=[ + 'Radio', + 'WIFI-Radio Driver', + 'Radio Capabilities', + 'Firmware Version', + 'max_sta', + 'max_vap', + 'max_vifs']) for key in lanforge_radio_json: if 'wiphy' in key: # print("key {}".format(key)) # print("lanforge_radio_json[{}]: {}".format(key,lanforge_radio_json[key])) - driver = lanforge_radio_json[key]['driver'].split('Driver:', maxsplit=1)[-1].split(maxsplit=1)[0] + driver = lanforge_radio_json[key]['driver'].split( + 'Driver:', maxsplit=1)[-1].split(maxsplit=1)[0] try: firmware_version = lanforge_radio_json[key]['firmware version'] except BaseException: @@ -1160,7 +1351,9 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # generate output reports test_rig = check.get_test_rig() - report.set_title("LF Check: {test_rig} lf_check.py".format(test_rig=test_rig)) + report.set_title( + "LF Check: {test_rig} lf_check.py".format( + test_rig=test_rig)) report.build_banner_left() report.start_content_div2() report.set_obj_html("Objective", "Run QA Tests") From 958427c1e2eff8a366514643e1dbcc1f5f87b395 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 6 Nov 2021 14:56:43 -0600 Subject: [PATCH 269/731] Jira: LAN-715 port_probe.py : defaut bw = 20 to fix UnboundLocalError: local variable 'bw' referenced before assignment Signed-off-by: Chuck SmileyRekiere --- py-json/port_probe.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-json/port_probe.py b/py-json/port_probe.py index 1cc77335..b630e7ff 100644 --- a/py-json/port_probe.py +++ b/py-json/port_probe.py @@ -172,12 +172,13 @@ class ProbePort(LFCliBase): T_dft = 3.2 * 10**-6 # Constant for HT T_gi_short = .4 * 10**-6 # Guard index. T_gi_long = .8 * 10**-6 # Guard index. + bw = 20 # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith try: bw = int(self.tx_mhz) except BaseException: - print("port_probe.py: {} WARNING unable to parse tx MHz (BW) , check probe output will use ") + print("port_probe.py: WARNING unable to parse tx MHz (BW) , check probe output will use {bw}".format(bw=bw)) print("Mhz {Mhz}".format(Mhz=self.tx_mhz)) if bw == 20: From a0e7685f3cca89884a378530c973c6ab225ed8ae Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sun, 7 Nov 2021 09:46:16 -0700 Subject: [PATCH 270/731] ct_us_00X_tests.json : rename of nightly to be a sorter test Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 4 ++-- py-scripts/tools/ct_us_004_tests.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 0f14db81..0d2524e0 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -171,7 +171,7 @@ ] } }, - "suite_wc_dp":{ + "suite_wc_dp_nightly":{ "lf_help_check":{ "enabled":"TRUE", "load_db":"skip", @@ -495,7 +495,7 @@ ] } }, - "suite_wc_dp_nightly":{ + "suite_wc_dp_long":{ "lf_help_check":{ "enabled":"TRUE", "load_db":"skip", diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index 2ccc82d9..d3fa33a0 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -159,7 +159,7 @@ ] } }, - "suite_wc_dp":{ + "suite_wc_dp_nightly":{ "lf_help_check":{ "enabled":"TRUE", "load_db":"skip", @@ -484,7 +484,7 @@ ] } }, - "suite_wc_dp_nightly":{ + "suite_wc_dp_long":{ "lf_help_check":{ "enabled":"TRUE", "load_db":"skip", From 86bb4fa42c11e8655f11252e980d7c23b6512a9b Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 8 Nov 2021 10:58:58 -0700 Subject: [PATCH 271/731] test_l3_longevity.py : updated destination so --mgr and --lfmgr added dest='lfmgr' updated the scripts tesing to allow for looped tests. Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 2 +- py-scripts/tools/ct_us_001_scripts.json | 80 ++++++++++++------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index f4abe50d..0f25c90e 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -1870,7 +1870,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m parser.add_argument('--tty', help='--tty \"/dev/ttyUSB2\" the serial interface to the AP', default="") parser.add_argument('--baud', help='--baud \"9600\" AP baud rate for the serial interface', default="9600") - parser.add_argument('--lfmgr', help='--lfmgr ', default='localhost') + parser.add_argument('--mgr','--lfmgr', dest='lfmgr', help='--lfmgr ', default='localhost') parser.add_argument( '--test_duration', help='--test_duration example --time 5d (5 days) default: 3m options: number followed by d, h, m or s', diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 724bbbb4..bf7b5b97 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -35,46 +35,46 @@ "test_l3_longevity":{"enabled":"TRUE","load_db":"NONE","command":"test_l3_longevity.py","args":"--mgr 192.168.100.116 --test_duration 15s --polling_interval 5s --upstream_port eth2 --radio 'radio==wiphy1,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --local_lf_report_dir REPORT_PATH"} }, "suite_daily":{ - "test_l3_longevity":{"enabled":"TRUE","load_db":"NONE","command":"test_l3_longevity.py","args":"--mgr 192.168.100.116 --test_duration 15s --polling_interval 5s --upstream_port eth2 --radio 'radio==wiphy1,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"}, - "example_security_connection0":{"enabled":"TRUE","command":"example_security_connection.py","args":"--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"}, - "example_security_connection1":{"enabled":"TRUE","command":"example_security_connection.py","args":"--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"}, - "example_security_connection2":{"enabled":"TRUE","command":"example_security_connection.py","args":"--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"}, - "example_security_connection3":{"enabled":"TRUE","command":"example_security_connection.py","args":"--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"}, - "sta_connect2":{"enabled":"FALSE","command":"sta_connect2.py","args":"--mgr 192.168.100.116 --dut_ssid asus11ax-5 --dut_passwd hello123 --dut_security wpa2"}, - "sta_connect_example":{"enabled":"FALSE","command":"sta_connect_example.py","args":"--mgr 192.168.100.116 "}, - "test_fileio":{"enabled":"TRUE","command":"test_fileio.py","args":"--mgr 192.168.100.116 --macvlan_parent eth2 --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 --netmask 255.255.255.0 --test_duration 30s --gateway 192.168.92.1"}, - "test_generic0":{"enabled":"FALSE","command":"test_generic.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type lfping --dest 10.40.0.1 --debug"}, - "test_generic1":{"enabled":"FALSE","command":"test_generic.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security wpa2 --debug"}, - "test_generic2":{"enabled":"FALSE","command":"test_generic.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type iperf3 --debug"}, - "test_generic3":{"enabled":"FALSE","command":"test_generic.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type lfcurl --dest 10.40.0.1 --file_output /home/lanforge/Documents/lfcurl_output.txt --debug"}, - "testgroup":{"enabled":"FALSE","command":"testgroup.py","args":"--mgr 192.168.100.116 --group_name group1 --add_group --list_groups --debug"}, - "testgroup5":{"enabled":"FALSE","command":"testgroup.py","args":"--mgr 192.168.100.116 --num_stations 4 --ssid lanforge --passwd password --security wpa2 --radio wiphy0 --group_name group0 --add_group"}, - "test_ip_connection-ipv4":{"enabled":"TRUE","command":"test_ip_connection.py","args":"--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"}, - "test_ip_variable_time0-ipv4":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"}, - "test_ip_variable_time1-ipv4":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"}, - "test_ip_connection-ipv6":{"enabled":"FALSE","command":"test_ip_connection.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --ipv6 --debug"}, - "test_ip_variable_time0-ipv6":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --ipv6 --traffic_type lf_udp --debug"}, - "test_ip_variable_time1-ipv6":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped --ipv6 --traffic_type lf_udp --debug"}, - "test_l4_bytes-rd":{"enabled":"TRUE","command":"test_l4.py","args":"--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --test_type bytes-rd --test_duration 15s --url 'dl http://10.40.0.1 /dev/null' --debug"}, - "test_l4_bytes-wr":{"enabled":"FALSE","command":"test_l4.py","args":"--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --test_type bytes-wr --test_duration 15s --url 'ul http://10.40.0.1' --debug"}, - "test_l4_urls_s":{"enabled":"TRUE","command":"test_l4.py","args":"--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --test_type urls --test_duration 15s --requests_per_ten 600 --target_per_ten 600 --url 'dl http://10.40.0.1 /dev/null' --debug"}, - "test_l4_ftp_bytes-rd":{"enabled":"TRUE","command":"test_l4.py","args":"--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --ftp --test_type bytes-rd --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null' --debug"}, - "test_l4_ftp_bytes-wr":{"enabled":"FALSE","command":"test_l4.py","args":"--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --ftp --test_type bytes-wr --test_duration 15s --url 'ul ftp://10.40.0.1' --debug"}, - "test_l4_ftp_urls_s":{"enabled":"TRUE","command":"test_l4.py","args":"--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --ftp --test_type urls --requests_per_ten 600 --target_per_ten 600 --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null' --debug"}, - "test_l3_longevity_1":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"--mgr 192.168.100.116 --test_duration 15s --polling_interval 5s --upstream_port eth2 --radio 'radio==wiphy0,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"}, - "test_l3_powersave_traffic":{"enabled":"FALSE","command":"test_l3_powersave_traffic.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"}, - "test_status_msg":{"enabled":"TRUE","command":"test_status_msg.py","args":"--mgr 192.168.100.116 --action run_test"}, - "test_wanlink":{"enabled":"TRUE","command":"test_wanlink.py","args":"--mgr 192.168.100.116 --debug"}, - "create_bridge":{"enabled":"TRUE","command":"create_bridge.py","args":"--mgr 192.168.100.116 --radio wiphy1 --upstream_port eth2 --target_device sta0000 --debug"}, - "create_l3":{"enabled":"TRUE","command":"create_l3.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"}, - "create_l4":{"enabled":"TRUE","command":"create_l4.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"}, - "create_macvlan":{"enabled":"TRUE","command":"create_macvlan.py","args":"--mgr 192.168.100.116 --radio wiphy1 --macvlan_parent eth2 --debug"}, - "create_station":{"enabled":"TRUE","command":"create_station.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"}, - "create_vap":{"enabled":"TRUE","command":"create_vap.py","args":"--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"}, - "create_qvlan":{"enabled":"TRUE","command":"create_qvlan.py","args":"--mgr 192.168.100.116 --radio wiphy1 --qvlan_parent eth2"}, - "wlan_capacity_calculator1":{"enabled":"TRUE","command":"./wlan_capacity_calculator.py","args":"-sta 11abg -t Voice -p 48 -m 106 -e WEP -q Yes -b 1 2 5.5 11 -pre Long -s N/A -co G.711 -r Yes -c Yes"}, - "wlan_capacity_calculator2":{"enabled":"TRUE","command":"./wlan_capacity_calculator.py","args":"-sta 11n -t Voice -d 17 -ch 40 -gu 800 -high 9 -e WEP -q Yes -ip 5 -mc 42 -b 6 9 12 24 -m 1538 -co G.729 -pl Greenfield -cw 15 -r Yes -c Yes"}, - "wlan_capacity_calculator3":{"enabled":"TRUE","command":"./wlan_capacity_calculator.py","args":"-sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes"} + "test_l3_longevity":{"enabled":"TRUE","load_db":"NONE","command":"test_l3_longevity.py","args":"","args_list":["--mgr 192.168.100.116 --test_duration 15s --polling_interval 5s --upstream_port eth2 --radio 'radio==wiphy1,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"]}, + "example_security_connection0":{"enabled":"TRUE","command":"example_security_connection.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"]}, + "example_security_connection1":{"enabled":"TRUE","command":"example_security_connection.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"]}, + "example_security_connection2":{"enabled":"TRUE","command":"example_security_connection.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"]}, + "example_security_connection3":{"enabled":"TRUE","command":"example_security_connection.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"]}, + "sta_connect2":{"enabled":"FALSE","command":"sta_connect2.py","args":"","args_list":["--mgr 192.168.100.116 --dut_ssid asus11ax-5 --dut_passwd hello123 --dut_security wpa2"]}, + "sta_connect_example":{"enabled":"FALSE","command":"sta_connect_example.py","args":"","args_list":["--mgr 192.168.100.116 "]}, + "test_fileio":{"enabled":"TRUE","command":"test_fileio.py","args":"","args_list":["--mgr 192.168.100.116 --macvlan_parent eth2 --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 --netmask 255.255.255.0 --test_duration 30s --gateway 192.168.92.1"]}, + "test_generic0":{"enabled":"FALSE","command":"test_generic.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type lfping --dest 10.40.0.1 --debug"]}, + "test_generic1":{"enabled":"FALSE","command":"test_generic.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security wpa2 --debug"]}, + "test_generic2":{"enabled":"FALSE","command":"test_generic.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type iperf3 --debug"]}, + "test_generic3":{"enabled":"FALSE","command":"test_generic.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type lfcurl --dest 10.40.0.1 --file_output /home/lanforge/Documents/lfcurl_output.txt --debug"]}, + "testgroup":{"enabled":"FALSE","command":"testgroup.py","args":"","args_list":["--mgr 192.168.100.116 --group_name group1 --add_group --list_groups --debug"]}, + "testgroup5":{"enabled":"FALSE","command":"testgroup.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid lanforge --passwd password --security wpa2 --radio wiphy0 --group_name group0 --add_group"]}, + "test_ip_connection-ipv4":{"enabled":"TRUE","command":"test_ip_connection.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, + "test_ip_variable_time0-ipv4":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"]}, + "test_ip_variable_time1-ipv4":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"]}, + "test_ip_connection-ipv6":{"enabled":"FALSE","command":"test_ip_connection.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --ipv6 --debug"]}, + "test_ip_variable_time0-ipv6":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --ipv6 --traffic_type lf_udp --debug"]}, + "test_ip_variable_time1-ipv6":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped --ipv6 --traffic_type lf_udp --debug"]}, + "test_l4_bytes-rd":{"enabled":"TRUE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --test_type bytes-rd --test_duration 15s --url 'dl http://10.40.0.1 /dev/null' --debug"]}, + "test_l4_bytes-wr":{"enabled":"FALSE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --test_type bytes-wr --test_duration 15s --url 'ul http://10.40.0.1' --debug"]}, + "test_l4_urls_s":{"enabled":"TRUE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --test_type urls --test_duration 15s --requests_per_ten 600 --target_per_ten 600 --url 'dl http://10.40.0.1 /dev/null' --debug"]}, + "test_l4_ftp_bytes-rd":{"enabled":"TRUE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --ftp --test_type bytes-rd --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null' --debug"]}, + "test_l4_ftp_bytes-wr":{"enabled":"FALSE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --ftp --test_type bytes-wr --test_duration 15s --url 'ul ftp://10.40.0.1' --debug"]}, + "test_l4_ftp_urls_s":{"enabled":"TRUE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --ftp --test_type urls --requests_per_ten 600 --target_per_ten 600 --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null' --debug"]}, + "test_l3_longevity_1":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"","args_list":["--mgr 192.168.100.116 --test_duration 15s --polling_interval 5s --upstream_port eth2 --radio 'radio==wiphy0,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"]}, + "test_l3_powersave_traffic":{"enabled":"FALSE","command":"test_l3_powersave_traffic.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, + "test_status_msg":{"enabled":"TRUE","command":"test_status_msg.py","args":"","args_list":["--mgr 192.168.100.116 --action run_test"]}, + "test_wanlink":{"enabled":"TRUE","command":"test_wanlink.py","args":"","args_list":["--mgr 192.168.100.116 --debug"]}, + "create_bridge":{"enabled":"TRUE","command":"create_bridge.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --upstream_port eth2 --target_device sta0000 --debug"]}, + "create_l3":{"enabled":"FALSE","command":"create_l3.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, + "create_l4":{"enabled":"TRUE","command":"create_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, + "create_macvlan":{"enabled":"TRUE","command":"create_macvlan.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --macvlan_parent eth2 --debug"]}, + "create_station":{"enabled":"TRUE","command":"create_station.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, + "create_vap":{"enabled":"TRUE","command":"create_vap.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, + "create_qvlan":{"enabled":"TRUE","command":"create_qvlan.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --qvlan_parent eth2"]}, + "wlan_capacity_calculator1":{"enabled":"TRUE","command":"./wlan_capacity_calculator.py","args":"","args_list":["-sta 11abg -t Voice -p 48 -m 106 -e WEP -q Yes -b 1 2 5.5 11 -pre Long -s N/A -co G.711 -r Yes -c Yes"]}, + "wlan_capacity_calculator2":{"enabled":"TRUE","command":"./wlan_capacity_calculator.py","args":"","args_list":["-sta 11n -t Voice -d 17 -ch 40 -gu 800 -high 9 -e WEP -q Yes -ip 5 -mc 42 -b 6 9 12 24 -m 1538 -co G.729 -pl Greenfield -cw 15 -r Yes -c Yes"]}, + "wlan_capacity_calculator3":{"enabled":"TRUE","command":"./wlan_capacity_calculator.py","args":"","args_list":["-sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes"]} } } } From 8678a558628f428808ae8fba93ac58b565892c98 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 8 Nov 2021 13:38:10 -0800 Subject: [PATCH 272/731] jbr_monitor_bssids.py: checks argument type for a nested list Signed-off-by: Jed Reynolds --- py-scripts/sandbox/jbr_monitor_bssids.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/py-scripts/sandbox/jbr_monitor_bssids.py b/py-scripts/sandbox/jbr_monitor_bssids.py index 3f53dc2b..e0e20e70 100755 --- a/py-scripts/sandbox/jbr_monitor_bssids.py +++ b/py-scripts/sandbox/jbr_monitor_bssids.py @@ -160,7 +160,10 @@ class BssidMonitor(Realm): exit_on_error=True) if args and args.debugging: pprint(args.debugging) + # we could have a nested list here? for item in args.debugging: + if (type(item) is list): + item = item[0] if item.startswith("tag:"): Logg.register_tag(item[item.rindex(":"):]) if item.startswith("method:"): @@ -202,6 +205,7 @@ class BssidMonitor(Realm): port='all', endp='all') time.sleep(0.2) + event_response = self.lf_query.events_last_events(event_count=1, debug=self.debug, wait_sec=1, From 2f72736e56c9c8e81b8a947deda5006e01227817 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 8 Nov 2021 13:40:32 -0800 Subject: [PATCH 273/731] run_cv_scenario.py: logic can handle a "cv list_instances" Instance names are in the [warnings] block of the response Signed-off-by: Jed Reynolds --- py-scripts/run_cv_scenario.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/py-scripts/run_cv_scenario.py b/py-scripts/run_cv_scenario.py index 902a7d0e..2d0fed71 100755 --- a/py-scripts/run_cv_scenario.py +++ b/py-scripts/run_cv_scenario.py @@ -103,10 +103,15 @@ class RunCvScenario(LFCliBase): print("Unable to load database within %d sec" % self.load_timeout_sec) exit(1) events_response = self.json_get("/events/since/%s" % previous_event_id) - if "events" not in events_response: + pronoun = None + if "events" in events_response: + pronoun = "events" + elif "event" in events_response: + pronoun = "event" + if not pronoun: pprint.pprint(("events response", events_response)) raise ValueError("incorrect events response") - for event_o in events_response["events"]: + for event_o in events_response[pronoun]: if load_completed: break for (key, record) in event_o.items(): @@ -212,6 +217,16 @@ class RunCvScenario(LFCliBase): print("sleeping %d..." % nap) sleep(nap) print("...proceeding") + elif command == "cv list_instances": + response_json = [] + print("running %s..." % command, end='') + response = self.json_post("/gui-json/cmd%s" % debug_par, + data, + debug_=False, + response_json_list_=response_json) + if debug_: + LFUtils.debug_printer.pprint(response_json) + print("Test Instances:\n%s" % pprint.pformat(response_json['warnings'])) else: response_json = [] print("running %s..." % command, end='') From 8b86e89033ecd5d9486306511eea226b61b4bf07 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 8 Nov 2021 14:56:10 -0800 Subject: [PATCH 274/731] run_cv_scenario: lists test instances and does prints thenm out Fixes example in argparse as well. Signed-off-by: Jed Reynolds --- py-scripts/run_cv_scenario.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/py-scripts/run_cv_scenario.py b/py-scripts/run_cv_scenario.py index 2d0fed71..e16b2195 100755 --- a/py-scripts/run_cv_scenario.py +++ b/py-scripts/run_cv_scenario.py @@ -182,6 +182,7 @@ class RunCvScenario(LFCliBase): "cv is_built", "cv sync", "sleep 4", + "cv list_instances", "cv create '%s' 'test_ref' 'true'" % self.cv_test, "sleep 5", "cv load test_ref '%s'" % self.test_profile, @@ -222,11 +223,10 @@ class RunCvScenario(LFCliBase): print("running %s..." % command, end='') response = self.json_post("/gui-json/cmd%s" % debug_par, data, - debug_=False, + debug_=debug_, response_json_list_=response_json) if debug_: - LFUtils.debug_printer.pprint(response_json) - print("Test Instances:\n%s" % pprint.pformat(response_json['warnings'])) + LFUtils.debug_printer.pprint(response) else: response_json = [] print("running %s..." % command, end='') @@ -234,8 +234,6 @@ class RunCvScenario(LFCliBase): if debug_: LFUtils.debug_printer.pprint(response_json) print("...proceeding") - - except Exception as x: print(x) @@ -256,9 +254,9 @@ def main(): prog="run_cv_scenario.py", formatter_class=argparse.RawTextHelpFormatter, description="""LANforge Reporting Script: Load a scenario and run a RvR report - Example: - ./load_ap_scenario.py --lfmgr 127.0.0.1 --scenario_db 'handsets' --cv_test --test_scenario 'test-20' - """) +Example: +./load_ap_scenario.py --lfmgr 127.0.0.1 --lanforge_db 'handsets' --cv_test 'WiFi Capacity' --test_profile 'test-20' +""") parser.add_argument("-m", "--lfmgr", type=str, help="address of the LANforge GUI machine (localhost is default)") parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") parser.add_argument("-d", "--lanforge_db", type=str, help="Name of test scenario database (see Status Tab)") From c4511ad39a98d089d3fe0832eb9b7412cc454260 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 8 Nov 2021 18:52:03 -0800 Subject: [PATCH 275/731] Fix LFRequest.get so it inherits debug commands from the class Signed-off-by: Matthew Stidham --- py-json/LANforge/LFRequest.py | 47 +++++++++++++++------------------- py-json/LANforge/LFUtils.py | 41 +++++++++++++++-------------- py-json/LANforge/lfcli_base.py | 2 +- 3 files changed, 41 insertions(+), 49 deletions(-) diff --git a/py-json/LANforge/LFRequest.py b/py-json/LANforge/LFRequest.py index 7de51adc..edb85817 100644 --- a/py-json/LANforge/LFRequest.py +++ b/py-json/LANforge/LFRequest.py @@ -6,7 +6,7 @@ import logging import sys import os -from pprint import pprint, pformat, PrettyPrinter +from pprint import pformat, PrettyPrinter import urllib from urllib import request import json @@ -220,16 +220,10 @@ class LFRequest: method_='PUT') def json_delete(self, show_error=True, debug=False, die_on_error_=False, response_json_list_=None): - return self.get_as_json(debug_=debug, - die_on_error_=die_on_error_, - method_='DELETE') + return self.get_as_json(method_='DELETE') - def get(self, debug=False, die_on_error_=False, method_='GET'): - if self.debug == True: - debug = True - if self.die_on_error == True: - die_on_error_ = True - if debug: + def get(self, method_='GET'): + if self.debug: self.logger.debug("LFUtils.get: url: "+self.requested_url) # https://stackoverflow.com/a/59635684/11014343 @@ -239,8 +233,8 @@ class LFRequest: request.install_opener(opener) myrequest = request.Request(url=self.requested_url, - headers=self.default_headers, - method=method_) + headers=self.default_headers, + method=method_) myresponses = [] try: myresponses.append(request.urlopen(myrequest)) @@ -252,7 +246,7 @@ class LFRequest: responses_=myresponses, error_=error, error_list_=self.error_list, - debug_=debug) + debug_=self.debug) except urllib.error.URLError as uerror: print_diagnostics(url_=self.requested_url, @@ -260,24 +254,23 @@ class LFRequest: responses_=myresponses, error_=uerror, error_list_=self.error_list, - debug_=debug) + debug_=self.debug) - if die_on_error_ == True: + if self.die_on_error is True: exit(1) return None - def getAsJson(self, die_on_error_=False, debug_=False): - return self.get_as_json(die_on_error_=die_on_error_, debug_=debug_) + def getAsJson(self): + return self.get_as_json() - def get_as_json(self, die_on_error_=False, debug_=False, method_='GET'): - responses = [] - j = self.get(debug=debug_, die_on_error_=die_on_error_, method_=method_) - responses.append(j) + def get_as_json(self, method_='GET'): + responses = list() + responses.append(self.get(method_=method_)) if len(responses) < 1: - if debug_ and self.has_errors(): + if self.debug and self.has_errors(): self.print_errors() return None - if responses[0] == None: + if responses[0] is None: self.logger.debug("No response from "+self.requested_url) return None json_data = json.loads(responses[0].read().decode('utf-8')) @@ -355,7 +348,7 @@ def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, er logger.warning("WARNING LFRequest::print_diagnostics: error_ is None") method = 'NA' - if (hasattr(request_, 'method')): + if hasattr(request_, 'method'): method = request_.method err_code = 0 err_reason = 'NA' @@ -373,7 +366,7 @@ def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, er if err_code == 404: xerrors.append("[%s HTTP %s] <%s> : %s" % (method, err_code, err_full_url, err_reason)) else: - if (len(err_headers) > 0): + if len(err_headers) > 0: for headername in sorted(err_headers.keys()): if headername.startswith("X-Error-"): xerrors.append("%s: %s" % (headername, err_headers.get(headername))) @@ -386,7 +379,7 @@ def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, er error_list_.append(xerr) logger.error(" = = = = = = = = = = = = = = = =") - if (error_.__class__ is urllib.error.HTTPError): + if error_.__class__ is urllib.error.HTTPError: logger.debug("----- LFRequest: HTTPError: --------------------------------------------") logger.debug("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) @@ -415,7 +408,7 @@ def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, er logger.debug("------------------------------------------------------------------------") return - if (error_.__class__ is urllib.error.URLError): + if error_.__class__ is urllib.error.URLError: logger.error("----- LFRequest: URLError: ---------------------------------------------") logger.error("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) logger.error("------------------------------------------------------------------------") diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index 95d97270..8d073f9c 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -18,7 +18,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit() - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) LFRequest = importlib.import_module("py-json.LANforge.LFRequest") @@ -421,9 +420,9 @@ def find_port_eids(resource_id=1, base_url="http://localhost:8080", port_names=( port_url = "/port/1" for port_name in port_names: uri = "%s/%s/%s" % (port_url, resource_id, port_name) - lf_r = LFRequest.LFRequest(base_url, uri) + lf_r = LFRequest.LFRequest(base_url, uri, debug_=debug) try: - response = lf_r.getAsJson(debug) + response = lf_r.getAsJson() if response is None: continue port_eids.append(PortEID(response)) @@ -445,8 +444,8 @@ def wait_until_ports_admin_down(resource_id=1, base_url="http://localhost:8080", up_stations = [] for port_name in port_list: uri = "%s/%s/%s?fields=device,down" % (port_url, resource_id, port_name) - lf_r = LFRequest.LFRequest(base_url, uri) - json_response = lf_r.getAsJson(debug_=False) + lf_r = LFRequest.LFRequest(base_url, uri, debug_=debug_) + json_response = lf_r.getAsJson() if json_response == None: if debug_: print("port %s disappeared" % port_name) @@ -472,8 +471,8 @@ def wait_until_ports_admin_up(resource_id=1, base_url="http://localhost:8080", p down_stations = [] for port_name in port_list: uri = "%s/%s/%s?fields=device,down" % (port_url, resource_id, port_name) - lf_r = LFRequest.LFRequest(base_url, uri) - json_response = lf_r.getAsJson(debug_=False) + lf_r = LFRequest.LFRequest(base_url, uri, debug_=debug_) + json_response = lf_r.getAsJson() if json_response == None: if debug_: print("port %s appeared" % port_name) @@ -525,8 +524,8 @@ def wait_until_ports_disappear(base_url="http://localhost:8080", port_list=(), d ("check_url", check_url), ]) lf_r = LFRequest.LFRequest(base_url, check_url, debug_=debug) - json_response = lf_r.get_as_json(debug_=debug, die_on_error_=False) - if (json_response == None): + json_response = lf_r.get_as_json() + if json_response is None: print("LFUtils::wait_until_ports_disappear:: Request returned None: [{}]".format(base_url + check_url)) else: if debug: @@ -635,15 +634,15 @@ def wait_until_ports_appear(base_url="http://localhost:8080", port_list=(), debu port_name = eid[2] # print("waiting for sta sta "+port_eid) uri = "%s/%s/%s" % (port_url, resource_id, port_name) - lf_r = LFRequest.LFRequest(base_url, uri) - json_response = lf_r.getAsJson(debug_=False) - if (json_response != None): + lf_r = LFRequest.LFRequest(base_url, uri, debug_=debug) + json_response = lf_r.getAsJson() + if json_response is not None: found_stations.append(port_name) else: - lf_r = LFRequest.LFRequest(base_url, ncshow_url) + lf_r = LFRequest.LFRequest(base_url, ncshow_url, debug_=debug) lf_r.addPostData({"shelf": shelf, "resource": resource_id, "port": port_name, "probe_flags": 5}) lf_r.jsonPost() - if (len(found_stations) < len(port_list)): + if len(found_stations) < len(port_list): sleep(2) if debug: @@ -676,12 +675,12 @@ def wait_until_endps(base_url="http://localhost:8080", endp_list=(), debug=False port_name = eid[2] uri = "%s/%s/%s" % (port_url, resource_id, port_name) - lf_r = LFRequest.LFRequest(base_url, uri) - json_response = lf_r.getAsJson(debug_=False) - if (json_response != None): + lf_r = LFRequest.LFRequest(base_url, uri, debug_=debug) + json_response = lf_r.getAsJson() + if json_response is not None: found_stations.append(port_name) else: - lf_r = LFRequest.LFRequest(base_url, ncshow_url) + lf_r = LFRequest.LFRequest(base_url, ncshow_url, debug_=debug) lf_r.addPostData({"shelf": shelf, "resource": resource_id, "port": port_name, "flags": 1}) lf_r.formPost() if (len(found_stations) < len(endp_list)): @@ -700,7 +699,7 @@ def remove_port(resource, port_name, baseurl="http://localhost:8080/", debug=Fal if debug: print("Removing port %d.%s" % (resource, port_name)) url = "/cli-json/rm_vlan" - lf_r = LFRequest.LFRequest(baseurl, url) + lf_r = LFRequest.LFRequest(baseurl, url, debug_=debug) lf_r.addPostData({ "shelf": 1, "resource": resource, @@ -722,7 +721,7 @@ def remove_cx(baseurl, cx_names, debug=False): "test_mgr": "all", "cx_name": name } - lf_r = LFRequest.LFRequest(baseurl, url) + lf_r = LFRequest.LFRequest(baseurl, url, debug_=debug) lf_r.addPostData(data) lf_r.jsonPost(debug) @@ -735,7 +734,7 @@ def remove_endps(baseurl, endp_names, debug=False): if debug: print("Removing endp %s" % ", ".join(endp_names)) url = "/cli-json/rm_endp" - lf_r = LFRequest.LFRequest(baseurl, url) + lf_r = LFRequest.LFRequest(baseurl, url, debug_=debug) for name in endp_names: data = { "endp_name": name diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 14d251c6..9a6c639b 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -321,7 +321,7 @@ class LFCliBase: proxies_=self.proxy, debug_=debug_, die_on_error_=self.exit_on_error) - json_response = lf_r.get_as_json(debug_=debug_, die_on_error_=False) + json_response = lf_r.get_as_json() #debug_printer.pprint(json_response) if (json_response is None): if debug_: From 3315cff3eab58c2eceeac132dca728070d04828b Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 8 Nov 2021 20:39:08 -0700 Subject: [PATCH 276/731] *rig.json update the upstream port to alias Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_test_rig.json | 2 +- py-scripts/tools/ct_us_001_rig.json | 2 +- py-scripts/tools/ct_us_001_scripts.json | 52 +++++++++++++++++++++---- py-scripts/tools/ct_us_002_rig.json | 2 +- py-scripts/tools/ct_us_003_rig.json | 2 +- py-scripts/tools/ct_us_004_rig.json | 2 +- 6 files changed, 50 insertions(+), 12 deletions(-) diff --git a/py-scripts/tools/ct_test_rig.json b/py-scripts/tools/ct_test_rig.json index 53343414..efaa5c76 100644 --- a/py-scripts/tools/ct_test_rig.json +++ b/py-scripts/tools/ct_test_rig.json @@ -12,7 +12,7 @@ "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", - "UPSTREAM_PORT":"1.1.eth2", + "UPSTREAM_PORT":"eth2", "TEST_TIMEOUT": 600, "EMAIL_LIST_PRODUCTION": "support@candelatech.com", "EMAIL_LIST_TEST": "support@candelatech.com", diff --git a/py-scripts/tools/ct_us_001_rig.json b/py-scripts/tools/ct_us_001_rig.json index ef67ceed..6590fd2d 100644 --- a/py-scripts/tools/ct_us_001_rig.json +++ b/py-scripts/tools/ct_us_001_rig.json @@ -12,7 +12,7 @@ "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", - "UPSTREAM_PORT":"1.1.eth2", + "UPSTREAM_PORT":"eth2", "TEST_TIMEOUT": 600, "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index bf7b5b97..f131ed8e 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -11,31 +11,69 @@ }, "test_suites":{ "suite_short":{ + "clean_up_cxs_endp_sta":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, "test_ip_variable_time0-ipv4":{ "enabled":"TRUE", "command":"test_ip_variable_time.py", "args":"", "args_list":[ - " --mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s", - " --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"] + " --mgr LF_MGR_IP --radio wiphy1 --ssid asus11ax-5 --passwd hello123", + " --security wpa2 --test_duration 60s --output_format excel ", + " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", + " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", + " --port_mgr_cols 'alias','channel','activity','mode'"] }, "test_ip_variable_time1-ipv4":{ "enabled":"TRUE", "command":"test_ip_variable_time.py", "args":"", "args_list":[ - " --mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s", - " --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug" + " --mgr LF_MGR_IP --radio wiphy1 --ssid asus11ax-5 --passwd hello123", + " --security wpa2 --test_duration 60s --output_format excel ", + " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", + " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", + " --port_mgr_cols 'alias','channel','activity','mode'" ]} }, "suite_l3":{ - "test_l3_longevity":{"enabled":"TRUE","load_db":"NONE","command":"test_l3_longevity.py","args":"--mgr 192.168.100.116 --test_duration 15s --polling_interval 5s --upstream_port eth2 --radio 'radio==wiphy1,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"} + "test_l3_longevity":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'" + ] + } }, "suite_l3r":{ - "test_l3_longevity":{"enabled":"TRUE","load_db":"NONE","command":"test_l3_longevity.py","args":"--mgr 192.168.100.116 --test_duration 15s --polling_interval 5s --upstream_port eth2 --radio 'radio==wiphy1,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --local_lf_report_dir REPORT_PATH"} + "test_l3_longevity":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --local_lf_report_dir REPORT_PATH"]} }, "suite_daily":{ - "test_l3_longevity":{"enabled":"TRUE","load_db":"NONE","command":"test_l3_longevity.py","args":"","args_list":["--mgr 192.168.100.116 --test_duration 15s --polling_interval 5s --upstream_port eth2 --radio 'radio==wiphy1,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"]}, + "test_l3_longevity":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"]}, "example_security_connection0":{"enabled":"TRUE","command":"example_security_connection.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"]}, "example_security_connection1":{"enabled":"TRUE","command":"example_security_connection.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"]}, "example_security_connection2":{"enabled":"TRUE","command":"example_security_connection.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"]}, diff --git a/py-scripts/tools/ct_us_002_rig.json b/py-scripts/tools/ct_us_002_rig.json index 43819d0d..2940b393 100644 --- a/py-scripts/tools/ct_us_002_rig.json +++ b/py-scripts/tools/ct_us_002_rig.json @@ -12,7 +12,7 @@ "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", - "UPSTREAM_PORT": "1.1.eth2", + "UPSTREAM_PORT": "eth2", "TEST_TIMEOUT": 600, "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", diff --git a/py-scripts/tools/ct_us_003_rig.json b/py-scripts/tools/ct_us_003_rig.json index 053ea38f..99b07679 100644 --- a/py-scripts/tools/ct_us_003_rig.json +++ b/py-scripts/tools/ct_us_003_rig.json @@ -12,7 +12,7 @@ "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", - "UPSTREAM_PORT":"1.1.eth1", + "UPSTREAM_PORT":"eth1", "TEST_TIMEOUT": 600, "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", diff --git a/py-scripts/tools/ct_us_004_rig.json b/py-scripts/tools/ct_us_004_rig.json index 6d386d46..5315d37e 100644 --- a/py-scripts/tools/ct_us_004_rig.json +++ b/py-scripts/tools/ct_us_004_rig.json @@ -12,7 +12,7 @@ "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", - "UPSTREAM_PORT": "1.1.eth2", + "UPSTREAM_PORT": "eth2", "TEST_TIMEOUT": 300, "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", From 35081c3fd82bf994a3f50b2b16c2dac68ccbd582 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 8 Nov 2021 21:00:47 -0700 Subject: [PATCH 277/731] ct_us_001_scripts.json replace with variables Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 246 +++++++++++++++++++----- 1 file changed, 201 insertions(+), 45 deletions(-) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index f131ed8e..6c2e7527 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -23,8 +23,8 @@ "command":"test_ip_variable_time.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --ssid asus11ax-5 --passwd hello123", - " --security wpa2 --test_duration 60s --output_format excel ", + " --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED", + " --security SECURITY_USED --test_duration 60s --output_format excel ", " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", " --port_mgr_cols 'alias','channel','activity','mode'"] @@ -34,8 +34,8 @@ "command":"test_ip_variable_time.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --ssid asus11ax-5 --passwd hello123", - " --security wpa2 --test_duration 60s --output_format excel ", + " --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED", + " --security SECURITY_USED --test_duration 60s --output_format excel ", " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", " --port_mgr_cols 'alias','channel','activity','mode'" @@ -62,7 +62,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[" --mgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", - " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USEDD,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --local_lf_report_dir REPORT_PATH"]} }, "suite_daily":{ @@ -72,47 +72,203 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[" --mgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2", - " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"]}, - "example_security_connection0":{"enabled":"TRUE","command":"example_security_connection.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"]}, - "example_security_connection1":{"enabled":"TRUE","command":"example_security_connection.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"]}, - "example_security_connection2":{"enabled":"TRUE","command":"example_security_connection.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"]}, - "example_security_connection3":{"enabled":"TRUE","command":"example_security_connection.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"]}, - "sta_connect2":{"enabled":"FALSE","command":"sta_connect2.py","args":"","args_list":["--mgr 192.168.100.116 --dut_ssid asus11ax-5 --dut_passwd hello123 --dut_security wpa2"]}, - "sta_connect_example":{"enabled":"FALSE","command":"sta_connect_example.py","args":"","args_list":["--mgr 192.168.100.116 "]}, - "test_fileio":{"enabled":"TRUE","command":"test_fileio.py","args":"","args_list":["--mgr 192.168.100.116 --macvlan_parent eth2 --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 --netmask 255.255.255.0 --test_duration 30s --gateway 192.168.92.1"]}, - "test_generic0":{"enabled":"FALSE","command":"test_generic.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type lfping --dest 10.40.0.1 --debug"]}, - "test_generic1":{"enabled":"FALSE","command":"test_generic.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security wpa2 --debug"]}, - "test_generic2":{"enabled":"FALSE","command":"test_generic.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type iperf3 --debug"]}, - "test_generic3":{"enabled":"FALSE","command":"test_generic.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type lfcurl --dest 10.40.0.1 --file_output /home/lanforge/Documents/lfcurl_output.txt --debug"]}, - "testgroup":{"enabled":"FALSE","command":"testgroup.py","args":"","args_list":["--mgr 192.168.100.116 --group_name group1 --add_group --list_groups --debug"]}, - "testgroup5":{"enabled":"FALSE","command":"testgroup.py","args":"","args_list":["--mgr 192.168.100.116 --num_stations 4 --ssid lanforge --passwd password --security wpa2 --radio wiphy0 --group_name group0 --add_group"]}, - "test_ip_connection-ipv4":{"enabled":"TRUE","command":"test_ip_connection.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, - "test_ip_variable_time0-ipv4":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"]}, - "test_ip_variable_time1-ipv4":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"]}, - "test_ip_connection-ipv6":{"enabled":"FALSE","command":"test_ip_connection.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --ipv6 --debug"]}, - "test_ip_variable_time0-ipv6":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --ipv6 --traffic_type lf_udp --debug"]}, - "test_ip_variable_time1-ipv6":{"enabled":"TRUE","command":"test_ip_variable_time.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped --ipv6 --traffic_type lf_udp --debug"]}, - "test_l4_bytes-rd":{"enabled":"TRUE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --test_type bytes-rd --test_duration 15s --url 'dl http://10.40.0.1 /dev/null' --debug"]}, - "test_l4_bytes-wr":{"enabled":"FALSE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --test_type bytes-wr --test_duration 15s --url 'ul http://10.40.0.1' --debug"]}, - "test_l4_urls_s":{"enabled":"TRUE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --test_type urls --test_duration 15s --requests_per_ten 600 --target_per_ten 600 --url 'dl http://10.40.0.1 /dev/null' --debug"]}, - "test_l4_ftp_bytes-rd":{"enabled":"TRUE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --ftp --test_type bytes-rd --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null' --debug"]}, - "test_l4_ftp_bytes-wr":{"enabled":"FALSE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --ftp --test_type bytes-wr --test_duration 15s --url 'ul ftp://10.40.0.1' --debug"]}, - "test_l4_ftp_urls_s":{"enabled":"TRUE","command":"test_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --num_stations 4 --security wpa2 --ssid asus11ax-5 --passwd hello123 --ftp --test_type urls --requests_per_ten 600 --target_per_ten 600 --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null' --debug"]}, - "test_l3_longevity_1":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"","args_list":["--mgr 192.168.100.116 --test_duration 15s --polling_interval 5s --upstream_port eth2 --radio 'radio==wiphy0,stations==4,ssid==asus11ax-5,ssid_pw==hello123,security==wpa2' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"]}, - "test_l3_powersave_traffic":{"enabled":"FALSE","command":"test_l3_powersave_traffic.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, - "test_status_msg":{"enabled":"TRUE","command":"test_status_msg.py","args":"","args_list":["--mgr 192.168.100.116 --action run_test"]}, - "test_wanlink":{"enabled":"TRUE","command":"test_wanlink.py","args":"","args_list":["--mgr 192.168.100.116 --debug"]}, - "create_bridge":{"enabled":"TRUE","command":"create_bridge.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --upstream_port eth2 --target_device sta0000 --debug"]}, - "create_l3":{"enabled":"FALSE","command":"create_l3.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, - "create_l4":{"enabled":"TRUE","command":"create_l4.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, - "create_macvlan":{"enabled":"TRUE","command":"create_macvlan.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --macvlan_parent eth2 --debug"]}, - "create_station":{"enabled":"TRUE","command":"create_station.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, - "create_vap":{"enabled":"TRUE","command":"create_vap.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"]}, - "create_qvlan":{"enabled":"TRUE","command":"create_qvlan.py","args":"","args_list":["--mgr 192.168.100.116 --radio wiphy1 --qvlan_parent eth2"]}, - "wlan_capacity_calculator1":{"enabled":"TRUE","command":"./wlan_capacity_calculator.py","args":"","args_list":["-sta 11abg -t Voice -p 48 -m 106 -e WEP -q Yes -b 1 2 5.5 11 -pre Long -s N/A -co G.711 -r Yes -c Yes"]}, - "wlan_capacity_calculator2":{"enabled":"TRUE","command":"./wlan_capacity_calculator.py","args":"","args_list":["-sta 11n -t Voice -d 17 -ch 40 -gu 800 -high 9 -e WEP -q Yes -ip 5 -mc 42 -b 6 9 12 24 -m 1538 -co G.729 -pl Greenfield -cw 15 -r Yes -c Yes"]}, - "wlan_capacity_calculator3":{"enabled":"TRUE","command":"./wlan_capacity_calculator.py","args":"","args_list":["-sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes"]} + "example_security_connection0":{ + "enabled":"TRUE", + "command":"example_security_connection.py", + "args":"", + "args_list":["--mgr LF_MGR_IP --num_stations 4", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --radio wiphy1 --security SECURITY_USED --debug"]}, + "example_security_connection1":{ + "enabled":"TRUE", + "command":"example_security_connection.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --num_stations 4 --ssid SSID_USED --passwd SSID_PW_USED", + " --radio wiphy1 --security SECURITY_USED --debug"]}, + "example_security_connection2":{ + "enabled":"TRUE", + "command":"example_security_connection.py", + "args":"", + "args_list":["use_ssid_idx=1 --mgr LF_MGR_IP --num_stations 4 --ssid SSID_USED --passwd SSID_PW_USED --radio wiphy1 --security SECURITY_USED --debug"]}, + "example_security_connection3":{ + "enabled":"TRUE", + "command":"example_security_connection.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --num_stations 4 --ssid SSID_USED --passwd SSID_PW_USED --radio wiphy1 --security SECURITY_USED --debug"]}, + "sta_connect2":{ + "enabled":"FALSE", + "command":"sta_connect2.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --dut_ssid SSID_USED --dut_passwd SSID_PW_USED --dut_security SECURITY_USED"]}, + "sta_connect_example":{ + "enabled":"FALSE", + "command":"sta_connect_example.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP "]}, + "test_fileio":{ + "enabled":"TRUE", + "command":"test_fileio.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --macvlan_parent eth2 --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 --netmask 255.255.255.0 --test_duration 30s --gateway 192.168.92.1"]}, + "test_generic0":{ + "enabled":"FALSE", + "command":"test_generic.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --num_stations 4 --type lfping --dest 10.40.0.1 --debug"]}, + "test_generic1":{ + "enabled":"FALSE", + "command":"test_generic.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --num_stations 4 --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security SECURITY_USED --debug"]}, + "test_generic2":{ + "enabled":"FALSE", + "command":"test_generic.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --num_stations 4 --type iperf3 --debug"]}, + "test_generic3":{ + "enabled":"FALSE", + "command":"test_generic.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --num_stations 4 --type lfcurl --dest 10.40.0.1 --file_output /home/lanforge/Documents/lfcurl_output.txt --debug"]}, + "testgroup":{ + "enabled":"FALSE", + "command":"testgroup.py", + "args":"", + "args_list":["--mgr LF_MGR_IP --group_name group1 --add_group --list_groups --debug"]}, + "testgroup5":{ + "enabled":"FALSE", + "command":"testgroup.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --num_stations 4 --ssid lanforge --passwd password --security SECURITY_USED --radio wiphy0 --group_name group0 --add_group"]}, + "test_ip_connection-ipv4":{ + "enabled":"TRUE", + "command":"test_ip_connection.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, + "test_ip_variable_time0-ipv4":{ + "enabled":"TRUE", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"]}, + "test_ip_variable_time1-ipv4":{ + "enabled":"TRUE", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"]}, + "test_ip_connection-ipv6":{ + "enabled":"FALSE", + "command":"test_ip_connection.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --ipv6 --debug"]}, + "test_ip_variable_time0-ipv6":{ + "enabled":"TRUE", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --ipv6 --traffic_type lf_udp --debug"]}, + "test_ip_variable_time1-ipv6":{ + "enabled":"TRUE", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped --ipv6 --traffic_type lf_udp --debug"]}, + "test_l4_bytes-rd":{ + "enabled":"TRUE", + "command":"test_l4.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --test_type bytes-rd --test_duration 15s --url 'dl http://10.40.0.1 /dev/null' --debug"]}, + "test_l4_bytes-wr":{ + "enabled":"FALSE", + "command":"test_l4.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --test_type bytes-wr --test_duration 15s --url 'ul http://10.40.0.1' --debug"]}, + "test_l4_urls_s":{ + "enabled":"TRUE", + "command":"test_l4.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --test_type urls --test_duration 15s --requests_per_ten 600 --target_per_ten 600 --url 'dl http://10.40.0.1 /dev/null' --debug"]}, + "test_l4_ftp_bytes-rd":{ + "enabled":"TRUE", + "command":"test_l4.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --ftp --test_type bytes-rd --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null' --debug"]}, + "test_l4_ftp_bytes-wr":{ + "enabled":"FALSE", + "command":"test_l4.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --ftp --test_type bytes-wr --test_duration 15s --url 'ul ftp://10.40.0.1' --debug"]}, + "test_l4_ftp_urls_s":{ + "enabled":"TRUE", + "command":"test_l4.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --ftp --test_type urls --requests_per_ten 600 --target_per_ten 600 --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null' --debug"]}, + "test_l3_longevity_1":{ + "enabled":"TRUE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2 --radio 'radio==wiphy0,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"]}, + "test_l3_powersave_traffic":{ + "enabled":"FALSE", + "command":"test_l3_powersave_traffic.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, + "test_status_msg":{ + "enabled":"TRUE", + "command":"test_status_msg.py", + "args":"", + "args_list":["--mgr LF_MGR_IP --action run_test"]}, + "test_wanlink":{ + "enabled":"TRUE", + "command":"test_wanlink.py", + "args":"","args_list":["--mgr LF_MGR_IP --debug"]}, + "create_bridge":{ + "enabled":"TRUE", + "command":"create_bridge.py", + "args":"", + "args_list":["--mgr LF_MGR_IP --radio wiphy1 --upstream_port eth2 --target_device sta0000 --debug"]}, + "create_l3":{ + "enabled":"FALSE", + "command":"create_l3.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, + "create_l4":{ + "enabled":"TRUE", + "command":"create_l4.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, + "create_macvlan":{ + "enabled":"TRUE", + "command":"create_macvlan.py", + "args":"", + "args_list":["--mgr LF_MGR_IP --radio wiphy1 --macvlan_parent eth2 --debug"]}, + "create_station":{ + "enabled":"TRUE", + "command":"create_station.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, + "create_vap":{ + "enabled":"TRUE", + "command":"create_vap.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, + "create_qvlan":{ + "enabled":"TRUE", + "command":"create_qvlan.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --qvlan_parent eth2"]}, + "wlan_capacity_calculator1":{ + "enabled":"TRUE", + "command":"./wlan_capacity_calculator.py", + "args":"", + "args_list":["-sta 11abg -t Voice -p 48 -m 106 -e WEP -q Yes -b 1 2 5.5 11 -pre Long -s N/A -co G.711 -r Yes -c Yes"]}, + "wlan_capacity_calculator2":{ + "enabled":"TRUE", + "command":"./wlan_capacity_calculator.py", + "args":"","args_list":["-sta 11n -t Voice -d 17 -ch 40 -gu 800 -high 9 -e WEP -q Yes -ip 5 -mc 42 -b 6 9 12 24 -m 1538 -co G.729 -pl Greenfield -cw 15 -r Yes -c Yes"]}, + "wlan_capacity_calculator3":{ + "enabled":"TRUE", + "command":"./wlan_capacity_calculator.py", + "args":"", + "args_list":["-sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes"]} } } } From ec76d13ba5b148ffd3c72f2a05ab094422020e5a Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 8 Nov 2021 20:19:03 -0800 Subject: [PATCH 278/731] LFRequest.py: json_post debug message more readable Signed-off-by: Jed Reynolds --- py-json/LANforge/LFRequest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/LANforge/LFRequest.py b/py-json/LANforge/LFRequest.py index edb85817..642e3528 100644 --- a/py-json/LANforge/LFRequest.py +++ b/py-json/LANforge/LFRequest.py @@ -176,7 +176,7 @@ class LFRequest: resp_data = resp.read().decode('utf-8') if (debug and die_on_error_): self.logger.debug("----- LFRequest::json_post:128 debug: --------------------------------------------") - self.logger.debug("URL: %s :%d "% (self.requested_url, resp.status)) + self.logger.debug("URL: <%s> status: %d "% (self.requested_url, resp.status)) if resp.status != 200: self.logger.debug(pformat(resp.getheaders())) self.logger.debug("----- resp_data:128 -------------------------------------------------") From ad1785cfe7d7a8f837306cab7c736a4a6d6bdcfa Mon Sep 17 00:00:00 2001 From: Nikita Yadav Date: Tue, 9 Nov 2021 18:33:05 +0530 Subject: [PATCH 279/731] class used for getting attenuator serial number --- py-scripts/attenuator_serial.py | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 py-scripts/attenuator_serial.py diff --git a/py-scripts/attenuator_serial.py b/py-scripts/attenuator_serial.py new file mode 100644 index 00000000..97e05070 --- /dev/null +++ b/py-scripts/attenuator_serial.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +""" +this file is used in tip for getting serial number of attenuators +""" +import sys +import os +import importlib +import time + +sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) + +lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") +LFCliBase = lfcli_base.LFCliBase +LFRequest = importlib.import_module("py-json.LANforge.LFRequest") +LFUtils = importlib.import_module("py-json.LANforge.LFUtils") + +class AttenuatorSerial(LFCliBase): + def __init__(self, lfclient_host, lfclient_port, debug_=False): + super().__init__(lfclient_host, lfclient_port, debug_) + self.lfclient_host = lfclient_host + self.COMMANDS = ["show_attenuators", "set_attenuator"] + self.atten_serno = "" + self.atten_idx = "" + self.atten_val = "" + self.atten_data = { + "shelf": 1, + "resource": 1, + "serno": None, + "atten_idx": None, + "val": None, + "mode": None, + "pulse_width_us5": None, + "pulse_interval_ms": None, + "pulse_count": None, + "pulse_time_ms": None + } + + def show(self, debug=False): + ser_no_list = [] + print("Show Attenuators.........") + response = self.json_get("/attenuators/") + time.sleep(0.01) + if response is None: + print(response) + raise ValueError("Cannot find any endpoints") + else: + attenuator_resp = response["attenuators"] + for i in attenuator_resp: + for key in i: + if key == "entity id": + print("entity id") + # print("%s " % (key)) + ser_no_list.append(key) + + return ser_no_list +def main(): + obj = AttenuatorSerial(lfclient_host="localhost", lfclient_port=8802) + x = obj.show() + print("out",x) + + +if __name__ == '__main__': + main() From 88e85173825ca992ae322a7a000cec651ee407a7 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 9 Nov 2021 06:18:55 -0700 Subject: [PATCH 280/731] lf_qa.py added update_layout(autotypenumbers='convert types') plotly latest version is updated so needed to treat numbers as objects. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_qa.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index a50c01f9..fc937259 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -472,6 +472,7 @@ class csv_sql(): yaxis_title="{}".format(units_list[-1]), xaxis={'type': 'date'} ) + kpi_fig.update_layout(autotypenumbers='convert types') self.generate_png(df_tmp=df_tmp, group=group, @@ -499,6 +500,8 @@ class csv_sql(): yaxis_title="{units}".format(units=units_list[-1]), xaxis={'type': 'date'} ) + kpi_fig.update_layout(autotypenumbers='convert types') + self.generate_png(df_tmp=df_tmp, group=group, From a5ddd4047f32ff5e647d847be584ddc82a2847be Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 9 Nov 2021 07:38:53 -0700 Subject: [PATCH 281/731] ct_us_*.json test updates Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_test_rig.json | 2 +- py-scripts/tools/ct_us_001_scripts.json | 12 +++++++++++- py-scripts/tools/ct_us_002_rig.json | 2 +- py-scripts/tools/ct_us_002_tests.json | 2 +- py-scripts/tools/ct_us_003_rig.json | 2 +- py-scripts/tools/ct_us_003_tests.json | 4 ++-- py-scripts/tools/ct_us_004_rig.json | 2 +- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/py-scripts/tools/ct_test_rig.json b/py-scripts/tools/ct_test_rig.json index efaa5c76..53343414 100644 --- a/py-scripts/tools/ct_test_rig.json +++ b/py-scripts/tools/ct_test_rig.json @@ -12,7 +12,7 @@ "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", - "UPSTREAM_PORT":"eth2", + "UPSTREAM_PORT":"1.1.eth2", "TEST_TIMEOUT": 600, "EMAIL_LIST_PRODUCTION": "support@candelatech.com", "EMAIL_LIST_TEST": "support@candelatech.com", diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 6c2e7527..fdddccdd 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -268,7 +268,17 @@ "enabled":"TRUE", "command":"./wlan_capacity_calculator.py", "args":"", - "args_list":["-sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes"]} + "args_list":["-sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes"]}, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } } } } diff --git a/py-scripts/tools/ct_us_002_rig.json b/py-scripts/tools/ct_us_002_rig.json index 2940b393..43819d0d 100644 --- a/py-scripts/tools/ct_us_002_rig.json +++ b/py-scripts/tools/ct_us_002_rig.json @@ -12,7 +12,7 @@ "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", - "UPSTREAM_PORT": "eth2", + "UPSTREAM_PORT": "1.1.eth2", "TEST_TIMEOUT": 600, "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 4aa6c648..744bb96c 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -139,7 +139,7 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS --instance_name ATH10K_9984_wc", " --upstream UPSTREAM_PORT --batch_size 1,5,15 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_'", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984'", " --test_rig TEST_RIG", " --set DUT_SET_NAME " ] diff --git a/py-scripts/tools/ct_us_003_rig.json b/py-scripts/tools/ct_us_003_rig.json index 99b07679..053ea38f 100644 --- a/py-scripts/tools/ct_us_003_rig.json +++ b/py-scripts/tools/ct_us_003_rig.json @@ -12,7 +12,7 @@ "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", - "UPSTREAM_PORT":"eth1", + "UPSTREAM_PORT":"1.1.eth1", "TEST_TIMEOUT": 600, "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index 6bb589af..6bb418fd 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -103,7 +103,7 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario mt7915e_dp ", - " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: USE_DUT_NAME Radio-2' NA wiphy7,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: USE_DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, @@ -115,7 +115,7 @@ "args":"", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name mt7915e_dp", - " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan7", + " --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", diff --git a/py-scripts/tools/ct_us_004_rig.json b/py-scripts/tools/ct_us_004_rig.json index 5315d37e..6d386d46 100644 --- a/py-scripts/tools/ct_us_004_rig.json +++ b/py-scripts/tools/ct_us_004_rig.json @@ -12,7 +12,7 @@ "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", - "UPSTREAM_PORT": "eth2", + "UPSTREAM_PORT": "1.1.eth2", "TEST_TIMEOUT": 300, "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", From 8271e54714b41ca3507c38c279c4c0f5218d7bd7 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 9 Nov 2021 10:35:57 -0700 Subject: [PATCH 282/731] ct_us_001_rig.json : update the rig Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_rig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_001_rig.json b/py-scripts/tools/ct_us_001_rig.json index 6590fd2d..ef67ceed 100644 --- a/py-scripts/tools/ct_us_001_rig.json +++ b/py-scripts/tools/ct_us_001_rig.json @@ -12,7 +12,7 @@ "LF_MGR_PORT": "8080", "LF_MGR_USER": "lanforge", "LF_MGR_PASS": "lanforge", - "UPSTREAM_PORT":"eth2", + "UPSTREAM_PORT":"1.1.eth2", "TEST_TIMEOUT": 600, "EMAIL_LIST_PRODUCTION": "konikofi@candelatech.com,greearb@candelatech.com,,jreynolds@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,erin.grimes@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com", "EMAIL_LIST_TEST": "chuck.rekiere@candelatech.com", From d16bdd9f7a7ab6bb7db75bb48d28eba44164a57a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 9 Nov 2021 17:17:38 -0800 Subject: [PATCH 283/731] Fix test_l3_longevity whitespace errors Signed-off-by: Matthew Stidham --- py-scripts/test_l3_longevity.py | 233 +++++++++++++++----------------- 1 file changed, 109 insertions(+), 124 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 0f25c90e..992c4ede 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -''' +""" NAME: test_l3_longevity.py PURPOSE: @@ -44,7 +44,7 @@ COPYRIGHT: Copyright 2021 Candela Technologies Inc INCLUDE_IN_README -''' +""" import argparse import csv import datetime @@ -63,11 +63,10 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lf_report = importlib.import_module("py-scripts.lf_report") -lf_kpi_csv = importlib.import_module("py-scripts.lf_kpi_csv") +lf_kpi_csv = importlib.import_module("py-scripts.lf_kpi_csv") LFUtils = importlib.import_module("py-json.LANforge.LFUtils") realm = importlib.import_module("py-json.realm") Realm = realm.Realm @@ -165,7 +164,7 @@ class L3VariableTime(Realm): self.test_duration = test_duration self.radio_name_list = radio_name_list self.number_of_stations_per_radio_list = number_of_stations_per_radio_list - #self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=debug_on) + # self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=debug_on) self.polling_interval_seconds = self.duration_time_to_seconds(polling_interval) self.cx_profile = self.new_l3_cx_profile() self.multicast_profile = self.new_multicast_profile() @@ -195,7 +194,7 @@ class L3VariableTime(Realm): self.attenuators = attenuators self.atten_vals = atten_vals - if ((len(self.atten_vals) > 0) and (self.atten_vals[0] != -1) and (len(self.attenuators) == 0)): + if (len(self.atten_vals) > 0) and (self.atten_vals[0] != -1) and (len(self.attenuators) == 0): print("ERROR: Attenuation values configured, but no Attenuator EIDs specified.\n") exit(1) @@ -233,24 +232,22 @@ class L3VariableTime(Realm): # Lookup key is port-eid name self.port_csv_files = {} self.port_csv_writers = {} - + self.ul_port_csv_files = {} self.ul_port_csv_writers = {} - # TODO: cmd-line arg to enable/disable these stats. self.ap_stats_col_titles = ["Station Address", "Dl-PHY-Mbps", "Dl-Data-Mbps", "Dl-Air-Use", "Dl-Data-Use", - "Dl-Retries", "Dl-BW", "Dl-MCS", "Dl-NSS", "Dl-OFDMA", "Dl-MU-MIMO", + "Dl-Retries", "Dl-BW", "Dl-MCS", "Dl-NSS", "Dl-OFDMA", "Dl-MU-MIMO", "Dl-Channel-Utilization"] - self.ap_stats_ul_col_titles = ["UL Station Address", "Ul-rssi", "Ul-tid", "Ul-ampdu","Ul-mpdu", "Ul-Data-Mbps", - "Ul-PHY-Mbps", "UL-BW", "Ul-MCS", "Ul-NSS", "Ul-OOW", "Ul-HOLES", - "Ul-DUP", "Ul-Retries", "Ul-OFDMA", "Ul-Tones", "Ul-AIR"] - + self.ap_stats_ul_col_titles = ["UL Station Address", "Ul-rssi", "Ul-tid", "Ul-ampdu", "Ul-mpdu", "Ul-Data-Mbps", + "Ul-PHY-Mbps", "UL-BW", "Ul-MCS", "Ul-NSS", "Ul-OOW", "Ul-HOLES", + "Ul-DUP", "Ul-Retries", "Ul-OFDMA", "Ul-Tones", "Ul-AIR"] dur = self.duration_time_to_seconds(self.test_duration) - if (self.polling_interval_seconds > dur + 1): + if self.polling_interval_seconds > dur + 1: self.polling_interval_seconds = dur - 1 # Full spread-sheet data @@ -265,8 +262,8 @@ class L3VariableTime(Realm): if self.dataplane == False: for (radio_, ssid_, ssid_password_, ssid_security_, reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ - in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, - reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): + in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, + reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): self.station_profile = self.new_station_profile() self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = ssid_ @@ -318,7 +315,7 @@ class L3VariableTime(Realm): return self.ap_ofdma_24g def get_kpi_csv(self): - #print("self.csv_kpi_file {}".format(self.csv_kpi_file.name)) + # print("self.csv_kpi_file {}".format(self.csv_kpi_file.name)) return self.csv_kpi_file.name # Find avg latency, jitter for connections using specified port. @@ -334,7 +331,7 @@ class L3VariableTime(Realm): count = 0 sta_name = 'no_station' - #print("endp-stats-for-port, port-eid: {}".format(eid_name)) + # print("endp-stats-for-port, port-eid: {}".format(eid_name)) eid = self.name_to_eid(eid_name) print("eid_name: {eid_name} eid: {eid}".format(eid_name=eid_name, eid=eid)) @@ -426,7 +423,7 @@ class L3VariableTime(Realm): endp_rx_drop_map[item] = value if value_name == 'rx rate': # This hack breaks for mcast or if someone names endpoints weirdly. - #print("item: ", item, " rx-bps: ", value_rx_bps) + # print("item: ", item, " rx-bps: ", value_rx_bps) if item.endswith("-A"): total_dl += int(value) else: @@ -438,9 +435,10 @@ class L3VariableTime(Realm): else: total_ul_ll += int(value) - #print("total-dl: ", total_dl, " total-ul: ", total_ul, "\n") + # print("total-dl: ", total_dl, " total-ul: ", total_ul, "\n") return endp_rx_map, endp_rx_drop_map, endps, total_dl, total_ul, total_dl_ll, total_ul_ll - # This script supports resetting ports, allowing one to test AP/controller under data load + + # This script supports resetting ports, allowing one to test AP/controller under data load # while bouncing wifi stations. Check here to see if we should reset ports. def reset_port_check(self): @@ -464,7 +462,7 @@ class L3VariableTime(Realm): "radio: {} countdown seconds_till_reset {}".format( station_profile.add_sta_data['radio'], station_profile.reset_port_extra_data['seconds_till_reset'])) - if ((station_profile.reset_port_extra_data['seconds_till_reset'] <= 0)): + if station_profile.reset_port_extra_data['seconds_till_reset'] <= 0: station_profile.reset_port_extra_data['reset_port_timer_started'] = False port_to_reset = random.randint(0, len(station_profile.station_names) - 1) print( @@ -489,12 +487,12 @@ class L3VariableTime(Realm): # Make sure they are gone count = 0 - while (count < 10): + while count < 10: more = False for station_list in self.station_lists: for sta in station_list: rv = self.rm_port(sta, check_exists=True) - if (rv): + if rv: more = True if not more: break @@ -523,7 +521,7 @@ class L3VariableTime(Realm): # stations, so allow skipping it. # Do clean cx lists so that when we re-apply them we get same endp name # as we had previously - #print("rebuild: Clearing cx profile lists.\n") + # print("rebuild: Clearing cx profile lists.\n") self.cx_profile.clean_cx_lists() self.multicast_profile.clean_mc_lists() @@ -534,9 +532,9 @@ class L3VariableTime(Realm): # use brackes on [self.side_a] to make it a list these_cx, these_endp = self.cx_profile.create(endp_type=etype, side_a=[self.side_a], side_b=self.side_b, sleep_time=0, tos=_tos) - if (etype == "lf_udp" or etype == "lf_udp6"): + if etype == "lf_udp" or etype == "lf_udp6": self.udp_endps = self.udp_endps + these_endp - elif(etype == "lf"): + elif etype == "lf": self.lf_endps = self.eth_endps + these_endp else: self.tcp_endps = self.tcp_endps + these_endp @@ -556,7 +554,7 @@ class L3VariableTime(Realm): # Build/update connection types for etype in self.endp_types: if etype == "mc_udp" or etype == "mc_udp6": - print("Creating Multicast connections for endpoint type: %s" % (etype)) + print("Creating Multicast connections for endpoint type: %s" % etype) self.multicast_profile.create_mc_tx(etype, self.side_b, etype) self.multicast_profile.create_mc_rx(etype, side_rx=station_profile.station_names) else: @@ -564,7 +562,7 @@ class L3VariableTime(Realm): print("Creating connections for endpoint type: %s TOS: %s cx-count: %s" % (etype, _tos, self.cx_profile.get_cx_count())) these_cx, these_endp = self.cx_profile.create(endp_type=etype, side_a=station_profile.station_names, side_b=self.side_b, sleep_time=0, tos=_tos) - if (etype == "lf_udp" or etype == "lf_udp6"): + if etype == "lf_udp" or etype == "lf_udp6": self.udp_endps = self.udp_endps + these_endp else: self.tcp_endps = self.tcp_endps + these_endp @@ -572,7 +570,7 @@ class L3VariableTime(Realm): self.cx_count = self.cx_profile.get_cx_count() if self.dataplane == True: - self._pass("PASS: CX build finished: created/updated: %s connections." % (self.cx_count)) + self._pass("PASS: CX build finished: created/updated: %s connections." % self.cx_count) else: self._pass("PASS: Stations & CX build finished: created/updated: %s stations and %s connections." % (self.station_count, self.cx_count)) @@ -744,16 +742,15 @@ class L3VariableTime(Realm): return ap_stats_ul_2g - # provide fake bs_data for testing without AP wl2 is the 6E interface, wl1 5G, wl0 2G def read_ap_rx_report_test_mode(self): ap_rx_report_fake = "{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 rx_report\n", - "Station Address (rssi) tid ampdu mpdu Data Mbps PHY Mbps bw mcs Nss oow holes dup rtries ofdma tones air\n", - "50:E0:85:87:5B:F4 (-43dBm) 0 2062 127078 32.5 571.9 80 11.0 2 0 0 64 0% 100% 483.3 6%\n", - "50:E0:85:84:7A:E7 (-44dBm) 0 2334 144373 36.9 343.1 80 10.9 2 0 0 63 0% 100% 291.4 11%\n", - "50:E0:85:88:F4:5F (-45dBm) 0 2296 142463 36.4 346.3 80 10.9 2 0 0 64 0% 100% 294.1 11%\n") - #Keep commented for testing "(overall) - 6692 413914 105.8 - - - - - - - - - - - -\n" + "Station Address (rssi) tid ampdu mpdu Data Mbps PHY Mbps bw mcs Nss oow holes dup rtries ofdma tones air\n", + "50:E0:85:87:5B:F4 (-43dBm) 0 2062 127078 32.5 571.9 80 11.0 2 0 0 64 0% 100% 483.3 6%\n", + "50:E0:85:84:7A:E7 (-44dBm) 0 2334 144373 36.9 343.1 80 10.9 2 0 0 63 0% 100% 291.4 11%\n", + "50:E0:85:88:F4:5F (-45dBm) 0 2296 142463 36.4 346.3 80 10.9 2 0 0 64 0% 100% 294.1 11%\n") + # Keep commented for testing "(overall) - 6692 413914 105.8 - - - - - - - - - - - -\n" return ap_rx_report_fake def read_ap_bs_data_test_mode(self): @@ -763,17 +760,17 @@ class L3VariableTime(Realm): "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n") - #Keep commented for testing "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") + # Keep commented for testing "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") # print("ap_stats_fake {}".format(ap_stats_fake)) return ap_stats_fake def read_ap_chanim_stats_test_mode(self): # Create the test data as a continuous string ap_chanim_stats_fake = "{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 chanim_stats\n", - "version: 3\n", - "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", - # `"0xe06a 61 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") - '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') + "version: 3\n", + "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", + # `"0xe06a 61 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") + '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') # "0xe06a 1.67 15.00 0.00 17.00 0.00 0.00 97.33 53.00 2.00 0 0 -91 65 343370578\n") return ap_chanim_stats_fake @@ -783,17 +780,17 @@ class L3VariableTime(Realm): self.admin_up(self.side_b) for station_profile in self.station_profiles: for sta in station_profile.station_names: - print("Bringing up station %s" % (sta)) + print("Bringing up station %s" % sta) self.admin_up(sta) temp_stations_list = [] - #temp_stations_list.append(self.side_b) + # temp_stations_list.append(self.side_b) for station_profile in self.station_profiles: temp_stations_list.extend(station_profile.station_names.copy()) temp_stations_list_with_side_b = temp_stations_list.copy() # wait for b side to get IP - temp_stations_list_with_side_b.append(self.side_b) + temp_stations_list_with_side_b.append(self.side_b) print("temp_stations_list {temp_stations_list}".format(temp_stations_list=temp_stations_list)) print("temp_stations_list_with_side_b {temp_stations_list_with_side_b}".format(temp_stations_list_with_side_b=temp_stations_list_with_side_b)) @@ -817,7 +814,6 @@ class L3VariableTime(Realm): for eid_name in port_eids: self.csv_add_ul_port_column_headers(eid_name, self.csv_generate_ul_port_column_headers()) - # For each rate rate_idx = 0 for ul in self.side_a_min_rate: @@ -840,10 +836,10 @@ class L3VariableTime(Realm): dl_pdu_str = dl_pdu ul_pdu_str = ul_pdu - if (ul_pdu == "AUTO" or ul_pdu == "MTU"): + if ul_pdu == "AUTO" or ul_pdu == "MTU": ul_pdu = "-1" - if (dl_pdu == "AUTO" or dl_pdu == "MTU"): + if dl_pdu == "AUTO" or dl_pdu == "MTU": dl_pdu = "-1" print("ul: %s dl: %s cx-count: %s rates-are-totals: %s\n" % (ul, dl, self.cx_count, self.rates_are_totals)) @@ -885,7 +881,7 @@ class L3VariableTime(Realm): end_time = self.parse_time(self.test_duration) + cur_time - print("Monitoring throughput for duration: %s" % (self.test_duration)) + print("Monitoring throughput for duration: %s" % self.test_duration) # Monitor test for the interval duration. passes = 0 @@ -904,7 +900,7 @@ class L3VariableTime(Realm): mac_found_2g = False reset_timer = 0 latency = 0 - jitter = 0 + jitter = 0 total_ul_rate = 0 total_ul_rate_ll = 0 total_ul_pkts_ll = 0 @@ -913,9 +909,9 @@ class L3VariableTime(Realm): total_dl_pkts_ll = 0 while cur_time < end_time: - #interval_time = cur_time + datetime.timedelta(seconds=5) + # interval_time = cur_time + datetime.timedelta(seconds=5) interval_time = cur_time + datetime.timedelta(seconds=self.polling_interval_seconds) - #print("polling_interval_seconds {}".format(self.polling_interval_seconds)) + # print("polling_interval_seconds {}".format(self.polling_interval_seconds)) while cur_time < interval_time: cur_time = datetime.datetime.now() @@ -952,7 +948,6 @@ class L3VariableTime(Realm): ap_chanim_stats_6g = self.read_ap_chanim_stats_6g() ap_stats_ul_6g = self.read_ap_stats_ul_6g() - ap_stats_6g_rows = ap_stats_6g.splitlines() print("From AP stats: ap_stats_6g_rows {}".format(ap_stats_6g_rows)) @@ -974,7 +969,7 @@ class L3VariableTime(Realm): # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("6g query-port: %s: incomplete response:" % (url)) + print("6g query-port: %s: incomplete response:" % url) pprint(response) else: # print("response".format(response)) @@ -987,8 +982,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_6g_rows: split_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_row[0].lower() != mac.lower(): ap_row = split_row @@ -1041,7 +1036,6 @@ class L3VariableTime(Realm): # ap information is passed with ap_row so all information needs to be contained in ap_row ap_row.append(str(channel_utilization)) - # work though the ul rx_data 6G for eid_name in port_eids: eid = self.name_to_eid(eid_name) @@ -1049,7 +1043,7 @@ class L3VariableTime(Realm): # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("6g query-port: %s: incomplete response:" % (url)) + print("6g query-port: %s: incomplete response:" % url) pprint(response) else: # print("response".format(response)) @@ -1062,8 +1056,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_ul_6g_rows: split_ul_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_ul_row[0].lower() != mac.lower(): ap_ul_row = split_ul_row @@ -1125,7 +1119,7 @@ class L3VariableTime(Realm): # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("query-port 5g: %s: incomplete response:" % (url)) + print("query-port 5g: %s: incomplete response:" % url) pprint(response) else: # print("response".format(response)) @@ -1138,8 +1132,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_5g_rows: split_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_row[0].lower() != mac.lower(): ap_row = split_row @@ -1196,16 +1190,16 @@ class L3VariableTime(Realm): self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) - # work though the ul rx_data 5G + # work though the ul rx_data 5G for eid_name in port_eids: eid = self.name_to_eid(eid_name) url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("5g query-port: %s: incomplete response:" % (url)) + print("5g query-port: %s: incomplete response:" % url) pprint(response) else: # print("response".format(response)) @@ -1218,8 +1212,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_ul_5g_rows: split_ul_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_ul_row[0].lower() != mac.lower(): ap_ul_row = split_ul_row @@ -1244,8 +1238,8 @@ class L3VariableTime(Realm): print("5g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) # 2g test mode if self.ap_test_mode: @@ -1279,7 +1273,7 @@ class L3VariableTime(Realm): # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("2g query-port: %s: incomplete response:" % (url)) + print("2g query-port: %s: incomplete response:" % url) pprint(response) else: # print("response".format(response)) @@ -1292,8 +1286,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_2g_rows: split_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_row[0].lower() != mac.lower(): ap_row = split_row @@ -1350,15 +1344,15 @@ class L3VariableTime(Realm): self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) - # work though the ul rx_data 5G + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + # work though the ul rx_data 5G for eid_name in port_eids: eid = self.name_to_eid(eid_name) url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("5g query-port: %s: incomplete response:" % (url)) + print("5g query-port: %s: incomplete response:" % url) pprint(response) else: # print("response".format(response)) @@ -1371,8 +1365,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_ul_2g_rows: split_ul_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_ul_row[0].lower() != mac.lower(): ap_ul_row = split_ul_row @@ -1397,8 +1391,8 @@ class L3VariableTime(Realm): print("2g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) else: # Query all of our ports @@ -1409,7 +1403,7 @@ class L3VariableTime(Realm): url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) response = self.json_get(url) if (response is None) or ("interface" not in response): - print("query-port: %s: incomplete response:" % (url)) + print("query-port: %s: incomplete response:" % url) pprint(response) else: p = response['interface'] @@ -1418,9 +1412,9 @@ class L3VariableTime(Realm): self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) - # At end of test step, record KPI into kpi.csv + # At end of test step, record KPI into kpi.csv self.record_kpi_csv( len(temp_stations_list), ul, @@ -1433,7 +1427,6 @@ class L3VariableTime(Realm): total_dl_ll_bps, total_ul_ll_bps) - # At end of test step, record KPI information. This is different the kpi.csv self.record_kpi( len(temp_stations_list), @@ -1494,12 +1487,12 @@ class L3VariableTime(Realm): port_data['signal'], port_data['ap'], port_data['mode'], latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll] # Add in info queried from AP. - #print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) - #print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) + # print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) + # print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) if len(ap_row) == len(self.ap_stats_col_titles): - #print("ap_row {}".format(ap_row)) + # print("ap_row {}".format(ap_row)) for col in ap_row: - #print("col {}".format(col)) + # print("col {}".format(col)) row.append(col) writer = self.port_csv_writers[eid_name] @@ -1507,7 +1500,7 @@ class L3VariableTime(Realm): self.port_csv_files[eid_name].flush() def write_ul_port_csv(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, eid_name, port_data, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row): + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row): row = [self.epoch_time, self.time_stamp(), sta_count, ul, ul, dl, dl, dl_pdu, dl_pdu, ul_pdu, ul_pdu, atten, eid_name @@ -1517,16 +1510,16 @@ class L3VariableTime(Realm): port_data['signal'], port_data['ap'], port_data['mode'], latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll] # Add in info queried from AP. - #print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) - #print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) + # print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) + # print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) - print("ap_ul_row len {} ap_stats_ul_col_titles len {} ap_ul_row {}".format(len(ap_ul_row),len(self.ap_stats_ul_col_titles),ap_ul_row)) + print("ap_ul_row len {} ap_stats_ul_col_titles len {} ap_ul_row {}".format(len(ap_ul_row), len(self.ap_stats_ul_col_titles), ap_ul_row)) if len(ap_ul_row) == len(self.ap_stats_ul_col_titles): print("ap_ul_row {}".format(ap_ul_row)) for col in ap_ul_row: print("col {}".format(col)) row.append(col) - + writer = self.ul_port_csv_writers[eid_name] writer.writerow(row) self.ul_port_csv_files[eid_name].flush() @@ -1540,52 +1533,50 @@ class L3VariableTime(Realm): def record_kpi_csv(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps): print("NOTE: Adding kpi to kpi.csv, sta_count {sta_count} total-download-bps:{total_dl_bps} upload: {total_ul_bps} bi-directional: {total}\n".format( - sta_count=sta_count,total_dl_bps=total_dl_bps, total_ul_bps=total_ul_bps, total=(total_ul_bps + total_dl_bps))) + sta_count=sta_count, total_dl_bps=total_dl_bps, total_ul_bps=total_ul_bps, total=(total_ul_bps + total_dl_bps))) print("NOTE: Adding kpi to kpi.csv, sta_count {sta_count} total-download-bps:{total_dl_ll_bps} upload: {total_ul_ll_bps} bi-directional: {total_ll}\n".format( - sta_count=sta_count,total_dl_ll_bps=total_dl_ll_bps, total_ul_ll_bps=total_ul_ll_bps, total_ll=(total_ul_ll_bps + total_dl_ll_bps))) - + sta_count=sta_count, total_dl_ll_bps=total_dl_ll_bps, total_ul_ll_bps=total_ul_ll_bps, total_ll=(total_ul_ll_bps + total_dl_ll_bps))) # the short description will all for more data to show up in one test-tag graph results_dict = self.kpi_csv.kpi_csv_get_dict_update_time() results_dict['Graph-Group'] = "Per Stations Rate DL" - results_dict['short-description'] = "DL {dl} bps pdu {dl_pdu} {sta_count} STA".format(dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) + results_dict['short-description'] = "DL {dl} bps pdu {dl_pdu} {sta_count} STA".format(dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_dl_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL" - results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,sta_count=sta_count) + results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} {sta_count} STA".format(ul=ul, ul_pdu=ul_pdu, sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_ul_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL+DL" - results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} + DL {dl} bps pud {dl_pdu}- {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) + results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} + DL {dl} bps pud {dl_pdu}- {sta_count} STA".format(ul=ul, ul_pdu=ul_pdu, dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) results_dict['numeric-score'] = "{}".format((total_ul_bps + total_dl_bps)) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate DL" - results_dict['short-description'] = "DL LL {dl} bps pdu {dl_pdu} {sta_count} STA".format(dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) + results_dict['short-description'] = "DL LL {dl} bps pdu {dl_pdu} {sta_count} STA".format(dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_dl_ll_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL" - results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,sta_count=sta_count) + results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} {sta_count} STA".format(ul=ul, ul_pdu=ul_pdu, sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_ul_ll_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL+DL" - results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} + DL LL {dl} bps pud {dl_pdu}- {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) + results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} + DL LL {dl} bps pud {dl_pdu}- {sta_count} STA".format(ul=ul, ul_pdu=ul_pdu, dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) results_dict['numeric-score'] = "{}".format((total_ul_ll_bps + total_dl_ll_bps)) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) - # Submit data to the influx db if configured to do so. # This is not the kpi.csv def record_kpi(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps): @@ -1643,11 +1634,7 @@ class L3VariableTime(Realm): station_profile.cleanup() def csv_generate_column_headers(self): - csv_rx_headers = ['Time epoch', 'Time', 'Monitor', - 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', - 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', - ] - csv_rx_headers.append("average_rx_data_bytes") + csv_rx_headers = ['Time epoch', 'Time', 'Monitor', 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', "average_rx_data_bytes"] return csv_rx_headers def csv_generate_port_column_headers(self): @@ -1665,19 +1652,17 @@ class L3VariableTime(Realm): def csv_generate_ul_port_column_headers(self): csv_ul_rx_headers = ['Time epoch', 'Time', 'Station-Count', - 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', - 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', 'Attenuation', - 'Name', 'Rx-Bps', 'Tx-Bps', 'Rx-Link-Rate', 'Tx-Link-Rate', 'RSSI', 'AP', 'Mode', - 'Rx-Latency', 'Rx-Jitter', 'Ul-Rx-Goodput-bps', 'Ul-Rx-Rate-ll', 'Ul-Rx-Pkts-ll', 'Dl-Rx-Goodput-bps', 'Dl-Rx-Rate-ll', 'Dl-Rx-Pkts-ll' - ] + 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', + 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', 'Attenuation', + 'Name', 'Rx-Bps', 'Tx-Bps', 'Rx-Link-Rate', 'Tx-Link-Rate', 'RSSI', 'AP', 'Mode', + 'Rx-Latency', 'Rx-Jitter', 'Ul-Rx-Goodput-bps', 'Ul-Rx-Rate-ll', 'Ul-Rx-Pkts-ll', 'Dl-Rx-Goodput-bps', 'Dl-Rx-Rate-ll', 'Dl-Rx-Pkts-ll' + ] # Add in columns we are going to query from the AP for col in self.ap_stats_ul_col_titles: csv_ul_rx_headers.append(col) return csv_ul_rx_headers - - def csv_generate_kpi_column_headers(self): csv_rx_headers = ['Time epoch', 'Time', 'Station-Count', 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', @@ -1721,7 +1706,6 @@ class L3VariableTime(Realm): ul_port_csv_writer.writerow(headers) pfile.flush() - def csv_validate_list(self, csv_list, length): if len(csv_list) < length: csv_list = csv_list + [('no data', 'no data')] * (length - len(csv_list)) @@ -1734,6 +1718,7 @@ class L3VariableTime(Realm): # End of the main class. + # Check some input values. @@ -1870,7 +1855,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m parser.add_argument('--tty', help='--tty \"/dev/ttyUSB2\" the serial interface to the AP', default="") parser.add_argument('--baud', help='--baud \"9600\" AP baud rate for the serial interface', default="9600") - parser.add_argument('--mgr','--lfmgr', dest='lfmgr', help='--lfmgr ', default='localhost') + parser.add_argument('--mgr', '--lfmgr', dest='lfmgr', help='--lfmgr ', default='localhost') parser.add_argument( '--test_duration', help='--test_duration example --time 5d (5 days) default: 3m options: number followed by d, h, m or s', @@ -1942,7 +1927,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m args = parser.parse_args() - #print("args: {}".format(args)) + # print("args: {}".format(args)) debug = args.debug # for kpi.csv generation @@ -1952,7 +1937,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m dut_hw_version = args.dut_hw_version dut_sw_version = args.dut_sw_version dut_model_num = args.dut_model_num - test_priority = args.test_priority # this may need to be set per test + test_priority = args.test_priority # this may need to be set per test test_id = args.test_id if args.ap_read: @@ -2113,7 +2098,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m radio_reset_found = True for key in optional_radio_reset_keys: if key not in radio_info_dict: - #print("port reset test not enabled") + # print("port reset test not enabled") radio_reset_found = False break @@ -2137,7 +2122,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m station_lists.append(station_list) index += 1 - #print("endp-types: %s"%(endp_types)) + # print("endp-types: %s"%(endp_types)) ul_rates = args.side_a_min_bps.split(",") dl_rates = args.side_b_min_bps.split(",") @@ -2147,14 +2132,14 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m attenuators = [] else: attenuators = args.attenuators.split(",") - if (args.atten_vals == ""): + if args.atten_vals == "": atten_vals = [-1] else: atten_vals = args.atten_vals.split(",") - if (len(ul_rates) != len(dl_rates)): + if len(ul_rates) != len(dl_rates): print("ERROR: ul_rates %s and dl_rates %s arrays must be same length\n" % (len(ul_rates), len(dl_rates))) - if (len(ul_pdus) != len(dl_pdus)): + if len(ul_pdus) != len(dl_pdus): print("ERROR: ul_pdus %s and dl_pdus %s arrays must be same length\n" % (len(ul_rates), len(dl_rates))) ip_var_test = L3VariableTime( @@ -2235,7 +2220,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m report.set_table_dataframe_from_csv(csv_kpi_file) report.build_table() report.write_html_with_timestamp() - #report.write_pdf(_page_size = 'A3', _orientation='Landscape') + # report.write_pdf(_page_size = 'A3', _orientation='Landscape') report.write_pdf_with_timestamp(_page_size='A4', _orientation='Portrait') # ap scheduler results and write to a file From cbe5286f8324c7e9c3163842ca94b2e091fcd05f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 9 Nov 2021 18:54:46 -0800 Subject: [PATCH 284/731] Fix test_l3_longevity regressions and pending problems Signed-off-by: Matthew Stidham --- py-scripts/test_l3_longevity.py | 332 +++++++++++++------------------- 1 file changed, 138 insertions(+), 194 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 992c4ede..3d7e42c7 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -73,6 +73,7 @@ Realm = realm.Realm csv_to_influx = importlib.import_module("py-scripts.csv_to_influx") InfluxRequest = importlib.import_module("py-dashboard.InfluxRequest") influx_add_parser_args = InfluxRequest.influx_add_parser_args +RecordInflux = InfluxRequest.RecordInflux # This class handles running the test and generating reports. @@ -94,19 +95,19 @@ class L3VariableTime(Realm): reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list, - side_a_min_rate=[56000], - side_a_max_rate=[0], - side_b_min_rate=[56000], - side_b_max_rate=[0], - side_a_min_pdu=["MTU"], - side_a_max_pdu=[0], - side_b_min_pdu=["MTU"], - side_b_max_pdu=[0], - user_tags=[], + side_a_min_rate=None, + side_a_max_rate=None, + side_b_min_rate=None, + side_b_max_rate=None, + side_a_min_pdu=None, + side_a_max_pdu=None, + side_b_min_pdu=None, + side_b_max_pdu=None, + user_tags=None, rates_are_totals=False, mconn=1, - attenuators=[], - atten_vals=[], + attenuators=None, + atten_vals=None, number_template="00", test_duration="256s", polling_interval="60s", @@ -133,7 +134,34 @@ class L3VariableTime(Realm): _exit_on_error=False, _exit_on_fail=False, _proxy_str=None, - _capture_signal_list=[]): + _capture_signal_list=None): + self.eth_endps = [] + self.total_stas = 0 + if side_a_min_rate is None: + side_a_min_rate = [56000] + if side_a_max_rate is None: + side_a_max_rate = [0] + if side_b_min_rate is None: + side_b_min_rate = [56000] + if side_b_max_rate is None: + side_b_max_rate = [0] + if side_a_min_pdu is None: + side_a_min_pdu = ["MTU"] + if side_a_max_pdu is None: + side_a_max_pdu = [0] + if side_b_min_pdu is None: + side_b_min_pdu = ["MTU"] + if side_b_max_pdu is None: + side_b_max_pdu = [0] + if user_tags is None: + user_tags = [] + if attenuators is None: + attenuators = [] + if atten_vals is None: + atten_vals = [] + if _capture_signal_list is None: + _capture_signal_list = [] + super().__init__(lfclient_host=lfclient_host, lfclient_port=lfclient_port, debug_=debug, @@ -259,7 +287,7 @@ class L3VariableTime(Realm): # if it is a dataplane test the side_a is not None and an ethernet port # if side_a is None then side_a is radios - if self.dataplane == False: + if not self.dataplane: for (radio_, ssid_, ssid_password_, ssid_security_, reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, @@ -287,6 +315,10 @@ class L3VariableTime(Realm): self.cx_profile.port = self.lfclient_port self.cx_profile.name_prefix = self.name_prefix + self.lf_endps = None + self.udp_endps = None + self.tcp_endps = None + def get_ap_6g_umsched(self): return self.ap_6g_umsched @@ -404,13 +436,13 @@ class L3VariableTime(Realm): 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(): + for item, endp_value in endp_name.items(): if item in our_endps: - endps.append(value) + endps.append(endp_value) print("endpoint: ", item, " value:\n") - pprint(value) + pprint(endp_value) - for value_name, value in value.items(): + for value_name, value in endp_value.items(): if value_name == 'rx bytes': endp_rx_map[item] = value if value_name == 'rx rate': @@ -479,7 +511,6 @@ class L3VariableTime(Realm): def pre_cleanup(self): self.cx_profile.cleanup_prefix() self.multicast_profile.cleanup_prefix() - self.total_stas = 0 for station_list in self.station_lists: for sta in station_list: self.rm_port(sta, check_exists=True) @@ -514,7 +545,6 @@ class L3VariableTime(Realm): self.station_count = 0 self.udp_endps = [] self.tcp_endps = [] - self.eth_endps = [] if rebuild: # if we are just re-applying new cx values, then no need to rebuild @@ -569,7 +599,7 @@ class L3VariableTime(Realm): self.cx_count = self.cx_profile.get_cx_count() - if self.dataplane == True: + if self.dataplane is True: self._pass("PASS: CX build finished: created/updated: %s connections." % self.cx_count) else: self._pass("PASS: Stations & CX build finished: created/updated: %s stations and %s connections." % (self.station_count, self.cx_count)) @@ -744,7 +774,8 @@ class L3VariableTime(Realm): # provide fake bs_data for testing without AP wl2 is the 6E interface, wl1 5G, wl0 2G - def read_ap_rx_report_test_mode(self): + @staticmethod + def read_ap_rx_report_test_mode(): ap_rx_report_fake = "{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 rx_report\n", "Station Address (rssi) tid ampdu mpdu Data Mbps PHY Mbps bw mcs Nss oow holes dup rtries ofdma tones air\n", "50:E0:85:87:5B:F4 (-43dBm) 0 2062 127078 32.5 571.9 80 11.0 2 0 0 64 0% 100% 483.3 6%\n", @@ -753,7 +784,8 @@ class L3VariableTime(Realm): # Keep commented for testing "(overall) - 6692 413914 105.8 - - - - - - - - - - - -\n" return ap_rx_report_fake - def read_ap_bs_data_test_mode(self): + @staticmethod + def read_ap_bs_data_test_mode(): ap_stats_fake = "{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 bs_data\n", "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", @@ -764,7 +796,8 @@ class L3VariableTime(Realm): # print("ap_stats_fake {}".format(ap_stats_fake)) return ap_stats_fake - def read_ap_chanim_stats_test_mode(self): + @staticmethod + def read_ap_chanim_stats_test_mode(): # Create the test data as a continuous string ap_chanim_stats_fake = "{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 chanim_stats\n", "version: 3\n", @@ -775,7 +808,7 @@ class L3VariableTime(Realm): return ap_chanim_stats_fake # Run the main body of the test logic. - def start(self, print_pass=False, print_fail=False): + def start(self, print_pass=False): print("Bringing up stations") self.admin_up(self.side_b) for station_profile in self.station_profiles: @@ -877,7 +910,7 @@ class L3VariableTime(Realm): cur_time = datetime.datetime.now() print("Getting initial values.") - old_rx_values, rx_drop_percent, endps, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps = self.__get_rx_values() + self.__get_rx_values() end_time = self.parse_time(self.test_duration) + cur_time @@ -890,23 +923,11 @@ class L3VariableTime(Realm): total_ul_bps = 0 total_dl_ll_bps = 0 total_ul_ll_bps = 0 - endps = [] ap_row = [] - mac_found_ul_6g = False - mac_found_ul_5g = False - mac_found_ul_2g = False mac_found_6g = False mac_found_5g = False mac_found_2g = False reset_timer = 0 - latency = 0 - jitter = 0 - total_ul_rate = 0 - total_ul_rate_ll = 0 - total_ul_pkts_ll = 0 - total_dl_rate = 0 - total_dl_rate_ll = 0 - total_dl_pkts_ll = 0 while cur_time < end_time: # interval_time = cur_time + datetime.timedelta(seconds=5) @@ -998,12 +1019,12 @@ class L3VariableTime(Realm): except BaseException: print("6g 'No stations are currently associated.'? from AP") print(" since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_6g == True: + if mac_found_6g is True: mac_found_6g = False print("6g selected ap_row (from split_row): {}".format(ap_row)) # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( + self.get_endp_stats_for_port( p["port"], endps) # now report the ap_chanim_stats along side of the ap_stats_6g @@ -1016,14 +1037,13 @@ class L3VariableTime(Realm): try: xtop = split_row[7] print("6g xtop {xtop}".format(xtop=xtop)) + try: + channel_utilization = float(100) - float(xtop) + print("6g channel_utilization {utilization}".format(utilization=channel_utilization)) + except BaseException: + print("6g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") except BaseException: print("6g detected chanspec with reading chanim_stats, exception reading xtop") - - try: - channel_utilization = float(100) - float(xtop) - print("6g channel_utilization {utilization}".format(utilization=channel_utilization)) - except BaseException: - print("6g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") # should be only one channel utilization break else: @@ -1061,30 +1081,17 @@ class L3VariableTime(Realm): if self.ap_test_mode: if split_ul_row[0].lower() != mac.lower(): ap_ul_row = split_ul_row - mac_found_ul_6g = True - else: - try: - # split_ul_row[0].lower() , mac from AP - # mac.lower() , mac from LANforge - if split_ul_row[0].lower() == mac.lower(): - ap_ul_row = split_ul_row - mac_found_ul_6g = True - except BaseException: - print("6g ul 'No stations are currently associated.'? from AP") - print(" ul since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_ul_6g == True: - mac_found_ul_6g = False - print("6g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) + print("6g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) - # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) + # Find latency, jitter for connections using this port. + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( + p["port"], endps) - print("6g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) + print("6g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) - self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) ##### # 5G test mode if self.ap_test_mode: @@ -1148,7 +1155,7 @@ class L3VariableTime(Realm): except BaseException: print("5g 'No stations are currently associated.'? from AP") print("5g since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_5g == True: + if mac_found_5g is True: mac_found_5g = False print("5g selected ap_row (from split_row): {}".format(ap_row)) @@ -1166,14 +1173,14 @@ class L3VariableTime(Realm): try: xtop = split_row[7] print("5g xtop {xtop}".format(xtop=xtop)) + try: + channel_utilization = float(100) - float(xtop) + print("5g channel_utilization {utilization}".format(utilization=channel_utilization)) + except BaseException: + print("5g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") except BaseException: print("5g detected chanspec with reading chanim_stats, exception reading xtop") - try: - channel_utilization = float(100) - float(xtop) - print("5g channel_utilization {utilization}".format(utilization=channel_utilization)) - except BaseException: - print("5g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") # should be only one channel utilization break else: @@ -1214,32 +1221,27 @@ class L3VariableTime(Realm): split_ul_row = row.split() # print("split_row {}".format(split_row)) # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) - if self.ap_test_mode: - if split_ul_row[0].lower() != mac.lower(): - ap_ul_row = split_ul_row - mac_found_ul_5g = True - else: + if not self.ap_test_mode: try: # split_ul_row[0].lower() , mac from AP # mac.lower() , mac from LANforge if split_ul_row[0].lower() == mac.lower(): ap_ul_row = split_ul_row mac_found_ul_5g = True + if mac_found_ul_5g is True: + print("5g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) + + # Find latency, jitter for connections using this port. + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( + p["port"], endps) + + print("5g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) + self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) except BaseException: print("5g ul 'No stations are currently associated.'? from AP") print("5g ul since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_ul_5g == True: - mac_found_ul_5g = False - print("5g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) - - # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) - - print("5g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) - self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) # 2g test mode if self.ap_test_mode: @@ -1302,7 +1304,7 @@ class L3VariableTime(Realm): except BaseException: print("2g 'No stations are currently associated.'? from AP") print("2g since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_2g == True: + if mac_found_2g is True: mac_found_2g = False print("2g selected ap_row (from split_row): {}".format(ap_row)) @@ -1320,16 +1322,16 @@ class L3VariableTime(Realm): try: xtop = split_row[7] print("2g xtop {xtop}".format(xtop=xtop)) + try: + channel_utilization = float(100) - float(xtop) + print("2g channel_utilization {utilization}".format(utilization=channel_utilization)) + except BaseException: + print("2g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") + # should be only one channel utilization + break except BaseException: print("2g detected chanspec with reading chanim_stats, exception reading xtop") - try: - channel_utilization = float(100) - float(xtop) - print("2g channel_utilization {utilization}".format(utilization=channel_utilization)) - except BaseException: - print("2g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") - # should be only one channel utilization - break else: try: if split_row[0].lower() == 'chanspec': @@ -1367,32 +1369,28 @@ class L3VariableTime(Realm): split_ul_row = row.split() # print("split_row {}".format(split_row)) # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) - if self.ap_test_mode: - if split_ul_row[0].lower() != mac.lower(): - ap_ul_row = split_ul_row - mac_found_ul_2g = True - else: + if not self.ap_test_mode: try: # split_ul_row[0].lower() , mac from AP # mac.lower() , mac from LANforge if split_ul_row[0].lower() == mac.lower(): ap_ul_row = split_ul_row mac_found_ul_2g = True + if mac_found_ul_2g is True: + print("2g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) + + # Find latency, jitter for connections using this port. + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( + p["port"], endps) + + print("2g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) + self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) except BaseException: print("2g ul 'No stations are currently associated.'? from AP") print("2g ul since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_ul_2g == True: - mac_found_ul_2g = False - print("2g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) - # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) - - print("2g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) - self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) else: # Query all of our ports @@ -1471,8 +1469,6 @@ class L3VariableTime(Realm): self.cx_profile.stop_cx() self.multicast_profile.stop_mc() - cur_time = datetime.datetime.now() - if passes == expected_passes: self._pass("PASS: Requested-Rate: %s <-> %s PDU: %s <-> %s All tests passed" % (ul, dl, ul_pdu, dl_pdu), print_pass) @@ -1633,7 +1629,8 @@ class L3VariableTime(Realm): for station_profile in self.station_profiles: station_profile.cleanup() - def csv_generate_column_headers(self): + @staticmethod + def csv_generate_column_headers(): csv_rx_headers = ['Time epoch', 'Time', 'Monitor', 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', "average_rx_data_bytes"] return csv_rx_headers @@ -1706,12 +1703,14 @@ class L3VariableTime(Realm): ul_port_csv_writer.writerow(headers) pfile.flush() - def csv_validate_list(self, csv_list, length): + @staticmethod + def csv_validate_list(csv_list, length): if len(csv_list) < length: csv_list = csv_list + [('no data', 'no data')] * (length - len(csv_list)) return csv_list - def csv_add_row(self, row, writer, csv_file): + @staticmethod + def csv_add_row(row, writer, csv_file): if csv_file is not None: writer.writerow(row) csv_file.flush() @@ -1737,7 +1736,6 @@ def main(): lfjson_host = "localhost" lfjson_port = 8080 endp_types = "lf_udp" - debug = False parser = argparse.ArgumentParser( prog='test_l3_longevity.py', @@ -1865,7 +1863,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m 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('--downstream_port', help='--downstream_port example: --downstream_port eth2') + parser.add_argument('--downstream_port', help='--downstream_port example: --downstream_port eth2', default=None) parser.add_argument('--polling_interval', help="--polling_interval ", default='60s') parser.add_argument('-r', '--radio', action='append', nargs=1, help='--radio\ @@ -1937,7 +1935,6 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m dut_hw_version = args.dut_hw_version dut_sw_version = args.dut_sw_version dut_model_num = args.dut_model_num - test_priority = args.test_priority # this may need to be set per test test_id = args.test_id if args.ap_read: @@ -1955,64 +1952,12 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m else: ap_ofdma_stats = False - if args.ap_test_mode: - ap_test_mode = args.ap_test_mode - else: - ap_test_mode = False - - if args.ap_port: - ap_port = args.ap_port - - if args.ap_baud: - ap_baud = args.ap_baud - - if args.ap_cmd_6g: - ap_cmd_6g = args.ap_cmd_6g - - if args.ap_cmd_5g: - ap_cmd_5g = args.ap_cmd_5g - - if args.ap_cmd_2g: - ap_cmd_2g = args.ap_cmd_2g - - if args.ap_cmd_ul_6g: - ap_cmd_ul_6g = args.ap_cmd_ul_6g - - if args.ap_cmd_ul_5g: - ap_cmd_ul_5g = args.ap_cmd_ul_5g - - if args.ap_cmd_ul_2g: - ap_cmd_ul_2g = args.ap_cmd_ul_2g - - if args.ap_chanim_cmd_6g: - ap_chanim_cmd_6g = args.ap_chanim_cmd_6g - - if args.ap_chanim_cmd_5g: - ap_chanim_cmd_5g = args.ap_chanim_cmd_5g - - if args.ap_chanim_cmd_2g: - ap_chanim_cmd_2g = args.ap_chanim_cmd_2g - - if args.test_duration: - test_duration = args.test_duration - - if args.polling_interval: - polling_interval = args.polling_interval - if args.endp_type: endp_types = args.endp_type if args.lfmgr: lfjson_host = args.lfmgr - if args.upstream_port: - side_b = args.upstream_port - - if args.downstream_port: - side_a = args.downstream_port - else: - side_a = None - if args.radio: radios = args.radio else: @@ -2052,7 +1997,6 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m influxdb = None if args.influx_bucket is not None: - from InfluxRequest import RecordInflux influxdb = RecordInflux(_influx_host=args.influx_host, _influx_port=args.influx_port, _influx_org=args.influx_org, @@ -2146,8 +2090,8 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m endp_types=endp_types, args=args, tos=args.tos, - side_b=side_b, - side_a=side_a, + side_b=args.upstream_port, + side_a=args.downstream_port, radio_name_list=radio_name_list, number_of_stations_per_radio_list=number_of_stations_per_radio_list, ssid_list=ssid_list, @@ -2169,8 +2113,8 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m attenuators=attenuators, atten_vals=atten_vals, number_template="00", - test_duration=test_duration, - polling_interval=polling_interval, + test_duration=args.test_duration, + polling_interval=args.polling_interval, lfclient_host=lfjson_host, lfclient_port=lfjson_port, debug=debug, @@ -2179,18 +2123,18 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m ap_scheduler_stats=ap_scheduler_stats, ap_ofdma_stats=ap_ofdma_stats, ap_read=ap_read, - ap_port=ap_port, - ap_baud=ap_baud, - ap_cmd_6g=ap_cmd_6g, - ap_cmd_5g=ap_cmd_5g, - ap_cmd_2g=ap_cmd_2g, - ap_cmd_ul_6g=ap_cmd_ul_6g, - ap_cmd_ul_5g=ap_cmd_ul_5g, - ap_cmd_ul_2g=ap_cmd_ul_2g, - ap_chanim_cmd_6g=ap_chanim_cmd_6g, - ap_chanim_cmd_5g=ap_chanim_cmd_5g, - ap_chanim_cmd_2g=ap_chanim_cmd_2g, - ap_test_mode=ap_test_mode) + ap_port=args.ap_port, + ap_baud=args.ap_baud, + ap_cmd_6g=args.ap_cmd_6g, + ap_cmd_5g=args.ap_cmd_5g, + ap_cmd_2g=args.ap_cmd_2g, + ap_cmd_ul_6g=args.ap_cmd_ul_6g, + ap_cmd_ul_5g=args.ap_cmd_ul_5g, + ap_cmd_ul_2g=args.ap_cmd_ul_2g, + ap_chanim_cmd_6g=args.ap_chanim_cmd_6g, + ap_chanim_cmd_5g=args.ap_chanim_cmd_5g, + ap_chanim_cmd_2g=args.ap_chanim_cmd_2g, + ap_test_mode=args.ap_test_mode) ip_var_test.pre_cleanup() @@ -2199,7 +2143,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m print("build step failed.") print(ip_var_test.get_fail_message()) exit(1) - ip_var_test.start(False, False) + ip_var_test.start(False) ip_var_test.stop() if not ip_var_test.passes(): print("Test Ended: There were Failures") @@ -2275,21 +2219,21 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m print("getting ofdma ap data and writing to a file") file_date = report.get_date() - ap_ofdma_6g_data = ip_var_test.get_ap_ofdma_6g() + ip_var_test.get_ap_ofdma_6g() ap_ofdma_6g = "{}-{}".format(file_date, "ap_ofdma_6g_data.txt") ap_ofdma_6g = report.file_add_path(ap_ofdma_6g) ap_ofdma_6g_data = open(ap_ofdma_6g, "w") ap_ofdma_6g_data.write(str(ap_ofdma_6g_data)) ap_ofdma_6g_data.close() - ap_ofdma_5g_data = ip_var_test.get_ap_ofdma_5g() + ip_var_test.get_ap_ofdma_5g() ap_ofdma_5g = "{}-{}".format(file_date, "ap_ofdma_5g_data.txt") ap_ofdma_5g = report.file_add_path(ap_ofdma_5g) ap_ofdma_5g_data = open(ap_ofdma_5g, "w") ap_ofdma_5g_data.write(str(ap_ofdma_5g_data)) ap_ofdma_5g_data.close() - ap_ofdma_24g_data = ip_var_test.get_ap_ofdma_24g() + ip_var_test.get_ap_ofdma_24g() ap_ofdma_24g = "{}-{}".format(file_date, "ap_ofdma_24g_data.txt") ap_ofdma_24g = report.file_add_path(ap_ofdma_24g) ap_ofdma_24g_data = open(ap_ofdma_24g, "w") From 098c0398ba01bcc45c31b587a03621de03fb82b0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 9 Nov 2021 19:00:28 -0800 Subject: [PATCH 285/731] Revert "Fix test_l3_longevity regressions and pending problems" This reverts commit cbe5286f8324c7e9c3163842ca94b2e091fcd05f. --- py-scripts/test_l3_longevity.py | 332 +++++++++++++++++++------------- 1 file changed, 194 insertions(+), 138 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 3d7e42c7..992c4ede 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -73,7 +73,6 @@ Realm = realm.Realm csv_to_influx = importlib.import_module("py-scripts.csv_to_influx") InfluxRequest = importlib.import_module("py-dashboard.InfluxRequest") influx_add_parser_args = InfluxRequest.influx_add_parser_args -RecordInflux = InfluxRequest.RecordInflux # This class handles running the test and generating reports. @@ -95,19 +94,19 @@ class L3VariableTime(Realm): reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list, - side_a_min_rate=None, - side_a_max_rate=None, - side_b_min_rate=None, - side_b_max_rate=None, - side_a_min_pdu=None, - side_a_max_pdu=None, - side_b_min_pdu=None, - side_b_max_pdu=None, - user_tags=None, + side_a_min_rate=[56000], + side_a_max_rate=[0], + side_b_min_rate=[56000], + side_b_max_rate=[0], + side_a_min_pdu=["MTU"], + side_a_max_pdu=[0], + side_b_min_pdu=["MTU"], + side_b_max_pdu=[0], + user_tags=[], rates_are_totals=False, mconn=1, - attenuators=None, - atten_vals=None, + attenuators=[], + atten_vals=[], number_template="00", test_duration="256s", polling_interval="60s", @@ -134,34 +133,7 @@ class L3VariableTime(Realm): _exit_on_error=False, _exit_on_fail=False, _proxy_str=None, - _capture_signal_list=None): - self.eth_endps = [] - self.total_stas = 0 - if side_a_min_rate is None: - side_a_min_rate = [56000] - if side_a_max_rate is None: - side_a_max_rate = [0] - if side_b_min_rate is None: - side_b_min_rate = [56000] - if side_b_max_rate is None: - side_b_max_rate = [0] - if side_a_min_pdu is None: - side_a_min_pdu = ["MTU"] - if side_a_max_pdu is None: - side_a_max_pdu = [0] - if side_b_min_pdu is None: - side_b_min_pdu = ["MTU"] - if side_b_max_pdu is None: - side_b_max_pdu = [0] - if user_tags is None: - user_tags = [] - if attenuators is None: - attenuators = [] - if atten_vals is None: - atten_vals = [] - if _capture_signal_list is None: - _capture_signal_list = [] - + _capture_signal_list=[]): super().__init__(lfclient_host=lfclient_host, lfclient_port=lfclient_port, debug_=debug, @@ -287,7 +259,7 @@ class L3VariableTime(Realm): # if it is a dataplane test the side_a is not None and an ethernet port # if side_a is None then side_a is radios - if not self.dataplane: + if self.dataplane == False: for (radio_, ssid_, ssid_password_, ssid_security_, reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, @@ -315,10 +287,6 @@ class L3VariableTime(Realm): self.cx_profile.port = self.lfclient_port self.cx_profile.name_prefix = self.name_prefix - self.lf_endps = None - self.udp_endps = None - self.tcp_endps = None - def get_ap_6g_umsched(self): return self.ap_6g_umsched @@ -436,13 +404,13 @@ class L3VariableTime(Realm): our_endps[e] = e for endp_name in endp_list['endpoint']: if endp_name != 'uri' and endp_name != 'handler': - for item, endp_value in endp_name.items(): + for item, value in endp_name.items(): if item in our_endps: - endps.append(endp_value) + endps.append(value) print("endpoint: ", item, " value:\n") - pprint(endp_value) + pprint(value) - for value_name, value in endp_value.items(): + for value_name, value in value.items(): if value_name == 'rx bytes': endp_rx_map[item] = value if value_name == 'rx rate': @@ -511,6 +479,7 @@ class L3VariableTime(Realm): def pre_cleanup(self): self.cx_profile.cleanup_prefix() self.multicast_profile.cleanup_prefix() + self.total_stas = 0 for station_list in self.station_lists: for sta in station_list: self.rm_port(sta, check_exists=True) @@ -545,6 +514,7 @@ class L3VariableTime(Realm): self.station_count = 0 self.udp_endps = [] self.tcp_endps = [] + self.eth_endps = [] if rebuild: # if we are just re-applying new cx values, then no need to rebuild @@ -599,7 +569,7 @@ class L3VariableTime(Realm): self.cx_count = self.cx_profile.get_cx_count() - if self.dataplane is True: + if self.dataplane == True: self._pass("PASS: CX build finished: created/updated: %s connections." % self.cx_count) else: self._pass("PASS: Stations & CX build finished: created/updated: %s stations and %s connections." % (self.station_count, self.cx_count)) @@ -774,8 +744,7 @@ class L3VariableTime(Realm): # provide fake bs_data for testing without AP wl2 is the 6E interface, wl1 5G, wl0 2G - @staticmethod - def read_ap_rx_report_test_mode(): + def read_ap_rx_report_test_mode(self): ap_rx_report_fake = "{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 rx_report\n", "Station Address (rssi) tid ampdu mpdu Data Mbps PHY Mbps bw mcs Nss oow holes dup rtries ofdma tones air\n", "50:E0:85:87:5B:F4 (-43dBm) 0 2062 127078 32.5 571.9 80 11.0 2 0 0 64 0% 100% 483.3 6%\n", @@ -784,8 +753,7 @@ class L3VariableTime(Realm): # Keep commented for testing "(overall) - 6692 413914 105.8 - - - - - - - - - - - -\n" return ap_rx_report_fake - @staticmethod - def read_ap_bs_data_test_mode(): + def read_ap_bs_data_test_mode(self): ap_stats_fake = "{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 bs_data\n", "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", @@ -796,8 +764,7 @@ class L3VariableTime(Realm): # print("ap_stats_fake {}".format(ap_stats_fake)) return ap_stats_fake - @staticmethod - def read_ap_chanim_stats_test_mode(): + def read_ap_chanim_stats_test_mode(self): # Create the test data as a continuous string ap_chanim_stats_fake = "{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 chanim_stats\n", "version: 3\n", @@ -808,7 +775,7 @@ class L3VariableTime(Realm): return ap_chanim_stats_fake # Run the main body of the test logic. - def start(self, print_pass=False): + def start(self, print_pass=False, print_fail=False): print("Bringing up stations") self.admin_up(self.side_b) for station_profile in self.station_profiles: @@ -910,7 +877,7 @@ class L3VariableTime(Realm): cur_time = datetime.datetime.now() print("Getting initial values.") - self.__get_rx_values() + old_rx_values, rx_drop_percent, endps, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps = self.__get_rx_values() end_time = self.parse_time(self.test_duration) + cur_time @@ -923,11 +890,23 @@ class L3VariableTime(Realm): total_ul_bps = 0 total_dl_ll_bps = 0 total_ul_ll_bps = 0 + endps = [] ap_row = [] + mac_found_ul_6g = False + mac_found_ul_5g = False + mac_found_ul_2g = False mac_found_6g = False mac_found_5g = False mac_found_2g = False reset_timer = 0 + latency = 0 + jitter = 0 + total_ul_rate = 0 + total_ul_rate_ll = 0 + total_ul_pkts_ll = 0 + total_dl_rate = 0 + total_dl_rate_ll = 0 + total_dl_pkts_ll = 0 while cur_time < end_time: # interval_time = cur_time + datetime.timedelta(seconds=5) @@ -1019,12 +998,12 @@ class L3VariableTime(Realm): except BaseException: print("6g 'No stations are currently associated.'? from AP") print(" since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_6g is True: + if mac_found_6g == True: mac_found_6g = False print("6g selected ap_row (from split_row): {}".format(ap_row)) # Find latency, jitter for connections using this port. - self.get_endp_stats_for_port( + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( p["port"], endps) # now report the ap_chanim_stats along side of the ap_stats_6g @@ -1037,13 +1016,14 @@ class L3VariableTime(Realm): try: xtop = split_row[7] print("6g xtop {xtop}".format(xtop=xtop)) - try: - channel_utilization = float(100) - float(xtop) - print("6g channel_utilization {utilization}".format(utilization=channel_utilization)) - except BaseException: - print("6g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") except BaseException: print("6g detected chanspec with reading chanim_stats, exception reading xtop") + + try: + channel_utilization = float(100) - float(xtop) + print("6g channel_utilization {utilization}".format(utilization=channel_utilization)) + except BaseException: + print("6g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") # should be only one channel utilization break else: @@ -1081,17 +1061,30 @@ class L3VariableTime(Realm): if self.ap_test_mode: if split_ul_row[0].lower() != mac.lower(): ap_ul_row = split_ul_row - print("6g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) + mac_found_ul_6g = True + else: + try: + # split_ul_row[0].lower() , mac from AP + # mac.lower() , mac from LANforge + if split_ul_row[0].lower() == mac.lower(): + ap_ul_row = split_ul_row + mac_found_ul_6g = True + except BaseException: + print("6g ul 'No stations are currently associated.'? from AP") + print(" ul since possibly no stations: excption on compare split_row[0].lower() ") + if mac_found_ul_6g == True: + mac_found_ul_6g = False + print("6g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) - # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) + # Find latency, jitter for connections using this port. + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( + p["port"], endps) - print("6g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) + print("6g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) - self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) ##### # 5G test mode if self.ap_test_mode: @@ -1155,7 +1148,7 @@ class L3VariableTime(Realm): except BaseException: print("5g 'No stations are currently associated.'? from AP") print("5g since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_5g is True: + if mac_found_5g == True: mac_found_5g = False print("5g selected ap_row (from split_row): {}".format(ap_row)) @@ -1173,14 +1166,14 @@ class L3VariableTime(Realm): try: xtop = split_row[7] print("5g xtop {xtop}".format(xtop=xtop)) - try: - channel_utilization = float(100) - float(xtop) - print("5g channel_utilization {utilization}".format(utilization=channel_utilization)) - except BaseException: - print("5g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") except BaseException: print("5g detected chanspec with reading chanim_stats, exception reading xtop") + try: + channel_utilization = float(100) - float(xtop) + print("5g channel_utilization {utilization}".format(utilization=channel_utilization)) + except BaseException: + print("5g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") # should be only one channel utilization break else: @@ -1221,27 +1214,32 @@ class L3VariableTime(Realm): split_ul_row = row.split() # print("split_row {}".format(split_row)) # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) - if not self.ap_test_mode: + if self.ap_test_mode: + if split_ul_row[0].lower() != mac.lower(): + ap_ul_row = split_ul_row + mac_found_ul_5g = True + else: try: # split_ul_row[0].lower() , mac from AP # mac.lower() , mac from LANforge if split_ul_row[0].lower() == mac.lower(): ap_ul_row = split_ul_row mac_found_ul_5g = True - if mac_found_ul_5g is True: - print("5g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) - - # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) - - print("5g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) - self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) except BaseException: print("5g ul 'No stations are currently associated.'? from AP") print("5g ul since possibly no stations: excption on compare split_row[0].lower() ") + if mac_found_ul_5g == True: + mac_found_ul_5g = False + print("5g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) + + # Find latency, jitter for connections using this port. + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( + p["port"], endps) + + print("5g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) + self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) # 2g test mode if self.ap_test_mode: @@ -1304,7 +1302,7 @@ class L3VariableTime(Realm): except BaseException: print("2g 'No stations are currently associated.'? from AP") print("2g since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_2g is True: + if mac_found_2g == True: mac_found_2g = False print("2g selected ap_row (from split_row): {}".format(ap_row)) @@ -1322,16 +1320,16 @@ class L3VariableTime(Realm): try: xtop = split_row[7] print("2g xtop {xtop}".format(xtop=xtop)) - try: - channel_utilization = float(100) - float(xtop) - print("2g channel_utilization {utilization}".format(utilization=channel_utilization)) - except BaseException: - print("2g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") - # should be only one channel utilization - break except BaseException: print("2g detected chanspec with reading chanim_stats, exception reading xtop") + try: + channel_utilization = float(100) - float(xtop) + print("2g channel_utilization {utilization}".format(utilization=channel_utilization)) + except BaseException: + print("2g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") + # should be only one channel utilization + break else: try: if split_row[0].lower() == 'chanspec': @@ -1369,28 +1367,32 @@ class L3VariableTime(Realm): split_ul_row = row.split() # print("split_row {}".format(split_row)) # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) - if not self.ap_test_mode: + if self.ap_test_mode: + if split_ul_row[0].lower() != mac.lower(): + ap_ul_row = split_ul_row + mac_found_ul_2g = True + else: try: # split_ul_row[0].lower() , mac from AP # mac.lower() , mac from LANforge if split_ul_row[0].lower() == mac.lower(): ap_ul_row = split_ul_row mac_found_ul_2g = True - if mac_found_ul_2g is True: - print("2g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) - - # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) - - print("2g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) - self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) except BaseException: print("2g ul 'No stations are currently associated.'? from AP") print("2g ul since possibly no stations: excption on compare split_row[0].lower() ") + if mac_found_ul_2g == True: + mac_found_ul_2g = False + print("2g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) + # Find latency, jitter for connections using this port. + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( + p["port"], endps) + + print("2g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) + self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) else: # Query all of our ports @@ -1469,6 +1471,8 @@ class L3VariableTime(Realm): self.cx_profile.stop_cx() self.multicast_profile.stop_mc() + cur_time = datetime.datetime.now() + if passes == expected_passes: self._pass("PASS: Requested-Rate: %s <-> %s PDU: %s <-> %s All tests passed" % (ul, dl, ul_pdu, dl_pdu), print_pass) @@ -1629,8 +1633,7 @@ class L3VariableTime(Realm): for station_profile in self.station_profiles: station_profile.cleanup() - @staticmethod - def csv_generate_column_headers(): + def csv_generate_column_headers(self): csv_rx_headers = ['Time epoch', 'Time', 'Monitor', 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', "average_rx_data_bytes"] return csv_rx_headers @@ -1703,14 +1706,12 @@ class L3VariableTime(Realm): ul_port_csv_writer.writerow(headers) pfile.flush() - @staticmethod - def csv_validate_list(csv_list, length): + def csv_validate_list(self, csv_list, length): if len(csv_list) < length: csv_list = csv_list + [('no data', 'no data')] * (length - len(csv_list)) return csv_list - @staticmethod - def csv_add_row(row, writer, csv_file): + def csv_add_row(self, row, writer, csv_file): if csv_file is not None: writer.writerow(row) csv_file.flush() @@ -1736,6 +1737,7 @@ def main(): lfjson_host = "localhost" lfjson_port = 8080 endp_types = "lf_udp" + debug = False parser = argparse.ArgumentParser( prog='test_l3_longevity.py', @@ -1863,7 +1865,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m 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('--downstream_port', help='--downstream_port example: --downstream_port eth2', default=None) + parser.add_argument('--downstream_port', help='--downstream_port example: --downstream_port eth2') parser.add_argument('--polling_interval', help="--polling_interval ", default='60s') parser.add_argument('-r', '--radio', action='append', nargs=1, help='--radio\ @@ -1935,6 +1937,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m dut_hw_version = args.dut_hw_version dut_sw_version = args.dut_sw_version dut_model_num = args.dut_model_num + test_priority = args.test_priority # this may need to be set per test test_id = args.test_id if args.ap_read: @@ -1952,12 +1955,64 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m else: ap_ofdma_stats = False + if args.ap_test_mode: + ap_test_mode = args.ap_test_mode + else: + ap_test_mode = False + + if args.ap_port: + ap_port = args.ap_port + + if args.ap_baud: + ap_baud = args.ap_baud + + if args.ap_cmd_6g: + ap_cmd_6g = args.ap_cmd_6g + + if args.ap_cmd_5g: + ap_cmd_5g = args.ap_cmd_5g + + if args.ap_cmd_2g: + ap_cmd_2g = args.ap_cmd_2g + + if args.ap_cmd_ul_6g: + ap_cmd_ul_6g = args.ap_cmd_ul_6g + + if args.ap_cmd_ul_5g: + ap_cmd_ul_5g = args.ap_cmd_ul_5g + + if args.ap_cmd_ul_2g: + ap_cmd_ul_2g = args.ap_cmd_ul_2g + + if args.ap_chanim_cmd_6g: + ap_chanim_cmd_6g = args.ap_chanim_cmd_6g + + if args.ap_chanim_cmd_5g: + ap_chanim_cmd_5g = args.ap_chanim_cmd_5g + + if args.ap_chanim_cmd_2g: + ap_chanim_cmd_2g = args.ap_chanim_cmd_2g + + if args.test_duration: + test_duration = args.test_duration + + if args.polling_interval: + polling_interval = args.polling_interval + if args.endp_type: endp_types = args.endp_type if args.lfmgr: lfjson_host = args.lfmgr + if args.upstream_port: + side_b = args.upstream_port + + if args.downstream_port: + side_a = args.downstream_port + else: + side_a = None + if args.radio: radios = args.radio else: @@ -1997,6 +2052,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m influxdb = None if args.influx_bucket is not None: + from InfluxRequest import RecordInflux influxdb = RecordInflux(_influx_host=args.influx_host, _influx_port=args.influx_port, _influx_org=args.influx_org, @@ -2090,8 +2146,8 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m endp_types=endp_types, args=args, tos=args.tos, - side_b=args.upstream_port, - side_a=args.downstream_port, + side_b=side_b, + side_a=side_a, radio_name_list=radio_name_list, number_of_stations_per_radio_list=number_of_stations_per_radio_list, ssid_list=ssid_list, @@ -2113,8 +2169,8 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m attenuators=attenuators, atten_vals=atten_vals, number_template="00", - test_duration=args.test_duration, - polling_interval=args.polling_interval, + test_duration=test_duration, + polling_interval=polling_interval, lfclient_host=lfjson_host, lfclient_port=lfjson_port, debug=debug, @@ -2123,18 +2179,18 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m ap_scheduler_stats=ap_scheduler_stats, ap_ofdma_stats=ap_ofdma_stats, ap_read=ap_read, - ap_port=args.ap_port, - ap_baud=args.ap_baud, - ap_cmd_6g=args.ap_cmd_6g, - ap_cmd_5g=args.ap_cmd_5g, - ap_cmd_2g=args.ap_cmd_2g, - ap_cmd_ul_6g=args.ap_cmd_ul_6g, - ap_cmd_ul_5g=args.ap_cmd_ul_5g, - ap_cmd_ul_2g=args.ap_cmd_ul_2g, - ap_chanim_cmd_6g=args.ap_chanim_cmd_6g, - ap_chanim_cmd_5g=args.ap_chanim_cmd_5g, - ap_chanim_cmd_2g=args.ap_chanim_cmd_2g, - ap_test_mode=args.ap_test_mode) + ap_port=ap_port, + ap_baud=ap_baud, + ap_cmd_6g=ap_cmd_6g, + ap_cmd_5g=ap_cmd_5g, + ap_cmd_2g=ap_cmd_2g, + ap_cmd_ul_6g=ap_cmd_ul_6g, + ap_cmd_ul_5g=ap_cmd_ul_5g, + ap_cmd_ul_2g=ap_cmd_ul_2g, + ap_chanim_cmd_6g=ap_chanim_cmd_6g, + ap_chanim_cmd_5g=ap_chanim_cmd_5g, + ap_chanim_cmd_2g=ap_chanim_cmd_2g, + ap_test_mode=ap_test_mode) ip_var_test.pre_cleanup() @@ -2143,7 +2199,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m print("build step failed.") print(ip_var_test.get_fail_message()) exit(1) - ip_var_test.start(False) + ip_var_test.start(False, False) ip_var_test.stop() if not ip_var_test.passes(): print("Test Ended: There were Failures") @@ -2219,21 +2275,21 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m print("getting ofdma ap data and writing to a file") file_date = report.get_date() - ip_var_test.get_ap_ofdma_6g() + ap_ofdma_6g_data = ip_var_test.get_ap_ofdma_6g() ap_ofdma_6g = "{}-{}".format(file_date, "ap_ofdma_6g_data.txt") ap_ofdma_6g = report.file_add_path(ap_ofdma_6g) ap_ofdma_6g_data = open(ap_ofdma_6g, "w") ap_ofdma_6g_data.write(str(ap_ofdma_6g_data)) ap_ofdma_6g_data.close() - ip_var_test.get_ap_ofdma_5g() + ap_ofdma_5g_data = ip_var_test.get_ap_ofdma_5g() ap_ofdma_5g = "{}-{}".format(file_date, "ap_ofdma_5g_data.txt") ap_ofdma_5g = report.file_add_path(ap_ofdma_5g) ap_ofdma_5g_data = open(ap_ofdma_5g, "w") ap_ofdma_5g_data.write(str(ap_ofdma_5g_data)) ap_ofdma_5g_data.close() - ip_var_test.get_ap_ofdma_24g() + ap_ofdma_24g_data = ip_var_test.get_ap_ofdma_24g() ap_ofdma_24g = "{}-{}".format(file_date, "ap_ofdma_24g_data.txt") ap_ofdma_24g = report.file_add_path(ap_ofdma_24g) ap_ofdma_24g_data = open(ap_ofdma_24g, "w") From 78fdf6551faf3be0c17e3fb8fb0c247bb1567a64 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 9 Nov 2021 19:00:45 -0800 Subject: [PATCH 286/731] Revert "Fix test_l3_longevity whitespace errors" This reverts commit d16bdd9f7a7ab6bb7db75bb48d28eba44164a57a. --- py-scripts/test_l3_longevity.py | 233 +++++++++++++++++--------------- 1 file changed, 124 insertions(+), 109 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 992c4ede..0f25c90e 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -""" +''' NAME: test_l3_longevity.py PURPOSE: @@ -44,7 +44,7 @@ COPYRIGHT: Copyright 2021 Candela Technologies Inc INCLUDE_IN_README -""" +''' import argparse import csv import datetime @@ -63,10 +63,11 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) + sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lf_report = importlib.import_module("py-scripts.lf_report") -lf_kpi_csv = importlib.import_module("py-scripts.lf_kpi_csv") +lf_kpi_csv = importlib.import_module("py-scripts.lf_kpi_csv") LFUtils = importlib.import_module("py-json.LANforge.LFUtils") realm = importlib.import_module("py-json.realm") Realm = realm.Realm @@ -164,7 +165,7 @@ class L3VariableTime(Realm): self.test_duration = test_duration self.radio_name_list = radio_name_list self.number_of_stations_per_radio_list = number_of_stations_per_radio_list - # self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=debug_on) + #self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=debug_on) self.polling_interval_seconds = self.duration_time_to_seconds(polling_interval) self.cx_profile = self.new_l3_cx_profile() self.multicast_profile = self.new_multicast_profile() @@ -194,7 +195,7 @@ class L3VariableTime(Realm): self.attenuators = attenuators self.atten_vals = atten_vals - if (len(self.atten_vals) > 0) and (self.atten_vals[0] != -1) and (len(self.attenuators) == 0): + if ((len(self.atten_vals) > 0) and (self.atten_vals[0] != -1) and (len(self.attenuators) == 0)): print("ERROR: Attenuation values configured, but no Attenuator EIDs specified.\n") exit(1) @@ -232,22 +233,24 @@ class L3VariableTime(Realm): # Lookup key is port-eid name self.port_csv_files = {} self.port_csv_writers = {} - + self.ul_port_csv_files = {} self.ul_port_csv_writers = {} + # TODO: cmd-line arg to enable/disable these stats. self.ap_stats_col_titles = ["Station Address", "Dl-PHY-Mbps", "Dl-Data-Mbps", "Dl-Air-Use", "Dl-Data-Use", - "Dl-Retries", "Dl-BW", "Dl-MCS", "Dl-NSS", "Dl-OFDMA", "Dl-MU-MIMO", + "Dl-Retries", "Dl-BW", "Dl-MCS", "Dl-NSS", "Dl-OFDMA", "Dl-MU-MIMO", "Dl-Channel-Utilization"] - self.ap_stats_ul_col_titles = ["UL Station Address", "Ul-rssi", "Ul-tid", "Ul-ampdu", "Ul-mpdu", "Ul-Data-Mbps", - "Ul-PHY-Mbps", "UL-BW", "Ul-MCS", "Ul-NSS", "Ul-OOW", "Ul-HOLES", - "Ul-DUP", "Ul-Retries", "Ul-OFDMA", "Ul-Tones", "Ul-AIR"] + self.ap_stats_ul_col_titles = ["UL Station Address", "Ul-rssi", "Ul-tid", "Ul-ampdu","Ul-mpdu", "Ul-Data-Mbps", + "Ul-PHY-Mbps", "UL-BW", "Ul-MCS", "Ul-NSS", "Ul-OOW", "Ul-HOLES", + "Ul-DUP", "Ul-Retries", "Ul-OFDMA", "Ul-Tones", "Ul-AIR"] + dur = self.duration_time_to_seconds(self.test_duration) - if self.polling_interval_seconds > dur + 1: + if (self.polling_interval_seconds > dur + 1): self.polling_interval_seconds = dur - 1 # Full spread-sheet data @@ -262,8 +265,8 @@ class L3VariableTime(Realm): if self.dataplane == False: for (radio_, ssid_, ssid_password_, ssid_security_, reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ - in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, - reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): + in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, + reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): self.station_profile = self.new_station_profile() self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = ssid_ @@ -315,7 +318,7 @@ class L3VariableTime(Realm): return self.ap_ofdma_24g def get_kpi_csv(self): - # print("self.csv_kpi_file {}".format(self.csv_kpi_file.name)) + #print("self.csv_kpi_file {}".format(self.csv_kpi_file.name)) return self.csv_kpi_file.name # Find avg latency, jitter for connections using specified port. @@ -331,7 +334,7 @@ class L3VariableTime(Realm): count = 0 sta_name = 'no_station' - # print("endp-stats-for-port, port-eid: {}".format(eid_name)) + #print("endp-stats-for-port, port-eid: {}".format(eid_name)) eid = self.name_to_eid(eid_name) print("eid_name: {eid_name} eid: {eid}".format(eid_name=eid_name, eid=eid)) @@ -423,7 +426,7 @@ class L3VariableTime(Realm): endp_rx_drop_map[item] = value if value_name == 'rx rate': # This hack breaks for mcast or if someone names endpoints weirdly. - # print("item: ", item, " rx-bps: ", value_rx_bps) + #print("item: ", item, " rx-bps: ", value_rx_bps) if item.endswith("-A"): total_dl += int(value) else: @@ -435,10 +438,9 @@ class L3VariableTime(Realm): else: total_ul_ll += int(value) - # print("total-dl: ", total_dl, " total-ul: ", total_ul, "\n") + #print("total-dl: ", total_dl, " total-ul: ", total_ul, "\n") return endp_rx_map, endp_rx_drop_map, endps, total_dl, total_ul, total_dl_ll, total_ul_ll - - # This script supports resetting ports, allowing one to test AP/controller under data load + # This script supports resetting ports, allowing one to test AP/controller under data load # while bouncing wifi stations. Check here to see if we should reset ports. def reset_port_check(self): @@ -462,7 +464,7 @@ class L3VariableTime(Realm): "radio: {} countdown seconds_till_reset {}".format( station_profile.add_sta_data['radio'], station_profile.reset_port_extra_data['seconds_till_reset'])) - if station_profile.reset_port_extra_data['seconds_till_reset'] <= 0: + if ((station_profile.reset_port_extra_data['seconds_till_reset'] <= 0)): station_profile.reset_port_extra_data['reset_port_timer_started'] = False port_to_reset = random.randint(0, len(station_profile.station_names) - 1) print( @@ -487,12 +489,12 @@ class L3VariableTime(Realm): # Make sure they are gone count = 0 - while count < 10: + while (count < 10): more = False for station_list in self.station_lists: for sta in station_list: rv = self.rm_port(sta, check_exists=True) - if rv: + if (rv): more = True if not more: break @@ -521,7 +523,7 @@ class L3VariableTime(Realm): # stations, so allow skipping it. # Do clean cx lists so that when we re-apply them we get same endp name # as we had previously - # print("rebuild: Clearing cx profile lists.\n") + #print("rebuild: Clearing cx profile lists.\n") self.cx_profile.clean_cx_lists() self.multicast_profile.clean_mc_lists() @@ -532,9 +534,9 @@ class L3VariableTime(Realm): # use brackes on [self.side_a] to make it a list these_cx, these_endp = self.cx_profile.create(endp_type=etype, side_a=[self.side_a], side_b=self.side_b, sleep_time=0, tos=_tos) - if etype == "lf_udp" or etype == "lf_udp6": + if (etype == "lf_udp" or etype == "lf_udp6"): self.udp_endps = self.udp_endps + these_endp - elif etype == "lf": + elif(etype == "lf"): self.lf_endps = self.eth_endps + these_endp else: self.tcp_endps = self.tcp_endps + these_endp @@ -554,7 +556,7 @@ class L3VariableTime(Realm): # Build/update connection types for etype in self.endp_types: if etype == "mc_udp" or etype == "mc_udp6": - print("Creating Multicast connections for endpoint type: %s" % etype) + print("Creating Multicast connections for endpoint type: %s" % (etype)) self.multicast_profile.create_mc_tx(etype, self.side_b, etype) self.multicast_profile.create_mc_rx(etype, side_rx=station_profile.station_names) else: @@ -562,7 +564,7 @@ class L3VariableTime(Realm): print("Creating connections for endpoint type: %s TOS: %s cx-count: %s" % (etype, _tos, self.cx_profile.get_cx_count())) these_cx, these_endp = self.cx_profile.create(endp_type=etype, side_a=station_profile.station_names, side_b=self.side_b, sleep_time=0, tos=_tos) - if etype == "lf_udp" or etype == "lf_udp6": + if (etype == "lf_udp" or etype == "lf_udp6"): self.udp_endps = self.udp_endps + these_endp else: self.tcp_endps = self.tcp_endps + these_endp @@ -570,7 +572,7 @@ class L3VariableTime(Realm): self.cx_count = self.cx_profile.get_cx_count() if self.dataplane == True: - self._pass("PASS: CX build finished: created/updated: %s connections." % self.cx_count) + self._pass("PASS: CX build finished: created/updated: %s connections." % (self.cx_count)) else: self._pass("PASS: Stations & CX build finished: created/updated: %s stations and %s connections." % (self.station_count, self.cx_count)) @@ -742,15 +744,16 @@ class L3VariableTime(Realm): return ap_stats_ul_2g + # provide fake bs_data for testing without AP wl2 is the 6E interface, wl1 5G, wl0 2G def read_ap_rx_report_test_mode(self): ap_rx_report_fake = "{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 rx_report\n", - "Station Address (rssi) tid ampdu mpdu Data Mbps PHY Mbps bw mcs Nss oow holes dup rtries ofdma tones air\n", - "50:E0:85:87:5B:F4 (-43dBm) 0 2062 127078 32.5 571.9 80 11.0 2 0 0 64 0% 100% 483.3 6%\n", - "50:E0:85:84:7A:E7 (-44dBm) 0 2334 144373 36.9 343.1 80 10.9 2 0 0 63 0% 100% 291.4 11%\n", - "50:E0:85:88:F4:5F (-45dBm) 0 2296 142463 36.4 346.3 80 10.9 2 0 0 64 0% 100% 294.1 11%\n") - # Keep commented for testing "(overall) - 6692 413914 105.8 - - - - - - - - - - - -\n" + "Station Address (rssi) tid ampdu mpdu Data Mbps PHY Mbps bw mcs Nss oow holes dup rtries ofdma tones air\n", + "50:E0:85:87:5B:F4 (-43dBm) 0 2062 127078 32.5 571.9 80 11.0 2 0 0 64 0% 100% 483.3 6%\n", + "50:E0:85:84:7A:E7 (-44dBm) 0 2334 144373 36.9 343.1 80 10.9 2 0 0 63 0% 100% 291.4 11%\n", + "50:E0:85:88:F4:5F (-45dBm) 0 2296 142463 36.4 346.3 80 10.9 2 0 0 64 0% 100% 294.1 11%\n") + #Keep commented for testing "(overall) - 6692 413914 105.8 - - - - - - - - - - - -\n" return ap_rx_report_fake def read_ap_bs_data_test_mode(self): @@ -760,17 +763,17 @@ class L3VariableTime(Realm): "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n") - # Keep commented for testing "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") + #Keep commented for testing "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") # print("ap_stats_fake {}".format(ap_stats_fake)) return ap_stats_fake def read_ap_chanim_stats_test_mode(self): # Create the test data as a continuous string ap_chanim_stats_fake = "{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 chanim_stats\n", - "version: 3\n", - "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", - # `"0xe06a 61 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") - '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') + "version: 3\n", + "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", + # `"0xe06a 61 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") + '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') # "0xe06a 1.67 15.00 0.00 17.00 0.00 0.00 97.33 53.00 2.00 0 0 -91 65 343370578\n") return ap_chanim_stats_fake @@ -780,17 +783,17 @@ class L3VariableTime(Realm): self.admin_up(self.side_b) for station_profile in self.station_profiles: for sta in station_profile.station_names: - print("Bringing up station %s" % sta) + print("Bringing up station %s" % (sta)) self.admin_up(sta) temp_stations_list = [] - # temp_stations_list.append(self.side_b) + #temp_stations_list.append(self.side_b) for station_profile in self.station_profiles: temp_stations_list.extend(station_profile.station_names.copy()) temp_stations_list_with_side_b = temp_stations_list.copy() # wait for b side to get IP - temp_stations_list_with_side_b.append(self.side_b) + temp_stations_list_with_side_b.append(self.side_b) print("temp_stations_list {temp_stations_list}".format(temp_stations_list=temp_stations_list)) print("temp_stations_list_with_side_b {temp_stations_list_with_side_b}".format(temp_stations_list_with_side_b=temp_stations_list_with_side_b)) @@ -814,6 +817,7 @@ class L3VariableTime(Realm): for eid_name in port_eids: self.csv_add_ul_port_column_headers(eid_name, self.csv_generate_ul_port_column_headers()) + # For each rate rate_idx = 0 for ul in self.side_a_min_rate: @@ -836,10 +840,10 @@ class L3VariableTime(Realm): dl_pdu_str = dl_pdu ul_pdu_str = ul_pdu - if ul_pdu == "AUTO" or ul_pdu == "MTU": + if (ul_pdu == "AUTO" or ul_pdu == "MTU"): ul_pdu = "-1" - if dl_pdu == "AUTO" or dl_pdu == "MTU": + if (dl_pdu == "AUTO" or dl_pdu == "MTU"): dl_pdu = "-1" print("ul: %s dl: %s cx-count: %s rates-are-totals: %s\n" % (ul, dl, self.cx_count, self.rates_are_totals)) @@ -881,7 +885,7 @@ class L3VariableTime(Realm): end_time = self.parse_time(self.test_duration) + cur_time - print("Monitoring throughput for duration: %s" % self.test_duration) + print("Monitoring throughput for duration: %s" % (self.test_duration)) # Monitor test for the interval duration. passes = 0 @@ -900,7 +904,7 @@ class L3VariableTime(Realm): mac_found_2g = False reset_timer = 0 latency = 0 - jitter = 0 + jitter = 0 total_ul_rate = 0 total_ul_rate_ll = 0 total_ul_pkts_ll = 0 @@ -909,9 +913,9 @@ class L3VariableTime(Realm): total_dl_pkts_ll = 0 while cur_time < end_time: - # interval_time = cur_time + datetime.timedelta(seconds=5) + #interval_time = cur_time + datetime.timedelta(seconds=5) interval_time = cur_time + datetime.timedelta(seconds=self.polling_interval_seconds) - # print("polling_interval_seconds {}".format(self.polling_interval_seconds)) + #print("polling_interval_seconds {}".format(self.polling_interval_seconds)) while cur_time < interval_time: cur_time = datetime.datetime.now() @@ -948,6 +952,7 @@ class L3VariableTime(Realm): ap_chanim_stats_6g = self.read_ap_chanim_stats_6g() ap_stats_ul_6g = self.read_ap_stats_ul_6g() + ap_stats_6g_rows = ap_stats_6g.splitlines() print("From AP stats: ap_stats_6g_rows {}".format(ap_stats_6g_rows)) @@ -969,7 +974,7 @@ class L3VariableTime(Realm): # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("6g query-port: %s: incomplete response:" % url) + print("6g query-port: %s: incomplete response:" % (url)) pprint(response) else: # print("response".format(response)) @@ -982,8 +987,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_6g_rows: split_row = row.split() - # print("split_row {}".format(split_row)) - # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + #print("split_row {}".format(split_row)) + #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_row[0].lower() != mac.lower(): ap_row = split_row @@ -1036,6 +1041,7 @@ class L3VariableTime(Realm): # ap information is passed with ap_row so all information needs to be contained in ap_row ap_row.append(str(channel_utilization)) + # work though the ul rx_data 6G for eid_name in port_eids: eid = self.name_to_eid(eid_name) @@ -1043,7 +1049,7 @@ class L3VariableTime(Realm): # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("6g query-port: %s: incomplete response:" % url) + print("6g query-port: %s: incomplete response:" % (url)) pprint(response) else: # print("response".format(response)) @@ -1056,8 +1062,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_ul_6g_rows: split_ul_row = row.split() - # print("split_row {}".format(split_row)) - # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + #print("split_row {}".format(split_row)) + #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_ul_row[0].lower() != mac.lower(): ap_ul_row = split_ul_row @@ -1119,7 +1125,7 @@ class L3VariableTime(Realm): # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("query-port 5g: %s: incomplete response:" % url) + print("query-port 5g: %s: incomplete response:" % (url)) pprint(response) else: # print("response".format(response)) @@ -1132,8 +1138,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_5g_rows: split_row = row.split() - # print("split_row {}".format(split_row)) - # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + #print("split_row {}".format(split_row)) + #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_row[0].lower() != mac.lower(): ap_row = split_row @@ -1190,16 +1196,16 @@ class L3VariableTime(Realm): self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) - # work though the ul rx_data 5G + # work though the ul rx_data 5G for eid_name in port_eids: eid = self.name_to_eid(eid_name) url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("5g query-port: %s: incomplete response:" % url) + print("5g query-port: %s: incomplete response:" % (url)) pprint(response) else: # print("response".format(response)) @@ -1212,8 +1218,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_ul_5g_rows: split_ul_row = row.split() - # print("split_row {}".format(split_row)) - # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + #print("split_row {}".format(split_row)) + #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_ul_row[0].lower() != mac.lower(): ap_ul_row = split_ul_row @@ -1238,8 +1244,8 @@ class L3VariableTime(Realm): print("5g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) # 2g test mode if self.ap_test_mode: @@ -1273,7 +1279,7 @@ class L3VariableTime(Realm): # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("2g query-port: %s: incomplete response:" % url) + print("2g query-port: %s: incomplete response:" % (url)) pprint(response) else: # print("response".format(response)) @@ -1286,8 +1292,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_2g_rows: split_row = row.split() - # print("split_row {}".format(split_row)) - # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + #print("split_row {}".format(split_row)) + #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_row[0].lower() != mac.lower(): ap_row = split_row @@ -1344,15 +1350,15 @@ class L3VariableTime(Realm): self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) - # work though the ul rx_data 5G + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + # work though the ul rx_data 5G for eid_name in port_eids: eid = self.name_to_eid(eid_name) url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) if (response is None) or ("interface" not in response): - print("5g query-port: %s: incomplete response:" % url) + print("5g query-port: %s: incomplete response:" % (url)) pprint(response) else: # print("response".format(response)) @@ -1365,8 +1371,8 @@ class L3VariableTime(Realm): # Parse the ap stats to find the matching mac then use that row for reporting for row in ap_stats_ul_2g_rows: split_ul_row = row.split() - # print("split_row {}".format(split_row)) - # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + #print("split_row {}".format(split_row)) + #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: if split_ul_row[0].lower() != mac.lower(): ap_ul_row = split_ul_row @@ -1391,8 +1397,8 @@ class L3VariableTime(Realm): print("2g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) else: # Query all of our ports @@ -1403,7 +1409,7 @@ class L3VariableTime(Realm): url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) response = self.json_get(url) if (response is None) or ("interface" not in response): - print("query-port: %s: incomplete response:" % url) + print("query-port: %s: incomplete response:" % (url)) pprint(response) else: p = response['interface'] @@ -1412,9 +1418,9 @@ class L3VariableTime(Realm): self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) - # At end of test step, record KPI into kpi.csv + # At end of test step, record KPI into kpi.csv self.record_kpi_csv( len(temp_stations_list), ul, @@ -1427,6 +1433,7 @@ class L3VariableTime(Realm): total_dl_ll_bps, total_ul_ll_bps) + # At end of test step, record KPI information. This is different the kpi.csv self.record_kpi( len(temp_stations_list), @@ -1487,12 +1494,12 @@ class L3VariableTime(Realm): port_data['signal'], port_data['ap'], port_data['mode'], latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll] # Add in info queried from AP. - # print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) - # print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) + #print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) + #print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) if len(ap_row) == len(self.ap_stats_col_titles): - # print("ap_row {}".format(ap_row)) + #print("ap_row {}".format(ap_row)) for col in ap_row: - # print("col {}".format(col)) + #print("col {}".format(col)) row.append(col) writer = self.port_csv_writers[eid_name] @@ -1500,7 +1507,7 @@ class L3VariableTime(Realm): self.port_csv_files[eid_name].flush() def write_ul_port_csv(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, eid_name, port_data, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row): + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row): row = [self.epoch_time, self.time_stamp(), sta_count, ul, ul, dl, dl, dl_pdu, dl_pdu, ul_pdu, ul_pdu, atten, eid_name @@ -1510,16 +1517,16 @@ class L3VariableTime(Realm): port_data['signal'], port_data['ap'], port_data['mode'], latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll] # Add in info queried from AP. - # print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) - # print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) + #print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) + #print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) - print("ap_ul_row len {} ap_stats_ul_col_titles len {} ap_ul_row {}".format(len(ap_ul_row), len(self.ap_stats_ul_col_titles), ap_ul_row)) + print("ap_ul_row len {} ap_stats_ul_col_titles len {} ap_ul_row {}".format(len(ap_ul_row),len(self.ap_stats_ul_col_titles),ap_ul_row)) if len(ap_ul_row) == len(self.ap_stats_ul_col_titles): print("ap_ul_row {}".format(ap_ul_row)) for col in ap_ul_row: print("col {}".format(col)) row.append(col) - + writer = self.ul_port_csv_writers[eid_name] writer.writerow(row) self.ul_port_csv_files[eid_name].flush() @@ -1533,50 +1540,52 @@ class L3VariableTime(Realm): def record_kpi_csv(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps): print("NOTE: Adding kpi to kpi.csv, sta_count {sta_count} total-download-bps:{total_dl_bps} upload: {total_ul_bps} bi-directional: {total}\n".format( - sta_count=sta_count, total_dl_bps=total_dl_bps, total_ul_bps=total_ul_bps, total=(total_ul_bps + total_dl_bps))) + sta_count=sta_count,total_dl_bps=total_dl_bps, total_ul_bps=total_ul_bps, total=(total_ul_bps + total_dl_bps))) print("NOTE: Adding kpi to kpi.csv, sta_count {sta_count} total-download-bps:{total_dl_ll_bps} upload: {total_ul_ll_bps} bi-directional: {total_ll}\n".format( - sta_count=sta_count, total_dl_ll_bps=total_dl_ll_bps, total_ul_ll_bps=total_ul_ll_bps, total_ll=(total_ul_ll_bps + total_dl_ll_bps))) + sta_count=sta_count,total_dl_ll_bps=total_dl_ll_bps, total_ul_ll_bps=total_ul_ll_bps, total_ll=(total_ul_ll_bps + total_dl_ll_bps))) + # the short description will all for more data to show up in one test-tag graph results_dict = self.kpi_csv.kpi_csv_get_dict_update_time() results_dict['Graph-Group'] = "Per Stations Rate DL" - results_dict['short-description'] = "DL {dl} bps pdu {dl_pdu} {sta_count} STA".format(dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) + results_dict['short-description'] = "DL {dl} bps pdu {dl_pdu} {sta_count} STA".format(dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_dl_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL" - results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} {sta_count} STA".format(ul=ul, ul_pdu=ul_pdu, sta_count=sta_count) + results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_ul_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL+DL" - results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} + DL {dl} bps pud {dl_pdu}- {sta_count} STA".format(ul=ul, ul_pdu=ul_pdu, dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) + results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} + DL {dl} bps pud {dl_pdu}- {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) results_dict['numeric-score'] = "{}".format((total_ul_bps + total_dl_bps)) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate DL" - results_dict['short-description'] = "DL LL {dl} bps pdu {dl_pdu} {sta_count} STA".format(dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) + results_dict['short-description'] = "DL LL {dl} bps pdu {dl_pdu} {sta_count} STA".format(dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_dl_ll_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL" - results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} {sta_count} STA".format(ul=ul, ul_pdu=ul_pdu, sta_count=sta_count) + results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_ul_ll_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL+DL" - results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} + DL LL {dl} bps pud {dl_pdu}- {sta_count} STA".format(ul=ul, ul_pdu=ul_pdu, dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) + results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} + DL LL {dl} bps pud {dl_pdu}- {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) results_dict['numeric-score'] = "{}".format((total_ul_ll_bps + total_dl_ll_bps)) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) + # Submit data to the influx db if configured to do so. # This is not the kpi.csv def record_kpi(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps): @@ -1634,7 +1643,11 @@ class L3VariableTime(Realm): station_profile.cleanup() def csv_generate_column_headers(self): - csv_rx_headers = ['Time epoch', 'Time', 'Monitor', 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', "average_rx_data_bytes"] + csv_rx_headers = ['Time epoch', 'Time', 'Monitor', + 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', + 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', + ] + csv_rx_headers.append("average_rx_data_bytes") return csv_rx_headers def csv_generate_port_column_headers(self): @@ -1652,17 +1665,19 @@ class L3VariableTime(Realm): def csv_generate_ul_port_column_headers(self): csv_ul_rx_headers = ['Time epoch', 'Time', 'Station-Count', - 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', - 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', 'Attenuation', - 'Name', 'Rx-Bps', 'Tx-Bps', 'Rx-Link-Rate', 'Tx-Link-Rate', 'RSSI', 'AP', 'Mode', - 'Rx-Latency', 'Rx-Jitter', 'Ul-Rx-Goodput-bps', 'Ul-Rx-Rate-ll', 'Ul-Rx-Pkts-ll', 'Dl-Rx-Goodput-bps', 'Dl-Rx-Rate-ll', 'Dl-Rx-Pkts-ll' - ] + 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', + 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', 'Attenuation', + 'Name', 'Rx-Bps', 'Tx-Bps', 'Rx-Link-Rate', 'Tx-Link-Rate', 'RSSI', 'AP', 'Mode', + 'Rx-Latency', 'Rx-Jitter', 'Ul-Rx-Goodput-bps', 'Ul-Rx-Rate-ll', 'Ul-Rx-Pkts-ll', 'Dl-Rx-Goodput-bps', 'Dl-Rx-Rate-ll', 'Dl-Rx-Pkts-ll' + ] # Add in columns we are going to query from the AP for col in self.ap_stats_ul_col_titles: csv_ul_rx_headers.append(col) return csv_ul_rx_headers + + def csv_generate_kpi_column_headers(self): csv_rx_headers = ['Time epoch', 'Time', 'Station-Count', 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', @@ -1706,6 +1721,7 @@ class L3VariableTime(Realm): ul_port_csv_writer.writerow(headers) pfile.flush() + def csv_validate_list(self, csv_list, length): if len(csv_list) < length: csv_list = csv_list + [('no data', 'no data')] * (length - len(csv_list)) @@ -1718,7 +1734,6 @@ class L3VariableTime(Realm): # End of the main class. - # Check some input values. @@ -1855,7 +1870,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m parser.add_argument('--tty', help='--tty \"/dev/ttyUSB2\" the serial interface to the AP', default="") parser.add_argument('--baud', help='--baud \"9600\" AP baud rate for the serial interface', default="9600") - parser.add_argument('--mgr', '--lfmgr', dest='lfmgr', help='--lfmgr ', default='localhost') + parser.add_argument('--mgr','--lfmgr', dest='lfmgr', help='--lfmgr ', default='localhost') parser.add_argument( '--test_duration', help='--test_duration example --time 5d (5 days) default: 3m options: number followed by d, h, m or s', @@ -1927,7 +1942,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m args = parser.parse_args() - # print("args: {}".format(args)) + #print("args: {}".format(args)) debug = args.debug # for kpi.csv generation @@ -1937,7 +1952,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m dut_hw_version = args.dut_hw_version dut_sw_version = args.dut_sw_version dut_model_num = args.dut_model_num - test_priority = args.test_priority # this may need to be set per test + test_priority = args.test_priority # this may need to be set per test test_id = args.test_id if args.ap_read: @@ -2098,7 +2113,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m radio_reset_found = True for key in optional_radio_reset_keys: if key not in radio_info_dict: - # print("port reset test not enabled") + #print("port reset test not enabled") radio_reset_found = False break @@ -2122,7 +2137,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m station_lists.append(station_list) index += 1 - # print("endp-types: %s"%(endp_types)) + #print("endp-types: %s"%(endp_types)) ul_rates = args.side_a_min_bps.split(",") dl_rates = args.side_b_min_bps.split(",") @@ -2132,14 +2147,14 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m attenuators = [] else: attenuators = args.attenuators.split(",") - if args.atten_vals == "": + if (args.atten_vals == ""): atten_vals = [-1] else: atten_vals = args.atten_vals.split(",") - if len(ul_rates) != len(dl_rates): + if (len(ul_rates) != len(dl_rates)): print("ERROR: ul_rates %s and dl_rates %s arrays must be same length\n" % (len(ul_rates), len(dl_rates))) - if len(ul_pdus) != len(dl_pdus): + if (len(ul_pdus) != len(dl_pdus)): print("ERROR: ul_pdus %s and dl_pdus %s arrays must be same length\n" % (len(ul_rates), len(dl_rates))) ip_var_test = L3VariableTime( @@ -2220,7 +2235,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m report.set_table_dataframe_from_csv(csv_kpi_file) report.build_table() report.write_html_with_timestamp() - # report.write_pdf(_page_size = 'A3', _orientation='Landscape') + #report.write_pdf(_page_size = 'A3', _orientation='Landscape') report.write_pdf_with_timestamp(_page_size='A4', _orientation='Portrait') # ap scheduler results and write to a file From bb29c5ff23f7a6a24a8e94bf068da16219121fdb Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 9 Nov 2021 08:02:53 -0700 Subject: [PATCH 287/731] ct_us_002_tests.json : test updates Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_002_tests.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 744bb96c..5d493099 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -125,9 +125,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ATH10K_9984__wc", - " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: USE_DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", - " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: USE_DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", + " --create_scenario ATH10K_9984_wc", + " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: USE_DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, @@ -201,8 +200,7 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario AX200_wc", - " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: USE_DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", - " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: USE_DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AUTO 1 'DUT: USE_DUT_NAME Radio-1' NA wiphy4,AUTO -1 NA\" ", " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA \" " ] }, From b60313457eb463e2f8e9ed91f928ea51f89b4467 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 9 Nov 2021 17:27:18 -0700 Subject: [PATCH 288/731] test_l3_longevity.py : add ability to pass wifi_settings per radio Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 123 ++++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 6 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 0f25c90e..4155e22a 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -89,6 +89,8 @@ class L3VariableTime(Realm): ssid_list, ssid_password_list, ssid_security_list, + wifi_mode_list, + enable_flags_list, station_lists, name_prefix, outfile, @@ -155,6 +157,8 @@ class L3VariableTime(Realm): self.dataplane = False self.ssid_list = ssid_list self.ssid_password_list = ssid_password_list + self.wifi_mode_list = wifi_mode_list + self.enable_flags_list = enable_flags_list self.station_lists = station_lists self.ssid_security_list = ssid_security_list self.reset_port_enable_list = reset_port_enable_list @@ -263,20 +267,25 @@ class L3VariableTime(Realm): # if it is a dataplane test the side_a is not None and an ethernet port # if side_a is None then side_a is radios if self.dataplane == False: - for (radio_, ssid_, ssid_password_, ssid_security_, - reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ + for (radio_, ssid_, ssid_password_, ssid_security_, + mode_,enable_flags_, + reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, - reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): + wifi_mode_list, enable_flags_list, + reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): self.station_profile = self.new_station_profile() self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = ssid_ self.station_profile.ssid_pass = ssid_password_ self.station_profile.security = ssid_security_ self.station_profile.number_template = self.number_template - self.station_profile.mode = 0 + self.station_profile.mode = mode_ + self.station_profile.desired_add_sta_flags = enable_flags_.copy() + self.station_profile.desired_add_sta_flags_mask = enable_flags_.copy() + # place the enable and disable flags # self.station_profile.desired_add_sta_flags = self.enable_flags - # self.station_profile.desired_add_sta_flags_mask = self.enable_flags + self.disable_flags + # self.station_profile.desired_add_sta_flags_mask = self.enable_flags self.station_profile.set_reset_extra(reset_port_enable=reset_port_enable_, test_duration=self.duration_time_to_seconds(self.test_duration), reset_port_min_time=self.duration_time_to_seconds(reset_port_time_min_), @@ -1842,6 +1851,72 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m --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" +Setting wifi_settings per radio +./test_l3_longevity.py --lfmgr 192.168.100.116 --local_lf_report_dir /home/lanforge/html-reports/ --test_duration 15s +--polling_interval 5s --upstream_port eth2 +--radio "radio==wiphy1 stations==4 ssid==asus11ax-5 ssid_pw==hello123 security==wpa2 mode==0 wifi_settings==wifi_settings enable_flags==('ht160_enable'|'wpa2_enable'|'80211u_enable'|'create_admin_down'|'ht160_enable') " +--endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --test_rig CT-US-001 --test_tag 'l3_longevity' + + wifi_mode + Input : Enum Val : Shown by nc_show_ports + + AUTO | 0 # 802.11g + 802.11a | 1 # 802.11a + b | 2 # 802.11b + g | 3 # 802.11g + abg | 4 # 802.11abg + abgn | 5 # 802.11abgn + bgn | 6 # 802.11bgn + bg | 7 # 802.11bg + abgnAC | 8 # 802.11abgn-AC + anAC | 9 # 802.11an-AC + an | 10 # 802.11an + bgnAC | 11 # 802.11bgn-AC + abgnAX | 12 # 802.11abgn-AX + # a/b/g/n/AC/AX (dual-band AX) support + bgnAX | 13 # 802.11bgn-AX + anAX | 14 # 802.11an-AX + aAX | 15 # 802.11a-AX (6E disables /n and /ac) + + + wifi_settings flags are currently defined as: + wpa_enable | 0x10 # Enable WPA + custom_conf | 0x20 # Use Custom wpa_supplicant config file. + wep_enable | 0x200 # Use wpa_supplicant configured for WEP encryption. + wpa2_enable | 0x400 # Use wpa_supplicant configured for WPA2 encryption. + ht40_disable | 0x800 # Disable HT-40 even if hardware and AP support it. + scan_ssid | 0x1000 # Enable SCAN-SSID flag in wpa_supplicant. + passive_scan | 0x2000 # Use passive scanning (don't send probe requests). + disable_sgi | 0x4000 # Disable SGI (Short Guard Interval). + lf_sta_migrate | 0x8000 # OK-To-Migrate (Allow station migration between LANforge radios) + verbose | 0x10000 # Verbose-Debug: Increase debug info in wpa-supplicant and hostapd logs. + 80211u_enable | 0x20000 # Enable 802.11u (Interworking) feature. + 80211u_auto | 0x40000 # Enable 802.11u (Interworking) Auto-internetworking feature. Always enabled currently. + 80211u_gw | 0x80000 # AP Provides access to internet (802.11u Interworking) + 80211u_additional | 0x100000 # AP requires additional step for access (802.11u Interworking) + 80211u_e911 | 0x200000 # AP claims emergency services reachable (802.11u Interworking) + 80211u_e911_unauth | 0x400000 # AP provides Unauthenticated emergency services (802.11u Interworking) + hs20_enable | 0x800000 # Enable Hotspot 2.0 (HS20) feature. Requires WPA-2. + disable_gdaf | 0x1000000 # AP: Disable DGAF (used by HotSpot 2.0). + 8021x_radius | 0x2000000 # Use 802.1x (RADIUS for AP). + 80211r_pmska_cache | 0x4000000 # Enable oportunistic PMSKA caching for WPA2 (Related to 802.11r). + disable_ht80 | 0x8000000 # Disable HT80 (for AC chipset NICs only) + ibss_mode | 0x20000000 # Station should be in IBSS mode. + osen_enable | 0x40000000 # Enable OSEN protocol (OSU Server-only Authentication) + disable_roam | 0x80000000 # Disable automatic station roaming based on scan results. + ht160_enable | 0x100000000 # Enable HT160 mode. + disable_fast_reauth | 0x200000000 # Disable fast_reauth option for virtual stations. + mesh_mode | 0x400000000 # Station should be in MESH mode. + power_save_enable | 0x800000000 # Station should enable power-save. May not work in all drivers/configurations. + create_admin_down | 0x1000000000 # Station should be created admin-down. + wds-mode | 0x2000000000 # WDS station (sort of like a lame mesh), not supported on ath10k + no-supp-op-class-ie | 0x4000000000 # Do not include supported-oper-class-IE in assoc requests. May work around AP bugs. + txo-enable | 0x8000000000 # Enable/disable tx-offloads, typically managed by set_wifi_txo command + use-wpa3 | 0x10000000000 # Enable WPA-3 (SAE Personal) mode. + use-bss-transition | 0x80000000000 # Enable BSS transition. + disable-twt | 0x100000000000 # Disable TWT mode + + ''') @@ -1885,7 +1960,8 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m parser.add_argument('-r', '--radio', action='append', nargs=1, help='--radio\ "radio== ssid== ssid_pw== security==\ - reset_port_enable==TRUE,reset_port_time_min==s,reset_port_time_max==s" ') + wifi_settings==True,wifi_mode==,enable_flags==\ + reset_port_enable==True,reset_port_time_min==s,reset_port_time_max==s" ') parser.add_argument('--ap_read', help='--ap_read flag present enable reading ap', action='store_true') parser.add_argument('--ap_port', help='--ap_port \'/dev/ttyUSB0\'', default='/dev/ttyUSB0') @@ -2083,6 +2159,10 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m ssid_security_list = [] station_lists = [] + # wifi settings configuration + wifi_mode_list= [] + wifi_enable_flags_list = [] + # optional radio configuration reset_port_enable_list = [] reset_port_time_min_list = [] @@ -2095,6 +2175,8 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m print("radio_dict before format {}".format(radio_)) radio_info_dict = dict(map(lambda x: x.split('=='), str(radio_).replace('"', '').replace( '[', '').replace(']', '').replace("'", "").replace(",", " ").split())) + #radio_info_dict = dict(map(lambda x: x.split('=='), str(radio_).replace('"', '').split())) + print("radio_dict {}".format(radio_info_dict)) for key in radio_keys: @@ -2108,7 +2190,34 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m ssid_password_list.append(radio_info_dict['ssid_pw']) ssid_security_list.append(radio_info_dict['security']) + # check for wifi_settings + wifi_settings_keys = ['wifi_settings'] + wifi_settings_found = True + for key in wifi_settings_keys: + if key not in radio_info_dict: + print("wifi_settings_keys not enabled") + wifi_settings_found = False + break + + if wifi_settings_found is True: + # Check for additional flags + if set(('wifi_mode','enable_flags')).issubset(radio_info_dict.keys()): + print("wifi_settings flags set") + else: + print("wifi_settings is present wifi_mode, enable_flags need to be set") + print("or remove the wifi_settings or set wifi_settings==False flag on the radio for defaults") + exit(1) + wifi_mode_list.append(radio_info_dict['wifi_mode']) + enable_flags_str = radio_info_dict['enable_flags'].replace('(','').replace(')','').replace('|',',') + enable_flags_list = list(enable_flags_str.split(",")) + wifi_enable_flags_list.append(enable_flags_list) + else: + wifi_mode_list.append(0) + wifi_enable_flags_list.append(["wpa2_enable", "80211u_enable", "create_admin_down"]) + + # check for optional radio key , currently only reset is enabled + # update for checking for reset_port_time_min, reset_port_time_max optional_radio_reset_keys = ['reset_port_enable'] radio_reset_found = True for key in optional_radio_reset_keys: @@ -2168,6 +2277,8 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m ssid_list=ssid_list, ssid_password_list=ssid_password_list, ssid_security_list=ssid_security_list, + wifi_mode_list=wifi_mode_list, + enable_flags_list=wifi_enable_flags_list, station_lists=station_lists, name_prefix="LT-", outfile=csv_outfile, From 5ad97eb619f65d40e035fc040f40db2d0a8cfb52 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 10 Nov 2021 11:55:29 -0700 Subject: [PATCH 289/731] test_l3_longevity.py : pep8 cleanup Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 1674 ++++++++++++++++++++++--------- 1 file changed, 1202 insertions(+), 472 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 4155e22a..7387fa46 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -10,7 +10,8 @@ PURPOSE: Supports generating connections with different ToS values. Supports generating tcp and/or UDP traffic types. Supports iterating over different PDU sizes - Supports iterating over different requested tx rates (configurable as total or per-connection value) + Supports iterating over different requested tx rates + (configurable as total or per-connection value) Supports iterating over attenuation values. Supports testing connection between two ethernet connection - L3 dataplane @@ -67,7 +68,7 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lf_report = importlib.import_module("py-scripts.lf_report") -lf_kpi_csv = importlib.import_module("py-scripts.lf_kpi_csv") +lf_kpi_csv = importlib.import_module("py-scripts.lf_kpi_csv") LFUtils = importlib.import_module("py-json.LANforge.LFUtils") realm = importlib.import_module("py-json.realm") Realm = realm.Realm @@ -169,8 +170,9 @@ class L3VariableTime(Realm): self.test_duration = test_duration self.radio_name_list = radio_name_list self.number_of_stations_per_radio_list = number_of_stations_per_radio_list - #self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=debug_on) - self.polling_interval_seconds = self.duration_time_to_seconds(polling_interval) + # self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=debug_on) + self.polling_interval_seconds = self.duration_time_to_seconds( + polling_interval) self.cx_profile = self.new_l3_cx_profile() self.multicast_profile = self.new_multicast_profile() self.multicast_profile.name_prefix = "MLT-" @@ -199,8 +201,10 @@ class L3VariableTime(Realm): self.attenuators = attenuators self.atten_vals = atten_vals - if ((len(self.atten_vals) > 0) and (self.atten_vals[0] != -1) and (len(self.attenuators) == 0)): - print("ERROR: Attenuation values configured, but no Attenuator EIDs specified.\n") + if ((len(self.atten_vals) > 0) and ( + self.atten_vals[0] != -1) and (len(self.attenuators) == 0)): + print( + "ERROR: Attenuation values configured, but no Attenuator EIDs specified.\n") exit(1) self.cx_profile.mconn = mconn @@ -237,20 +241,43 @@ class L3VariableTime(Realm): # Lookup key is port-eid name self.port_csv_files = {} self.port_csv_writers = {} - + self.ul_port_csv_files = {} self.ul_port_csv_writers = {} - # TODO: cmd-line arg to enable/disable these stats. - self.ap_stats_col_titles = ["Station Address", "Dl-PHY-Mbps", "Dl-Data-Mbps", "Dl-Air-Use", "Dl-Data-Use", - "Dl-Retries", "Dl-BW", "Dl-MCS", "Dl-NSS", "Dl-OFDMA", "Dl-MU-MIMO", - "Dl-Channel-Utilization"] - - self.ap_stats_ul_col_titles = ["UL Station Address", "Ul-rssi", "Ul-tid", "Ul-ampdu","Ul-mpdu", "Ul-Data-Mbps", - "Ul-PHY-Mbps", "UL-BW", "Ul-MCS", "Ul-NSS", "Ul-OOW", "Ul-HOLES", - "Ul-DUP", "Ul-Retries", "Ul-OFDMA", "Ul-Tones", "Ul-AIR"] + self.ap_stats_col_titles = [ + "Station Address", + "Dl-PHY-Mbps", + "Dl-Data-Mbps", + "Dl-Air-Use", + "Dl-Data-Use", + "Dl-Retries", + "Dl-BW", + "Dl-MCS", + "Dl-NSS", + "Dl-OFDMA", + "Dl-MU-MIMO", + "Dl-Channel-Utilization"] + self.ap_stats_ul_col_titles = [ + "UL Station Address", + "Ul-rssi", + "Ul-tid", + "Ul-ampdu", + "Ul-mpdu", + "Ul-Data-Mbps", + "Ul-PHY-Mbps", + "UL-BW", + "Ul-MCS", + "Ul-NSS", + "Ul-OOW", + "Ul-HOLES", + "Ul-DUP", + "Ul-Retries", + "Ul-OFDMA", + "Ul-Tones", + "Ul-AIR"] dur = self.duration_time_to_seconds(self.test_duration) @@ -266,13 +293,26 @@ class L3VariableTime(Realm): # if it is a dataplane test the side_a is not None and an ethernet port # if side_a is None then side_a is radios - if self.dataplane == False: - for (radio_, ssid_, ssid_password_, ssid_security_, - mode_,enable_flags_, - reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ - in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, - wifi_mode_list, enable_flags_list, - reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): + if not self.dataplane: + for ( + radio_, + ssid_, + ssid_password_, + ssid_security_, + mode_, + enable_flags_, + reset_port_enable_, + reset_port_time_min_, + reset_port_time_max_) in zip( + radio_name_list, + ssid_list, + ssid_password_list, + ssid_security_list, + wifi_mode_list, + enable_flags_list, + reset_port_enable_list, + reset_port_time_min_list, + reset_port_time_max_list): self.station_profile = self.new_station_profile() self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = ssid_ @@ -281,15 +321,17 @@ class L3VariableTime(Realm): self.station_profile.number_template = self.number_template self.station_profile.mode = mode_ self.station_profile.desired_add_sta_flags = enable_flags_.copy() - self.station_profile.desired_add_sta_flags_mask = enable_flags_.copy() + self.station_profile.desired_add_sta_flags_mask = enable_flags_.copy() # place the enable and disable flags # self.station_profile.desired_add_sta_flags = self.enable_flags - # self.station_profile.desired_add_sta_flags_mask = self.enable_flags - self.station_profile.set_reset_extra(reset_port_enable=reset_port_enable_, - test_duration=self.duration_time_to_seconds(self.test_duration), - reset_port_min_time=self.duration_time_to_seconds(reset_port_time_min_), - reset_port_max_time=self.duration_time_to_seconds(reset_port_time_max_)) + # self.station_profile.desired_add_sta_flags_mask = self.enable_flags + self.station_profile.set_reset_extra( + reset_port_enable=reset_port_enable_, + test_duration=self.duration_time_to_seconds( + self.test_duration), + reset_port_min_time=self.duration_time_to_seconds(reset_port_time_min_), + reset_port_max_time=self.duration_time_to_seconds(reset_port_time_max_)) self.station_profiles.append(self.station_profile) else: pass @@ -327,7 +369,7 @@ class L3VariableTime(Realm): return self.ap_ofdma_24g def get_kpi_csv(self): - #print("self.csv_kpi_file {}".format(self.csv_kpi_file.name)) + # print("self.csv_kpi_file {}".format(self.csv_kpi_file.name)) return self.csv_kpi_file.name # Find avg latency, jitter for connections using specified port. @@ -343,9 +385,12 @@ class L3VariableTime(Realm): count = 0 sta_name = 'no_station' - #print("endp-stats-for-port, port-eid: {}".format(eid_name)) + # print("endp-stats-for-port, port-eid: {}".format(eid_name)) eid = self.name_to_eid(eid_name) - print("eid_name: {eid_name} eid: {eid}".format(eid_name=eid_name, eid=eid)) + print( + "eid_name: {eid_name} eid: {eid}".format( + eid_name=eid_name, + eid=eid)) # Convert all eid elements to strings eid[0] = str(eid[0]) @@ -355,7 +400,8 @@ class L3VariableTime(Realm): for endp in endps: pprint(endp) eid_endp = endp["eid"].split(".") - print("Comparing eid:{eid} to endp-id {eid_endp}".format(eid=eid, eid_endp=eid_endp)) + print( + "Comparing eid:{eid} to endp-id {eid_endp}".format(eid=eid, eid_endp=eid_endp)) # Look through all the endpoints (endps), to find the port the eid_name is using. # The eid_name that has the same Shelf, Resource, and Port as the eid_endp (looking at all the endps) # Then read the eid_endp to get the delay, jitter and rx rate @@ -370,16 +416,21 @@ class L3VariableTime(Realm): # only the -A endpoint will be found so need to look count += 1 - print("Matched: name: {name} eid:{eid} to endp-id {eid_endp}".format(name=name, eid=eid, eid_endp=eid_endp)) + print( + "Matched: name: {name} eid:{eid} to endp-id {eid_endp}".format( + name=name, eid=eid, eid_endp=eid_endp)) else: name = endp["name"] - print("No Match: name: {name} eid:{eid} to endp-id {eid_endp}".format(name=name, eid=eid, eid_endp=eid_endp)) + print( + "No Match: name: {name} eid:{eid} to endp-id {eid_endp}".format( + name=name, eid=eid, eid_endp=eid_endp)) if count > 1: lat = int(lat / count) jit = int(jit / count) - # need to loop though again to find the upload and download per station if the name matched + # need to loop though again to find the upload and download per station + # if the name matched for endp in endps: if sta_name in endp["name"]: name = endp["name"] @@ -399,7 +450,9 @@ class L3VariableTime(Realm): # Query all endpoints to generate rx and other stats, returned # as an array of objects. def __get_rx_values(self): - endp_list = self.json_get("endp?fields=name,eid,delay,jitter,rx+rate,rx+rate+ll,rx+bytes,rx+drop+%25,rx+pkts+ll", debug_=False) + endp_list = self.json_get( + "endp?fields=name,eid,delay,jitter,rx+rate,rx+rate+ll,rx+bytes,rx+drop+%25,rx+pkts+ll", + debug_=False) endp_rx_drop_map = {} endp_rx_map = {} our_endps = {} @@ -435,58 +488,72 @@ class L3VariableTime(Realm): endp_rx_drop_map[item] = value if value_name == 'rx rate': # This hack breaks for mcast or if someone names endpoints weirdly. - #print("item: ", item, " rx-bps: ", value_rx_bps) + # print("item: ", item, " rx-bps: ", value_rx_bps) if item.endswith("-A"): total_dl += int(value) else: total_ul += int(value) if value_name == 'rx rate ll': - # This hack breaks for mcast or if someone names endpoints weirdly. + # This hack breaks for mcast or if someone + # names endpoints weirdly. if item.endswith("-A"): total_dl_ll += int(value) else: total_ul_ll += int(value) - #print("total-dl: ", total_dl, " total-ul: ", total_ul, "\n") + # print("total-dl: ", total_dl, " total-ul: ", total_ul, "\n") return endp_rx_map, endp_rx_drop_map, endps, total_dl, total_ul, total_dl_ll, total_ul_ll - # This script supports resetting ports, allowing one to test AP/controller under data load - # while bouncing wifi stations. Check here to see if we should reset ports. + # This script supports resetting ports, allowing one to test AP/controller under data load + # while bouncing wifi stations. Check here to see if we should reset + # ports. def reset_port_check(self): for station_profile in self.station_profiles: if station_profile.reset_port_extra_data['reset_port_enable']: if station_profile.reset_port_extra_data['reset_port_timer_started'] is False: - print("reset_port_timer_started {}".format(station_profile.reset_port_extra_data['reset_port_timer_started'])) - print("reset_port_time_min: {}".format(station_profile.reset_port_extra_data['reset_port_time_min'])) - print("reset_port_time_max: {}".format(station_profile.reset_port_extra_data['reset_port_time_max'])) - station_profile.reset_port_extra_data['seconds_till_reset'] = \ - random.randint(station_profile.reset_port_extra_data['reset_port_time_min'], - station_profile.reset_port_extra_data['reset_port_time_max']) + print( + "reset_port_timer_started {}".format( + station_profile.reset_port_extra_data['reset_port_timer_started'])) + print( + "reset_port_time_min: {}".format( + station_profile.reset_port_extra_data['reset_port_time_min'])) + print( + "reset_port_time_max: {}".format( + station_profile.reset_port_extra_data['reset_port_time_max'])) + station_profile.reset_port_extra_data['seconds_till_reset'] = random.randint( + station_profile.reset_port_extra_data['reset_port_time_min'], + station_profile.reset_port_extra_data['reset_port_time_max']) station_profile.reset_port_extra_data['reset_port_timer_started'] = True print( "on radio {} seconds_till_reset {}".format( station_profile.add_sta_data['radio'], station_profile.reset_port_extra_data['seconds_till_reset'])) else: - station_profile.reset_port_extra_data['seconds_till_reset'] = station_profile.reset_port_extra_data['seconds_till_reset'] - 1 + station_profile.reset_port_extra_data[ + 'seconds_till_reset'] = station_profile.reset_port_extra_data['seconds_till_reset'] - 1 print( "radio: {} countdown seconds_till_reset {}".format( station_profile.add_sta_data['radio'], station_profile.reset_port_extra_data['seconds_till_reset'])) - if ((station_profile.reset_port_extra_data['seconds_till_reset'] <= 0)): + if (( + station_profile.reset_port_extra_data['seconds_till_reset'] <= 0)): station_profile.reset_port_extra_data['reset_port_timer_started'] = False - port_to_reset = random.randint(0, len(station_profile.station_names) - 1) + port_to_reset = random.randint( + 0, len(station_profile.station_names) - 1) print( "reset on radio {} station: {}".format( station_profile.add_sta_data['radio'], station_profile.station_names[port_to_reset])) - self.reset_port(station_profile.station_names[port_to_reset]) + self.reset_port( + station_profile.station_names[port_to_reset]) # Common code to generate timestamp for CSV files. def time_stamp(self): - return time.strftime('%m_%d_%Y_%H_%M_%S', time.localtime(self.epoch_time)) + return time.strftime('%m_%d_%Y_%H_%M_%S', + time.localtime(self.epoch_time)) - # Cleanup any older config that a previous run of this test may have created. + # Cleanup any older config that a previous run of this test may have + # created. def pre_cleanup(self): self.cx_profile.cleanup_prefix() self.multicast_profile.cleanup_prefix() @@ -532,17 +599,20 @@ class L3VariableTime(Realm): # stations, so allow skipping it. # Do clean cx lists so that when we re-apply them we get same endp name # as we had previously - #print("rebuild: Clearing cx profile lists.\n") + # print("rebuild: Clearing cx profile lists.\n") self.cx_profile.clean_cx_lists() self.multicast_profile.clean_mc_lists() if self.dataplane: for etype in self.endp_types: for _tos in self.tos: - print("Creating connections for endpoint type: %s TOS: %s cx-count: %s" % (etype, _tos, self.cx_profile.get_cx_count())) + print( + "Creating connections for endpoint type: %s TOS: %s cx-count: %s" % + (etype, _tos, self.cx_profile.get_cx_count())) # use brackes on [self.side_a] to make it a list - these_cx, these_endp = self.cx_profile.create(endp_type=etype, side_a=[self.side_a], - side_b=self.side_b, sleep_time=0, tos=_tos) + these_cx, these_endp = self.cx_profile.create( + endp_type=etype, side_a=[ + self.side_a], side_b=self.side_b, sleep_time=0, tos=_tos) if (etype == "lf_udp" or etype == "lf_udp6"): self.udp_endps = self.udp_endps + these_endp elif(etype == "lf"): @@ -553,11 +623,21 @@ class L3VariableTime(Realm): else: for station_profile in self.station_profiles: if not rebuild: - station_profile.use_security(station_profile.security, station_profile.ssid, station_profile.ssid_pass) - station_profile.set_number_template(station_profile.number_template) - print("Creating stations on radio %s" % (self.radio_name_list[index])) + station_profile.use_security( + station_profile.security, + station_profile.ssid, + station_profile.ssid_pass) + station_profile.set_number_template( + station_profile.number_template) + print( + "Creating stations on radio %s" % + (self.radio_name_list[index])) - station_profile.create(radio=self.radio_name_list[index], sta_names_=self.station_lists[index], debug=self.debug, sleep_time=0) + station_profile.create( + radio=self.radio_name_list[index], + sta_names_=self.station_lists[index], + debug=self.debug, + sleep_time=0) index += 1 self.station_count += len(station_profile.station_names) @@ -565,14 +645,20 @@ class L3VariableTime(Realm): # Build/update connection types for etype in self.endp_types: if etype == "mc_udp" or etype == "mc_udp6": - print("Creating Multicast connections for endpoint type: %s" % (etype)) - self.multicast_profile.create_mc_tx(etype, self.side_b, etype) - self.multicast_profile.create_mc_rx(etype, side_rx=station_profile.station_names) + print( + "Creating Multicast connections for endpoint type: %s" % + (etype)) + self.multicast_profile.create_mc_tx( + etype, self.side_b, etype) + self.multicast_profile.create_mc_rx( + etype, side_rx=station_profile.station_names) else: for _tos in self.tos: - print("Creating connections for endpoint type: %s TOS: %s cx-count: %s" % (etype, _tos, self.cx_profile.get_cx_count())) - these_cx, these_endp = self.cx_profile.create(endp_type=etype, side_a=station_profile.station_names, - side_b=self.side_b, sleep_time=0, tos=_tos) + print( + "Creating connections for endpoint type: %s TOS: %s cx-count: %s" % + (etype, _tos, self.cx_profile.get_cx_count())) + these_cx, these_endp = self.cx_profile.create( + endp_type=etype, side_a=station_profile.station_names, side_b=self.side_b, sleep_time=0, tos=_tos) if (etype == "lf_udp" or etype == "lf_udp6"): self.udp_endps = self.udp_endps + these_endp else: @@ -580,10 +666,14 @@ class L3VariableTime(Realm): self.cx_count = self.cx_profile.get_cx_count() - if self.dataplane == True: - self._pass("PASS: CX build finished: created/updated: %s connections." % (self.cx_count)) + if self.dataplane: + self._pass( + "PASS: CX build finished: created/updated: %s connections." % + (self.cx_count)) else: - self._pass("PASS: Stations & CX build finished: created/updated: %s stations and %s connections." % (self.station_count, self.cx_count)) + self._pass( + "PASS: Stations & CX build finished: created/updated: %s stations and %s connections." % + (self.station_count, self.cx_count)) def ap_custom_cmd(self, ap_custom_cmd): ap_results = "" @@ -592,11 +682,15 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(ap_custom_cmd)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + # do not detete line, waits for output + ss.expect([pexpect.TIMEOUT], timeout=1) ap_results = ss.before.decode('utf-8', 'ignore') - print("ap_custom_cmd: {} ap_results {}".format(ap_custom_cmd, ap_results)) + print( + "ap_custom_cmd: {} ap_results {}".format( + ap_custom_cmd, ap_results)) except BaseException: - print("ap_custom_cmd: {} WARNING unable to read AP ".format(ap_custom_cmd)) + print( + "ap_custom_cmd: {} WARNING unable to read AP ".format(ap_custom_cmd)) return ap_results @@ -608,7 +702,8 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_cmd_6g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + # do not detete line, waits for output + ss.expect([pexpect.TIMEOUT], timeout=1) ap_stats_6g = ss.before.decode('utf-8', 'ignore') print("ap_stats_6g from AP: {}".format(ap_stats_6g)) @@ -625,7 +720,8 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_cmd_5g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + # do not detete line, waits for output + ss.expect([pexpect.TIMEOUT], timeout=1) ap_stats_5g = ss.before.decode('utf-8', 'ignore') print("ap_stats_5g from AP: {}".format(ap_stats_5g)) @@ -642,7 +738,8 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_cmd_2g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + # do not detete line, waits for output + ss.expect([pexpect.TIMEOUT], timeout=1) ap_stats_2g = ss.before.decode('utf-8', 'ignore') print("ap_stats_2g from AP: {}".format(ap_stats_2g)) @@ -659,7 +756,8 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_chanim_cmd_6g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + # do not detete line, waits for output + ss.expect([pexpect.TIMEOUT], timeout=1) ap_chanim_stats_6g = ss.before.decode('utf-8', 'ignore') print("read_ap_chanim_stats_6g {}".format(ap_chanim_stats_6g)) @@ -676,7 +774,8 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_chanim_cmd_5g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + # do not detete line, waits for output + ss.expect([pexpect.TIMEOUT], timeout=1) ap_chanim_stats_5g = ss.before.decode('utf-8', 'ignore') print("read_ap_chanim_stats_5g {}".format(ap_chanim_stats_5g)) @@ -693,7 +792,8 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_chanim_cmd_2g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + # do not detete line, waits for output + ss.expect([pexpect.TIMEOUT], timeout=1) ap_chanim_stats_2g = ss.before.decode('utf-8', 'ignore') print("read_ap_chanim_stats_2g {}".format(ap_chanim_stats_2g)) @@ -710,7 +810,8 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_cmd_ul_6g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + # do not detete line, waits for output + ss.expect([pexpect.TIMEOUT], timeout=1) ap_stats_ul_6g = ss.before.decode('utf-8', 'ignore') print("ap_stats_ul_6g from AP: {}".format(ap_stats_ul_6g)) @@ -727,7 +828,8 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_cmd_ul_5g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + # do not detete line, waits for output + ss.expect([pexpect.TIMEOUT], timeout=1) ap_stats_ul_5g = ss.before.decode('utf-8', 'ignore') print("ap_stats_ul_5g from AP: {}".format(ap_stats_ul_5g)) @@ -744,7 +846,8 @@ class L3VariableTime(Realm): ser = serial.Serial(self.ap_port, int(self.ap_baud), timeout=5) ss = SerialSpawn(ser) ss.sendline(str(self.ap_cmd_ul_2g)) - ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + # do not detete line, waits for output + ss.expect([pexpect.TIMEOUT], timeout=1) ap_stats_ul_2g = ss.before.decode('utf-8', 'ignore') print("ap_stats_ul_2g from AP: {}".format(ap_stats_ul_2g)) @@ -753,36 +856,40 @@ class L3VariableTime(Realm): return ap_stats_ul_2g - - # provide fake bs_data for testing without AP wl2 is the 6E interface, wl1 5G, wl0 2G + # provide fake bs_data for testing without AP wl2 is the 6E interface, wl1 + # 5G, wl0 2G def read_ap_rx_report_test_mode(self): - ap_rx_report_fake = "{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 rx_report\n", - "Station Address (rssi) tid ampdu mpdu Data Mbps PHY Mbps bw mcs Nss oow holes dup rtries ofdma tones air\n", - "50:E0:85:87:5B:F4 (-43dBm) 0 2062 127078 32.5 571.9 80 11.0 2 0 0 64 0% 100% 483.3 6%\n", - "50:E0:85:84:7A:E7 (-44dBm) 0 2334 144373 36.9 343.1 80 10.9 2 0 0 63 0% 100% 291.4 11%\n", - "50:E0:85:88:F4:5F (-45dBm) 0 2296 142463 36.4 346.3 80 10.9 2 0 0 64 0% 100% 294.1 11%\n") - #Keep commented for testing "(overall) - 6692 413914 105.8 - - - - - - - - - - - -\n" + ap_rx_report_fake = "{}{}{}{}{}".format( + "root@Docsis-Gateway:~# wl -i wl1 rx_report\n", + "Station Address (rssi) tid ampdu mpdu Data Mbps PHY Mbps bw mcs Nss oow holes dup rtries ofdma tones air\n", + "50:E0:85:87:5B:F4 (-43dBm) 0 2062 127078 32.5 571.9 80 11.0 2 0 0 64 0% 100% 483.3 6%\n", + "50:E0:85:84:7A:E7 (-44dBm) 0 2334 144373 36.9 343.1 80 10.9 2 0 0 63 0% 100% 291.4 11%\n", + "50:E0:85:88:F4:5F (-45dBm) 0 2296 142463 36.4 346.3 80 10.9 2 0 0 64 0% 100% 294.1 11%\n") + # Keep commented for testing "(overall) - 6692 413914 105.8 + # - - - - - - - - - - - + # -\n" return ap_rx_report_fake def read_ap_bs_data_test_mode(self): - ap_stats_fake = "{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 bs_data\n", - "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", - "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", - "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", - "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", - "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n") - #Keep commented for testing "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") + ap_stats_fake = "{}{}{}{}{}{}".format( + "root@Docsis-Gateway:~# wl -i wl2 bs_data\n", + "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", + "04:f0:21:82:2f:d6 1016.6 48.9 6.5% 24.4% 16.6% 80 9.7 2 0.0% 0.0%\n", + "50:E0:85:84:7A:E7 880.9 52.2 7.7% 26.1% 20.0% 80 8.5 2 0.0% 0.0%\n", + "50:E0:85:89:5D:00 840.0 47.6 6.4% 23.8% 2.3% 80 8.0 2 0.0% 0.0%\n", + "50:E0:85:87:5B:F4 960.7 51.5 5.9% 25.7% 0.0% 80 9 2 0.0% 0.0%\n") + # Keep commented for testing "- note the MAC will match ap_stats.append((overall) - 200.2 26.5% - - \n") # print("ap_stats_fake {}".format(ap_stats_fake)) return ap_stats_fake def read_ap_chanim_stats_test_mode(self): # Create the test data as a continuous string ap_chanim_stats_fake = "{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 chanim_stats\n", - "version: 3\n", - "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", - # `"0xe06a 61 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") - '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') + "version: 3\n", + "chanspec tx inbss obss nocat nopkt doze txop goodtx badtx glitch badplcp knoise idle timestamp\n", + # `"0xe06a 61 15 0 17 0 0 6 53 2 0 0 -91 65 343370578\n") + '0xe06a\t41.82\t20.22\t0.00\t13.56\t0.02\t0.00\t17.58\t29.54\t1.94\t3\t0\t-90\t58\t146903490\n') # "0xe06a 1.67 15.00 0.00 17.00 0.00 0.00 97.33 53.00 2.00 0 0 -91 65 343370578\n") return ap_chanim_stats_fake @@ -796,15 +903,17 @@ class L3VariableTime(Realm): self.admin_up(sta) temp_stations_list = [] - #temp_stations_list.append(self.side_b) + # temp_stations_list.append(self.side_b) for station_profile in self.station_profiles: temp_stations_list.extend(station_profile.station_names.copy()) temp_stations_list_with_side_b = temp_stations_list.copy() # wait for b side to get IP - temp_stations_list_with_side_b.append(self.side_b) - print("temp_stations_list {temp_stations_list}".format(temp_stations_list=temp_stations_list)) - print("temp_stations_list_with_side_b {temp_stations_list_with_side_b}".format(temp_stations_list_with_side_b=temp_stations_list_with_side_b)) + temp_stations_list_with_side_b.append(self.side_b) + print("temp_stations_list {temp_stations_list}".format( + temp_stations_list=temp_stations_list)) + print("temp_stations_list_with_side_b {temp_stations_list_with_side_b}".format( + temp_stations_list_with_side_b=temp_stations_list_with_side_b)) if self.wait_for_ip(temp_stations_list_with_side_b, timeout_sec=120): print("ip's acquired") @@ -820,12 +929,13 @@ class L3VariableTime(Realm): # dl - ports port_eids = self.gather_port_eids() for eid_name in port_eids: - self.csv_add_port_column_headers(eid_name, self.csv_generate_port_column_headers()) + self.csv_add_port_column_headers( + eid_name, self.csv_generate_port_column_headers()) port_eids = self.gather_port_eids() for eid_name in port_eids: - self.csv_add_ul_port_column_headers(eid_name, self.csv_generate_ul_port_column_headers()) - + self.csv_add_ul_port_column_headers( + eid_name, self.csv_generate_ul_port_column_headers()) # For each rate rate_idx = 0 @@ -839,7 +949,8 @@ class L3VariableTime(Realm): dl_pdu = self.side_b_min_pdu[pdu_idx] pdu_idx += 1 - # Adjust rate to take into account the number of connections we have. + # Adjust rate to take into account the number of connections we + # have. if self.cx_count > 1 and self.rates_are_totals: # Convert from string to int to do math, then back to string # as that is what the cx_profile wants. @@ -855,7 +966,9 @@ class L3VariableTime(Realm): if (dl_pdu == "AUTO" or dl_pdu == "MTU"): dl_pdu = "-1" - print("ul: %s dl: %s cx-count: %s rates-are-totals: %s\n" % (ul, dl, self.cx_count, self.rates_are_totals)) + print( + "ul: %s dl: %s cx-count: %s rates-are-totals: %s\n" % + (ul, dl, self.cx_count, self.rates_are_totals)) # Set rate and pdu size config self.cx_profile.side_a_min_bps = ul @@ -894,7 +1007,9 @@ class L3VariableTime(Realm): end_time = self.parse_time(self.test_duration) + cur_time - print("Monitoring throughput for duration: %s" % (self.test_duration)) + print( + "Monitoring throughput for duration: %s" % + (self.test_duration)) # Monitor test for the interval duration. passes = 0 @@ -913,7 +1028,7 @@ class L3VariableTime(Realm): mac_found_2g = False reset_timer = 0 latency = 0 - jitter = 0 + jitter = 0 total_ul_rate = 0 total_ul_rate_ll = 0 total_ul_pkts_ll = 0 @@ -922,9 +1037,11 @@ class L3VariableTime(Realm): total_dl_pkts_ll = 0 while cur_time < end_time: - #interval_time = cur_time + datetime.timedelta(seconds=5) - interval_time = cur_time + datetime.timedelta(seconds=self.polling_interval_seconds) - #print("polling_interval_seconds {}".format(self.polling_interval_seconds)) + # interval_time = cur_time + datetime.timedelta(seconds=5) + interval_time = cur_time + \ + datetime.timedelta( + seconds=self.polling_interval_seconds) + # print("polling_interval_seconds {}".format(self.polling_interval_seconds)) while cur_time < interval_time: cur_time = datetime.datetime.now() @@ -948,7 +1065,8 @@ class L3VariableTime(Realm): # AP OUTPUT # rx_report command gives OFDMA and airtime fro the Uplink - # bs_data command shows the OFDMA and MU-MIMO on the downlink + # bs_data command shows the OFDMA and MU-MIMO on the + # downlink if self.ap_read: # 6G test mode if self.ap_test_mode: @@ -961,145 +1079,209 @@ class L3VariableTime(Realm): ap_chanim_stats_6g = self.read_ap_chanim_stats_6g() ap_stats_ul_6g = self.read_ap_stats_ul_6g() - ap_stats_6g_rows = ap_stats_6g.splitlines() - print("From AP stats: ap_stats_6g_rows {}".format(ap_stats_6g_rows)) + print( + "From AP stats: ap_stats_6g_rows {}".format(ap_stats_6g_rows)) ap_chanim_stats_rows_6g = ap_chanim_stats_6g.splitlines() - print("From AP chanim: ap_chanim_stats_rows_6g {}".format(ap_chanim_stats_rows_6g)) + print( + "From AP chanim: ap_chanim_stats_rows_6g {}".format(ap_chanim_stats_rows_6g)) ap_stats_ul_6g_rows = ap_stats_ul_6g.splitlines() - print("From AP stats ul: ap_stats_ul_6g_rows {}".format(ap_stats_ul_6g_rows)) + print( + "From AP stats ul: ap_stats_ul_6g_rows {}".format(ap_stats_ul_6g_rows)) channel_utilization = 0 # Query all of our ports - # Note: the endp eid is the shelf.resource.port.endp-id + # Note: the endp eid is the + # shelf.resource.port.endp-id port_eids = self.gather_port_eids() # read find the bs_data for eid_name in port_eids: eid = self.name_to_eid(eid_name) - url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) + url = "/port/%s/%s/%s" % (eid[0], + eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) - if (response is None) or ("interface" not in response): - print("6g query-port: %s: incomplete response:" % (url)) + if (response is None) or ( + "interface" not in response): + print( + "6g query-port: %s: incomplete response:" % + (url)) pprint(response) else: # print("response".format(response)) pprint(response) p = response['interface'] - print("#### 6g From LANforge: p, response['insterface']:{}".format(p)) + print( + "#### 6g From LANforge: p, response['insterface']:{}".format(p)) mac = p['mac'] - # print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) + # print("#### From LANforge: p['mac']: + # {mac}".format(mac=mac)) - # Parse the ap stats to find the matching mac then use that row for reporting + # Parse the ap stats to find the matching + # mac then use that row for reporting for row in ap_stats_6g_rows: split_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: - if split_row[0].lower() != mac.lower(): + if split_row[0].lower( + ) != mac.lower(): ap_row = split_row mac_found_6g = True else: try: # split_row[0].lower() , mac from AP - # mac.lower() , mac from LANforge - if split_row[0].lower() == mac.lower(): + # mac.lower() , mac from + # LANforge + if split_row[0].lower( + ) == mac.lower(): ap_row = split_row mac_found_6g = True except BaseException: - print("6g 'No stations are currently associated.'? from AP") - print(" since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_6g == True: + print( + "6g 'No stations are currently associated.'? from AP") + print( + " since possibly no stations: excption on compare split_row[0].lower() ") + if mac_found_6g: mac_found_6g = False - print("6g selected ap_row (from split_row): {}".format(ap_row)) + print( + "6g selected ap_row (from split_row): {}".format(ap_row)) - # Find latency, jitter for connections using this port. + # Find latency, jitter for connections + # using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( p["port"], endps) - # now report the ap_chanim_stats along side of the ap_stats_6g + # now report the ap_chanim_stats along + # side of the ap_stats_6g xtop_reported = False for row in ap_chanim_stats_rows_6g: split_row = row.split() if xtop_reported: - print("6g xtop_reported row: {row}".format(row=row)) - print("6g xtop_reported split_row: {split_row}".format(split_row=split_row)) + print( + "6g xtop_reported row: {row}".format( + row=row)) + print( + "6g xtop_reported split_row: {split_row}".format( + split_row=split_row)) try: xtop = split_row[7] - print("6g xtop {xtop}".format(xtop=xtop)) + print( + "6g xtop {xtop}".format(xtop=xtop)) except BaseException: - print("6g detected chanspec with reading chanim_stats, exception reading xtop") + print( + "6g detected chanspec with reading chanim_stats, exception reading xtop") try: - channel_utilization = float(100) - float(xtop) - print("6g channel_utilization {utilization}".format(utilization=channel_utilization)) + channel_utilization = float( + 100) - float(xtop) + print( + "6g channel_utilization {utilization}".format( + utilization=channel_utilization)) except BaseException: - print("6g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") - # should be only one channel utilization + print( + "6g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") + # should be only one channel + # utilization break else: try: - if split_row[0].lower() == 'chanspec': - print("6g chanspec found xtop_reported = True") + if split_row[0].lower( + ) == 'chanspec': + print( + "6g chanspec found xtop_reported = True") xtop_reported = True except BaseException: - print("6g Error reading xtop") - # ap information is passed with ap_row so all information needs to be contained in ap_row + print( + "6g Error reading xtop") + # ap information is passed with ap_row + # so all information needs to be + # contained in ap_row ap_row.append(str(channel_utilization)) - # work though the ul rx_data 6G for eid_name in port_eids: eid = self.name_to_eid(eid_name) - url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) + url = "/port/%s/%s/%s" % (eid[0], + eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) - if (response is None) or ("interface" not in response): - print("6g query-port: %s: incomplete response:" % (url)) + if (response is None) or ( + "interface" not in response): + print( + "6g query-port: %s: incomplete response:" % + (url)) pprint(response) else: # print("response".format(response)) pprint(response) p = response['interface'] - print("#### 6g From LANforge: p, response['insterface']:{}".format(p)) + print( + "#### 6g From LANforge: p, response['insterface']:{}".format(p)) mac = p['mac'] - # print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) + # print("#### From LANforge: p['mac']: + # {mac}".format(mac=mac)) - # Parse the ap stats to find the matching mac then use that row for reporting + # Parse the ap stats to find the matching + # mac then use that row for reporting for row in ap_stats_ul_6g_rows: split_ul_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: - if split_ul_row[0].lower() != mac.lower(): + if split_ul_row[0].lower( + ) != mac.lower(): ap_ul_row = split_ul_row mac_found_ul_6g = True else: try: # split_ul_row[0].lower() , mac from AP - # mac.lower() , mac from LANforge - if split_ul_row[0].lower() == mac.lower(): + # mac.lower() , mac from + # LANforge + if split_ul_row[0].lower( + ) == mac.lower(): ap_ul_row = split_ul_row mac_found_ul_6g = True except BaseException: - print("6g ul 'No stations are currently associated.'? from AP") - print(" ul since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_ul_6g == True: + print( + "6g ul 'No stations are currently associated.'? from AP") + print( + " ul since possibly no stations: excption on compare split_row[0].lower() ") + if mac_found_ul_6g: mac_found_ul_6g = False - print("6g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) + print( + "6g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) - # Find latency, jitter for connections using this port. + # Find latency, jitter for connections + # using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( p["port"], endps) - print("6g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) + print( + "6g ap_ul_row {ap_ul_row}".format( + ap_ul_row=ap_ul_row)) - self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + self.write_port_csv( + len(temp_stations_list), + ul, + dl, + ul_pdu_str, + dl_pdu_str, + atten_val, + eid_name, + p, + latency, + jitter, + total_ul_rate, + total_ul_rate_ll, + total_ul_pkts_ll, + total_dl_rate, + total_dl_rate_ll, + total_dl_pkts_ll, + ap_row) ##### # 5G test mode if self.ap_test_mode: @@ -1114,13 +1296,16 @@ class L3VariableTime(Realm): ap_stats_ul_5g = self.read_ap_stats_ul_5g() ap_stats_5g_rows = ap_stats_5g.splitlines() - print("From AP stats: ap_stats_5g_rows {}".format(ap_stats_5g_rows)) + print( + "From AP stats: ap_stats_5g_rows {}".format(ap_stats_5g_rows)) ap_chanim_stats_rows_5g = ap_chanim_stats_5g.splitlines() - print("From AP chanim: ap_chanim_stats_rows_5g {}".format(ap_chanim_stats_rows_5g)) + print( + "From AP chanim: ap_chanim_stats_rows_5g {}".format(ap_chanim_stats_rows_5g)) ap_stats_ul_5g_rows = ap_stats_ul_5g.splitlines() - print("From AP stats ul: ap_stats_ul_5g_rows {}".format(ap_stats_ul_5g_rows)) + print( + "From AP stats ul: ap_stats_ul_5g_rows {}".format(ap_stats_ul_5g_rows)) channel_utilization = 0 @@ -1130,131 +1315,212 @@ class L3VariableTime(Realm): port_eids = self.gather_port_eids() for eid_name in port_eids: eid = self.name_to_eid(eid_name) - url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) + url = "/port/%s/%s/%s" % (eid[0], + eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) - if (response is None) or ("interface" not in response): - print("query-port 5g: %s: incomplete response:" % (url)) + if (response is None) or ( + "interface" not in response): + print( + "query-port 5g: %s: incomplete response:" % + (url)) pprint(response) else: # print("response".format(response)) pprint(response) p = response['interface'] - print("#### From LANforge: p, response['insterface']:{}".format(p)) + print( + "#### From LANforge: p, response['insterface']:{}".format(p)) mac = p['mac'] - # print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) + # print("#### From LANforge: p['mac']: + # {mac}".format(mac=mac)) - # Parse the ap stats to find the matching mac then use that row for reporting + # Parse the ap stats to find the matching + # mac then use that row for reporting for row in ap_stats_5g_rows: split_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: - if split_row[0].lower() != mac.lower(): + if split_row[0].lower( + ) != mac.lower(): ap_row = split_row mac_found_5g = True else: try: # split_row[0].lower() , mac from AP - # mac.lower() , mac from LANforge - if split_row[0].lower() == mac.lower(): + # mac.lower() , mac from + # LANforge + if split_row[0].lower( + ) == mac.lower(): ap_row = split_row mac_found_5g = True except BaseException: - print("5g 'No stations are currently associated.'? from AP") - print("5g since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_5g == True: + print( + "5g 'No stations are currently associated.'? from AP") + print( + "5g since possibly no stations: excption on compare split_row[0].lower() ") + if mac_found_5g: mac_found_5g = False - print("5g selected ap_row (from split_row): {}".format(ap_row)) + print( + "5g selected ap_row (from split_row): {}".format(ap_row)) - # Find latency, jitter for connections using this port. + # Find latency, jitter for connections + # using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( p["port"], endps) - # now report the ap_chanim_stats along side of the ap_stats_5g + # now report the ap_chanim_stats along + # side of the ap_stats_5g xtop_reported = False for row in ap_chanim_stats_rows_5g: split_row = row.split() if xtop_reported: - print("xtop_reported 5g row: {row}".format(row=row)) - print("xtop_reported 5g split_row: {split_row}".format(split_row=split_row)) + print( + "xtop_reported 5g row: {row}".format( + row=row)) + print( + "xtop_reported 5g split_row: {split_row}".format( + split_row=split_row)) try: xtop = split_row[7] - print("5g xtop {xtop}".format(xtop=xtop)) + print( + "5g xtop {xtop}".format(xtop=xtop)) except BaseException: - print("5g detected chanspec with reading chanim_stats, exception reading xtop") + print( + "5g detected chanspec with reading chanim_stats, exception reading xtop") try: - channel_utilization = float(100) - float(xtop) - print("5g channel_utilization {utilization}".format(utilization=channel_utilization)) + channel_utilization = float( + 100) - float(xtop) + print( + "5g channel_utilization {utilization}".format( + utilization=channel_utilization)) except BaseException: - print("5g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") - # should be only one channel utilization + print( + "5g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") + # should be only one channel + # utilization break else: try: - if split_row[0].lower() == 'chanspec': - print("5g chanspec found xtop_reported = True") + if split_row[0].lower( + ) == 'chanspec': + print( + "5g chanspec found xtop_reported = True") xtop_reported = True except BaseException: - print("5g Error reading xtop") - # ap information is passed with ap_row so all information needs to be contained in ap_row + print( + "5g Error reading xtop") + # ap information is passed with ap_row + # so all information needs to be + # contained in ap_row ap_row.append(str(channel_utilization)) - print("5g channel_utilization {channel_utilization}".format(channel_utilization=channel_utilization)) - print("5g ap_row {ap_row}".format(ap_row=ap_row)) + print( + "5g channel_utilization {channel_utilization}".format( + channel_utilization=channel_utilization)) + print( + "5g ap_row {ap_row}".format( + ap_row=ap_row)) - self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + self.write_port_csv( + len(temp_stations_list), + ul, + dl, + ul_pdu_str, + dl_pdu_str, + atten_val, + eid_name, + p, + latency, + jitter, + total_ul_rate, + total_ul_rate_ll, + total_ul_pkts_ll, + total_dl_rate, + total_dl_rate_ll, + total_dl_pkts_ll, + ap_row) # work though the ul rx_data 5G for eid_name in port_eids: eid = self.name_to_eid(eid_name) - url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) + url = "/port/%s/%s/%s" % (eid[0], + eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) - if (response is None) or ("interface" not in response): - print("5g query-port: %s: incomplete response:" % (url)) + if (response is None) or ( + "interface" not in response): + print( + "5g query-port: %s: incomplete response:" % + (url)) pprint(response) else: # print("response".format(response)) pprint(response) p = response['interface'] - print("#### 5g From LANforge: p, response['insterface']:{}".format(p)) + print( + "#### 5g From LANforge: p, response['insterface']:{}".format(p)) mac = p['mac'] - # print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) + # print("#### From LANforge: p['mac']: + # {mac}".format(mac=mac)) - # Parse the ap stats to find the matching mac then use that row for reporting + # Parse the ap stats to find the matching + # mac then use that row for reporting for row in ap_stats_ul_5g_rows: split_ul_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: - if split_ul_row[0].lower() != mac.lower(): + if split_ul_row[0].lower( + ) != mac.lower(): ap_ul_row = split_ul_row mac_found_ul_5g = True else: try: # split_ul_row[0].lower() , mac from AP - # mac.lower() , mac from LANforge - if split_ul_row[0].lower() == mac.lower(): + # mac.lower() , mac from + # LANforge + if split_ul_row[0].lower( + ) == mac.lower(): ap_ul_row = split_ul_row mac_found_ul_5g = True except BaseException: - print("5g ul 'No stations are currently associated.'? from AP") - print("5g ul since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_ul_5g == True: + print( + "5g ul 'No stations are currently associated.'? from AP") + print( + "5g ul since possibly no stations: excption on compare split_row[0].lower() ") + if mac_found_ul_5g: mac_found_ul_5g = False - print("5g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) + print( + "5g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) - # Find latency, jitter for connections using this port. + # Find latency, jitter for connections + # using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( p["port"], endps) - print("5g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) - self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) + print( + "5g ap_ul_row {ap_ul_row}".format( + ap_ul_row=ap_ul_row)) + self.write_ul_port_csv( + len(temp_stations_list), + ul, + dl, + ul_pdu_str, + dl_pdu_str, + atten_val, + eid_name, + p, + latency, + jitter, + total_ul_rate, + total_ul_rate_ll, + total_ul_pkts_ll, + total_dl_rate, + total_dl_rate_ll, + total_dl_pkts_ll, + ap_ul_row) # 2g test mode if self.ap_test_mode: @@ -1269,165 +1535,269 @@ class L3VariableTime(Realm): ap_stats_ul_2g = self.read_ap_stats_ul_2g() ap_stats_2g_rows = ap_stats_2g.splitlines() - print("From AP stats: ap_stats_2g_rows {}".format(ap_stats_2g_rows)) + print( + "From AP stats: ap_stats_2g_rows {}".format(ap_stats_2g_rows)) ap_chanim_stats_rows_2g = ap_chanim_stats_2g.splitlines() - print("From AP chanim: ap_chanim_stats_rows_2g {}".format(ap_chanim_stats_rows_2g)) + print( + "From AP chanim: ap_chanim_stats_rows_2g {}".format(ap_chanim_stats_rows_2g)) ap_stats_ul_2g_rows = ap_stats_ul_2g.splitlines() - print("From AP stats ul: ap_stats_ul_2g_rows {}".format(ap_stats_ul_2g_rows)) + print( + "From AP stats ul: ap_stats_ul_2g_rows {}".format(ap_stats_ul_2g_rows)) channel_utilization = 0 # Query all of our ports - # Note: the endp eid is the shelf.resource.port.endp-id + # Note: the endp eid is the + # shelf.resource.port.endp-id port_eids = self.gather_port_eids() for eid_name in port_eids: eid = self.name_to_eid(eid_name) - url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) + url = "/port/%s/%s/%s" % (eid[0], + eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) - if (response is None) or ("interface" not in response): - print("2g query-port: %s: incomplete response:" % (url)) + if (response is None) or ( + "interface" not in response): + print( + "2g query-port: %s: incomplete response:" % + (url)) pprint(response) else: # print("response".format(response)) pprint(response) p = response['interface'] - # print("#### From LANforge: p, response['insterface']:{}".format(p)) + # print("#### From LANforge: p, + # response['insterface']:{}".format(p)) mac = p['mac'] - # print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) + # print("#### From LANforge: p['mac']: + # {mac}".format(mac=mac)) - # Parse the ap stats to find the matching mac then use that row for reporting + # Parse the ap stats to find the matching + # mac then use that row for reporting for row in ap_stats_2g_rows: split_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: - if split_row[0].lower() != mac.lower(): + if split_row[0].lower( + ) != mac.lower(): ap_row = split_row mac_found_2g = True else: try: # split_row[0].lower() , mac from AP - # mac.lower() , mac from LANforge - if split_row[0].lower() == mac.lower(): + # mac.lower() , mac from + # LANforge + if split_row[0].lower( + ) == mac.lower(): ap_row = split_row mac_found_2g = True except BaseException: - print("2g 'No stations are currently associated.'? from AP") - print("2g since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_2g == True: + print( + "2g 'No stations are currently associated.'? from AP") + print( + "2g since possibly no stations: excption on compare split_row[0].lower() ") + if mac_found_2g: mac_found_2g = False - print("2g selected ap_row (from split_row): {}".format(ap_row)) + print( + "2g selected ap_row (from split_row): {}".format(ap_row)) - # Find latency, jitter for connections using this port. + # Find latency, jitter for connections + # using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( p["port"], endps) - # now report the ap_chanim_stats along side of the ap_stats_2g + # now report the ap_chanim_stats along + # side of the ap_stats_2g xtop_reported = False for row in ap_chanim_stats_rows_2g: split_row = row.split() if xtop_reported: - print("2g xtop_reported row: {row}".format(row=row)) - print("2g xtop_reported split_row: {split_row}".format(split_row=split_row)) + print( + "2g xtop_reported row: {row}".format( + row=row)) + print( + "2g xtop_reported split_row: {split_row}".format( + split_row=split_row)) try: xtop = split_row[7] - print("2g xtop {xtop}".format(xtop=xtop)) + print( + "2g xtop {xtop}".format(xtop=xtop)) except BaseException: - print("2g detected chanspec with reading chanim_stats, exception reading xtop") + print( + "2g detected chanspec with reading chanim_stats, exception reading xtop") try: - channel_utilization = float(100) - float(xtop) - print("2g channel_utilization {utilization}".format(utilization=channel_utilization)) + channel_utilization = float( + 100) - float(xtop) + print( + "2g channel_utilization {utilization}".format( + utilization=channel_utilization)) except BaseException: - print("2g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") - # should be only one channel utilization + print( + "2g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") + # should be only one channel + # utilization break else: try: - if split_row[0].lower() == 'chanspec': - print("2g chanspec found xtop_reported = True") + if split_row[0].lower( + ) == 'chanspec': + print( + "2g chanspec found xtop_reported = True") xtop_reported = True except BaseException: - print("2g Error reading xtop") - # ap information is passed with ap_row so all information needs to be contained in ap_row + print( + "2g Error reading xtop") + # ap information is passed with ap_row + # so all information needs to be + # contained in ap_row ap_row.append(str(channel_utilization)) - print("2g channel_utilization {channel_utilization}".format(channel_utilization=channel_utilization)) - print("2g ap_row {ap_row}".format(ap_row=ap_row)) + print( + "2g channel_utilization {channel_utilization}".format( + channel_utilization=channel_utilization)) + print( + "2g ap_row {ap_row}".format( + ap_row=ap_row)) - self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + self.write_port_csv( + len(temp_stations_list), + ul, + dl, + ul_pdu_str, + dl_pdu_str, + atten_val, + eid_name, + p, + latency, + jitter, + total_ul_rate, + total_ul_rate_ll, + total_ul_pkts_ll, + total_dl_rate, + total_dl_rate_ll, + total_dl_pkts_ll, + ap_row) # work though the ul rx_data 5G for eid_name in port_eids: eid = self.name_to_eid(eid_name) - url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) + url = "/port/%s/%s/%s" % (eid[0], + eid[1], eid[2]) # read LANforge to get the mac response = self.json_get(url) - if (response is None) or ("interface" not in response): - print("5g query-port: %s: incomplete response:" % (url)) + if (response is None) or ( + "interface" not in response): + print( + "5g query-port: %s: incomplete response:" % + (url)) pprint(response) else: # print("response".format(response)) pprint(response) p = response['interface'] - print("#### 2g From LANforge: p, response['insterface']:{}".format(p)) + print( + "#### 2g From LANforge: p, response['insterface']:{}".format(p)) mac = p['mac'] - # print("#### From LANforge: p['mac']: {mac}".format(mac=mac)) + # print("#### From LANforge: p['mac']: + # {mac}".format(mac=mac)) - # Parse the ap stats to find the matching mac then use that row for reporting + # Parse the ap stats to find the matching + # mac then use that row for reporting for row in ap_stats_ul_2g_rows: split_ul_row = row.split() - #print("split_row {}".format(split_row)) - #print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) + # print("split_row {}".format(split_row)) + # print("split_row[0] {} mac {}".format(split_row[0].lower(),mac.lower())) if self.ap_test_mode: - if split_ul_row[0].lower() != mac.lower(): + if split_ul_row[0].lower( + ) != mac.lower(): ap_ul_row = split_ul_row mac_found_ul_2g = True else: try: # split_ul_row[0].lower() , mac from AP - # mac.lower() , mac from LANforge - if split_ul_row[0].lower() == mac.lower(): + # mac.lower() , mac from + # LANforge + if split_ul_row[0].lower( + ) == mac.lower(): ap_ul_row = split_ul_row mac_found_ul_2g = True except BaseException: - print("2g ul 'No stations are currently associated.'? from AP") - print("2g ul since possibly no stations: excption on compare split_row[0].lower() ") - if mac_found_ul_2g == True: + print( + "2g ul 'No stations are currently associated.'? from AP") + print( + "2g ul since possibly no stations: excption on compare split_row[0].lower() ") + if mac_found_ul_2g: mac_found_ul_2g = False - print("2g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) + print( + "2g ul selected ap_ul_row (from split_ul_row): {}".format(ap_ul_row)) - # Find latency, jitter for connections using this port. + # Find latency, jitter for connections + # using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( p["port"], endps) - print("2g ap_ul_row {ap_ul_row}".format(ap_ul_row=ap_ul_row)) - self.write_ul_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row) + print( + "2g ap_ul_row {ap_ul_row}".format( + ap_ul_row=ap_ul_row)) + self.write_ul_port_csv( + len(temp_stations_list), + ul, + dl, + ul_pdu_str, + dl_pdu_str, + atten_val, + eid_name, + p, + latency, + jitter, + total_ul_rate, + total_ul_rate_ll, + total_ul_pkts_ll, + total_dl_rate, + total_dl_rate_ll, + total_dl_pkts_ll, + ap_ul_row) else: # Query all of our ports - # Note: the endp eid is the shelf.resource.port.endp-id + # Note: the endp eid is the + # shelf.resource.port.endp-id port_eids = self.gather_port_eids() for eid_name in port_eids: eid = self.name_to_eid(eid_name) - url = "/port/%s/%s/%s" % (eid[0], eid[1], eid[2]) + url = "/port/%s/%s/%s" % (eid[0], + eid[1], eid[2]) response = self.json_get(url) - if (response is None) or ("interface" not in response): - print("query-port: %s: incomplete response:" % (url)) + if (response is None) or ( + "interface" not in response): + print( + "query-port: %s: incomplete response:" % (url)) pprint(response) else: p = response['interface'] latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( p["port"], endps) - self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row) + self.write_port_csv( + len(temp_stations_list), + ul, + dl, + ul_pdu_str, + dl_pdu_str, + atten_val, + eid_name, + p, + latency, + jitter, + total_ul_rate, + total_ul_rate_ll, + total_ul_pkts_ll, + total_dl_rate, + total_dl_rate_ll, + total_dl_pkts_ll, + ap_row) # At end of test step, record KPI into kpi.csv self.record_kpi_csv( @@ -1442,8 +1812,8 @@ class L3VariableTime(Realm): total_dl_ll_bps, total_ul_ll_bps) - - # At end of test step, record KPI information. This is different the kpi.csv + # At end of test step, record KPI information. This is + # different the kpi.csv self.record_kpi( len(temp_stations_list), ul, @@ -1456,32 +1826,42 @@ class L3VariableTime(Realm): total_dl_ll_bps, total_ul_ll_bps) - # At end of test if requested store upload and download stats + # At end of test if requested store upload and download + # stats if self.ap_scheduler_stats: # get the (UL) Upload 6g scheduler statistics - self.ap_6g_umsched += self.ap_custom_cmd('wl -i wl2 dump umsched') + self.ap_6g_umsched += self.ap_custom_cmd( + 'wl -i wl2 dump umsched') # get the (DL) Download 6g schduler staticstics - self.ap_6g_msched += self.ap_custom_cmd('wl -i wl2 dump msched') + self.ap_6g_msched += self.ap_custom_cmd( + 'wl -i wl2 dump msched') # get the (UL) Upload 5g scheduler statistics - self.ap_5g_umsched += self.ap_custom_cmd('wl -i wl1 dump umsched') + self.ap_5g_umsched += self.ap_custom_cmd( + 'wl -i wl1 dump umsched') # get the (DL) Download 5g schduler staticstics - self.ap_5g_msched += self.ap_custom_cmd('wl -i wl1 dump msched') + self.ap_5g_msched += self.ap_custom_cmd( + 'wl -i wl1 dump msched') # get the (UL) Upload 24g scheduler statistics - self.ap_24g_umsched += self.ap_custom_cmd('wl -i wl0 dump umsched') + self.ap_24g_umsched += self.ap_custom_cmd( + 'wl -i wl0 dump umsched') # get the (DL) Download 24g schduler staticstics - self.ap_24g_msched += self.ap_custom_cmd('wl -i wl0 dump msched') + self.ap_24g_msched += self.ap_custom_cmd( + 'wl -i wl0 dump msched') if self.ap_ofdma_stats: # provide OFDMA stats 6GHz - self.ap_ofdma_6g += self.ap_custom_cmd('wl -i wl2 muinfo -v') + self.ap_ofdma_6g += self.ap_custom_cmd( + 'wl -i wl2 muinfo -v') # provide OFDMA stats 5GHz - self.ap_ofdma_5g += self.ap_custom_cmd('wl -i wl1 muinfo -v') + self.ap_ofdma_5g += self.ap_custom_cmd( + 'wl -i wl1 muinfo -v') # provide OFDMA stats 2.4GHz - self.ap_ofdma_24g += self.ap_custom_cmd('wl -i wl0 muinfo -v') + self.ap_ofdma_24g += self.ap_custom_cmd( + 'wl -i wl0 muinfo -v') # Stop connections. self.cx_profile.stop_cx() @@ -1490,52 +1870,115 @@ class L3VariableTime(Realm): cur_time = datetime.datetime.now() if passes == expected_passes: - self._pass("PASS: Requested-Rate: %s <-> %s PDU: %s <-> %s All tests passed" % (ul, dl, ul_pdu, dl_pdu), print_pass) + self._pass( + "PASS: Requested-Rate: %s <-> %s PDU: %s <-> %s All tests passed" % + (ul, dl, ul_pdu, dl_pdu), print_pass) - def write_port_csv(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, eid_name, port_data, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row): + def write_port_csv( + self, + sta_count, + ul, + dl, + ul_pdu, + dl_pdu, + atten, + eid_name, + port_data, + latency, + jitter, + total_ul_rate, + total_ul_rate_ll, + total_ul_pkts_ll, + total_dl_rate, + total_dl_rate_ll, + total_dl_pkts_ll, + ap_row): row = [self.epoch_time, self.time_stamp(), sta_count, ul, ul, dl, dl, dl_pdu, dl_pdu, ul_pdu, ul_pdu, atten, eid_name ] - row = row + [port_data['bps rx'], port_data['bps tx'], port_data['rx-rate'], port_data['tx-rate'], - port_data['signal'], port_data['ap'], port_data['mode'], latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll] + row = row + [port_data['bps rx'], + port_data['bps tx'], + port_data['rx-rate'], + port_data['tx-rate'], + port_data['signal'], + port_data['ap'], + port_data['mode'], + latency, + jitter, + total_ul_rate, + total_ul_rate_ll, + total_ul_pkts_ll, + total_dl_rate, + total_dl_rate_ll, + total_dl_pkts_ll] - # Add in info queried from AP. - #print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) - #print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) + # Add in info queried from AP. + # print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) + # print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) if len(ap_row) == len(self.ap_stats_col_titles): - #print("ap_row {}".format(ap_row)) + # print("ap_row {}".format(ap_row)) for col in ap_row: - #print("col {}".format(col)) + # print("col {}".format(col)) row.append(col) writer = self.port_csv_writers[eid_name] writer.writerow(row) self.port_csv_files[eid_name].flush() - def write_ul_port_csv(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, eid_name, port_data, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, - total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_ul_row): + def write_ul_port_csv( + self, + sta_count, + ul, + dl, + ul_pdu, + dl_pdu, + atten, + eid_name, + port_data, + latency, + jitter, + total_ul_rate, + total_ul_rate_ll, + total_ul_pkts_ll, + total_dl_rate, + total_dl_rate_ll, + total_dl_pkts_ll, + ap_ul_row): row = [self.epoch_time, self.time_stamp(), sta_count, ul, ul, dl, dl, dl_pdu, dl_pdu, ul_pdu, ul_pdu, atten, eid_name ] - row = row + [port_data['bps rx'], port_data['bps tx'], port_data['rx-rate'], port_data['tx-rate'], - port_data['signal'], port_data['ap'], port_data['mode'], latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll] + row = row + [port_data['bps rx'], + port_data['bps tx'], + port_data['rx-rate'], + port_data['tx-rate'], + port_data['signal'], + port_data['ap'], + port_data['mode'], + latency, + jitter, + total_ul_rate, + total_ul_rate_ll, + total_ul_pkts_ll, + total_dl_rate, + total_dl_rate_ll, + total_dl_pkts_ll] - # Add in info queried from AP. - #print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) - #print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) + # Add in info queried from AP. + # print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles))) + # print("self.ap_stats_col_titles {} ap_stats_col_titles {}".format(self.ap_stats_col_titles,ap_stats_col_titles)) - print("ap_ul_row len {} ap_stats_ul_col_titles len {} ap_ul_row {}".format(len(ap_ul_row),len(self.ap_stats_ul_col_titles),ap_ul_row)) + print("ap_ul_row len {} ap_stats_ul_col_titles len {} ap_ul_row {}".format( + len(ap_ul_row), len(self.ap_stats_ul_col_titles), ap_ul_row)) if len(ap_ul_row) == len(self.ap_stats_ul_col_titles): print("ap_ul_row {}".format(ap_ul_row)) for col in ap_ul_row: print("col {}".format(col)) row.append(col) - + writer = self.ul_port_csv_writers[eid_name] writer.writerow(row) self.ul_port_csv_files[eid_name].flush() @@ -1546,58 +1989,88 @@ class L3VariableTime(Realm): 'test details','Units','Graph-Group','Subtest-Pass','Subtest-Fail'], ''' - def record_kpi_csv(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps): + def record_kpi_csv( + self, + sta_count, + ul, + dl, + ul_pdu, + dl_pdu, + atten, + total_dl_bps, + total_ul_bps, + total_dl_ll_bps, + total_ul_ll_bps): print("NOTE: Adding kpi to kpi.csv, sta_count {sta_count} total-download-bps:{total_dl_bps} upload: {total_ul_bps} bi-directional: {total}\n".format( - sta_count=sta_count,total_dl_bps=total_dl_bps, total_ul_bps=total_ul_bps, total=(total_ul_bps + total_dl_bps))) + sta_count=sta_count, total_dl_bps=total_dl_bps, total_ul_bps=total_ul_bps, total=(total_ul_bps + total_dl_bps))) print("NOTE: Adding kpi to kpi.csv, sta_count {sta_count} total-download-bps:{total_dl_ll_bps} upload: {total_ul_ll_bps} bi-directional: {total_ll}\n".format( - sta_count=sta_count,total_dl_ll_bps=total_dl_ll_bps, total_ul_ll_bps=total_ul_ll_bps, total_ll=(total_ul_ll_bps + total_dl_ll_bps))) + sta_count=sta_count, total_dl_ll_bps=total_dl_ll_bps, total_ul_ll_bps=total_ul_ll_bps, total_ll=(total_ul_ll_bps + total_dl_ll_bps))) - - # the short description will all for more data to show up in one test-tag graph + # the short description will all for more data to show up in one + # test-tag graph results_dict = self.kpi_csv.kpi_csv_get_dict_update_time() results_dict['Graph-Group'] = "Per Stations Rate DL" - results_dict['short-description'] = "DL {dl} bps pdu {dl_pdu} {sta_count} STA".format(dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) + results_dict['short-description'] = "DL {dl} bps pdu {dl_pdu} {sta_count} STA".format( + dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_dl_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL" - results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,sta_count=sta_count) + results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} {sta_count} STA".format( + ul=ul, ul_pdu=ul_pdu, sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_ul_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL+DL" - results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} + DL {dl} bps pud {dl_pdu}- {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) - results_dict['numeric-score'] = "{}".format((total_ul_bps + total_dl_bps)) + results_dict['short-description'] = "UL {ul} bps pdu {ul_pdu} + DL {dl} bps pud {dl_pdu}- {sta_count} STA".format( + ul=ul, ul_pdu=ul_pdu, dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) + results_dict['numeric-score'] = "{}".format( + (total_ul_bps + total_dl_bps)) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate DL" - results_dict['short-description'] = "DL LL {dl} bps pdu {dl_pdu} {sta_count} STA".format(dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) + results_dict['short-description'] = "DL LL {dl} bps pdu {dl_pdu} {sta_count} STA".format( + dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_dl_ll_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL" - results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,sta_count=sta_count) + results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} {sta_count} STA".format( + ul=ul, ul_pdu=ul_pdu, sta_count=sta_count) results_dict['numeric-score'] = "{}".format(total_ul_ll_bps) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) results_dict['Graph-Group'] = "Per Stations Rate UL+DL" - results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} + DL LL {dl} bps pud {dl_pdu}- {sta_count} STA".format(ul=ul,ul_pdu=ul_pdu,dl=dl,dl_pdu=dl_pdu,sta_count=sta_count) - results_dict['numeric-score'] = "{}".format((total_ul_ll_bps + total_dl_ll_bps)) + results_dict['short-description'] = "UL LL {ul} bps pdu {ul_pdu} + DL LL {dl} bps pud {dl_pdu}- {sta_count} STA".format( + ul=ul, ul_pdu=ul_pdu, dl=dl, dl_pdu=dl_pdu, sta_count=sta_count) + results_dict['numeric-score'] = "{}".format( + (total_ul_ll_bps + total_dl_ll_bps)) results_dict['Units'] = "bps" self.kpi_csv.kpi_csv_write_dict(results_dict) - # Submit data to the influx db if configured to do so. - # This is not the kpi.csv - def record_kpi(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps): + # This is not the kpi.csv + + def record_kpi( + self, + sta_count, + ul, + dl, + ul_pdu, + dl_pdu, + atten, + total_dl_bps, + total_ul_bps, + total_dl_ll_bps, + total_ul_ll_bps): tags = dict() tags['requested-ul-bps'] = ul @@ -1614,20 +2087,29 @@ class L3VariableTime(Realm): now = str(datetime.datetime.utcnow().isoformat()) - print("NOTE: Adding kpi to influx, total-download-bps: %s upload: %s bi-directional: %s\n" % - (total_dl_bps, total_ul_bps, (total_ul_bps + total_dl_bps))) + print( + "NOTE: Adding kpi to influx, total-download-bps: %s upload: %s bi-directional: %s\n" % + (total_dl_bps, total_ul_bps, (total_ul_bps + total_dl_bps))) if self.influxdb is not None: - self.influxdb.post_to_influx("total-download-bps", total_dl_bps, tags, now) - self.influxdb.post_to_influx("total-upload-bps", total_ul_bps, tags, now) - self.influxdb.post_to_influx("total-bi-directional-bps", total_ul_bps + total_dl_bps, tags, now) + self.influxdb.post_to_influx( + "total-download-bps", total_dl_bps, tags, now) + self.influxdb.post_to_influx( + "total-upload-bps", total_ul_bps, tags, now) + self.influxdb.post_to_influx( + "total-bi-directional-bps", + total_ul_bps + + total_dl_bps, + tags, + now) if self.csv_kpi_file: row = [self.epoch_time, self.time_stamp(), sta_count, ul, ul, dl, dl, dl_pdu, dl_pdu, ul_pdu, ul_pdu, atten, total_dl_bps, total_ul_bps, (total_ul_bps + total_dl_bps), - total_dl_ll_bps, total_ul_ll_bps, (total_ul_ll_bps + total_dl_ll_bps) + total_dl_ll_bps, total_ul_ll_bps, ( + total_ul_ll_bps + total_dl_ll_bps) ] # Add values for any user specified tags for k in self.user_tags: @@ -1652,20 +2134,52 @@ class L3VariableTime(Realm): station_profile.cleanup() def csv_generate_column_headers(self): - csv_rx_headers = ['Time epoch', 'Time', 'Monitor', - 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', - 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', - ] + csv_rx_headers = [ + 'Time epoch', + 'Time', + 'Monitor', + 'UL-Min-Requested', + 'UL-Max-Requested', + 'DL-Min-Requested', + 'DL-Max-Requested', + 'UL-Min-PDU', + 'UL-Max-PDU', + 'DL-Min-PDU', + 'DL-Max-PDU', + ] csv_rx_headers.append("average_rx_data_bytes") return csv_rx_headers def csv_generate_port_column_headers(self): - csv_rx_headers = ['Time epoch', 'Time', 'Station-Count', - 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', - 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', 'Attenuation', - 'Name', 'Rx-Bps', 'Tx-Bps', 'Rx-Link-Rate', 'Tx-Link-Rate', 'RSSI', 'AP', 'Mode', - 'Rx-Latency', 'Rx-Jitter', 'Ul-Rx-Goodput-bps', 'Ul-Rx-Rate-ll', 'Ul-Rx-Pkts-ll', 'Dl-Rx-Goodput-bps', 'Dl-Rx-Rate-ll', 'Dl-Rx-Pkts-ll' - ] + csv_rx_headers = [ + 'Time epoch', + 'Time', + 'Station-Count', + 'UL-Min-Requested', + 'UL-Max-Requested', + 'DL-Min-Requested', + 'DL-Max-Requested', + 'UL-Min-PDU', + 'UL-Max-PDU', + 'DL-Min-PDU', + 'DL-Max-PDU', + 'Attenuation', + 'Name', + 'Rx-Bps', + 'Tx-Bps', + 'Rx-Link-Rate', + 'Tx-Link-Rate', + 'RSSI', + 'AP', + 'Mode', + 'Rx-Latency', + 'Rx-Jitter', + 'Ul-Rx-Goodput-bps', + 'Ul-Rx-Rate-ll', + 'Ul-Rx-Pkts-ll', + 'Dl-Rx-Goodput-bps', + 'Dl-Rx-Rate-ll', + 'Dl-Rx-Pkts-ll'] # Add in columns we are going to query from the AP for col in self.ap_stats_col_titles: csv_rx_headers.append(col) @@ -1673,27 +2187,61 @@ class L3VariableTime(Realm): return csv_rx_headers def csv_generate_ul_port_column_headers(self): - csv_ul_rx_headers = ['Time epoch', 'Time', 'Station-Count', - 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', - 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', 'Attenuation', - 'Name', 'Rx-Bps', 'Tx-Bps', 'Rx-Link-Rate', 'Tx-Link-Rate', 'RSSI', 'AP', 'Mode', - 'Rx-Latency', 'Rx-Jitter', 'Ul-Rx-Goodput-bps', 'Ul-Rx-Rate-ll', 'Ul-Rx-Pkts-ll', 'Dl-Rx-Goodput-bps', 'Dl-Rx-Rate-ll', 'Dl-Rx-Pkts-ll' - ] + csv_ul_rx_headers = [ + 'Time epoch', + 'Time', + 'Station-Count', + 'UL-Min-Requested', + 'UL-Max-Requested', + 'DL-Min-Requested', + 'DL-Max-Requested', + 'UL-Min-PDU', + 'UL-Max-PDU', + 'DL-Min-PDU', + 'DL-Max-PDU', + 'Attenuation', + 'Name', + 'Rx-Bps', + 'Tx-Bps', + 'Rx-Link-Rate', + 'Tx-Link-Rate', + 'RSSI', + 'AP', + 'Mode', + 'Rx-Latency', + 'Rx-Jitter', + 'Ul-Rx-Goodput-bps', + 'Ul-Rx-Rate-ll', + 'Ul-Rx-Pkts-ll', + 'Dl-Rx-Goodput-bps', + 'Dl-Rx-Rate-ll', + 'Dl-Rx-Pkts-ll'] # Add in columns we are going to query from the AP for col in self.ap_stats_ul_col_titles: csv_ul_rx_headers.append(col) return csv_ul_rx_headers - - def csv_generate_kpi_column_headers(self): - csv_rx_headers = ['Time epoch', 'Time', 'Station-Count', - 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', 'DL-Max-Requested', - 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', 'Attenuation', - 'Total-Download-Bps', 'Total-Upload-Bps', 'Total-UL/DL-Bps', - 'Total-Download-LL-Bps', 'Total-Upload-LL-Bps', 'Total-UL/DL-LL-Bps' - ] + csv_rx_headers = [ + 'Time epoch', + 'Time', + 'Station-Count', + 'UL-Min-Requested', + 'UL-Max-Requested', + 'DL-Min-Requested', + 'DL-Max-Requested', + 'UL-Min-PDU', + 'UL-Max-PDU', + 'DL-Min-PDU', + 'DL-Max-PDU', + 'Attenuation', + 'Total-Download-Bps', + 'Total-Upload-Bps', + 'Total-UL/DL-Bps', + 'Total-Download-LL-Bps', + 'Total-Upload-LL-Bps', + 'Total-UL/DL-LL-Bps'] for k in self.user_tags: csv_rx_headers.append(k[0]) @@ -1702,7 +2250,8 @@ class L3VariableTime(Realm): # Write initial headers to csv file. def csv_add_column_headers(self, headers): if self.csv_kpi_file is not None: - self.csv_kpi_writer.writerow(self.csv_generate_kpi_column_headers()) + self.csv_kpi_writer.writerow( + self.csv_generate_kpi_column_headers()) self.csv_kpi_file.flush() # Write initial headers to port csv file. @@ -1730,10 +2279,10 @@ class L3VariableTime(Realm): ul_port_csv_writer.writerow(headers) pfile.flush() - def csv_validate_list(self, csv_list, length): if len(csv_list) < length: - csv_list = csv_list + [('no data', 'no data')] * (length - len(csv_list)) + csv_list = csv_list + [('no data', 'no data')] * \ + (length - len(csv_list)) return csv_list def csv_add_row(self, row, writer, csv_file): @@ -1749,9 +2298,18 @@ class L3VariableTime(Realm): def valid_endp_types(_endp_type): etypes = _endp_type.split(',') for endp_type in etypes: - valid_endp_type = ['lf', 'lf_udp', 'lf_udp6', 'lf_tcp', 'lf_tcp6', 'mc_udp', 'mc_udp6'] + valid_endp_type = [ + 'lf', + 'lf_udp', + 'lf_udp6', + 'lf_tcp', + 'lf_tcp6', + 'mc_udp', + 'mc_udp6'] if not (str(endp_type) in valid_endp_type): - print('invalid endp_type: %s. Valid types lf, lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6' % endp_type) + print( + 'invalid endp_type: %s. Valid types lf, lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6' % + endp_type) exit(1) return _endp_type @@ -1852,9 +2410,10 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m --radio "radio==wiphy1 stations==64 ssid==candelaTech-wpa2-x2048-5-3 ssid_pw==candelaTech-wpa2-x2048-5-3 security==wpa2" Setting wifi_settings per radio -./test_l3_longevity.py --lfmgr 192.168.100.116 --local_lf_report_dir /home/lanforge/html-reports/ --test_duration 15s ---polling_interval 5s --upstream_port eth2 ---radio "radio==wiphy1 stations==4 ssid==asus11ax-5 ssid_pw==hello123 security==wpa2 mode==0 wifi_settings==wifi_settings enable_flags==('ht160_enable'|'wpa2_enable'|'80211u_enable'|'create_admin_down'|'ht160_enable') " +./test_l3_longevity.py --lfmgr 192.168.100.116 --local_lf_report_dir /home/lanforge/html-reports/ --test_duration 15s +--polling_interval 5s --upstream_port eth2 +--radio "radio==wiphy1 stations==4 ssid==asus11ax-5 ssid_pw==hello123 security==wpa2 mode==0 wifi_settings==wifi_settings + enable_flags==('ht160_enable'|'wpa2_enable'|'80211u_enable'|'create_admin_down'|'ht160_enable') " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --test_rig CT-US-001 --test_tag 'l3_longevity' wifi_mode @@ -1924,13 +2483,34 @@ Setting wifi_settings per radio '--local_lf_report_dir', help='--local_lf_report_dir override the report path, primary use when running test in test suite', default="") - parser.add_argument("--test_rig", default="", help="test rig for kpi.csv, testbed that the tests are run on") - parser.add_argument("--test_tag", default="", help="test tag for kpi.csv, test specific information to differenciate the test") - parser.add_argument("--dut_hw_version", default="", help="dut hw version for kpi.csv, hardware version of the device under test") - parser.add_argument("--dut_sw_version", default="", help="dut sw version for kpi.csv, software version of the device under test") - parser.add_argument("--dut_model_num", default="", help="dut model for kpi.csv, model number / name of the device under test") - parser.add_argument("--test_priority", default="", help="dut model for kpi.csv, test-priority is arbitrary number") - parser.add_argument("--test_id", default="l3 Longevity", help="test-id for kpi.csv, script or test name") + parser.add_argument( + "--test_rig", + default="", + help="test rig for kpi.csv, testbed that the tests are run on") + parser.add_argument( + "--test_tag", + default="", + help="test tag for kpi.csv, test specific information to differenciate the test") + parser.add_argument( + "--dut_hw_version", + default="", + help="dut hw version for kpi.csv, hardware version of the device under test") + parser.add_argument( + "--dut_sw_version", + default="", + help="dut sw version for kpi.csv, software version of the device under test") + parser.add_argument( + "--dut_model_num", + default="", + help="dut model for kpi.csv, model number / name of the device under test") + parser.add_argument( + "--test_priority", + default="", + help="dut model for kpi.csv, test-priority is arbitrary number") + parser.add_argument( + "--test_id", + default="l3 Longevity", + help="test-id for kpi.csv, script or test name") ''' Other values that are included in the kpi.csv row. short-description : short description of the test @@ -1941,46 +2521,131 @@ Setting wifi_settings per radio Graph-Group - For the lf_qa.py dashboard ''' - parser.add_argument('-o', '--csv_outfile', help="--csv_outfile ", default="") + parser.add_argument( + '-o', + '--csv_outfile', + help="--csv_outfile ", + default="") - parser.add_argument('--tty', help='--tty \"/dev/ttyUSB2\" the serial interface to the AP', default="") - parser.add_argument('--baud', help='--baud \"9600\" AP baud rate for the serial interface', default="9600") - parser.add_argument('--mgr','--lfmgr', dest='lfmgr', help='--lfmgr ', default='localhost') + parser.add_argument( + '--tty', + help='--tty \"/dev/ttyUSB2\" the serial interface to the AP', + default="") + parser.add_argument( + '--baud', + help='--baud \"9600\" AP baud rate for the serial interface', + default="9600") + parser.add_argument( + '--mgr', + '--lfmgr', + dest='lfmgr', + help='--lfmgr ', + default='localhost') parser.add_argument( '--test_duration', help='--test_duration example --time 5d (5 days) default: 3m options: number followed by d, h, m or s', default='3m') - parser.add_argument('--tos', help='--tos: Support different ToS settings: BK | BE | VI | VO | numeric', default="BE") - parser.add_argument('--debug', help='--debug flag present debug on enable debugging', action='store_true') - 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('--downstream_port', help='--downstream_port example: --downstream_port eth2') - parser.add_argument('--polling_interval', help="--polling_interval ", default='60s') + parser.add_argument( + '--tos', + help='--tos: Support different ToS settings: BK | BE | VI | VO | numeric', + default="BE") + parser.add_argument( + '--debug', + help='--debug flag present debug on enable debugging', + action='store_true') + 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( + '--downstream_port', + help='--downstream_port example: --downstream_port eth2') + parser.add_argument( + '--polling_interval', + help="--polling_interval ", + default='60s') - parser.add_argument('-r', '--radio', action='append', nargs=1, help='--radio\ - "radio== ssid== ssid_pw== security==\ - wifi_settings==True,wifi_mode==,enable_flags==\ - reset_port_enable==True,reset_port_time_min==s,reset_port_time_max==s" ') - - parser.add_argument('--ap_read', help='--ap_read flag present enable reading ap', action='store_true') - parser.add_argument('--ap_port', help='--ap_port \'/dev/ttyUSB0\'', default='/dev/ttyUSB0') - parser.add_argument('--ap_baud', help='--ap_baud \'115200\'', default='115200') - # note wl2 is the 6G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection (default may be eth8) - parser.add_argument('--ap_cmd_6g', help='ap_cmd_6g \'wl -i wl2 bs_data\'', default="wl -i wl2 bs_data") - # note wl1 is the 5G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection (default may be eth7) - parser.add_argument('--ap_cmd_5g', help='ap_cmd_5g \'wl -i wl1 bs_data\'', default="wl -i wl1 bs_data") - # note wl1 is the 2.4G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection (default may be eth6) - parser.add_argument('--ap_cmd_2g', help='ap_cmd_2g \'wl -i wl0 bs_data\'', default="wl -i wl0 bs_data") - # note wl2 is the 6G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection (default may be eth8) - parser.add_argument('--ap_cmd_ul_6g', help='ap_cmd_ul_6g \'wl -i wl2 rx_report\'', default="wl -i wl2 rx_report") - # note wl1 is the 5G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection (default may be eth7) - parser.add_argument('--ap_cmd_ul_5g', help='ap_cmd_ul_5g \'wl -i wl1 rx_report\'', default="wl -i wl1 rx_report") - # note wl1 is the 2.4G interface , check the MAC ifconfig -a of the interface to the AP BSSID connection (default may be eth6) - parser.add_argument('--ap_cmd_ul_2g', help='ap_cmd_ul_2g \'wl -i wl0 rx_report\'', default="wl -i wl0 rx_report") - parser.add_argument('--ap_chanim_cmd_6g', help='ap_chanim_cmd_6g \'wl -i wl2 chanim_stats\'', default="wl -i wl2 chanim_stats") - parser.add_argument('--ap_chanim_cmd_5g', help='ap_chanim_cmd_5g \'wl -i wl1 chanim_stats\'', default="wl -i wl1 chanim_stats") - parser.add_argument('--ap_chanim_cmd_2g', help='ap_chanim_cmd_2g \'w1 -i wl0 chanim_stats\'', default="wl -i wl0 chanim_stats") + parser.add_argument( + '-r', '--radio', + action='append', + nargs=1, + help=(' --radio' + ' "radio==' + ' ssid== ssid_pw== security== ' + ' wifi_settings==True wifi_mode==' + ' enable_flags== ' + ' reset_port_enable==True reset_port_time_min==s' + ' reset_port_time_max==s" ') + ) + parser.add_argument( + '--ap_read', + help='--ap_read flag present enable reading ap', + action='store_true') + parser.add_argument( + '--ap_port', + help='--ap_port \'/dev/ttyUSB0\'', + default='/dev/ttyUSB0') + parser.add_argument( + '--ap_baud', + help='--ap_baud \'115200\'', + default='115200') + # note wl2 is the 6G interface , check the MAC ifconfig -a of the + # interface to the AP BSSID connection (default may be eth8) + parser.add_argument( + '--ap_cmd_6g', + help='ap_cmd_6g \'wl -i wl2 bs_data\'', + default="wl -i wl2 bs_data") + # note wl1 is the 5G interface , check the MAC ifconfig -a of the + # interface to the AP BSSID connection (default may be eth7) + parser.add_argument( + '--ap_cmd_5g', + help='ap_cmd_5g \'wl -i wl1 bs_data\'', + default="wl -i wl1 bs_data") + # note wl1 is the 2.4G interface , check the MAC ifconfig -a of the + # interface to the AP BSSID connection (default may be eth6) + parser.add_argument( + '--ap_cmd_2g', + help='ap_cmd_2g \'wl -i wl0 bs_data\'', + default="wl -i wl0 bs_data") + # note wl2 is the 6G interface , check the MAC ifconfig -a of the + # interface to the AP BSSID connection (default may be eth8) + parser.add_argument( + '--ap_cmd_ul_6g', + help='ap_cmd_ul_6g \'wl -i wl2 rx_report\'', + default="wl -i wl2 rx_report") + # note wl1 is the 5G interface , check the MAC ifconfig -a of the + # interface to the AP BSSID connection (default may be eth7) + parser.add_argument( + '--ap_cmd_ul_5g', + help='ap_cmd_ul_5g \'wl -i wl1 rx_report\'', + default="wl -i wl1 rx_report") + # note wl1 is the 2.4G interface , check the MAC ifconfig -a of the + # interface to the AP BSSID connection (default may be eth6) + parser.add_argument( + '--ap_cmd_ul_2g', + help='ap_cmd_ul_2g \'wl -i wl0 rx_report\'', + default="wl -i wl0 rx_report") + parser.add_argument( + '--ap_chanim_cmd_6g', + help='ap_chanim_cmd_6g \'wl -i wl2 chanim_stats\'', + default="wl -i wl2 chanim_stats") + parser.add_argument( + '--ap_chanim_cmd_5g', + help='ap_chanim_cmd_5g \'wl -i wl1 chanim_stats\'', + default="wl -i wl1 chanim_stats") + parser.add_argument( + '--ap_chanim_cmd_2g', + help='ap_chanim_cmd_2g \'w1 -i wl0 chanim_stats\'', + default="wl -i wl0 chanim_stats") parser.add_argument( '--ap_scheduler_stats', help='--ap_scheduler_stats flag to clear stats run test then dump ul and dl stats to file', @@ -1990,35 +2655,64 @@ Setting wifi_settings per radio help='--ap_ofdma_stats flag to clear stats run test then dumps wl -i wl1 muinfo -v and wl 0i wl0 muinof -v to file', action='store_true') - parser.add_argument('--ap_test_mode', help='ap_test_mode flag present use ap canned data', action='store_true') + parser.add_argument( + '--ap_test_mode', + help='ap_test_mode flag present use ap canned data', + action='store_true') - parser.add_argument('-amr', '--side_a_min_bps', - help='--side_a_min_bps, requested downstream min tx rate, comma separated list for multiple iterations. Default 256k', default="256000") - parser.add_argument('-amp', '--side_a_min_pdu', - help='--side_a_min_pdu, downstream pdu size, comma separated list for multiple iterations. Default MTU', default="MTU") - parser.add_argument('-bmr', '--side_b_min_bps', - help='--side_b_min_bps, requested upstream min tx rate, comma separated list for multiple iterations. Default 256000', default="256000") - parser.add_argument('-bmp', '--side_b_min_pdu', - help='--side_b_min_pdu, upstream pdu size, comma separated list for multiple iterations. Default MTU', default="MTU") - parser.add_argument("--rates_are_totals", default=False, - help="Treat configured rates as totals instead of using the un-modified rate for every connection.", action='store_true') - parser.add_argument("--multiconn", default=1, - help="Configure multi-conn setting for endpoints. Default is 1 (auto-helper is enabled by default as well).") + parser.add_argument( + '-amr', + '--side_a_min_bps', + help='--side_a_min_bps, requested downstream min tx rate, comma separated list for multiple iterations. Default 256k', + default="256000") + parser.add_argument( + '-amp', + '--side_a_min_pdu', + help='--side_a_min_pdu, downstream pdu size, comma separated list for multiple iterations. Default MTU', + default="MTU") + parser.add_argument( + '-bmr', + '--side_b_min_bps', + help='--side_b_min_bps, requested upstream min tx rate, comma separated list for multiple iterations. Default 256000', + default="256000") + parser.add_argument( + '-bmp', + '--side_b_min_pdu', + help='--side_b_min_pdu, upstream pdu size, comma separated list for multiple iterations. Default MTU', + default="MTU") + parser.add_argument( + "--rates_are_totals", + default=False, + help="Treat configured rates as totals instead of using the un-modified rate for every connection.", + action='store_true') + parser.add_argument( + "--multiconn", + default=1, + help="Configure multi-conn setting for endpoints. Default is 1 (auto-helper is enabled by default as well).") parser.add_argument( '--attenuators', help='--attenuators, comma separated list of attenuator module eids: shelf.resource.atten-serno.atten-idx', default="") - parser.add_argument('--atten_vals', help='--atten_vals, comma separated list of attenuator settings in ddb units (1/10 of db)', default="") + parser.add_argument( + '--atten_vals', + help='--atten_vals, comma separated list of attenuator settings in ddb units (1/10 of db)', + default="") influx_add_parser_args(parser) - parser.add_argument("--cap_ctl_out", help="--cap_ctl_out, switch the controller output will be captured", action='store_true') - parser.add_argument("--wait", help="--wait
${CURR_TEST_NAME}${i} Failure${execution} STDOUT STDERR
${CURR_TEST_NAME}${i} Success${execution} STDOUT
Command Name Command StatusExecution time STDOUT STDERR
${CURR_TEST_NAME}${i}
${CURR_TEST_NAME}${testcommand} Failure ${execution} STDOUT STDERR
${CURR_TEST_NAME}${i}
${CURR_TEST_NAME}${testcommand} Success ${execution} STDOUT
- - - - - - + + + + + + " tail="" diff --git a/py-scripts/sortabletable.js b/py-scripts/sortabletable.js index e69de29b..7f8aa8d7 100644 --- a/py-scripts/sortabletable.js +++ b/py-scripts/sortabletable.js @@ -0,0 +1,41 @@ +function sortTable(tableID, n) { +var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0; + +table = document.getElementById(tableID); +switching = true; +dir = "asc"; +while (switching) { + switching = false; + rows = table.getElementsByTagName("TR"); + for (i = 1; i < (rows.length - 1); i++) { + shouldSwitch = false; + x = rows[i].getElementsByTagName("TD")[n]; + y = rows[i + 1].getElementsByTagName("TD")[n]; + var cmpX=isNaN(parseInt(x.innerHTML))?x.innerHTML.toLowerCase():parseInt(x.innerHTML); + var cmpY=isNaN(parseInt(y.innerHTML))?y.innerHTML.toLowerCase():parseInt(y.innerHTML); +cmpX=(cmpX=='-')?0:cmpX; +cmpY=(cmpY=='-')?0:cmpY; + if (dir == "asc") { + if (cmpX > cmpY) { + shouldSwitch= true; + break; + } + } else if (dir == "desc") { + if (cmpX < cmpY) { + shouldSwitch= true; + break; + } + } + } + if (shouldSwitch) { + rows[i].parentNode.insertBefore(rows[i + 1], rows[i]); + switching = true; + switchcount ++; + } else { + if (switchcount == 0 && dir == "asc") { + dir = "desc"; + switching = true; + } + } +} +} \ No newline at end of file From c10a2ec2cf293968e5e97ed2eb342d92e58475d1 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 11 Nov 2021 18:18:39 -0700 Subject: [PATCH 316/731] ct_us_001_scripts.json : script regression updates Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 139 ++++++++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index fdddccdd..25d6c8d3 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -65,7 +65,146 @@ " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USEDD,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --local_lf_report_dir REPORT_PATH"]} }, + "suite_test":{ + "create_l3_stations":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"create_l3_stations.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP ", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + ] + }, + "create_l4":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"create_l4.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP ", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + ] + }, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + }, "suite_daily":{ + "lf_help_check":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"lf_help_check.bash", + "args":"", + "args_list":[ + " " + ] + }, + "create_l3_stations":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"create_l3_stations.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP ", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + ] + }, + "create_l4":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"create_l4.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP ", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + ] + }, + "create_chamberview_dut_ATH10K_9984__wc":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" + ] + }, + "create_chamberview_ATH10K_9984__wc":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ATH10K_9984__wc ", + " --raw_line \"profile_link 1.1 STA-AUTO 32 'DUT: USE_DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" + ] + }, + "wifi_capacity_ATH10K_9984_":{ + "enabled":"TRUE", + "timeout":"600", + "iterations":"1", + "load_db":"skip", + "command":"lf_wifi_capacity_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__wc", + " --upstream 1.1.eth2 --batch_size 1,5,25,32 --loop_iter 1 --protocol UDP-IPv4 --duration 6000", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_'", + " --test_rig TEST_RIG ", + " --set DUT_SET_NAME" + ] + }, + "create_chamberview_dut_ATH10K_9984__dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" + ] + }, + "create_chamberview_ATH10K_9984__dp":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ATH10K_9984__dp", + " --raw_line \"profile_link 1.1 STA-AC 1 'DUT: USE_DUT_NAME Radio-2' NA wiphy1,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" + ] + }, + "dataplane_ATH10K_9984_":{ + "enabled":"TRUE", + "load_db":"skip", + "timeout":"600", + "iterations":"1", + "command":"lf_dataplane_test.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name ATH10K_9984__dp", + " --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.wlan1", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;Custom' ", + " --raw_line 'cust_pkt_sz: 88;256;512;768;1024;MTU' ", + " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: AUTO'", + " --raw_line 'spatial_streams: AUTO' --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'ATH10K_9984_' ", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "test_l3_longevity":{ "enabled":"TRUE", "load_db":"NONE", From dd80666057903ace67711e104c0dd505fda842f6 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 11 Nov 2021 20:37:22 -0700 Subject: [PATCH 317/731] ct_us_001_scripts.json updated for testing individual scripts updated layer3_test.py to accept the correct parameters Signed-off-by: Chuck SmileyRekiere --- py-scripts/layer3_test.py | 9 ++++- py-scripts/tools/ct_us_001_scripts.json | 50 ++++++++++++------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/py-scripts/layer3_test.py b/py-scripts/layer3_test.py index 89df5101..a6913a7a 100755 --- a/py-scripts/layer3_test.py +++ b/py-scripts/layer3_test.py @@ -21,7 +21,7 @@ Realm = realm.Realm class Layer3Test(Realm): def __init__(self, lfclient_host="localhost", lfclient_port=8080, radio="wiphy1", sta_prefix="sta", start_id=0, num_sta=2, - dut_ssid="lexusdut", dut_security="open", dut_passwd="[BLANK]", upstream="eth1", name_prefix="L3Test", + dut_ssid="lexusdut", dut_security="open", dut_passwd="[BLANK]", upstream="1.1.eth1", name_prefix="L3Test", traffic_type="lf_udp", side_a_min_rate=256000, side_a_max_rate=0, side_b_min_rate=256000, side_b_max_rate=0, @@ -137,7 +137,11 @@ class Layer3Test(Realm): pass def main(): - # This has --mgr, --mgr_port and --debug + # Realm.create_basic_argparse defined in + # /py-json/LANforge/lfcli_base.py + # args --mgr --mgr_port --upstream_port --num_stations --test_id + # --debug --proxy --debugging --debug_log + # --radio --security --ssid --passwd parser = Realm.create_basic_argparse( prog="layer3_test.py", formatter_class=argparse.RawTextHelpFormatter, @@ -157,6 +161,7 @@ def main(): obj = Layer3Test(lfclient_host=args.mgr, lfclient_port=args.mgr_port, duration=args.test_duration, session_id=args.session_id, traffic_type=args.traffic_type, + upstream=args.upstream_port, dut_ssid=args.ssid, dut_passwd=args.passwd, dut_security=args.security, num_sta=args.num_client, side_a_min_rate=args.side_a_min_speed, side_b_min_rate=args.side_b_min_speed, radio=args.radio,_debug_on=args.debug) obj.precleanup() diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 25d6c8d3..d6aaf925 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -66,21 +66,31 @@ " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --local_lf_report_dir REPORT_PATH"]} }, "suite_test":{ - "create_l3_stations":{ + "lf_cleanup":{ "enabled":"TRUE", "load_db":"NONE", - "command":"create_l3_stations.py", + "command":"lf_cleanup.py", "args":"", - "args_list":[" --mgr LF_MGR_IP ", + "args_list":["--mgr LF_MGR_IP --cxs --sta" + ] + }, + "layer3_test":{ + "enabled":"TRUE", + "load_db":"NONE", + "timeout":"60", + "command":"layer3_test.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP --upstream_port UPSTREAM_PORT", " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " ] }, - "create_l4":{ + "layer4_test":{ "enabled":"TRUE", "load_db":"NONE", - "command":"create_l4.py", + "timeout":"60", + "command":"layer4_test.py", "args":"", - "args_list":[" --mgr LF_MGR_IP ", + "args_list":[" --mgr LF_MGR_IP --upstream_port UPSTREAM_PORT", " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " ] }, @@ -105,24 +115,6 @@ " " ] }, - "create_l3_stations":{ - "enabled":"TRUE", - "load_db":"NONE", - "command":"create_l3_stations.py", - "args":"", - "args_list":[" --mgr LF_MGR_IP ", - " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " - ] - }, - "create_l4":{ - "enabled":"TRUE", - "load_db":"NONE", - "command":"create_l4.py", - "args":"", - "args_list":[" --mgr LF_MGR_IP ", - " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " - ] - }, "create_chamberview_dut_ATH10K_9984__wc":{ "enabled":"TRUE", "load_db":"skip", @@ -204,7 +196,6 @@ " --set DUT_SET_NAME" ] }, - "test_l3_longevity":{ "enabled":"TRUE", "load_db":"NONE", @@ -374,6 +365,15 @@ "command":"create_l4.py", "args":"", "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, + "create_l3_stations":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"create_l3_stations.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP ", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + ] + }, "create_macvlan":{ "enabled":"TRUE", "command":"create_macvlan.py", From 7ab916ed02155f71267874dc3a7c8009ba118c00 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 11 Nov 2021 20:40:39 -0700 Subject: [PATCH 318/731] layer3_test.py , layer4_test.py moved to sandbox until updated Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => sandbox}/layer3_test.py | 3 +++ py-scripts/{ => sandbox}/layer4_test.py | 4 ++++ 2 files changed, 7 insertions(+) rename py-scripts/{ => sandbox}/layer3_test.py (99%) rename py-scripts/{ => sandbox}/layer4_test.py (99%) diff --git a/py-scripts/layer3_test.py b/py-scripts/sandbox/layer3_test.py similarity index 99% rename from py-scripts/layer3_test.py rename to py-scripts/sandbox/layer3_test.py index a6913a7a..d870da80 100755 --- a/py-scripts/layer3_test.py +++ b/py-scripts/sandbox/layer3_test.py @@ -1,4 +1,7 @@ #!/usr/bin/env python3 + +# script moved to sandbox 11/11/2021 - needs updates + import sys import os import importlib diff --git a/py-scripts/layer4_test.py b/py-scripts/sandbox/layer4_test.py similarity index 99% rename from py-scripts/layer4_test.py rename to py-scripts/sandbox/layer4_test.py index 6507ef2a..a35593e3 100755 --- a/py-scripts/layer4_test.py +++ b/py-scripts/sandbox/layer4_test.py @@ -5,7 +5,11 @@ Candela Technologies Inc. Info : Standard Script for Layer 4 Testing Date : Author : Shivam Thakur + + """ + +# script moved to sandbox 11/11/2021 needs work import sys import os import importlib From 54170fffe79ac45326762e4395d4a32da898d287 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 12 Nov 2021 07:18:15 -0700 Subject: [PATCH 319/731] lf_graph.py , lf_report_test.py : updated for --mgr and --lfmgr updated so help will be show with --help Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_graph.py | 43 +++++++++++++++++++++++++++++++++--- py-scripts/lf_report_test.py | 29 +++++++++++++++++++----- 2 files changed, 64 insertions(+), 8 deletions(-) diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index 9704c305..aef088e5 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -24,7 +24,7 @@ import matplotlib.pyplot as plt import numpy as np import pdfkit from matplotlib.colors import ListedColormap - +import argparse sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) @@ -412,8 +412,40 @@ class lf_line_graph(): print("{}.csv".format(self.graph_image_name)) return "%s.png" % self.graph_image_name -# Unit Test -if __name__ == "__main__": +def main(): + # arguments + parser = argparse.ArgumentParser( + prog='lf_graph.py', + formatter_class=argparse.RawTextHelpFormatter, + epilog='''\ + lf_graph.py : unit test in lf_graph.py for exersizing the lf_graph.py library + ''', + description='''\ +----------------- +NAME: lf_graph.py + +PURPOSE: +Common Library for generating graphs for LANforge output + +SETUP: +/lanforge/html-reports directory needs to be present or output generated in local file + +EXAMPLE: +see: /py-scritps/lf_report_test.py for example + +COPYWRITE + Copyright 2021 Candela Technologies Inc + License: Free to distribute and modify. LANforge systems must be licensed. + +INCLUDE_IN_README +--------------------- + ''') + parser.add_argument('--mgr','--lfmgr', dest='lfmgr', help='sample argument: where LANforge GUI is running', default='localhost') + # the args parser is not really used , this is so the report is not generated when testing + # the imports with --help + args = parser.parse_args() + print("LANforge manager {lfmgr}".format(lfmgr=args.lfmgr)) + output_html_1 = "graph_1.html" output_pdf_1 = "graph_1.pdf" @@ -467,3 +499,8 @@ if __name__ == "__main__": # sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb options = {"enable-local-file-access": None} # prevent eerror Blocked access to file pdfkit.from_file(output_html_2, output_pdf_2, options=options) + +# Unit Test +if __name__ == "__main__": + main() + diff --git a/py-scripts/lf_report_test.py b/py-scripts/lf_report_test.py index 15c1b597..831fe400 100755 --- a/py-scripts/lf_report_test.py +++ b/py-scripts/lf_report_test.py @@ -39,16 +39,33 @@ lf_scatter_graph = lf_graph.lf_scatter_graph lf_stacked_graph = lf_graph.lf_stacked_graph lf_horizontal_stacked_graph = lf_graph.lf_horizontal_stacked_graph - # Unit Test -if __name__ == "__main__": +def main(): # Testing: generate data frame - parser = argparse.ArgumentParser( prog="lf_report_test.py", formatter_class=argparse.RawTextHelpFormatter, - description="Tests reporting library") - parser.add_argument('--lfmgr', help='sample argument: where LANforge GUI is running', default='localhost') + description='''\ +----------------- +NAME: lf_report_test.py + +PURPOSE: +Common file for testing lf_report and lf_graph Library generates html and pdf output + +SETUP: +/lanforge/html-reports directory needs to be present or output generated in local file + +EXAMPLE: +./lf_report_test.py : currently script does not accept input + +COPYWRITE + Copyright 2021 Candela Technologies Inc + License: Free to distribute and modify. LANforge systems must be licensed. + +INCLUDE_IN_README +''') + + parser.add_argument('--mgr','--lfmgr', dest='lfmgr', help='sample argument: where LANforge GUI is running', default='localhost') # the args parser is not really used , this is so the report is not generated when testing # the imports with --help args = parser.parse_args() @@ -227,3 +244,5 @@ if __name__ == "__main__": # report.write_pdf(_page_size = 'Legal', _orientation='Portrait') # report.generate_report() +if __name__ == "__main__": + main() From 58c7613d874f7fb7b31be7d725db8a111218634f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 12 Nov 2021 07:21:44 -0700 Subject: [PATCH 320/731] lf_graph.py lf_report_test.py : pep8 complience Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_graph.py | 134 +++++++++++++++++++++++++++-------- py-scripts/lf_report_test.py | 49 +++++++------ 2 files changed, 133 insertions(+), 50 deletions(-) diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index aef088e5..139c08d5 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -25,15 +25,18 @@ import numpy as np import pdfkit from matplotlib.colors import ListedColormap import argparse - + sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lf_csv = importlib.import_module("py-scripts.lf_csv") lf_csv = lf_csv.lf_csv -# internal candela references included during intial phases, to be deleted at future date +# internal candela references included during intial phases, to be deleted +# at future date # graph reporting classes + + class lf_bar_graph(): def __init__(self, _data_set=[[30.4, 55.3, 69.2, 37.1], [45.1, 67.2, 34.3, 22.4], [22.5, 45.6, 12.7, 34.8]], _xaxis_name="x-axis", @@ -52,11 +55,11 @@ class lf_bar_graph(): _figsize=(10, 5), _show_bar_value=False, _xaxis_step=1, - _xticks_font = None, - _xaxis_value_location = 0, + _xticks_font=None, + _xaxis_value_location=0, _text_font=None, _text_rotation=None, - _grp_title = "", + _grp_title="", _legend_handles=None, _legend_loc="best", _legend_box=None, @@ -132,11 +135,19 @@ class lf_bar_graph(): plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15) plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15) if self.xaxis_categories[0] == 0: - plt.xticks(np.arange(0, len(self.xaxis_categories), step=self.xaxis_step),fontsize = self.xticks_font) + plt.xticks(np.arange(0, + len(self.xaxis_categories), + step=self.xaxis_step), + fontsize=self.xticks_font) else: plt.xticks([i + self._xaxis_value_location for i in np.arange(0, len(self.data_set[0]), step=self.xaxis_step)], - self.xaxis_categories, fontsize=self.xticks_font) - plt.legend(handles=self.legend_handles, loc=self.legend_loc, bbox_to_anchor=self.legend_box, ncol=self.legend_ncol, fontsize=self.legend_fontsize) + self.xaxis_categories, fontsize=self.xticks_font) + plt.legend( + handles=self.legend_handles, + loc=self.legend_loc, + bbox_to_anchor=self.legend_box, + ncol=self.legend_ncol, + fontsize=self.legend_fontsize) plt.suptitle(self.title, fontsize=self.title_size) plt.title(self.grp_title) fig = plt.gcf() @@ -155,7 +166,8 @@ class lf_bar_graph(): self.lf_csv.filename = f"{self.graph_image_name}.csv" self.lf_csv.generate_csv() else: - raise ValueError("Length and x-axis values and y-axis values should be same.") + raise ValueError( + "Length and x-axis values and y-axis values should be same.") else: print("No Dataset Found") print("{}.csv".format(self.graph_image_name)) @@ -188,20 +200,38 @@ class lf_scatter_graph(): def build_scatter_graph(self): if self.color is None: - self.color = ["orchid", "lime", "aquamarine", "royalblue", "darkgray", "maroon"] + self.color = [ + "orchid", + "lime", + "aquamarine", + "royalblue", + "darkgray", + "maroon"] fig = plt.subplots(figsize=self.figsize) if self.values is None: - plt.scatter(self.x_data_set, self.y_data_set[0], color=self.color[0], label=self.label[0]) + plt.scatter( + self.x_data_set, + self.y_data_set[0], + color=self.color[0], + label=self.label[0]) if len(self.y_data_set) > 1: for i in range(1, len(self.y_data_set)): - plt.scatter(self.x_data_set, self.y_data_set[i], color=self.color[i], label=self.label[i]) + plt.scatter( + self.x_data_set, + self.y_data_set[i], + color=self.color[i], + label=self.label[i]) plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15) plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15) plt.gcf().autofmt_xdate() plt.legend() else: colours = ListedColormap(self.color) - scatter = plt.scatter(self.x_data_set, self.y_data_set, c=self.values, cmap=colours) + scatter = plt.scatter( + self.x_data_set, + self.y_data_set, + c=self.values, + cmap=colours) plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15) plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15) plt.gcf().autofmt_xdate() @@ -241,9 +271,19 @@ class lf_stacked_graph(): def build_stacked_graph(self): fig = plt.subplots(figsize=self.figsize) if self.color is None: - self.color = ["darkred", "tomato", "springgreen", "skyblue", "indigo", "plum"] + self.color = [ + "darkred", + "tomato", + "springgreen", + "skyblue", + "indigo", + "plum"] plt.bar(self.data_set[0], self.data_set[1], color=self.color[0]) - plt.bar(self.data_set[0], self.data_set[2], bottom=self.data_set[1], color=self.color[1]) + plt.bar( + self.data_set[0], + self.data_set[2], + bottom=self.data_set[1], + color=self.color[1]) if len(self.data_set) > 3: for i in range(3, len(self.data_set)): plt.bar(self.data_set[0], self.data_set[i], @@ -303,8 +343,19 @@ class lf_horizontal_stacked_graph(): ind = np.arange(n) + .15 width = 0.3 - rects1 = plt.barh(ind, values1, width, color=self.color[0], label=self.label[0]) - rects2 = plt.barh(ind, values2, width, left=sumzip(values1), color=self.color[1], label=self.label[1]) + rects1 = plt.barh( + ind, + values1, + width, + color=self.color[0], + label=self.label[0]) + rects2 = plt.barh( + ind, + values2, + width, + left=sumzip(values1), + color=self.color[1], + label=self.label[1]) extra_space = 0.15 ax.set_yticks(ind + width - extra_space) @@ -326,7 +377,12 @@ class lf_horizontal_stacked_graph(): ax.spines['top'].set_visible(False) ax.legend(loc='upper right') if self.disable_xaxis: - plt.tick_params(axis='x', which='both', bottom=False, top=False, labelbottom=False) # disable x-axis + plt.tick_params( + axis='x', + which='both', + bottom=False, + top=False, + labelbottom=False) # disable x-axis plt.savefig("%s.png" % self.graph_image_name, dpi=96) plt.close() print("{}.png".format(self.graph_image_name)) @@ -339,7 +395,7 @@ class lf_horizontal_stacked_graph(): class lf_line_graph(): - def __init__(self,_data_set=[[30.4, 55.3, 69.2, 37.1], [45.1, 67.2, 34.3, 22.4], [22.5, 45.6, 12.7, 34.8]], + def __init__(self, _data_set=[[30.4, 55.3, 69.2, 37.1], [45.1, 67.2, 34.3, 22.4], [22.5, 45.6, 12.7, 34.8]], _xaxis_name="x-axis", _yaxis_name="y-axis", _xaxis_categories=[1, 2, 3, 4, 5], @@ -351,8 +407,8 @@ class lf_line_graph(): _font_weight='bold', _color=['forestgreen', 'c', 'r', 'g', 'b', 'p'], _figsize=(10, 5), - _xaxis_step = 5, - _xticks_font = None, + _xaxis_step=5, + _xticks_font=None, _text_font=None, _legend_handles=None, _legend_loc="best", @@ -390,12 +446,22 @@ class lf_line_graph(): fig = plt.subplots(figsize=self.figsize) i = 0 for data in self.data_set: - plt.plot(self.xaxis_categories, data, color=self.color[i], label=self.label[i], marker = self.marker) + plt.plot( + self.xaxis_categories, + data, + color=self.color[i], + label=self.label[i], + marker=self.marker) i += 1 plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15) plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15) - plt.legend(handles=self.legend_handles, loc=self.legend_loc, bbox_to_anchor=self.legend_box, ncol=self.legend_ncol, fontsize=self.legend_fontsize) + plt.legend( + handles=self.legend_handles, + loc=self.legend_loc, + bbox_to_anchor=self.legend_box, + ncol=self.legend_ncol, + fontsize=self.legend_fontsize) plt.suptitle(self.grp_title, fontsize=self.title_size) fig = plt.gcf() plt.savefig("%s.png" % self.graph_image_name, dpi=96) @@ -412,6 +478,7 @@ class lf_line_graph(): print("{}.csv".format(self.graph_image_name)) return "%s.png" % self.graph_image_name + def main(): # arguments parser = argparse.ArgumentParser( @@ -421,7 +488,7 @@ def main(): lf_graph.py : unit test in lf_graph.py for exersizing the lf_graph.py library ''', description='''\ ------------------ +----------------- NAME: lf_graph.py PURPOSE: @@ -440,8 +507,13 @@ COPYWRITE INCLUDE_IN_README --------------------- ''') - parser.add_argument('--mgr','--lfmgr', dest='lfmgr', help='sample argument: where LANforge GUI is running', default='localhost') - # the args parser is not really used , this is so the report is not generated when testing + parser.add_argument( + '--mgr', + '--lfmgr', + dest='lfmgr', + help='sample argument: where LANforge GUI is running', + default='localhost') + # the args parser is not really used , this is so the report is not generated when testing # the imports with --help args = parser.parse_args() print("LANforge manager {lfmgr}".format(lfmgr=args.lfmgr)) @@ -464,7 +536,8 @@ INCLUDE_IN_README # write logic to generate pdf here # wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb # sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb - options = {"enable-local-file-access": None} # prevent eerror Blocked access to file + # prevent eerror Blocked access to file + options = {"enable-local-file-access": None} pdfkit.from_file(output_html_1, output_pdf_1, options=options) # test build_bar_graph setting values @@ -497,10 +570,11 @@ INCLUDE_IN_README # write logic to generate pdf here # wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb # sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb - options = {"enable-local-file-access": None} # prevent eerror Blocked access to file + # prevent eerror Blocked access to file + options = {"enable-local-file-access": None} pdfkit.from_file(output_html_2, output_pdf_2, options=options) + # Unit Test if __name__ == "__main__": - main() - + main() diff --git a/py-scripts/lf_report_test.py b/py-scripts/lf_report_test.py index 831fe400..114af078 100755 --- a/py-scripts/lf_report_test.py +++ b/py-scripts/lf_report_test.py @@ -2,13 +2,13 @@ ''' NAME: lf_report_test.py -PURPOSE: +PURPOSE: Common file for testing lf_report and lf_graph Library generates html and pdf output -SETUP: +SETUP: /lanforge/html-reports directory needs to be present or output generated in local file -EXAMPLE: +EXAMPLE: ./lf_report_test.py : currently script does not accept input COPYWRITE @@ -28,7 +28,7 @@ import pdfkit import random import argparse - + sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lf_report = importlib.import_module("py-scripts.lf_report") @@ -40,22 +40,24 @@ lf_stacked_graph = lf_graph.lf_stacked_graph lf_horizontal_stacked_graph = lf_graph.lf_horizontal_stacked_graph # Unit Test + + def main(): # Testing: generate data frame parser = argparse.ArgumentParser( prog="lf_report_test.py", formatter_class=argparse.RawTextHelpFormatter, description='''\ ------------------ +----------------- NAME: lf_report_test.py -PURPOSE: +PURPOSE: Common file for testing lf_report and lf_graph Library generates html and pdf output -SETUP: +SETUP: /lanforge/html-reports directory needs to be present or output generated in local file -EXAMPLE: +EXAMPLE: ./lf_report_test.py : currently script does not accept input COPYWRITE @@ -65,8 +67,13 @@ COPYWRITE INCLUDE_IN_README ''') - parser.add_argument('--mgr','--lfmgr', dest='lfmgr', help='sample argument: where LANforge GUI is running', default='localhost') - # the args parser is not really used , this is so the report is not generated when testing + parser.add_argument( + '--mgr', + '--lfmgr', + dest='lfmgr', + help='sample argument: where LANforge GUI is running', + default='localhost') + # the args parser is not really used , this is so the report is not generated when testing # the imports with --help args = parser.parse_args() print("LANforge manager {lfmgr}".format(lfmgr=args.lfmgr)) @@ -82,7 +89,7 @@ INCLUDE_IN_README print(dataframe) - # Testing: generate data frame + # Testing: generate data frame dataframe2 = pd.DataFrame({ 'station': [1, 2, 3, 4, 5, 6, 7], 'time_seconds': [23, 78, 22, 19, 45, 22, 25] @@ -137,7 +144,7 @@ INCLUDE_IN_README _xaxis_categories=x_axis_values, _graph_image_name="Bi-single_radio_2.4GHz", _label=["bi-downlink", "bi-uplink", 'uplink'], - _color=['darkorange', 'forestgreen','blueviolet'], + _color=['darkorange', 'forestgreen', 'blueviolet'], _color_edge='red', _grp_title="Throughput for each clients", _xaxis_step=5, @@ -146,7 +153,7 @@ INCLUDE_IN_README _text_rotation=45, _xticks_font=7, _legend_loc="best", - _legend_box=(1,1), + _legend_box=(1, 1), _legend_ncol=1, _legend_fontsize=None, _enable_csv=True) @@ -156,7 +163,7 @@ INCLUDE_IN_README print("graph name {}".format(graph_png)) report.set_graph_image(graph_png) - # need to move the graph image to the results + # need to move the graph image to the results report.move_graph_image() if graph.enable_csv: report.set_csv_filename(graph_png) @@ -169,7 +176,7 @@ INCLUDE_IN_README _graph_image_name="image_name1", _color=None, _label=["s1", "s2", "s3"], - _enable_csv = False) + _enable_csv=False) graph_png = graph2.build_scatter_graph() print("graph name {}".format(graph_png)) @@ -178,14 +185,15 @@ INCLUDE_IN_README report.move_graph_image() report.build_graph() - # this will generate graph which is independent,we can customize the value with different colors + # this will generate graph which is independent,we can customize the value + # with different colors graph2 = lf_scatter_graph(_x_data_set=set1, _y_data_set=[45, 67, 45, 34], _values=[0, 0, 0, 1], _xaxis_name="x-axis", _yaxis_name="y-axis", _graph_image_name="image_name_map", _color=None, _label=["s1", "s2"], - _enable_csv = False) + _enable_csv=False) graph_png = graph2.build_scatter_graph() print("graph name {}".format(graph_png)) @@ -194,14 +202,15 @@ INCLUDE_IN_README report.move_graph_image() report.build_graph() - dataset = [["1", "2", "3", "4"], [12, 45, 67, 34], [23, 67, 23, 12], [25, 45, 34, 23]] + dataset = [["1", "2", "3", "4"], [12, 45, 67, 34], + [23, 67, 23, 12], [25, 45, 34, 23]] graph = lf_stacked_graph(_data_set=dataset, _xaxis_name="Stations", _yaxis_name="Login PASS/FAIL", _label=['Success', 'Fail', 'both'], _graph_image_name="login_pass_fail1", _color=None, - _enable_csv = False) + _enable_csv=False) graph_png = graph.build_stacked_graph() @@ -221,7 +230,7 @@ INCLUDE_IN_README _graph_image_name="image_name_pass_fail", _color=["r", "g"], _figsize=(9, 4), - _enable_csv = False) + _enable_csv=False) graph_png = graph.build_horizontal_stacked_graph() From a71b65ff6e6dbeee78d716ff9b07651c04df4bd8 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 12 Nov 2021 07:48:49 -0700 Subject: [PATCH 321/731] lf_report_test.py lf_graph.py added to lf_check.py regression Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 35 ++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index d6aaf925..a4b1ae80 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -67,31 +67,29 @@ }, "suite_test":{ "lf_cleanup":{ - "enabled":"TRUE", + "enabled":"FALSE", "load_db":"NONE", "command":"lf_cleanup.py", "args":"", "args_list":["--mgr LF_MGR_IP --cxs --sta" ] }, - "layer3_test":{ + "lf_report_test":{ "enabled":"TRUE", "load_db":"NONE", "timeout":"60", - "command":"layer3_test.py", + "command":"lf_report_test.py", "args":"", - "args_list":[" --mgr LF_MGR_IP --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + "args_list":[" --mgr LF_MGR_IP " ] }, - "layer4_test":{ + "lf_graph":{ "enabled":"TRUE", "load_db":"NONE", "timeout":"60", - "command":"layer4_test.py", + "command":"lf_graph.py", "args":"", - "args_list":[" --mgr LF_MGR_IP --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + "args_list":[" --mgr LF_MGR_IP " ] }, "lf_qa":{ @@ -408,6 +406,25 @@ "command":"./wlan_capacity_calculator.py", "args":"", "args_list":["-sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes"]}, + "lf_report_test":{ + "enabled":"TRUE", + "load_db":"NONE", + "timeout":"60", + "command":"lf_report_test.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP " + ] + }, + "lf_graph":{ + "enabled":"TRUE", + "load_db":"NONE", + "timeout":"60", + "command":"lf_graph.py", + "args":"", + "args_list":[" --mgr LF_MGR_IP " + ] + }, + "lf_qa":{ "enabled":"TRUE", "timeout":"600", From 2176098ad3592d253df7940a074bc8445e7cc588 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 12 Nov 2021 09:12:41 -0800 Subject: [PATCH 322/731] Remove layer3_test and layer4_test from regression_test Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 1e4e8bc5..379709fb 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -206,8 +206,8 @@ else --passwd $PASSWD_USED --radio 1.1.$RADIO_USED --security wpa2 --debug --mgr $MGR" #./ftp_html.py #./grafana_profile - "./layer3_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED" - "./layer4_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" + # "./layer3_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED" + # "./layer4_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" "./lf_ap_auto_test.py \ --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ @@ -290,7 +290,7 @@ else #--influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ #--influx_bucket ben \ #"./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --debug --report_file measure_station_time_up.txt" - "./create_stations.py --radio $RADIO_USED --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED && ./modify_station.py \ + "./create_station.py --radio $RADIO_USED --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED && ./modify_station.py \ --radio $RADIO_USED \ --station 1.1.sta0000 \ --security $SECURITY \ From 614880cedd0d625173666d9a9e2e0362e645ea3b Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 12 Nov 2021 12:10:58 -0700 Subject: [PATCH 323/731] test_ip_variable_time.py note for location of create_basic_argparse Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_ip_variable_time.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index 11cc9906..61f1683e 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -320,6 +320,9 @@ class IPVariableTime(Realm): def main(): + # Realm args parser is one directory up then traverse into /py-json/LANforge/lfcli_base.py + # search for create_basic_argsparse + # --mgr --mgr_port --upstream_port --num_stations --radio --security --ssid --passwd parser = Realm.create_basic_argparse( prog='test_ip_variable_time.py', formatter_class=argparse.RawTextHelpFormatter, From 1f24b2c79b2ea0f8ced18666c7bd396247ab0354 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Mon, 8 Nov 2021 11:35:43 -0800 Subject: [PATCH 324/731] Fixed imports and some function calls --- py-scripts/lf_webpage.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/py-scripts/lf_webpage.py b/py-scripts/lf_webpage.py index 79a27a62..d0ac2715 100755 --- a/py-scripts/lf_webpage.py +++ b/py-scripts/lf_webpage.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """ This script will create 40 clients on 5Ghz , 2.4Ghz and Both and generate layer4 traffic on LANforge ,The Webpage Download Test is designed to test the performance of the Access Point.The goal is to check whether the webpage loading time meets the expectation when clients connected on single radio as well as dual radio. @@ -13,6 +14,8 @@ import importlib import time import argparse import paramiko +from datetime import datetime +import pandas as pd sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) @@ -462,7 +465,7 @@ class HttpDownload(Realm): pass def generate_graph(self, dataset, lis, bands): - graph = lf_bar_graph(_data_set=dataset, _xaxis_name="Stations", _yaxis_name="Time in Seconds", + graph = lf_graph.lf_bar_graph(_data_set=dataset, _xaxis_name="Stations", _yaxis_name="Time in Seconds", _xaxis_categories=lis, _label=bands, _xticks_font=8, _graph_image_name="webpage download time graph", _color=['forestgreen', 'darkorange', 'blueviolet'], _color_edge='black', _figsize=(14, 5), @@ -477,7 +480,7 @@ class HttpDownload(Realm): return graph_png def graph_2(self,dataset2, lis, bands): - graph_2 = lf_bar_graph(_data_set=dataset2, _xaxis_name="Stations", _yaxis_name="Download Rate in Mbps", + graph_2 = lf_graph.lf_bar_graph(_data_set=dataset2, _xaxis_name="Stations", _yaxis_name="Download Rate in Mbps", _xaxis_categories=lis, _label=bands, _xticks_font=8, _graph_image_name="webpage_speed_graph", _color=['forestgreen', 'darkorange', 'blueviolet'], _color_edge='black', @@ -492,7 +495,7 @@ class HttpDownload(Realm): return graph_png def generate_report(self,date, num_stations,duration, test_setup_info,dataset,lis,bands,threshold_2g,threshold_5g,threshold_both,dataset2,summary_table_value,result_data,test_input_infor): - report = lf_report(_results_dir_name="webpage_test", _output_html="Webpage.html", _output_pdf="Webpage.pdf") + report = lf_report.lf_report(_results_dir_name="webpage_test", _output_html="Webpage.html", _output_pdf="Webpage.pdf") report.set_title("WEBPAGE DOWNLOAD TEST") report.set_date(date) report.build_banner() @@ -638,7 +641,7 @@ def main(): parser.add_argument('--ssh_port', type=int, help="specify the shh port eg 22",default=22) args = parser.parse_args() - test_time = datetime.datetime.now() + test_time = datetime.now() test_time = test_time.strftime("%b %d %H:%M:%S") print("Test started at ", test_time) list5G = [] @@ -746,16 +749,16 @@ def main(): result_data = final_dict print("result", result_data) print("Test Finished") - test_end = datetime.datetime.now() + test_end = datetime.now() test_end = test_end.strftime("%b %d %H:%M:%S") print("Test ended at ", test_end) s1 = test_time s2 = test_end # for example FMT = '%b %d %H:%M:%S' - test_duration = datetime.datetime.strptime(s2, FMT) - datetime.datetime.strptime(s1, FMT) + test_duration = datetime.strptime(s2, FMT) - datetime.strptime(s1, FMT) print("total test duration ", test_duration) - date = str(datetime.datetime.now()).split(",")[0].replace(" ", "-").split(".")[0] + date = str(datetime.now()).split(",")[0].replace(" ", "-").split(".")[0] test_setup_info = { "DUT Name": args.ap_name, "SSID": args.ssid, From 322bc7ea559b6ef9092841017b8103f169332f04 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Wed, 10 Nov 2021 11:45:22 -0800 Subject: [PATCH 325/731] rewrote my_monitor function to be more reusable, removed other monitor functions, renamed variables to better represent contents. Reporting WIP --- py-scripts/lf_webpage.py | 77 ++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 50 deletions(-) diff --git a/py-scripts/lf_webpage.py b/py-scripts/lf_webpage.py index d0ac2715..e3e14e81 100755 --- a/py-scripts/lf_webpage.py +++ b/py-scripts/lf_webpage.py @@ -57,6 +57,8 @@ class HttpDownload(Realm): self.http_profile.debug = _debug_on self.created_cx = {} + + def set_values(self): # This method will set values according user input if self.bands == "5G": @@ -156,44 +158,19 @@ class HttpDownload(Realm): def stop(self): self.http_profile.stop_cx() - def my_monitor(self): + def my_monitor(self, data_mon): # data in json format - data = self.local_realm.json_get("layer4/list?fields=uc-avg") - data1 = [] - for i in range(len(data['endpoint'])): - data1.append(str(list(data['endpoint'][i]))[2:-2]) - data2 = [] - for i in range(self.num_sta): - data = self.local_realm.json_get("layer4/list?fields=uc-avg") - # print(type(data['endpoint'][i][data1[i]]['uc-avg'])) - data2.append((data['endpoint'][i][data1[i]]['uc-avg'])) - return data2 - def monitor_bytes(self): - # data in json format - data = self.local_realm.json_get("layer4/list?fields=bytes-rd") + data = self.local_realm.json_get("layer4/%s/list?fields=name,%s" % + (','.join(self.http_profile.created_cx.keys()), data_mon.replace(' ', '+'))) + # print(data) data1 = [] - for i in range(len(data['endpoint'])): - data1.append(str(list(data['endpoint'][i]))[2:-2]) - data2 = [] - for i in range(self.num_sta): - data = self.local_realm.json_get("layer4/list?fields=bytes-rd") - # print(type(data['endpoint'][i][data1[i]]['uc-avg'])) - data2.append((data['endpoint'][i][data1[i]]['bytes-rd'])) - return data2 - - def monitor_rx(self): - # data in json format - data = self.local_realm.json_get("layer4/list?fields=rx rate") - data1 = [] - for i in range(len(data['endpoint'])): - data1.append(str(list(data['endpoint'][i]))[2:-2]) - data2 = [] - for i in range(self.num_sta): - data = self.local_realm.json_get("layer4/list?fields=rx rate") - # print(type(data['endpoint'][i][data1[i]]['uc-avg'])) - data2.append((data['endpoint'][i][data1[i]]['rx rate'])) - return data2 + for cx in self.http_profile.created_cx.keys(): + for info in data['endpoint']: + if cx in info: + data1.append(info[cx][data_mon]) + # print(data_mon, data1) + return data1 def postcleanup(self): self.http_profile.cleanup() @@ -632,7 +609,7 @@ def main(): parser.add_argument('--passwd', help='WiFi passphrase/password/key') parser.add_argument('--target_per_ten', help='number of request per 10 minutes', default=100) parser.add_argument('--file_size', type=str, help='specify the size of file you want to download', default='5MB') - parser.add_argument('--bands', nargs="+", help='specify which band testing you want to run eg 5G OR 2.4G OR 5G 2.4G', default=["5G", "2.4G", "Both"]) + parser.add_argument('--bands', nargs="+", help='specify which band testing you want to run eg 5G OR 2.4G OR Both', default=["5G", "2.4G", "Both"]) parser.add_argument('--duration', type=int, help='time to run traffic') parser.add_argument('--threshold_5g',help="Enter the threshold value for 5G Pass/Fail criteria", default="60") parser.add_argument('--threshold_2g',help="Enter the threshold value for 2.4G Pass/Fail criteria",default="90") @@ -692,21 +669,19 @@ def main(): print("time in seconds ", duration) time.sleep(duration) http.stop() - value = http.my_monitor() - value2 = http.monitor_bytes() - value3 = http.monitor_rx() - http.postcleanup() + uc_avg_val = http.my_monitor('uc-avg') + rx_bytes_val = http.my_monitor('bytes-rd') + rx_rate_val = http.my_monitor('rx rate') if bands == "5G": print("yes") - list5G.extend(value) - list5G_bytes.extend(value2) - list5G_speed.extend(value3) + list5G.extend(uc_avg_val) + list5G_bytes.extend(rx_bytes_val) + list5G_speed.extend(rx_rate_val) print(list5G) print(list5G_bytes) print(list5G_speed) final_dict['5G']['dl_time'] = list5G - min5.append(min(list5G)) final_dict['5G']['min'] = min5 max5.append(max(list5G)) @@ -717,9 +692,9 @@ def main(): final_dict['5G']['speed'] = list5G_speed elif bands == "2.4G": print("no") - list2G.extend(value) - list2G_bytes.extend(value2) - list2G_speed.extend(value3) + list2G.extend(uc_avg_val) + list2G_bytes.extend(rx_bytes_val) + list2G_speed.extend(rx_rate_val) print(list2G) print(list2G_bytes) print(list2G_speed) @@ -733,9 +708,9 @@ def main(): final_dict['2.4G']['bytes_rd'] = list2G_bytes final_dict['2.4G']['speed'] = list2G_speed elif bands == "Both": - Both.extend(value) - Both_bytes.extend(value2) - Both_speed.extend(value3) + Both.extend(uc_avg_val) + Both_bytes.extend(rx_bytes_val) + Both_speed.extend(rx_rate_val) final_dict['Both']['dl_time'] = Both min_both.append(min(Both)) final_dict['Both']['min'] = min_both @@ -746,6 +721,8 @@ def main(): final_dict['Both']['bytes_rd'] = Both_bytes final_dict['Both']['speed'] = Both_speed + http.postcleanup() + result_data = final_dict print("result", result_data) print("Test Finished") From acff7f8585ee8e556bad9667b298f9b8845431b6 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Fri, 12 Nov 2021 09:40:04 -0800 Subject: [PATCH 326/731] Improved my_monitor function --- py-scripts/lf_webpage.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/py-scripts/lf_webpage.py b/py-scripts/lf_webpage.py index e3e14e81..4ff65452 100755 --- a/py-scripts/lf_webpage.py +++ b/py-scripts/lf_webpage.py @@ -160,15 +160,18 @@ class HttpDownload(Realm): def my_monitor(self, data_mon): # data in json format - - data = self.local_realm.json_get("layer4/%s/list?fields=name,%s" % + data = self.local_realm.json_get("layer4/%s/list?fields=%s" % (','.join(self.http_profile.created_cx.keys()), data_mon.replace(' ', '+'))) # print(data) data1 = [] - for cx in self.http_profile.created_cx.keys(): - for info in data['endpoint']: - if cx in info: - data1.append(info[cx][data_mon]) + data = data['endpoint'] + if self.num_sta == 1: + data1.append(data[data_mon]) + else: + for cx in self.http_profile.created_cx.keys(): + for info in data: + if cx in info: + data1.append(info[cx][data_mon]) # print(data_mon, data1) return data1 @@ -672,6 +675,7 @@ def main(): uc_avg_val = http.my_monitor('uc-avg') rx_bytes_val = http.my_monitor('bytes-rd') rx_rate_val = http.my_monitor('rx rate') + http.postcleanup() if bands == "5G": print("yes") @@ -721,8 +725,6 @@ def main(): final_dict['Both']['bytes_rd'] = Both_bytes final_dict['Both']['speed'] = Both_speed - http.postcleanup() - result_data = final_dict print("result", result_data) print("Test Finished") From b2df641854a8947bb70361beeb01a622fdb8354b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 12 Nov 2021 13:04:49 -0800 Subject: [PATCH 327/731] Turn on debug for test_ip_variable_time wait until ports admin up Signed-off-by: Matthew Stidham --- py-scripts/test_ip_variable_time.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index 61f1683e..8c4b704f 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -250,11 +250,6 @@ class IPVariableTime(Realm): print("Port Manager column names are...") print(port_mgr_cols) - print("Layer 3 Endp column names are...") - print(layer3_cols) - print("Port Manager column names are...") - print(port_mgr_cols) - try: monitor_interval = Realm.parse_time(self.monitor_interval).total_seconds() except ValueError as error: @@ -311,7 +306,7 @@ class IPVariableTime(Realm): if not self.passes(): print(self.get_fail_message()) self.exit_fail() - LFUtils.wait_until_ports_admin_up(port_list=self.sta_list) + LFUtils.wait_until_ports_admin_up(port_list=self.sta_list, debug_=self.debug) if self.passes(): self.success() From 5180dcb6855751170b839951f1a5a25dcc53f777 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 12 Nov 2021 14:32:41 -0800 Subject: [PATCH 328/731] regression_test was missing a backslash on line 224 Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 379709fb..55a25b41 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -221,7 +221,7 @@ else --set 'Basic Client Connectivity' 1 \ --set 'Multi Band Performance' 1 \ --set 'Skip 2.4Ghz Tests' 1 \ - --set 'Skip 5Ghz Tests' 1 + --set 'Skip 5Ghz Tests' 1 \ --set 'Throughput vs Pkt Size' 0 \ --set 'Capacity' 0 \ --set 'Stability' 0 \ From 7ff62b9fd666b474e8c5e2a3c3daa706a06d769a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 12 Nov 2021 14:42:29 -0800 Subject: [PATCH 329/731] Fix improper equalities in LFUtils.py Signed-off-by: Matthew Stidham --- py-json/LANforge/LFUtils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index 8d073f9c..a6ba8d1f 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -87,10 +87,10 @@ class PortEID: port_name = p_port_name def __init__(self, json_response): - if json_response == None: + if json_response is None: raise Exception("No json input") json_s = json_response - if json_response['interface'] != None: + if json_response['interface'] is not None: json_s = json_response['interface'] debug_printer(json_s) @@ -446,7 +446,7 @@ def wait_until_ports_admin_down(resource_id=1, base_url="http://localhost:8080", uri = "%s/%s/%s?fields=device,down" % (port_url, resource_id, port_name) lf_r = LFRequest.LFRequest(base_url, uri, debug_=debug_) json_response = lf_r.getAsJson() - if json_response == None: + if json_response is None: if debug_: print("port %s disappeared" % port_name) continue @@ -473,7 +473,7 @@ def wait_until_ports_admin_up(resource_id=1, base_url="http://localhost:8080", p uri = "%s/%s/%s?fields=device,down" % (port_url, resource_id, port_name) lf_r = LFRequest.LFRequest(base_url, uri, debug_=debug_) json_response = lf_r.getAsJson() - if json_response == None: + if json_response is None: if debug_: print("port %s appeared" % port_name) continue From 1aa792930a749891c516c8c1e38e656a0ce62a17 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 12 Nov 2021 17:02:13 -0700 Subject: [PATCH 330/731] One Interface support to work with inconsistent list construction between single and multiple elements decided around May 23, 2018 Updates for probe with AX210 , AX200 wiphy Signed-off-by: Chuck SmileyRekiere --- py-json/l3_cxprofile.py | 25 +++++++++++++++++++------ py-scripts/test_ip_variable_time.py | 11 +++++++++++ py-scripts/tools/ct_us_001_scripts.json | 17 +++++++++++------ 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/py-json/l3_cxprofile.py b/py-json/l3_cxprofile.py index bb42d87a..20687b67 100644 --- a/py-json/l3_cxprofile.py +++ b/py-json/l3_cxprofile.py @@ -231,8 +231,8 @@ class L3CXProfile(LFCliBase): result = dict() # create dataframe from layer 3 results if type(layer_3_response) is dict: for dictionary in layer_3_response['endpoint']: - if debug: - print('layer_3_data: %s' % dictionary) + # if debug: + print('layer_3_data: %s' % dictionary) result.update(dictionary) else: pass @@ -242,11 +242,25 @@ class L3CXProfile(LFCliBase): if port_mgr_cols is not None: # create dataframe from port mgr results result = dict() if type(port_mgr_response) is dict: - for dictionary in port_mgr_response['interfaces']: + print("port_mgr_response {pmr}".format(pmr=port_mgr_response)) + if 'interfaces' in port_mgr_response: + for dictionary in port_mgr_response['interfaces']: + if debug: + print('port mgr data: %s' % dictionary) + result.update(dictionary) + + elif 'interface' in port_mgr_response: + dict_update = {port_mgr_response['interface']['alias']: port_mgr_response['interface']} if debug: - print('port mgr data: %s' % dictionary) - result.update(dictionary) + print(dict_update) + result.update(dict_update) + if debug: + print(result) + else: + print('interfaces and interface not in port_mgr_response') + exit(1) portdata_df = pd.DataFrame(result.values()) + print("portdata_df {pd}".format(pd=portdata_df)) portdata_df.columns = ['port-' + x for x in portdata_df.columns] portdata_df['alias'] = portdata_df['port-alias'] @@ -279,7 +293,6 @@ class L3CXProfile(LFCliBase): probe_results['Signal per Chain'] = probe_port.getSignalPerChain() probe_results['Beacon Avg Signal'] = probe_port.getBeaconSignalAvg() # probe_results['HE status'] = probe_port.he - probe_results['TX Bitrate'] = probe_port.tx_bitrate probe_results['TX Mbps'] = probe_port.tx_mbit probe_results['TX MCS ACTUAL'] = probe_port.tx_mcs diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index 8c4b704f..53a2053a 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -328,6 +328,10 @@ def main(): description='''\ test_ip_variable_time.py: -------------------- +Report: +The report will be in /home/lanforge/report-data/_test_ip_variable_time . +if the directory it not present it "should" place it in the local directory from where the script was run. + Generic command layout: python3 ./test_ip_variable_time.py @@ -521,6 +525,13 @@ python3 ./test_ip_variable_time.py 'wifi retries' Can't decide what columns to use? You can just use 'all' to select all available columns from both tables. + + + Example command: + ./test_ip_variable_time.py --mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 + --test_duration 60s --output_format csv --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 + --upstream_port eth2 --mode "5" --layer3_cols 'name','tx rate','rx rate' --port_mgr_cols 'alias','channel','activity','mode' + --num_stations 1 ''') parser.add_argument('--mode', help='Used to force mode of stations') diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index a4b1ae80..75b803ee 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -21,21 +21,26 @@ "test_ip_variable_time0-ipv4":{ "enabled":"TRUE", "command":"test_ip_variable_time.py", + "timeout":"360", "args":"", "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED", - " --security SECURITY_USED --test_duration 60s --output_format excel ", + " --mgr LF_MGR_IP ", + " use_ssid_idx=1 --radio wiphy4 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 60s --output_format csv ", " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", - " --port_mgr_cols 'alias','channel','activity','mode'"] + " --port_mgr_cols 'alias','channel','activity','mode'", + " --num_stations 1"] }, "test_ip_variable_time1-ipv4":{ - "enabled":"TRUE", + "enabled":"FALSE", + "timeout":"360", "command":"test_ip_variable_time.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED", - " --security SECURITY_USED --test_duration 60s --output_format excel ", + " --mgr LF_MGR_IP", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 60s --output_format csv ", " --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2", " --mode '5' --layer3_cols 'name','tx rate','rx rate' ", " --port_mgr_cols 'alias','channel','activity','mode'" From e5e3c90336c2e5ec94c23ab63c1e2b7630928fdc Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 12 Nov 2021 17:02:13 -0700 Subject: [PATCH 331/731] l3_cxprofile.py : updated to support one interface, port_probe.py : added more supported mcs in calculation test_ip_variable_time.py : added support for use_existing_sta removed create_sta as it was defaulted True and could not be set by construct. inconsistent list construction between single and multiple elements decided around May 23, 2018 Updates for probe with AX210 , AX200 wiphy Signed-off-by: Chuck SmileyRekiere --- py-json/port_probe.py | 32 ++++---- py-scripts/test_ip_variable_time.py | 115 +++++++++++++++++++--------- 2 files changed, 94 insertions(+), 53 deletions(-) diff --git a/py-json/port_probe.py b/py-json/port_probe.py index b630e7ff..c0992036 100644 --- a/py-json/port_probe.py +++ b/py-json/port_probe.py @@ -199,35 +199,35 @@ class ProbePort(LFCliBase): # MCS (Modulation Coding Scheme) determines the constands # MCS 0 == Modulation BPSK R = 1/2 , N_bpscs = 1, # Only for HT configuration - if self.tx_mcs == 0 or self.tx_mcs == 16 or self.tx_mcs == 24: + if self.tx_mcs == 0 or self.tx_mcs == 8 or self.tx_mcs == 16 or self.tx_mcs == 24: R = 1 / 2 N_bpscs = 1 # MCS 1 == Modulation QPSK R = 1/2 , N_bpscs = 2 - elif self.tx_mcs == 1 or self.tx_mcs == 17 or self.tx_mcs == 25: + elif self.tx_mcs == 1 or self.tx_mcs == 9 or self.tx_mcs == 17 or self.tx_mcs == 25: R = 1 / 2 N_bpscs = 2 # MCS 2 == Modulation QPSK R = 3/4 , N_bpscs = 2 - elif self.tx_mcs == 2 or self.tx_mcs == 18 or self.tx_mcs == 26: + elif self.tx_mcs == 2 or self.tx_mcs == 10 or self.tx_mcs == 18 or self.tx_mcs == 26: R = 3 / 4 N_bpscs = 2 # MCS 3 == Modulation 16-QAM R = 1/2 , N_bpscs = 4 - elif self.tx_mcs == 3 or self.tx_mcs == 19 or self.tx_mcs == 27: + elif self.tx_mcs == 3 or self.tx_mcs == 11 or self.tx_mcs == 19 or self.tx_mcs == 27: R = 1 / 2 N_bpscs = 4 # MCS 4 == Modulation 16-QAM R = 3/4 , N_bpscs = 4 - elif self.tx_mcs == 4 or self.tx_mcs == 20 or self.tx_mcs == 28: + elif self.tx_mcs == 4 or self.tx_mcs == 12 or self.tx_mcs == 20 or self.tx_mcs == 28: R = 3 / 4 N_bpscs = 4 # MCS 5 == Modulation 64-QAM R = 2/3 , N_bpscs = 6 - elif self.tx_mcs == 5 or self.tx_mcs == 21 or self.tx_mcs == 29: + elif self.tx_mcs == 5 or self.tx_mcs == 13 or self.tx_mcs == 21 or self.tx_mcs == 29: R = 2 / 3 N_bpscs = 6 # MCS 6 == Modulation 64-QAM R = 3/4 , N_bpscs = 6 - elif self.tx_mcs == 6 or self.tx_mcs == 22 or self.tx_mcs == 30: + elif self.tx_mcs == 6 or self.tx_mcs == 14 or self.tx_mcs == 22 or self.tx_mcs == 30: R = 3 / 4 N_bpscs = 6 # MCS 7 == Modulation 64-QAM R = 5/6 , N_bpscs = 6 - elif self.tx_mcs == 7 or self.tx_mcs == 23 or self.tx_mcs == 31: + elif self.tx_mcs == 7 or self.tx_mcs == 15 or self.tx_mcs == 23 or self.tx_mcs == 31: R = 5 / 6 N_bpscs = 6 @@ -290,35 +290,35 @@ class ProbePort(LFCliBase): # MCS (Modulation Coding Scheme) determines the constands # MCS 0 == Modulation BPSK R = 1/2 , N_bpscs = 1, # Only for HT configuration - if self.rx_mcs == 0 or self.rx_mcs == 16 or self.rx_mcs == 24: + if self.rx_mcs == 0 or self.rx_mcs == 8 or self.rx_mcs == 16 or self.rx_mcs == 24: R = 1 / 2 N_bpscs = 1 # MCS 1 == Modulation QPSK R = 1/2 , N_bpscs = 2 - elif self.rx_mcs == 1 or self.rx_mcs == 17 or self.rx_mcs == 25: + elif self.rx_mcs == 1 or self.rx_mcs == 9 or self.rx_mcs == 17 or self.rx_mcs == 25: R = 1 / 2 N_bpscs = 2 # MCS 2 == Modulation QPSK R = 3/4 , N_bpscs = 2 - elif self.rx_mcs == 2 or self.rx_mcs == 18 or self.rx_mcs == 26: + elif self.rx_mcs == 2 or self.rx_mcs == 10 or self.rx_mcs == 18 or self.rx_mcs == 26: R = 3 / 4 N_bpscs = 2 # MCS 3 == Modulation 16-QAM R = 1/2 , N_bpscs = 4 - elif self.rx_mcs == 3 or self.rx_mcs == 19 or self.rx_mcs == 27: + elif self.rx_mcs == 3 or self.rx_mcs == 11 or self.rx_mcs == 19 or self.rx_mcs == 27: R = 1 / 2 N_bpscs = 4 # MCS 4 == Modulation 16-QAM R = 3/4 , N_bpscs = 4 - elif self.rx_mcs == 4 or self.rx_mcs == 20 or self.rx_mcs == 28: + elif self.rx_mcs == 4 or self.rx_mcs == 12 or self.rx_mcs == 20 or self.rx_mcs == 28: R = 3 / 4 N_bpscs = 4 # MCS 5 == Modulation 64-QAM R = 2/3 , N_bpscs = 6 - elif self.rx_mcs == 5 or self.rx_mcs == 21 or self.rx_mcs == 29: + elif self.rx_mcs == 5 or self.rx_mcs == 13 or self.rx_mcs == 21 or self.rx_mcs == 29: R = 2 / 3 N_bpscs = 6 # MCS 6 == Modulation 64-QAM R = 3/4 , N_bpscs = 6 - elif self.rx_mcs == 6 or self.rx_mcs == 22 or self.rx_mcs == 30: + elif self.rx_mcs == 6 or self.rx_mcs == 14 or self.rx_mcs == 22 or self.rx_mcs == 30: R = 3 / 4 N_bpscs = 6 # MCS 7 == Modulation 64-QAM R = 5/6 , N_bpscs = 6 - elif self.rx_mcs == 7 or self.rx_mcs == 23 or self.rx_mcs == 31: + elif self.rx_mcs == 7 or self.rx_mcs == 15 or self.rx_mcs == 23 or self.rx_mcs == 31: R = 5 / 6 N_bpscs = 6 diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index 53a2053a..a6af227d 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -48,7 +48,7 @@ class IPVariableTime(Realm): security=None, password=None, sta_list=None, - create_sta=True, + use_existing_sta=False, name_prefix=None, upstream=None, radio=None, @@ -88,7 +88,7 @@ class IPVariableTime(Realm): self.port = port self.ssid = ssid self.sta_list = sta_list - self.create_sta = create_sta + self.use_existing_sta = use_existing_sta self.security = security self.password = password self.radio = radio @@ -104,24 +104,26 @@ class IPVariableTime(Realm): # "max_trying_ifup": 15, # "max_station_bringup": 6 # }) - self.name_prefix = name_prefix - self.test_duration = test_duration + self.station_profile = self.new_station_profile() - self.cx_profile = self.new_l3_cx_profile() self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = self.ssid self.station_profile.ssid_pass = self.password self.station_profile.security = self.security self.station_profile.number_template_ = self.number_template self.station_profile.debug = self.debug - self.station_profile.use_ht160 = use_ht160 if self.station_profile.use_ht160: self.station_profile.mode = 9 self.station_profile.mode = mode if self.ap is not None: self.station_profile.set_command_param("add_sta", "ap", self.ap) + if self.use_existing_sta is True: + self.station_profile.station_names = self.sta_list + self.name_prefix = name_prefix + self.test_duration = test_duration + self.cx_profile = self.new_l3_cx_profile() self.cx_profile.host = self.host self.cx_profile.port = self.port self.ipv6 = ipv6 @@ -143,44 +145,48 @@ class IPVariableTime(Realm): self.cx_profile.side_b_max_bps = side_b_max_rate def start(self, print_pass=False, print_fail=False): - if self.create_sta: - self.station_profile.admin_up() - # to-do- check here if upstream port got IP - temp_stas = self.station_profile.station_names.copy() - - if self.wait_for_ip(temp_stas, ipv4=not self.ipv6, ipv6=self.ipv6): - self._pass("All stations got IPs") - else: - self._fail("Stations failed to get IPs") - self.exit_fail() + # if self.use_existing_station is False: + # to-do- check here if upstream port got IP + self.station_profile.admin_up() + temp_stas = self.station_profile.station_names.copy() + print("temp_stas {temp_stas}".format(temp_stas=temp_stas)) + if self.wait_for_ip(temp_stas, ipv4=not self.ipv6, ipv6=self.ipv6): + self._pass("All stations got IPs") + else: + self._fail("Stations failed to get IPs") + self.exit_fail() self.cx_profile.start_cx() def stop(self): self.cx_profile.stop_cx() - if self.create_sta: - self.station_profile.admin_down() + self.station_profile.admin_down() def pre_cleanup(self): self.cx_profile.cleanup_prefix() - if self.create_sta: + # do not clean up station if existed prior to test + if self.use_existing_sta is False: for sta in self.sta_list: self.rm_port(sta, check_exists=True) def cleanup(self): self.cx_profile.cleanup() - if self.create_sta: + if self.use_existing_sta is False: self.station_profile.cleanup() LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=self.station_profile.station_names, debug=self.debug) def build(self): - if self.create_sta: - self.station_profile.use_security(self.security, self.ssid, self.password) - self.station_profile.set_number_template(self.number_template) + self.station_profile.use_security(self.security, self.ssid, self.password) + self.station_profile.set_number_template(self.number_template) + # print("sta_list {}".format(self.sta_list)) + 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) + + if self.use_existing_sta is True: + print("Use Existing Stations: {sta_list}".format(sta_list=self.sta_list)) + else: print("Creating stations") - 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=self.radio, sta_names_=self.sta_list, debug=self.debug) self._pass("PASS: Station build finished") @@ -222,7 +228,8 @@ class IPVariableTime(Realm): self.build() # exit() - if self.create_sta: + # CMR What is this code doing + if self.use_existing_sta is False: if not self.passes(): print(self.get_fail_message()) self.exit_fail() @@ -302,7 +309,7 @@ class IPVariableTime(Realm): debug=self.debug) self.stop() - if self.create_sta: + if self.use_existing_sta is False: if not self.passes(): print(self.get_fail_message()) self.exit_fail() @@ -526,14 +533,39 @@ python3 ./test_ip_variable_time.py Can't decide what columns to use? You can just use 'all' to select all available columns from both tables. + This script uses two args parsers one in the script the second is Realm args parser + Realm args parser is one directory up then traverse into /py-json/LANforge/lfcli_base.py + search for create_basic_argsparse + --mgr --mgr_port --upstream_port --num_stations --radio --security --ssid --passwd + Example command: - ./test_ip_variable_time.py --mgr 192.168.100.116 --radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 - --test_duration 60s --output_format csv --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 - --upstream_port eth2 --mode "5" --layer3_cols 'name','tx rate','rx rate' --port_mgr_cols 'alias','channel','activity','mode' - --num_stations 1 + 1. Use Existing station , Note: put the resource.shelf.wifi-sta (below is 1.1.wlan4), + The station needs to configured with the ssid, passwd, security and mode in the LANforge GUI + ./test_ip_variable_time.py --mgr 192.168.0.100 --radio wiphy4 --ssid ssid_5g --passwd pass_5g + --security wpa2 --test_duration 60s --output_format csv --traffic_type lf_tcp + --a_min 600000000 --b_min 600000000 --upstream_port eth2 --mode '5' + --layer3_cols 'name','tx rate','rx rate' --port_mgr_cols 'alias','channel','activity','mode' + --use_existing_sta --sta_names 1.1.wlan4 + + 2. Create a one station (script default is 1 if --num_stations not entered) + ./test_ip_variable_time.py --mgr 192.168.0.100 --radio wiphy6 --ssid ssid_5g --passwd pass_5g + --security wpa2 --test_duration 60s --output_format csv --traffic_type lf_tcp + --a_min 600000000 --b_min 600000000 --upstream_port eth2 --mode '5' + --layer3_cols 'name','tx rate','rx rate' --port_mgr_cols 'alias','channel','activity','mode' + + 3. Create two stations + ./test_ip_variable_time.py --mgr 192.168.0.100 --radio wiphy1 --ssid ssid_5g --passwd pass_5g + --security wpa2 --test_duration 60s --output_format csv --traffic_type lf_tcp + --a_min 600000000 --b_min 600000000 --upstream_port eth2 --mode '5' + --layer3_cols 'name','tx rate','rx rate' --port_mgr_cols 'alias','channel','activity','mode' + --num_stations 2 + ''') + # Realm args parser is one directory up then traverse into /py-json/LANforge/lfcli_base.py + # search for create_basic_argsparse + # --mgr --mgr_port --upstream_port --num_stations --radio --security --ssid --passwd parser.add_argument('--mode', help='Used to force mode of stations') parser.add_argument('--ap', help='Used to force a connection to a particular AP') parser.add_argument('--traffic_type', help='Select the Traffic Type [lf_udp, lf_tcp, udp, tcp], type will be ' @@ -564,21 +596,30 @@ python3 ./test_ip_variable_time.py parser.add_argument('--influx_mgr', help='IP address of the server your Influx database is hosted if different from your LANforge Manager', default=None) - parser.add_argument('--create_sta', help='Used to force a connection to a particular AP', default=True) + parser.add_argument('--use_existing_sta', help='Used an existing stationsto a particular AP', action='store_true') parser.add_argument('--sta_names', help='Used to force a connection to a particular AP', default="sta0000") args = parser.parse_args() - num_sta = 2 + num_sta = 1 if (args.num_stations is not None) and (int(args.num_stations) > 0): + print("one") num_sta = int(args.num_stations) - if args.create_sta: + if args.use_existing_sta is False: + print("two") station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, radio=args.radio) else: + print("three") station_list = args.sta_names.split(",") - # Create directory + + print("args.num_stations: {create}".format(create=args.num_stations)) + print("args.sta_names: {create}".format(create=args.sta_names)) + print("args.use_existing_sta: {create} {typeof}".format(create=args.use_existing_sta, typeof=type(args.use_existing_sta))) + print("station_list: {sta}".format(sta=station_list)) + + # Create directory # if file path with output file extension is not given... # check if home/lanforge/report-data exists. if not, save # in new folder based in current file's directory @@ -604,7 +645,7 @@ python3 ./test_ip_variable_time.py port=args.mgr_port, number_template="0000", sta_list=station_list, - create_sta=args.create_sta, + use_existing_sta=args.use_existing_sta, name_prefix="VT", upstream=args.upstream_port, ssid=args.ssid, From d549bfccdc2a0435c0a1e78750ba60f0e4c4c618 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 10:10:58 -0800 Subject: [PATCH 332/731] More solid pandas call so we don't get an error Signed-off-by: Matthew Stidham --- py-json/l3_cxprofile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/l3_cxprofile.py b/py-json/l3_cxprofile.py index 20687b67..aab3a743 100644 --- a/py-json/l3_cxprofile.py +++ b/py-json/l3_cxprofile.py @@ -342,7 +342,7 @@ class L3CXProfile(LFCliBase): timestamp_data.append(timestamp_df) time.sleep(monitor_interval_ms) df = pd.concat(timestamp_data) - df = df.drop('alias', 1) + df = df.drop('alias', axis=1) df.to_csv(str(report_file), index=False) # comparison to last report / report inputted From f2b4628a81e6fa9caf1d4c027388d699e3040f9f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 11:39:38 -0800 Subject: [PATCH 333/731] We cannot use default paramters in our code! Signed-off-by: Matthew Stidham --- py-json/LANforge/LFUtils.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index a6ba8d1f..f321687a 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -555,15 +555,16 @@ def waitUntilPortsAppear(base_url="http://localhost:8080", port_list=(), debug=F """ return wait_until_ports_appear(base_url, port_list, debug=debug) -def name_to_eid(input, non_port=False): + +def name_to_eid(eid_input, non_port=False): rv = [1, 1, "", ""] info = [] - if (input is None) or (input == ""): - raise ValueError("name_to_eid wants eid like 1.1.sta0 but given[%s]" % input) - if type(input) is not str: - raise ValueError("name_to_eid wants string formatted like '1.2.name', not a tuple or list or [%s]" % type(input)) + if (eid_input is None) or (eid_input == ""): + raise ValueError("name_to_eid wants eid like 1.1.sta0 but given[%s]" % eid_input) + if type(eid_input) is not str: + raise ValueError("name_to_eid wants string formatted like '1.2.name', not a tuple or list or [%s]" % type(eid_input)) - info = input.split('.') + info = eid_input.split('.') if len(info) == 1: rv[2] = info[0] # just port name return rv From e9e7c6de31c819ddd379b9ddea2bb867c78cb09d Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 15 Nov 2021 14:07:58 -0700 Subject: [PATCH 334/731] test_ip_varible_time.py : there was an admin up in the stop caused errors Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_ip_variable_time.py | 1 - 1 file changed, 1 deletion(-) diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index a6af227d..9ce0f536 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -313,7 +313,6 @@ class IPVariableTime(Realm): if not self.passes(): print(self.get_fail_message()) self.exit_fail() - LFUtils.wait_until_ports_admin_up(port_list=self.sta_list, debug_=self.debug) if self.passes(): self.success() From 919503f86793352597fc5a4507dac78bf49c8669 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 13:33:24 -0800 Subject: [PATCH 335/731] Fix test_ipv4_ttls.py Signed-off-by: Matthew Stidham --- py-scripts/test_ipv4_ttls.py | 67 ++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 37 deletions(-) diff --git a/py-scripts/test_ipv4_ttls.py b/py-scripts/test_ipv4_ttls.py index f0f3264a..e1ee49fc 100755 --- a/py-scripts/test_ipv4_ttls.py +++ b/py-scripts/test_ipv4_ttls.py @@ -127,8 +127,9 @@ class TTLSTest(LFCliBase): self.station_profile.mode = 0 # Layer3 Traffic - self.l3_cx_obj_udp = IPVariableTime(host=self.host, port=self.port, - create_sta=False, sta_list=self.sta_list, traffic_type="lf_udp", + self.l3_cx_obj_udp = IPVariableTime(host=self.host, port=self.port, radio=self.radio, + ssid=self.ssid, password=self.password, security=self.security, + use_existing_sta=False, sta_list=self.sta_list, traffic_type="lf_udp", upstream=self.upstream_port) self.l3_cx_obj_udp.cx_profile.name_prefix = "udp-" @@ -140,8 +141,9 @@ class TTLSTest(LFCliBase): self.l3_cx_obj_udp.cx_profile.side_b_min_pdu = 1500 self.l3_cx_obj_udp.cx_profile.report_timer = 1000 - self.l3_cx_obj_tcp = IPVariableTime(host=self.host, port=self.port, - create_sta=False, sta_list=self.sta_list, traffic_type="lf_tcp", + self.l3_cx_obj_tcp = IPVariableTime(host=self.host, port=self.port, radio=self.radio, + ssid=self.ssid, password=self.password, security=self.security, + use_existing_sta=False, sta_list=self.sta_list, traffic_type="lf_tcp", upstream=self.upstream_port) self.l3_cx_obj_tcp.cx_profile.name_prefix = "tcp-" self.l3_cx_obj_tcp.cx_profile.side_a_min_bps = 128000 @@ -152,13 +154,15 @@ class TTLSTest(LFCliBase): self.l3_cx_obj_tcp.cx_profile.side_b_min_pdu = 1500 self.l3_cx_obj_tcp.cx_profile.report_timer = 1000 - def build(self, extra_securities=[]): + def build(self, + extra_securities=None): # Build stations keyphrase = "[BLANK]" self.station_profile.use_security(self.security, self.ssid, passwd=self.password) - for security in extra_securities: - self.station_profile.add_security_extra(security=security) + if extra_securities is not None: + for security in extra_securities: + self.station_profile.add_security_extra(security=security) if self.vap: self.vap_profile.use_security(self.security, self.ssid, passwd=self.password) self.station_profile.set_number_template(self.number_template) @@ -336,35 +340,23 @@ test_ipv4_ttls.py: --debug ''') - required = None - for agroup in parser._action_groups: - if agroup.title == "required arguments": - required = agroup - # if required is not None: - optional = None - for agroup in parser._action_groups: - if agroup.title == "optional arguments": - optional = agroup - - if optional is not None: - optional.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) - optional.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000) - optional.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="5m") - optional.add_argument('--key-mgmt', help="--key-mgt: { %s }" % ", ".join(realm.wpa_ent_list()), - default="WPA-EAP") - optional.add_argument('--wpa_psk', help='wpa-ent pre shared key', default="[BLANK]") - optional.add_argument('--eap', help='--eap eap method to use', default="TTLS") - optional.add_argument('--identity', help='--identity eap identity string', default="testuser") - optional.add_argument('--ttls_passwd', help='--ttls_passwd eap password string', default="testpasswd") - optional.add_argument('--ttls_realm', help='--ttls_realm 802.11u home realm to use', - default="localhost.localdomain") - optional.add_argument('--domain', help='--domain 802.11 domain to use', default="localhost.localdomain") - optional.add_argument('--hessid', help='--hessid 802.11u HESSID (MAC addr format/peer for WDS)', - default="00:00:00:00:00:01") - optional.add_argument('--ieee80211w', help='--ieee80211w 0): @@ -372,7 +364,8 @@ test_ipv4_ttls.py: num_sta = num_stations_converted station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000) - ttls_test = TTLSTest(host=args.mgr, port=args.mgr_port, + ttls_test = TTLSTest(host=args.mgr, + port=args.mgr_port, ssid=args.ssid, password=args.passwd, security=args.security, @@ -381,7 +374,7 @@ test_ipv4_ttls.py: key_mgmt=args.key_mgmt, wpa_psk=args.wpa_psk, eap=args.eap, - vap=True, + vap=args.vap, identity=args.identity, ttls_passwd=args.ttls_passwd, ttls_realm=args.ttls_realm, From 3c1858a60909f690a4a3992360fdd66eb2a20fc7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 13:36:05 -0800 Subject: [PATCH 336/731] Remove == True errors in lfcli_base Signed-off-by: Matthew Stidham --- py-json/LANforge/lfcli_base.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 9a6c639b..6b546716 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -239,7 +239,7 @@ class LFCliBase: del _data['suppress_postexec_cli'] if 'suppress_postexec_method' in _data: del _data['suppress_postexec_method'] - elif suppress_related_commands_ == False: + elif suppress_related_commands_ is False: _data['suppress_preexec_cli'] = False _data['suppress_preexec_method'] = False _data['suppress_postexec_cli'] = False @@ -536,11 +536,9 @@ class LFCliBase: return userhome=os.path.expanduser('~') session = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':','-') - if filename == None: - try: + if filename is None: + if os.path.isdir("%s/report-data/%s" % (userhome, session)): os.mkdir("%s/report-data/%s" % (userhome, session)) - except: - pass filename = ("%s/report-data/%s/%s.log" % (userhome,session,scriptname)) import logging logging.basicConfig(filename=filename, level=logging.DEBUG) @@ -742,8 +740,8 @@ class LFCliBase: def get_seconds(self, timestamp): return (timestamp - datetime.datetime(1970,1,1)).total_seconds() - def replace_special_char(self, str): - return str.replace('+', ' ').replace('_', ' ').strip(' ') + def replace_special_char(self, special_str): + return special_str.replace('+', ' ').replace('_', ' ').strip(' ') Help_Mode = """Station WiFi modes: use the number value below: auto : 0, From 12da46d6fbfb76349a6a382277a3113fc299fe91 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 13:36:27 -0800 Subject: [PATCH 337/731] Remove == True error in LFRequest Signed-off-by: Matthew Stidham --- py-json/LANforge/LFRequest.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/py-json/LANforge/LFRequest.py b/py-json/LANforge/LFRequest.py index 642e3528..16396426 100644 --- a/py-json/LANforge/LFRequest.py +++ b/py-json/LANforge/LFRequest.py @@ -81,9 +81,9 @@ class LFRequest: # finding '#' prolly indicates a macvlan (eth1#0) # finding ' ' prolly indicates a field name that should imply %20 - if (self.requested_url.find('#') >= 1): + if self.requested_url.find('#') >= 1: self.requested_url = self.requested_url.replace('#', '%23') - if (self.requested_url.find(' ') >= 1): + if self.requested_url.find(' ') >= 1: self.requested_url = self.requested_url.replace(' ', '+') self.logger.debug("new LFRequest[%s]" % self.requested_url ) @@ -94,7 +94,7 @@ class LFRequest: def form_post(self, show_error=True, debug=False, die_on_error_=False): if self.die_on_error: die_on_error_ = True - if (debug == False) and (self.debug == True): + if (debug is False) and (self.debug is True): debug = True responses = [] urlenc_data = "" @@ -106,7 +106,7 @@ class LFRequest: self.logger.debug("formPost: url: "+self.requested_url) - if ((self.post_data != None) and (self.post_data is not self.No_Data)): + if (self.post_data is not None) and (self.post_data is not self.No_Data): urlenc_data = urllib.parse.urlencode(self.post_data).encode("utf-8") self.logger.debug("formPost: data looks like:" + str(urlenc_data)) self.logger.debug("formPost: url: "+self.requested_url) @@ -141,7 +141,7 @@ class LFRequest: error_list_=self.error_list, debug_=debug) - if (die_on_error_ == True) or (self.die_on_error == True): + if (die_on_error_ is True) or (self.die_on_error is True): exit(1) return None @@ -149,7 +149,7 @@ class LFRequest: return self.json_post(show_error=show_error, debug=debug, die_on_error_=die_on_error_, response_json_list_=response_json_list_) def json_post(self, show_error=True, debug=False, die_on_error_=False, response_json_list_=None, method_='POST'): - if (debug == False) and (self.debug == True): + if (debug is False) and (self.debug is True): debug = True if self.die_on_error: die_on_error_ = True @@ -158,7 +158,7 @@ class LFRequest: opener = urllib.request.build_opener(request.ProxyHandler(self.proxies)) urllib.request.install_opener(opener) - if ((self.post_data != None) and (self.post_data is not self.No_Data)): + if (self.post_data is not None) and (self.post_data is not self.No_Data): myrequest = request.Request(url=self.requested_url, method=method_, data=json.dumps(self.post_data).encode("utf-8"), @@ -174,7 +174,7 @@ class LFRequest: try: resp = urllib.request.urlopen(myrequest) resp_data = resp.read().decode('utf-8') - if (debug and die_on_error_): + if debug and die_on_error_: self.logger.debug("----- LFRequest::json_post:128 debug: --------------------------------------------") self.logger.debug("URL: <%s> status: %d "% (self.requested_url, resp.status)) if resp.status != 200: @@ -208,7 +208,7 @@ class LFRequest: error_=uerror, debug_=debug) - if die_on_error_ == True: + if die_on_error_: exit(1) return None @@ -330,7 +330,7 @@ def plain_get(url_=None, debug_=False, die_on_error_=False, proxies_=None): error_=uerror, debug_=debug_) - if die_on_error_ == True: + if die_on_error_: exit(1) return None From 3969a4710e11572d21a1bfd51956b8c254172f44 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 13:42:34 -0800 Subject: [PATCH 338/731] station_profile.py: Removing ==True landmines Signed-off-by: Matthew Stidham --- py-json/station_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/station_profile.py b/py-json/station_profile.py index f06ea12c..eb515284 100644 --- a/py-json/station_profile.py +++ b/py-json/station_profile.py @@ -449,7 +449,7 @@ class StationProfile: else: my_sta_names = sta_names_ - if (len(my_sta_names) >= 15) or (suppress_related_commands_ == True): + if (len(my_sta_names) >= 15) or suppress_related_commands_: self.add_sta_data["suppress_preexec_cli"] = "yes" self.add_sta_data["suppress_preexec_method"] = 1 self.set_port_data["suppress_preexec_cli"] = "yes" From d0c40cb4b2bd81f56c0ad381580623e3eabd2bea Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 15:35:11 -0800 Subject: [PATCH 339/731] lfcli_base fix if os.path.isdir command Signed-off-by: Matthew Stidham --- py-json/LANforge/lfcli_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 6b546716..61d3ec47 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -537,7 +537,7 @@ class LFCliBase: userhome=os.path.expanduser('~') session = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':','-') if filename is None: - if os.path.isdir("%s/report-data/%s" % (userhome, session)): + if not os.path.isdir("%s/report-data/%s" % (userhome, session)): os.mkdir("%s/report-data/%s" % (userhome, session)) filename = ("%s/report-data/%s/%s.log" % (userhome,session,scriptname)) import logging From be740527bfb32da846b25e6d0dce63c0526ea6d7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 15:56:31 -0800 Subject: [PATCH 340/731] lfcli_base: Create report-data folder in home directory if it doesn't exist Signed-off-by: Matthew Stidham --- py-json/LANforge/lfcli_base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 61d3ec47..b99bbe0d 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -538,8 +538,10 @@ class LFCliBase: session = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':','-') if filename is None: if not os.path.isdir("%s/report-data/%s" % (userhome, session)): + if not os.path.isdir('%s/report-data' % userhome): + os.mkdir('%s/report-data' % userhome) os.mkdir("%s/report-data/%s" % (userhome, session)) - filename = ("%s/report-data/%s/%s.log" % (userhome,session,scriptname)) + filename = ("%s/report-data/%s/%s.log" % (userhome, session, scriptname)) import logging logging.basicConfig(filename=filename, level=logging.DEBUG) if level == "debug": From 7c57cd1d3e73c165563162bd22e864634a7cd807 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 17:04:53 -0800 Subject: [PATCH 341/731] l4_cxprofile Remove == None error Signed-off-by: Matthew Stidham --- py-json/l4_cxprofile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-json/l4_cxprofile.py b/py-json/l4_cxprofile.py index 25138e72..14e17bda 100644 --- a/py-json/l4_cxprofile.py +++ b/py-json/l4_cxprofile.py @@ -196,9 +196,9 @@ class L4CXProfile(LFCliBase): raise ValueError("L4CXProfile::monitor wants duration_sec > 1 second") if (duration_sec <= monitor_interval): raise ValueError("L4CXProfile::monitor wants duration_sec > monitor_interval") - if report_file == None: + if report_file is None: raise ValueError("Monitor requires an output file to be defined") - if created_cx == None: + if created_cx is None: raise ValueError("Monitor needs a list of Layer 4 connections") if (monitor_interval is None) or (monitor_interval < 1): raise ValueError("L4CXProfile::monitor wants monitor_interval >= 1 second") From 8713f5909820361ebaf88981de48574b9d142f87 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 17:05:40 -0800 Subject: [PATCH 342/731] lf_cv_base: remove shadow built in error Signed-off-by: Matthew Stidham --- py-json/lf_cv_base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-json/lf_cv_base.py b/py-json/lf_cv_base.py index 4016c03c..ab916a2c 100644 --- a/py-json/lf_cv_base.py +++ b/py-json/lf_cv_base.py @@ -27,15 +27,15 @@ class ChamberViewBase(LFCliBase): def remove_text_blobs(self): pass - def add_text_blobs(self, type="", name="", data="", debug=False): - data = {'type': type, + def add_text_blobs(self, text_type="", name="", data="", debug=False): + data = {'type': text_type, 'name': name, "text": data } self.json_post("/cli-json/add_text_blob/", data, debug_=debug) - def get_text_blob(self, type="", name="", debug=False): - data = {'type': type, + def get_text_blob(self, text_type="", name="", debug=False): + data = {'type': text_type, 'name': name, } return self.json_post("/cli-json/show_text_blob/", data, debug_=debug) From 39746c5ce0b61d0f27d1f13f3b125ec83a8fe014 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 17:06:39 -0800 Subject: [PATCH 343/731] http_profile.py: Remove == None error Signed-off-by: Matthew Stidham --- py-json/http_profile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-json/http_profile.py b/py-json/http_profile.py index cc4032b2..5c2f03d8 100644 --- a/py-json/http_profile.py +++ b/py-json/http_profile.py @@ -122,7 +122,7 @@ class HTTPProfile(LFCliBase): resource = self.local_realm.name_to_eid(port_name)[1] name = self.local_realm.name_to_eid(port_name)[2] - if upload_name != None: + if upload_name is not None: name = upload_name if http: @@ -155,7 +155,7 @@ class HTTPProfile(LFCliBase): if (url is None) or (url == ""): raise ValueError("HTTPProfile::create: url unset") - if upload_name ==None: + if upload_name is None: endp_data = { "alias": name + "_l4", "shelf": shelf, From a1cf4e2e47adf5f41da5584920df09dc1fd5ce36 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 17:10:18 -0800 Subject: [PATCH 344/731] lf_cleanup: Rename undefined variable Signed-off-by: Matthew Stidham --- py-scripts/lf_cleanup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/py-scripts/lf_cleanup.py b/py-scripts/lf_cleanup.py index 8b3face8..b1a1901f 100755 --- a/py-scripts/lf_cleanup.py +++ b/py-scripts/lf_cleanup.py @@ -178,9 +178,8 @@ class lf_clean(Realm): # also clean the endp when cleaning cxs still_looking_cxs = self.cxs_clean() still_looking_endp = self.endp_clean() - print("clean_cxs: still_looking_cxs {looking_cxs} still_looking_endp {looking_endp}"\ - .format(looking_cxs=still_looking_cxs,looking_endp=still_looking_endp)) - if self.clean_endp and not clean_cxs: + print("clean_cxs: still_looking_cxs {looking_cxs} still_looking_endp {looking_endp}".format(looking_cxs=still_looking_cxs,looking_endp=still_looking_endp)) + if self.clean_endp and not self.clean_cxs: still_looking_endp = self.endp_clean() print("clean_endp: still_looking_endp {looking_endp}".format(looking_endp=still_looking_endp)) From b8b207493eaf6d523c183e7457010a29fbed0075 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 15 Nov 2021 17:11:29 -0800 Subject: [PATCH 345/731] lf_mesh_test: Fix mutable default values Signed-off-by: Matthew Stidham --- py-scripts/lf_mesh_test.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/py-scripts/lf_mesh_test.py b/py-scripts/lf_mesh_test.py index 2ccaf11c..c325b0e7 100755 --- a/py-scripts/lf_mesh_test.py +++ b/py-scripts/lf_mesh_test.py @@ -146,14 +146,22 @@ class MeshTest(cvtest): upload_speed="56Kbps", download_speed="85%", duration="60s", - enables=[], - disables=[], - raw_lines=[], + enables=None, + disables=None, + raw_lines=None, raw_lines_file="", - sets=[], + sets=None, ): super().__init__(lfclient_host=lf_host, lfclient_port=lf_port) + if enables is None: + enables = [] + if disables is None: + disables = [] + if raw_lines is None: + raw_lines = [] + if sets is None: + sets = [] self.lf_host = lf_host self.lf_port = lf_port self.lf_user = lf_user From 954a2f9f804e8a1b0c823f7dea227878c2453c16 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 08:59:51 -0800 Subject: [PATCH 346/731] regression_test: git log command was backwards, it needed a head not a tail Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 55a25b41..72dd9b5b 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -534,7 +534,7 @@ function start_tests() { } function html_generator() { - LAST_COMMIT=$(git log --pretty=oneline | tail -n 1) + LAST_COMMIT=$(git log --pretty=oneline | head -n 1) header=" Regression Test Results $NOW From 0a8461dde15f66e05d601e8a6baef4a190855dee Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 09:35:31 -0800 Subject: [PATCH 347/731] test_utility.py Remove C0122 errors Signed-off-by: Matthew Stidham --- py-json/test_utility.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/py-json/test_utility.py b/py-json/test_utility.py index edc6462a..124ac670 100644 --- a/py-json/test_utility.py +++ b/py-json/test_utility.py @@ -14,7 +14,7 @@ import threading import re import json - + sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -57,14 +57,14 @@ class ClientVisualization(LFCliBase, threading.Thread): print(i[j]['port type']) if i[j]['port type'] == "WIFI-STA" and i[j]['parent dev'] == "wiphy1" and i[j]['alias'] != 'wlan1': #print(j) - if i[j]['down'] == False and i[j]['phantom'] == False and i[j]['ip'] == '0.0.0.0': + if i[j]['down'] is False and i[j]['phantom'] is False and i[j]['ip'] == '0.0.0.0': self.scanning += 1 - elif i[j]['down'] == False and i[j]['phantom'] == True: + elif i[j]['down'] is False and i[j]['phantom'] is True: self.phantom += 1 - elif i[j]['down'] == True and i[j]['phantom'] == True: + elif i[j]['down'] is True and i[j]['phantom'] is True: self.phantom += 1 self.client_data['phantom'].append(self.phantom) - elif i[j]['down'] == True and i[j]['phantom'] == False: + elif i[j]['down'] is True and i[j]['phantom'] is False: self.down += 1 elif i[j]['ip'] != "0.0.0.0": self.ip += 1 From c29a5e9b12f5052af9749bd908a71ce7bc754d7c Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 16 Nov 2021 11:02:29 -0700 Subject: [PATCH 348/731] py-json/port_probe.py : initial commit for VHT calculations Signed-off-by: Chuck SmileyRekiere --- py-json/port_probe.py | 200 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 199 insertions(+), 1 deletion(-) diff --git a/py-json/port_probe.py b/py-json/port_probe.py index c0992036..ca58b432 100644 --- a/py-json/port_probe.py +++ b/py-json/port_probe.py @@ -32,6 +32,9 @@ class ProbePort(LFCliBase): self.he = None self.rx_mgt_6Mb_frame = None + self.he = False + self.ofdma = False + self.tx_bitrate = None self.tx_mcs = None self.tx_nss = None @@ -72,6 +75,8 @@ class ProbePort(LFCliBase): self.signals = dict(zip(keys, values)) tx_bitrate = [x for x in text if 'tx bitrate' in x][0].replace('\t', ' ') + if 'HE' in tx_bitrate: + print("HE not supported ") print("tx_bitrate {tx_bitrate}".format(tx_bitrate=tx_bitrate)) self.tx_bitrate = tx_bitrate.split(':')[-1].strip(' ') if 'MHz' in tx_bitrate: @@ -251,7 +256,6 @@ class ProbePort(LFCliBase): self.tx_gi = T_gi_long def calculated_data_rate_rx_HT(self): - # TODO compare with standard for 40 MHz if values change N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) R = 0 # coding , (Determined by the modulation, MCS ) @@ -340,3 +344,197 @@ class ProbePort(LFCliBase): else: self.rx_mbit_calc = self.rx_data_rate_gi_long_Mbps self.rx_gi = T_gi_long + + + def calculated_data_rate_tx_VHT(self): + # TODO compare with standard for 40 MHz if values change + N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith + N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) + R = 0 # coding , (Determined by the modulation, MCS ) + N_ss = 0 # Number of Spatial Streams + T_dft = 3.2 * 10**-6 # Constant for HT + T_gi_short = .4 * 10**-6 # Guard index. + T_gi_long = .8 * 10**-6 # Guard index. + bw = 20 + # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 + # the nubmer of Data Subcarriers is based on modulation and bandwith + try: + bw = int(self.tx_mhz) + except BaseException: + print("port_probe.py: WARNING unable to parse tx MHz (BW) , check probe output will use {bw}".format(bw=bw)) + + print("Mhz {Mhz}".format(Mhz=self.tx_mhz)) + if bw == 20: + N_sd = 52 + elif bw == 40: + N_sd = 108 + elif bw == 80: + N_sd = 234 + elif bw == 160: + N_sd = 468 + else: + print("For HT if cannot be read bw is assumed to be 20") + N_sd = 52 + self.tx_mhz = 20 + + # NSS + N_ss = self.tx_nss + # MCS (Modulation Coding Scheme) determines the constands + # MCS 0 == Modulation BPSK R = 1/2 , N_bpscs = 1, + # Only for HT configuration + if self.tx_mcs == 0 : + R = 1 / 2 + N_bpscs = 1 + # MCS 1 == Modulation QPSK R = 1/2 , N_bpscs = 2 + elif self.tx_mcs == 1 : + R = 1 / 2 + N_bpscs = 2 + # MCS 2 == Modulation QPSK R = 3/4 , N_bpscs = 2 + elif self.tx_mcs == 2 : + R = 3 / 4 + N_bpscs = 2 + # MCS 3 == Modulation 16-QAM R = 1/2 , N_bpscs = 4 + elif self.tx_mcs == 3 : + R = 1 / 2 + N_bpscs = 4 + # MCS 4 == Modulation 16-QAM R = 3/4 , N_bpscs = 4 + elif self.tx_mcs == 4 : + R = 3 / 4 + N_bpscs = 4 + # MCS 5 == Modulation 64-QAM R = 2/3 , N_bpscs = 6 + elif self.tx_mcs == 5 : + R = 2 / 3 + N_bpscs = 6 + # MCS 6 == Modulation 64-QAM R = 3/4 , N_bpscs = 6 + elif self.tx_mcs == 6 : + R = 3 / 4 + N_bpscs = 6 + # MCS 7 == Modulation 64-QAM R = 5/6 , N_bpscs = 6 + elif self.tx_mcs == 7 : + R = 5 / 6 + N_bpscs = 6 + # MCS 8 == Modulation 256-QAM R = 3/4 , N_bpscs = 8 + elif self.tx_mcs == 8 : + R = 3 / 4 + N_bpscs = 8 + # MCS 9 == Modulation 256-QAM R = 5/6 , N_bpscs = 8 + elif self.tx_mcs == 9 : + R = 5 / 6 + N_bpscs = 8 + + print("tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( + mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) + + self.tx_data_rate_gi_short_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_short)) / 1000000 + print("tx_data_rate gi_short {data_rate} Mbit/s".format(data_rate=self.tx_data_rate_gi_short_Mbps)) + + print("tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( + mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) + + self.tx_data_rate_gi_long_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_long)) / 1000000 + print("data_rate gi_long {data_rate} Mbps".format(data_rate=self.tx_data_rate_gi_long_Mbps)) + + if abs(self.tx_mbit - self.tx_data_rate_gi_short_Mbps) <= abs(self.tx_mbit - self.tx_data_rate_gi_long_Mbps): + self.tx_mbit_calc = self.tx_data_rate_gi_short_Mbps + self.tx_gi = T_gi_short + else: + self.tx_mbit_calc = self.tx_data_rate_gi_long_Mbps + self.tx_gi = T_gi_long + + def calculated_data_rate_rx_VHT(self): + N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith + N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) + R = 0 # coding , (Determined by the modulation, MCS ) + N_ss = 0 # Number of Spatial Streams + T_dft = 3.2 * 10**-6 # Constant for HT + T_gi_short = .4 * 10**-6 # Guard index. + T_gi_long = .8 * 10**-6 # Guard index. + # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 + # the nubmer of Data Subcarriers is based on modulation and bandwith + if self.rx_mgt_6Mb_frame is True: + self.rx_mgt_6Mg_frame = False + self.rx_data_rate_gi_short_Mbps = None + self.rx_data_rate_gi_long_Mbps = None + else: + try: + bw = int(self.rx_mhz) + except BaseException: + print("port_probe.py: {} WARNING unable to parse rx MHz (BW) , check probe output will use ") + + print("Mhz {Mhz}".format(Mhz=self.rx_mhz)) + if bw == 20: + N_sd = 52 + elif bw == 40: + N_sd = 108 + elif bw == 80: + N_sd = 234 + elif bw == 160: + N_sd = 468 + else: + print("For HT if cannot be read bw is assumed to be 20") + N_sd = 52 + self.rx_mhz = 20 + + # NSS + N_ss = self.rx_nss + # MCS (Modulation Coding Scheme) determines the constands + # MCS 0 == Modulation BPSK R = 1/2 , N_bpscs = 1, + # Only for HT configuration + if self.rx_mcs == 0 : + R = 1 / 2 + N_bpscs = 1 + # MCS 1 == Modulation QPSK R = 1/2 , N_bpscs = 2 + elif self.rx_mcs == 1 : + R = 1 / 2 + N_bpscs = 2 + # MCS 2 == Modulation QPSK R = 3/4 , N_bpscs = 2 + elif self.rx_mcs == 2 : + R = 3 / 4 + N_bpscs = 2 + # MCS 3 == Modulation 16-QAM R = 1/2 , N_bpscs = 4 + elif self.rx_mcs == 3 : + R = 1 / 2 + N_bpscs = 4 + # MCS 4 == Modulation 16-QAM R = 3/4 , N_bpscs = 4 + elif self.rx_mcs == 4 : + R = 3 / 4 + N_bpscs = 4 + # MCS 5 == Modulation 64-QAM R = 2/3 , N_bpscs = 6 + elif self.rx_mcs == 5 : + R = 2 / 3 + N_bpscs = 6 + # MCS 6 == Modulation 64-QAM R = 3/4 , N_bpscs = 6 + elif self.rx_mcs == 6 : + R = 3 / 4 + N_bpscs = 6 + # MCS 7 == Modulation 64-QAM R = 5/6 , N_bpscs = 6 + elif self.rx_mcs == 7 : + R = 5 / 6 + N_bpscs = 6 + # MCS 8 == Modulation 256-QAM R = 3/4 , N_bpscs = 8 + elif self.rx_mcs == 8 : + R = 3 / 4 + N_bpscs = 8 + # MCS 9 == Modulation 256-QAM R = 5/6 , N_bpscs = 8 + elif self.rx_mcs == 9 : + R = 5 / 6 + N_bpscs = 8 + + print("mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( + mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) + + self.rx_data_rate_gi_short_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_short)) / 1000000 + print("rx_data_rate gi_short {data_rate} Mbit/s".format(data_rate=self.rx_data_rate_gi_short_Mbps)) + + print("mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( + mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) + + self.rx_data_rate_gi_long_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_long)) / 1000000 + print("rx_data_rate gi_long {data_rate} Mbps".format(data_rate=self.rx_data_rate_gi_long_Mbps)) + + if abs(self.rx_mbit - self.rx_data_rate_gi_short_Mbps) <= abs(self.rx_mbit - self.rx_data_rate_gi_long_Mbps): + self.rx_mbit_calc = self.rx_data_rate_gi_short_Mbps + self.rx_gi = T_gi_short + else: + self.rx_mbit_calc = self.rx_data_rate_gi_long_Mbps + self.rx_gi = T_gi_long From a22c6c60e390dab6e78a901278f293f830bd6e99 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:00:50 -0800 Subject: [PATCH 349/731] check_argparse: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/check_argparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/check_argparse.py b/py-scripts/check_argparse.py index 1702e5c0..56331928 100644 --- a/py-scripts/check_argparse.py +++ b/py-scripts/check_argparse.py @@ -29,7 +29,7 @@ def main(): text = open(os.path.join(args.path, file)).read() results_file = dict() results_file['argparse'] = 'argparse.' in text - if results_file['argparse'] is True: + if results_file['argparse']: results_file['create_basic'] = 'create_basic_argparse' in text results_file['create_bare'] = 'create_bare_argparse' in text results_file['prog'] = 'prog=' in text From aa8c6bebf5b0555c68e557ab8c85c21f445f0189 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:01:20 -0800 Subject: [PATCH 350/731] lf_dfs_test: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/lf_dfs_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/lf_dfs_test.py b/py-scripts/lf_dfs_test.py index 5ed0ff59..afdfc249 100755 --- a/py-scripts/lf_dfs_test.py +++ b/py-scripts/lf_dfs_test.py @@ -1176,7 +1176,7 @@ class L3VariableTime(Realm): def reset_port_check(self): for station_profile in self.station_profiles: if station_profile.reset_port_extra_data['reset_port_enable']: - if station_profile.reset_port_extra_data['reset_port_timer_started'] == False: + if not station_profile.reset_port_extra_data['reset_port_timer_started']: logg.info("reset_port_time_min: {}".format(station_profile.reset_port_extra_data['reset_port_time_min'])) logg.info("reset_port_time_max: {}".format(station_profile.reset_port_extra_data['reset_port_time_max'])) station_profile.reset_port_extra_data['seconds_till_reset'] = \ @@ -1526,7 +1526,7 @@ class L3VariableTime(Realm): gain_ = "0" frequency_ = self.dfs_get_frequency(channel) - if frequency_ == None: + if frequency_ is None: logg.info("frequency_ is : {}".format(frequency_)) exit(1) @@ -1715,8 +1715,8 @@ class L3VariableTime(Realm): while cur_time < interval_time: cur_time = datetime.datetime.now() self.reset_port_check() - if((cur_time > dfs_time) and dfs_radar_sent == False): - if(self.dfs): + if cur_time > dfs_time and not dfs_radar_sent: + if self.dfs: self.dfs_send_radar(initial_channel) dfs_radar_sent = True else: From 130b23a65b3abc5f288de81edc0d87514512cc0d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:01:35 -0800 Subject: [PATCH 351/731] Improve create_bridge function Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 72dd9b5b..8870b308 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -154,6 +154,10 @@ function testgroup_delete_group() { ./testgroup.py --group_name group1 --add_group --add_cx cx0000,cx0001,cx0002 --remove_cx cx0003 ./testgroup.py --group_name group1--del_group --debug --mgr "$MGR" } +function create_bridge_and_station() { + ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR + ./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug --mgr $MGR +} if [[ ${#SHORT} -gt 0 ]]; then testCommands=( @@ -168,7 +172,9 @@ if [[ ${#SHORT} -gt 0 ]]; then --max_stations_5 100 \ --max_stations_dual 200 \ --radio2 1.1.wiphy0 \ - --radio2 1.1.wiphy1 --set 'Basic Client Connectivity' 1 --set 'Multi Band Performance' 1 --set 'Skip 2.4Ghz Tests' 1 --set 'Skip 5Ghz Tests' 1 --set 'Throughput vs Pkt Size' 0 --set 'Capacity' 0 --set 'Stability' 0 --set 'Band-Steering' 0 --set 'Multi-Station Throughput vs Pkt Size' 0 --set 'Long-Term' 0 \ + --radio2 1.1.wiphy1 --set 'Basic Client Connectivity' 1 --set 'Multi Band Performance' 1 --set 'Skip 2.4Ghz Tests' 1 \ + --set 'Skip 5Ghz Tests' 1 --set 'Throughput vs Pkt Size' 0 --set 'Capacity' 0 --set 'Stability' 0 \ + --set 'Band-Steering' 0 --set 'Multi-Station Throughput vs Pkt Size' 0 --set 'Long-Term' 0 \ --pull_report \ --influx_host c7-graphana \ --influx_port 8086 \ @@ -180,7 +186,7 @@ if [[ ${#SHORT} -gt 0 ]]; then else testCommands=( "./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" - "./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug --mgr $MGR" + create_bridge_and_station "./create_chamberview.py -m $MGR -cs 'regression_test' \ --line 'Resource=1.1 Profile=STA-AC Amount=1 Uses-1 $RADIO_USED Freq=-1 DUT=TEST DUT_RADIO=$RADIO_USED Traffic=http' \ --line 'Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=Test DUT_RADIO=$RADIO_USED Traffic=http'" @@ -255,7 +261,7 @@ else #"./lf_multipsk.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --debug" "./lf_report.py" "./lf_report_test.py" - "./lf_rvr_test.py" + # "./lf_rvr_test.py" "./lf_rx_sensitivity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ --instance_name rx-sensitivity-instance --config_name test_con --upstream 1.1.eth2 \ --dut linksys-8450 --duration 15s --station 1.1.sta01500 \ From cf8a5f8d839340697de4dbbe4b3685967a8c8248 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:01:52 -0800 Subject: [PATCH 352/731] monitor_rvr: remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/sandbox/monitor_rvr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/sandbox/monitor_rvr.py b/py-scripts/sandbox/monitor_rvr.py index 2d1dd125..aa96c88d 100755 --- a/py-scripts/sandbox/monitor_rvr.py +++ b/py-scripts/sandbox/monitor_rvr.py @@ -51,7 +51,7 @@ class RunCvScenario(LFCliBase): } self.json_post("/cli-json/load", data) sleep(1) - port_counter = 0; + port_counter = 0 attempts = 6 while (attempts > 0) and (port_counter > 0): sleep(1) @@ -69,7 +69,7 @@ class RunCvScenario(LFCliBase): if (port_counter != 0) and (attempts == 0): print("There appears to be a vAP in this database, quitting.") - pprint(alias_map); + pprint(alias_map) exit(1) data = { From 6a9ee4cb00b8d02e395ed5f6cdcb4210a80865fc Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:02:09 -0800 Subject: [PATCH 353/731] test_l3_longevity_beta: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/sandbox/test_l3_longevity_beta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/sandbox/test_l3_longevity_beta.py b/py-scripts/sandbox/test_l3_longevity_beta.py index 0bfa08a2..ded14a1f 100644 --- a/py-scripts/sandbox/test_l3_longevity_beta.py +++ b/py-scripts/sandbox/test_l3_longevity_beta.py @@ -423,7 +423,7 @@ class L3VariableTime(Realm): def reset_port_check(self): for station_profile in self.station_profiles: if station_profile.reset_port_extra_data['reset_port_enable']: - if station_profile.reset_port_extra_data['reset_port_timer_started'] is False: + if not station_profile.reset_port_extra_data['reset_port_timer_started']: print("reset_port_timer_started {}".format(station_profile.reset_port_extra_data['reset_port_timer_started'])) print("reset_port_time_min: {}".format(station_profile.reset_port_extra_data['reset_port_time_min'])) print("reset_port_time_max: {}".format(station_profile.reset_port_extra_data['reset_port_time_max'])) From c5b08834b20de9e14391035add033662502a2169 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:02:25 -0800 Subject: [PATCH 354/731] Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/scripts_deprecated/cicd_testrail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/scripts_deprecated/cicd_testrail.py b/py-scripts/scripts_deprecated/cicd_testrail.py index bfd38748..f6cdb3a2 100755 --- a/py-scripts/scripts_deprecated/cicd_testrail.py +++ b/py-scripts/scripts_deprecated/cicd_testrail.py @@ -147,7 +147,7 @@ class APIClient: # Update the result in TestRail using send_post function. # Parameters for add_result_for_case is the combination of runid and case id. # status_id is 1 for Passed, 2 For Blocked, 4 for Retest and 5 for Failed - #status_id = 1 if result_flag is True else 5 + #status_id = 1 if result_flag else 5 print("result status is = ", status_id) print("case id=", case_id) From 6f4ff7e2524da1d022460176503d1d2223f6c649 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:02:37 -0800 Subject: [PATCH 355/731] Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/scripts_deprecated/ghost_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/scripts_deprecated/ghost_profile.py b/py-scripts/scripts_deprecated/ghost_profile.py index 5a91843a..30837b39 100755 --- a/py-scripts/scripts_deprecated/ghost_profile.py +++ b/py-scripts/scripts_deprecated/ghost_profile.py @@ -196,7 +196,7 @@ def main(): if args.folder is not None: Ghost.upload_images(args.folder) - if args.kpi_to_ghost is True: + if args.kpi_to_ghost: Ghost.kpi(args.authors, args.folders, args.parent_folder, From d50946f53c38be48fecc19ff9fb1bc7c00e6b345 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:02:47 -0800 Subject: [PATCH 356/731] sta_connect: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index c86314e4..b0328d4d 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -267,7 +267,7 @@ class StaConnect(LFCliBase): else: self._pass("%s connected to AP: %s With IP: %s" % (sta_name, ap, ip)) - if self.passes() == False: + if not self.passes(): if self.cleanup_on_exit: print("Cleaning up...") self.remove_stations() @@ -532,17 +532,14 @@ Example: run_results = staConnect.get_result_list() - - is_passing = staConnect.passes() - if is_passing == False: + if not staConnect.passes(): print("FAIL: Some tests failed") else: print("PASS: All tests pass") print(staConnect.get_all_message()) - is_passing = staConnect.passes() - if is_passing == False: + if not staConnect.passes(): print("FAIL: Some tests failed") else: print("PASS: All tests pass") From 7d32906c8256061b0fe0959cdf649041bdaf38be Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:03:02 -0800 Subject: [PATCH 357/731] sta_connect2.py: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/sta_connect2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index 7f2f0af9..2d3d033c 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -217,7 +217,7 @@ class StaConnect2(LFCliBase): pprint.pprint(self.station_profile) if self.station_profile.up is None: self._fail("Incorrect station profile, missing profile.up") - if self.station_profile.up == False: + if not self.station_profile.up: print("\nBringing ports up...") data = {"shelf": 1, "resource": self.resource, @@ -309,7 +309,7 @@ class StaConnect2(LFCliBase): else: self._pass("%s connected to AP: %s With IP: %s" % (sta_name, ap, ip)) - if self.passes() == False: + if not self.passes(): if self.cleanup_on_exit: print("Cleaning up...") self.remove_stations() @@ -484,7 +484,7 @@ Example: staConnect.stop() run_results = staConnect.get_result_list() is_passing = staConnect.passes() - if is_passing == False: + if not is_passing: print("FAIL: Some tests failed") else: print("PASS: All tests pass") From 69a75872a4da39e7798b1454faa62d3c341b85b5 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:03:14 -0800 Subject: [PATCH 358/731] sta_connect_example: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/sta_connect_example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/sta_connect_example.py b/py-scripts/sta_connect_example.py index 2365858b..4f193489 100755 --- a/py-scripts/sta_connect_example.py +++ b/py-scripts/sta_connect_example.py @@ -65,7 +65,7 @@ def main(): #staConnect.finish() staConnect.cleanup() is_passing = staConnect.passes() - if is_passing == False: + if not is_passing: # run_results = staConnect.get_failed_result_list() fail_message = staConnect.get_fail_message() print("Some tests failed:\n" + fail_message) From db403ed05b881b5a7aa5e88e84339ad2a12e6e52 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:03:34 -0800 Subject: [PATCH 359/731] Sta_connect_multi_example: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/sta_connect_multi_example.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/sta_connect_multi_example.py b/py-scripts/sta_connect_multi_example.py index 0e76de54..999c9187 100755 --- a/py-scripts/sta_connect_multi_example.py +++ b/py-scripts/sta_connect_multi_example.py @@ -64,7 +64,7 @@ Example of how to instantiate StaConnect and run the test print("** endp: "+endp_name) pprint.pprint(test.resulting_endpoints[endp_name]) ''' - if is_passing == False: + if not is_passing: # run_results = staConnect.get_failed_result_list() fail_message = test.get_fail_message() print("Some tests failed:\n" + fail_message) @@ -78,7 +78,7 @@ Example of how to instantiate StaConnect and run the test test.dut_passwd = "jedway-wpa2-x2048-5-1" test.run() is_passing = test.passes() - if is_passing == False: + if not is_passing: # run_results = staConnect.get_failed_result_list() fail_message = test.get_fail_message() print("Some tests failed:\n" + fail_message) @@ -86,7 +86,7 @@ Example of how to instantiate StaConnect and run the test else: print("Tests pass") - if test.cleanup_on_exit == True: + if test.cleanup_on_exit: test.remove_stations() From 20597efed92e0fdc93655fc137604d16d870759f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:03:52 -0800 Subject: [PATCH 360/731] test_ip_variable_time: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/test_ip_variable_time.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index 9ce0f536..77fa4d6d 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -118,7 +118,7 @@ class IPVariableTime(Realm): self.station_profile.mode = mode if self.ap is not None: self.station_profile.set_command_param("add_sta", "ap", self.ap) - if self.use_existing_sta is True: + if self.use_existing_sta: self.station_profile.station_names = self.sta_list self.name_prefix = name_prefix @@ -145,7 +145,7 @@ class IPVariableTime(Realm): self.cx_profile.side_b_max_bps = side_b_max_rate def start(self, print_pass=False, print_fail=False): - # if self.use_existing_station is False: + # if self.use_existing_station: # to-do- check here if upstream port got IP self.station_profile.admin_up() temp_stas = self.station_profile.station_names.copy() @@ -164,13 +164,13 @@ class IPVariableTime(Realm): def pre_cleanup(self): self.cx_profile.cleanup_prefix() # do not clean up station if existed prior to test - if self.use_existing_sta is False: + if not self.use_existing_sta: for sta in self.sta_list: self.rm_port(sta, check_exists=True) def cleanup(self): self.cx_profile.cleanup() - if self.use_existing_sta is False: + if not self.use_existing_sta: self.station_profile.cleanup() LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=self.station_profile.station_names, debug=self.debug) @@ -183,7 +183,7 @@ class IPVariableTime(Realm): self.station_profile.set_command_param("set_port", "report_timer", 1500) self.station_profile.set_command_flag("set_port", "rpt_timer", 1) - if self.use_existing_sta is True: + if self.use_existing_sta: print("Use Existing Stations: {sta_list}".format(sta_list=self.sta_list)) else: print("Creating stations") @@ -229,7 +229,7 @@ class IPVariableTime(Realm): self.build() # exit() # CMR What is this code doing - if self.use_existing_sta is False: + if not self.use_existing_sta: if not self.passes(): print(self.get_fail_message()) self.exit_fail() @@ -309,7 +309,7 @@ class IPVariableTime(Realm): debug=self.debug) self.stop() - if self.use_existing_sta is False: + if not self.use_existing_sta: if not self.passes(): print(self.get_fail_message()) self.exit_fail() @@ -603,7 +603,7 @@ python3 ./test_ip_variable_time.py if (args.num_stations is not None) and (int(args.num_stations) > 0): print("one") num_sta = int(args.num_stations) - if args.use_existing_sta is False: + if not args.use_existing_sta: print("two") station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, From 462e47d5b87ba72b5777dc75d1301dc0ae18d4be Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:04:07 -0800 Subject: [PATCH 361/731] test_l3_longevity: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/test_l3_longevity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 62b67f34..9a9cae77 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -552,7 +552,7 @@ class L3VariableTime(Realm): def reset_port_check(self): for station_profile in self.station_profiles: if station_profile.reset_port_extra_data['reset_port_enable']: - if station_profile.reset_port_extra_data['reset_port_timer_started'] is False: + if not station_profile.reset_port_extra_data['reset_port_timer_started']: print( "reset_port_timer_started {}".format( station_profile.reset_port_extra_data['reset_port_timer_started'])) @@ -2952,7 +2952,7 @@ Setting wifi_settings per radio wifi_settings_found = False break - if wifi_settings_found is True: + if wifi_settings_found: # Check for additional flags if set(('wifi_mode', 'enable_flags')).issubset( radio_info_dict.keys()): From a7274caa6f27b000f53bd66413ee4e1094061aba Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:04:22 -0800 Subject: [PATCH 362/731] test_l3_unicast_traffic_gen: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/test_l3_unicast_traffic_gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/test_l3_unicast_traffic_gen.py b/py-scripts/test_l3_unicast_traffic_gen.py index 25406b45..11be83c8 100755 --- a/py-scripts/test_l3_unicast_traffic_gen.py +++ b/py-scripts/test_l3_unicast_traffic_gen.py @@ -170,7 +170,7 @@ class L3VariableTimeLongevity(LFCliBase): timeout = 20 done = False - while timeout > 0 and done == False: + while timeout > 0 and not done: time.sleep( 1) port_r = self.json_get("/port/1/1/list?fields=alias") if self.debug: From 1d244e69e5f5a93114303c73b34b5117a5b85aa8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:04:41 -0800 Subject: [PATCH 363/731] testrail_api: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/tip-cicd-sanity/testrail_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tip-cicd-sanity/testrail_api.py b/py-scripts/tip-cicd-sanity/testrail_api.py index 6125cf37..c59a99f2 100644 --- a/py-scripts/tip-cicd-sanity/testrail_api.py +++ b/py-scripts/tip-cicd-sanity/testrail_api.py @@ -153,7 +153,7 @@ class APIClient: # Update the result in TestRail using send_post function. # Parameters for add_result_for_case is the combination of runid and case id. # status_id is 1 for Passed, 2 For Blocked, 4 for Retest and 5 for Failed - #status_id = 1 if result_flag is True else 5 + #status_id = 1 if result_flag else 5 print("result status Pass/Fail = ", status_id) print("case id=", case_id) From fb2652a9e8a7df8e8d09ab349ce07ba8a0b29c8e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:04:54 -0800 Subject: [PATCH 364/731] lf_qa: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-scripts/tools/lf_qa.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index fc937259..3912dba3 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -22,7 +22,7 @@ lf_report = lf_report.lf_report external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] -class csv_sql(): +class csv_sql: def __init__(self, _path='.', _file='kpi.csv', @@ -582,16 +582,15 @@ Usage: lf_qa.py --store --png --path --databas database=__database, table=__table, server=__server, store=args.store, png=args.png)) - if(__path == '' and args.store): + if __path == '' and args.store: print("--path must be entered if --store , exiting") exit(1) - - if(args.png and args.store is False): - print("if --png set to create png files then --store must also be set, exiting") - exit(1) - - if args.store is False and args.png is False: - print("Need to enter an action of --store --png ") + elif not args.store: + if args.png: + print("if --png set to create png files then --store must also be set, exiting") + exit(1) + elif not args.png: + print("Need to enter an action of --store --png ") # create report class for reporting report = lf_report(_path=__path, From f7f05b505d3d54702d04a72b7fdb6b248606fa53 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:05:20 -0800 Subject: [PATCH 365/731] update_dependencies: Improve comparisons Signed-off-by: Matthew Stidham --- py-scripts/update_dependencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/update_dependencies.py b/py-scripts/update_dependencies.py index 9236438a..5f4788f4 100755 --- a/py-scripts/update_dependencies.py +++ b/py-scripts/update_dependencies.py @@ -26,7 +26,7 @@ def main(): packages = ['pandas', 'plotly', 'numpy', 'cryptography', 'paramiko', 'bokeh','pyarrow', 'websocket-client', 'xlsxwriter',\ 'pyshark', 'influxdb', 'influxdb-client', 'matplotlib', 'pdfkit', 'pip-search', 'pyserial', 'pexpect-serial' ,'scp',\ 'dash', 'kaleido'] - if args.pyjwt is True: + if args.pyjwt: packages.append('pyjwt') else: print('Not installing PyJWT') From 8a2a466edf231ea093fa4c54c0770849ea132fd3 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:06:19 -0800 Subject: [PATCH 366/731] LFRequest: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-json/LANforge/LFRequest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-json/LANforge/LFRequest.py b/py-json/LANforge/LFRequest.py index 16396426..422e650b 100644 --- a/py-json/LANforge/LFRequest.py +++ b/py-json/LANforge/LFRequest.py @@ -94,7 +94,7 @@ class LFRequest: def form_post(self, show_error=True, debug=False, die_on_error_=False): if self.die_on_error: die_on_error_ = True - if (debug is False) and (self.debug is True): + if not debug and self.debug: debug = True responses = [] urlenc_data = "" @@ -141,7 +141,7 @@ class LFRequest: error_list_=self.error_list, debug_=debug) - if (die_on_error_ is True) or (self.die_on_error is True): + if die_on_error_ or self.die_on_error: exit(1) return None @@ -149,7 +149,7 @@ class LFRequest: return self.json_post(show_error=show_error, debug=debug, die_on_error_=die_on_error_, response_json_list_=response_json_list_) def json_post(self, show_error=True, debug=False, die_on_error_=False, response_json_list_=None, method_='POST'): - if (debug is False) and (self.debug is True): + if not debug and self.debug: debug = True if self.die_on_error: die_on_error_ = True @@ -256,7 +256,7 @@ class LFRequest: error_list_=self.error_list, debug_=self.debug) - if self.die_on_error is True: + if self.die_on_error: exit(1) return None From bd760c7552961852b87c6a1fcf46a02cbe5bd8b8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:06:34 -0800 Subject: [PATCH 367/731] lfcli_base.py: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-json/LANforge/lfcli_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index b99bbe0d..0a1ab30c 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -239,7 +239,7 @@ class LFCliBase: del _data['suppress_postexec_cli'] if 'suppress_postexec_method' in _data: del _data['suppress_postexec_method'] - elif suppress_related_commands_ is False: + elif not suppress_related_commands_: _data['suppress_preexec_cli'] = False _data['suppress_preexec_method'] = False _data['suppress_postexec_cli'] = False From 3a9a0b5de106ce661306948e93fed53c6bdb4860 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:06:48 -0800 Subject: [PATCH 368/731] pandas_extensions: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-json/LANforge/pandas_extensions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/LANforge/pandas_extensions.py b/py-json/LANforge/pandas_extensions.py index 935daa4b..3214d2da 100644 --- a/py-json/LANforge/pandas_extensions.py +++ b/py-json/LANforge/pandas_extensions.py @@ -81,7 +81,7 @@ class pandas_extensions: print(for_loop_df1.at[0, col]) print(for_loop_df2.at[0, col]) if type(for_loop_df1.at[0, col]) == str and type(for_loop_df2.at[0, col]) == str: - if (' ' in for_loop_df1.at[0, col]) == True: + if (' ' in for_loop_df1.at[0, col]): # do subtraction new_value = float(for_loop_df1.at[0, col].split(" ")[0]) - float( for_loop_df2.at[0, col].split(" ")[0]) From e071eaa8564f5b43a0b19427887d07c0abaced6d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:07:03 -0800 Subject: [PATCH 369/731] l3_cxprofile2: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-json/l3_cxprofile2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-json/l3_cxprofile2.py b/py-json/l3_cxprofile2.py index 1bbc3e08..de5398d9 100644 --- a/py-json/l3_cxprofile2.py +++ b/py-json/l3_cxprofile2.py @@ -611,9 +611,9 @@ class L3CXProfile2(BaseProfile): raise ValueError("L3CXProfile::monitor wants duration_sec > 1 second") if (duration_sec <= monitor_interval_ms): raise ValueError("L3CXProfile::monitor wants duration_sec > monitor_interval") - if report_file == None: + if report_file is None: raise ValueError("Monitor requires an output file to be defined") - if created_cx == None: + if created_cx is None: raise ValueError("Monitor needs a list of Layer 3 connections") if (monitor_interval_ms is None) or (monitor_interval_ms < 1): raise ValueError("L3CXProfile::monitor wants monitor_interval >= 1 second") From 75e6d32e3ec596ed4de4d4b9345e142dcc168770 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:07:16 -0800 Subject: [PATCH 370/731] create_sta: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-json/old-examples/create_sta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/old-examples/create_sta.py b/py-json/old-examples/create_sta.py index 0cc40273..e45d911a 100755 --- a/py-json/old-examples/create_sta.py +++ b/py-json/old-examples/create_sta.py @@ -203,7 +203,7 @@ def main(): url = base_url+"/port/1/%s/list?fields=alias" % (resource_id) lf_r = LFRequest.LFRequest(url) json_response = lf_r.getAsJson() - if json_response == None: + if json_response is None: raise Exception("no reponse to: "+url) port_map = LFUtils.portListToAliasMap(json_response) #LFUtils.debug_printer.pprint(port_map) From 160562de80a8e25b5400ff63f9d188a0cd0cf483 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:07:37 -0800 Subject: [PATCH 371/731] wct-example: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-json/old-examples/wct-example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/old-examples/wct-example.py b/py-json/old-examples/wct-example.py index 0d1e1410..94f9cb97 100755 --- a/py-json/old-examples/wct-example.py +++ b/py-json/old-examples/wct-example.py @@ -136,7 +136,7 @@ def main(): # Now lets do some cli-socket scripting gui_telnet = pexpect.spawn('telnet %s %s'%(host, clisock)) - if (gui_telnet == None): + if gui_telnet is None: print ("Unable to telnet to %s:%s"%(host,clisock)); exit(1) From 3b45c4f11bfc4a231191755aa1b69a223516514a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:07:48 -0800 Subject: [PATCH 372/731] port_probe: remove invalid comparisons Signed-off-by: Matthew Stidham --- py-json/port_probe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/port_probe.py b/py-json/port_probe.py index ca58b432..18ec0c49 100644 --- a/py-json/port_probe.py +++ b/py-json/port_probe.py @@ -265,7 +265,7 @@ class ProbePort(LFCliBase): T_gi_long = .8 * 10**-6 # Guard index. # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith - if self.rx_mgt_6Mb_frame is True: + if self.rx_mgt_6Mb_frame: self.rx_mgt_6Mg_frame = False self.rx_data_rate_gi_short_Mbps = None self.rx_data_rate_gi_long_Mbps = None From b2a9200511a38b2c567e0485647c1d259a210e96 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:08:00 -0800 Subject: [PATCH 373/731] realm: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-json/realm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/realm.py b/py-json/realm.py index 2d67ef3a..8154516c 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -525,7 +525,7 @@ class Realm(LFCliBase): # removes port by eid/eidpn def remove_vlan_by_eid(self, eid): - if (eid is None) or ("" == eid): + if (eid is None) or (eid == ""): raise ValueError("removeVlanByEid wants eid like 1.1.sta0 but given[%s]" % eid) hunks = self.name_to_eid(eid) # print("- - - - - - - - - - - - - - - - -") From 357459f3a9dcfe27460c182a2055e1219747c7e3 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:08:12 -0800 Subject: [PATCH 374/731] vr_profile2: Remove invalid comparisons Signed-off-by: Matthew Stidham --- py-json/vr_profile2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-json/vr_profile2.py b/py-json/vr_profile2.py index 7e994ddf..b2870e81 100644 --- a/py-json/vr_profile2.py +++ b/py-json/vr_profile2.py @@ -74,7 +74,7 @@ class VRProfile(BaseProfile): def vr_eid_to_url(self, eid_str=None, debug=False): debug |= self.debug - if (eid_str is None) or ("" == eid_str) or (eid_str.index(".") < 1): + if (eid_str is None) or (eid_str == "") or (eid_str.index(".") < 1): raise ValueError("vr_eid_to_url cannot read eid[%s]" % eid_str) hunks = eid_str.split(".") if len(hunks) > 3: @@ -111,7 +111,7 @@ class VRProfile(BaseProfile): resource=1, debug=False): debug |= self.debug - if (resource is None) or (resource == 0) or ("" == resource): + if (resource is None) or (resource == 0) or (resource == ""): raise ValueError("resource needs to be a number greater than 1") router_map = self.router_list(resource=resource, debug=debug) @@ -334,9 +334,9 @@ class VRProfile(BaseProfile): :return: True if area is inside listed virtual router(s) """ debug |= self.debug - if (resource is None) or (resource == 0) or ("" == resource): + if (resource is None) or (resource == 0) or (resource == ""): raise ValueError("resource needs to be a number greater than 1") - if (vrcx_rect is None) or type(vrcx_rect ) or ("" == resource): + if (vrcx_rect is None) or type(vrcx_rect) or (resource == ""): raise ValueError("resource needs to be a number greater than 1") router_list = self.router_list(resource=resource, debug=debug) #router_list = self.json_get("/vr/1/%s/%s?fields=eid,x,y,height,width") From d587ec4a354576cf7b4b0b75ad470a02cf0f3fcc Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 11:21:30 -0800 Subject: [PATCH 375/731] lf_snp_test: Remove invalid comparison Signed-off-by: Matthew Stidham --- py-scripts/lf_snp_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/lf_snp_test.py b/py-scripts/lf_snp_test.py index d5a54f8f..a39ea321 100755 --- a/py-scripts/lf_snp_test.py +++ b/py-scripts/lf_snp_test.py @@ -1176,7 +1176,7 @@ class L3VariableTime(Realm): def reset_port_check(self): for station_profile in self.station_profiles: if station_profile.reset_port_extra_data['reset_port_enable']: - if station_profile.reset_port_extra_data['reset_port_timer_started'] == False: + if not station_profile.reset_port_extra_data['reset_port_timer_started']: logg.info("reset_port_time_min: {}".format(station_profile.reset_port_extra_data['reset_port_time_min'])) logg.info("reset_port_time_max: {}".format(station_profile.reset_port_extra_data['reset_port_time_max'])) station_profile.reset_port_extra_data['seconds_till_reset'] = \ From ad0d80dab170bf42ee22ec377e4822d720444e22 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 18:46:35 -0800 Subject: [PATCH 376/731] lfcli_base.json_get: Improve json_get debugging Signed-off-by: Matthew Stidham --- py-json/LANforge/lfcli_base.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 0a1ab30c..f54df4b1 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -307,14 +307,14 @@ class LFCliBase: exit(1) return json_response - def json_get(self, _req_url, debug_=False): - debug_ |= self.debug + def json_get(self, _req_url, debug_=None): # if debug_: # print("json_get: "+_req_url) # print("json_get: proxies:") # pprint.pprint(self.proxy) + if debug_ is None: + debug_ = self.debug json_response = None - # print("----- GET ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ") try: lf_r = LFRequest.LFRequest(url=self.lfclient_url, uri=_req_url, @@ -322,8 +322,7 @@ class LFCliBase: debug_=debug_, die_on_error_=self.exit_on_error) json_response = lf_r.get_as_json() - #debug_printer.pprint(json_response) - if (json_response is None): + if json_response is None: if debug_: if hasattr(lf_r, 'print_errors'): lf_r.print_errors() From 60d547a7ec8aba37204f38e68612b61f709c825e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 18:47:07 -0800 Subject: [PATCH 377/731] realm.py: Improve rm_port and port_exists debugging Signed-off-by: Matthew Stidham --- py-json/realm.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/py-json/realm.py b/py-json/realm.py index 8154516c..207b3cc5 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -224,14 +224,15 @@ class Realm(LFCliBase): port_list=sta_list, debug=debug_) - def rm_port(self, port_eid, check_exists=True, debug_=False): + def rm_port(self, port_eid, check_exists=True, debug_=None): if port_eid is None: raise ValueError("realm.rm_port: want a port eid like 1.1.eth1") - debug_ |= self.debug + if debug_ is None: + debug_ = self.debug req_url = "/cli-json/rm_vlan" eid = self.name_to_eid(port_eid) if check_exists: - if not self.port_exists(port_eid): + if not self.port_exists(port_eid, debug=debug_): return False data = { @@ -239,13 +240,16 @@ class Realm(LFCliBase): "resource": eid[1], "port": eid[2] } - rsp = self.json_post(req_url, data, debug_=debug_) + self.json_post(req_url, data, debug_=debug_) return True - def port_exists(self, port_eid): + def port_exists(self, port_eid, debug=None): + if debug is None: + debug = self.debug eid = self.name_to_eid(port_eid) - current_stations = self.json_get("/port/%s/%s/%s?fields=alias" % (eid[0], eid[1], eid[2])) - if not current_stations is None: + current_stations = self.json_get("/port/%s/%s/%s?fields=alias" % (eid[0], eid[1], eid[2]), + debug_=debug) + if current_stations is not None: return True return False From 2598ac42d999b7de6e3909369dd9462c992dab75 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 18:47:39 -0800 Subject: [PATCH 378/731] station_profile: Improve cleanup debugging Signed-off-by: Matthew Stidham --- py-json/station_profile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/py-json/station_profile.py b/py-json/station_profile.py index eb515284..687c7600 100644 --- a/py-json/station_profile.py +++ b/py-json/station_profile.py @@ -359,7 +359,7 @@ class StationProfile: def cleanup(self, desired_stations=None, delay=0.03, debug_=False): print("Cleaning up stations") - if (desired_stations is None): + if desired_stations is None: desired_stations = self.station_names if len(desired_stations) < 1: @@ -371,7 +371,9 @@ class StationProfile: self.local_realm.rm_port(port_eid, check_exists=True, debug_=debug_) time.sleep(delay) # And now see if they are gone - LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=desired_stations) + LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, + port_list=desired_stations, + debug=debug_) # Checks for errors in initialization values and creates specified number of stations using init parameters def create(self, radio, From 1a6881edf24fb010ba3415fb8fc479cadb99bf28 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 16 Nov 2021 18:48:04 -0800 Subject: [PATCH 379/731] test_ip_variable_time: Cleanup debug output Signed-off-by: Matthew Stidham --- py-scripts/test_ip_variable_time.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index 77fa4d6d..3b81f8b9 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -82,7 +82,8 @@ class IPVariableTime(Realm): if layer3_cols is None: layer3_cols = ['name', 'tx bytes', 'rx bytes', 'tx rate', 'rx rate'] super().__init__(lfclient_host=host, - lfclient_port=port), + lfclient_port=port, + debug_=_debug_on), self.upstream = upstream self.host = host self.port = port @@ -166,7 +167,7 @@ class IPVariableTime(Realm): # do not clean up station if existed prior to test if not self.use_existing_sta: for sta in self.sta_list: - self.rm_port(sta, check_exists=True) + self.rm_port(sta, check_exists=True, debug_=False) def cleanup(self): self.cx_profile.cleanup() From c5f08b9c5070ede03f60c53b915807dfaef1e220 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 17 Nov 2021 04:12:33 -0700 Subject: [PATCH 380/731] port_probe.py : beginning of HE calculations Signed-off-by: Chuck SmileyRekiere --- py-json/port_probe.py | 201 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) diff --git a/py-json/port_probe.py b/py-json/port_probe.py index 18ec0c49..ae58e342 100644 --- a/py-json/port_probe.py +++ b/py-json/port_probe.py @@ -72,6 +72,9 @@ class ProbePort(LFCliBase): signals = [x.strip('\t').split('\t') for x in text if 'signal' in x] keys = [x[0].strip(' ').strip(':') for x in signals] values = [x[1].strip('dBm').strip(' ') for x in signals] + # if self.debug: + print("signals keys: {keys}".format(keys=keys)) + print("signals values: {values}".format(values=values)) self.signals = dict(zip(keys, values)) tx_bitrate = [x for x in text if 'tx bitrate' in x][0].replace('\t', ' ') @@ -538,3 +541,201 @@ class ProbePort(LFCliBase): else: self.rx_mbit_calc = self.rx_data_rate_gi_long_Mbps self.rx_gi = T_gi_long + + ########################################### + # + # HE no OFDMA - changes the calculations + # + ########################################### + def calculated_data_rate_tx_HE(self): + # TODO compare with standard for 40 MHz if values change + N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith + N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) + R = 0 # coding , (Determined by the modulation, MCS ) + N_ss = 0 # Number of Spatial Streams + T_dft = 3.2 * 10**-6 # Constant for HT + T_gi_short = .4 * 10**-6 # Guard index. + T_gi_long = .8 * 10**-6 # Guard index. + bw = 20 + # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 + # the nubmer of Data Subcarriers is based on modulation and bandwith + try: + bw = int(self.tx_mhz) + except BaseException: + print("port_probe.py: WARNING unable to parse tx MHz (BW) , check probe output will use {bw}".format(bw=bw)) + + print("Mhz {Mhz}".format(Mhz=self.tx_mhz)) + if bw == 20: + N_sd = 52 + elif bw == 40: + N_sd = 108 + elif bw == 80: + N_sd = 234 + elif bw == 160: + N_sd = 468 + else: + print("For HT if cannot be read bw is assumed to be 20") + N_sd = 52 + self.tx_mhz = 20 + + # NSS + N_ss = self.tx_nss + # MCS (Modulation Coding Scheme) determines the constands + # MCS 0 == Modulation BPSK R = 1/2 , N_bpscs = 1, + # Only for HT configuration + if self.tx_mcs == 0 : + R = 1 / 2 + N_bpscs = 1 + # MCS 1 == Modulation QPSK R = 1/2 , N_bpscs = 2 + elif self.tx_mcs == 1 : + R = 1 / 2 + N_bpscs = 2 + # MCS 2 == Modulation QPSK R = 3/4 , N_bpscs = 2 + elif self.tx_mcs == 2 : + R = 3 / 4 + N_bpscs = 2 + # MCS 3 == Modulation 16-QAM R = 1/2 , N_bpscs = 4 + elif self.tx_mcs == 3 : + R = 1 / 2 + N_bpscs = 4 + # MCS 4 == Modulation 16-QAM R = 3/4 , N_bpscs = 4 + elif self.tx_mcs == 4 : + R = 3 / 4 + N_bpscs = 4 + # MCS 5 == Modulation 64-QAM R = 2/3 , N_bpscs = 6 + elif self.tx_mcs == 5 : + R = 2 / 3 + N_bpscs = 6 + # MCS 6 == Modulation 64-QAM R = 3/4 , N_bpscs = 6 + elif self.tx_mcs == 6 : + R = 3 / 4 + N_bpscs = 6 + # MCS 7 == Modulation 64-QAM R = 5/6 , N_bpscs = 6 + elif self.tx_mcs == 7 : + R = 5 / 6 + N_bpscs = 6 + # MCS 8 == Modulation 256-QAM R = 3/4 , N_bpscs = 8 + elif self.tx_mcs == 8 : + R = 3 / 4 + N_bpscs = 8 + # MCS 9 == Modulation 256-QAM R = 5/6 , N_bpscs = 8 + elif self.tx_mcs == 9 : + R = 5 / 6 + N_bpscs = 8 + + print("tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( + mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) + + self.tx_data_rate_gi_short_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_short)) / 1000000 + print("tx_data_rate gi_short {data_rate} Mbit/s".format(data_rate=self.tx_data_rate_gi_short_Mbps)) + + print("tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( + mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) + + self.tx_data_rate_gi_long_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_long)) / 1000000 + print("data_rate gi_long {data_rate} Mbps".format(data_rate=self.tx_data_rate_gi_long_Mbps)) + + if abs(self.tx_mbit - self.tx_data_rate_gi_short_Mbps) <= abs(self.tx_mbit - self.tx_data_rate_gi_long_Mbps): + self.tx_mbit_calc = self.tx_data_rate_gi_short_Mbps + self.tx_gi = T_gi_short + else: + self.tx_mbit_calc = self.tx_data_rate_gi_long_Mbps + self.tx_gi = T_gi_long + + def calculated_data_rate_rx_HE(self): + N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith + N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) + R = 0 # coding , (Determined by the modulation, MCS ) + N_ss = 0 # Number of Spatial Streams + T_dft = 3.2 * 10**-6 # Constant for HT + T_gi_short = .4 * 10**-6 # Guard index. + T_gi_long = .8 * 10**-6 # Guard index. + # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 + # the nubmer of Data Subcarriers is based on modulation and bandwith + if self.rx_mgt_6Mb_frame is True: + self.rx_mgt_6Mg_frame = False + self.rx_data_rate_gi_short_Mbps = None + self.rx_data_rate_gi_long_Mbps = None + else: + try: + bw = int(self.rx_mhz) + except BaseException: + print("port_probe.py: {} WARNING unable to parse rx MHz (BW) , check probe output will use ") + + print("Mhz {Mhz}".format(Mhz=self.rx_mhz)) + if bw == 20: + N_sd = 52 + elif bw == 40: + N_sd = 108 + elif bw == 80: + N_sd = 234 + elif bw == 160: + N_sd = 468 + else: + print("For HT if cannot be read bw is assumed to be 20") + N_sd = 52 + self.rx_mhz = 20 + + # NSS + N_ss = self.rx_nss + # MCS (Modulation Coding Scheme) determines the constands + # MCS 0 == Modulation BPSK R = 1/2 , N_bpscs = 1, + # Only for HT configuration + if self.rx_mcs == 0 : + R = 1 / 2 + N_bpscs = 1 + # MCS 1 == Modulation QPSK R = 1/2 , N_bpscs = 2 + elif self.rx_mcs == 1 : + R = 1 / 2 + N_bpscs = 2 + # MCS 2 == Modulation QPSK R = 3/4 , N_bpscs = 2 + elif self.rx_mcs == 2 : + R = 3 / 4 + N_bpscs = 2 + # MCS 3 == Modulation 16-QAM R = 1/2 , N_bpscs = 4 + elif self.rx_mcs == 3 : + R = 1 / 2 + N_bpscs = 4 + # MCS 4 == Modulation 16-QAM R = 3/4 , N_bpscs = 4 + elif self.rx_mcs == 4 : + R = 3 / 4 + N_bpscs = 4 + # MCS 5 == Modulation 64-QAM R = 2/3 , N_bpscs = 6 + elif self.rx_mcs == 5 : + R = 2 / 3 + N_bpscs = 6 + # MCS 6 == Modulation 64-QAM R = 3/4 , N_bpscs = 6 + elif self.rx_mcs == 6 : + R = 3 / 4 + N_bpscs = 6 + # MCS 7 == Modulation 64-QAM R = 5/6 , N_bpscs = 6 + elif self.rx_mcs == 7 : + R = 5 / 6 + N_bpscs = 6 + # MCS 8 == Modulation 256-QAM R = 3/4 , N_bpscs = 8 + elif self.rx_mcs == 8 : + R = 3 / 4 + N_bpscs = 8 + # MCS 9 == Modulation 256-QAM R = 5/6 , N_bpscs = 8 + elif self.rx_mcs == 9 : + R = 5 / 6 + N_bpscs = 8 + + print("mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( + mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) + + self.rx_data_rate_gi_short_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_short)) / 1000000 + print("rx_data_rate gi_short {data_rate} Mbit/s".format(data_rate=self.rx_data_rate_gi_short_Mbps)) + + print("mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( + mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) + + self.rx_data_rate_gi_long_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_long)) / 1000000 + print("rx_data_rate gi_long {data_rate} Mbps".format(data_rate=self.rx_data_rate_gi_long_Mbps)) + + if abs(self.rx_mbit - self.rx_data_rate_gi_short_Mbps) <= abs(self.rx_mbit - self.rx_data_rate_gi_long_Mbps): + self.rx_mbit_calc = self.rx_data_rate_gi_short_Mbps + self.rx_gi = T_gi_short + else: + self.rx_mbit_calc = self.rx_data_rate_gi_long_Mbps + self.rx_gi = T_gi_long From 7261a9f032f0f676097ec0a7adccfbe8971702e5 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 17 Nov 2021 06:15:23 -0700 Subject: [PATCH 381/731] lf_qa.py : fixed paths in report when not running with a server lf_check.py : added --server input and TEST_SERVER parameter Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 4 ++-- py-scripts/tools/lf_check.py | 14 ++++++++++++++ py-scripts/tools/lf_qa.py | 6 +++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index d9a64bd8..62362921 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -36,7 +36,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -63,7 +63,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server 'http://192.168.95.6/' --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 32f5673d..1b93537f 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -131,6 +131,7 @@ class lf_check(): _json_dut, _json_test, _test_suite, + _test_server, _db_override, _production, _csv_results, @@ -142,6 +143,7 @@ class lf_check(): self.json_dut = _json_dut self.json_test = _json_test self.test_suite = _test_suite + self.test_server = _test_server self.db_override = _db_override self.production_run = _production self.report_path = _report_path @@ -797,6 +799,10 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( 'REPORT_PATH', self.report_path) + if 'TEST_SERVER' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( + 'TEST_SERVER', self.test_server) + if 'DUT_SET_NAME' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_SET_NAME', self.dut_set_name) @@ -1145,6 +1151,10 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a '--suite', help="--suite default TEST_DICTIONARY", default="TEST_DICTIONARY") + parser.add_argument( + '--server', + help="--server http:/// example: http://192.168.95.6/ default: ''", + default='') parser.add_argument( '--db_override', help="--db_override override for json DATABASE_SQLITE''", @@ -1191,6 +1201,9 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # select test suite test_suite = args.suite + + test_server = args.server + __dir = args.dir __path = args.path @@ -1222,6 +1235,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a _json_dut=json_dut, _json_test=json_test, _test_suite=test_suite, + _test_server=test_server, _db_override=db_override, _production=production, _csv_results=csv_results, diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 3912dba3..0000ffc9 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -28,7 +28,7 @@ class csv_sql: _file='kpi.csv', _database='qa_db', _table='qa_table', - _server='http://192.168.95.6/', + _server='', _cut='/home/lanforge/', _png=False): self.path = _path @@ -544,8 +544,8 @@ Usage: lf_qa.py --store --png --path --databas default='qa_table') parser.add_argument( '--server', - help='--server http:/// default: http://192.168.95.6/', - default='http://192.168.95.6/') + help="--server http:/// example: http://192.168.95.6/ default: ''", + default='') parser.add_argument( '--cut', help='--cut /home/lanforge/ used to adjust server path default: /home/lanforge/', From 89b7d57cea1ed5df49d2d31ee36c6eaba6dd69c5 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 17 Nov 2021 07:17:51 -0700 Subject: [PATCH 382/731] ct_us_X_tests.json updated for supporting TEST_SERVER being passed in Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_tests.json | 2 +- py-scripts/tools/ct_us_001_tests.json | 12 ++++++------ py-scripts/tools/ct_us_002_tests.json | 6 +++--- py-scripts/tools/ct_us_003_tests.json | 8 ++++---- py-scripts/tools/ct_us_004_tests.json | 12 ++++++------ 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/py-scripts/tools/ct_tests.json b/py-scripts/tools/ct_tests.json index 8f28e92a..52430ad6 100644 --- a/py-scripts/tools/ct_tests.json +++ b/py-scripts/tools/ct_tests.json @@ -52,7 +52,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } } diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 62362921..4fec6d2b 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -63,7 +63,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --server 'http://192.168.95.6/' --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -88,7 +88,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } @@ -194,7 +194,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -518,7 +518,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -842,7 +842,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -904,7 +904,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } } diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 5d493099..a9742db5 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -24,7 +24,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -81,7 +81,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -310,7 +310,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } } diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index 6bb418fd..f0f1539a 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -39,7 +39,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -131,7 +131,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -454,7 +454,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -516,7 +516,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } } diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index d3fa33a0..68d0e5e0 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -37,7 +37,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -63,7 +63,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -155,7 +155,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -480,7 +480,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -805,7 +805,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -867,7 +867,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } } From 7b9946e756d08f1d332d7d902fa34b988d639bd6 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 17 Nov 2021 07:36:44 -0700 Subject: [PATCH 383/731] ct_us_00X_tests.json : updated nightly script name Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_002_tests.json | 2 +- py-scripts/tools/ct_us_003_tests.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index a9742db5..94bccda7 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -85,7 +85,7 @@ ] } }, - "suite_wc_dp":{ + "suite_wc_dp_nightly":{ "lf_help_check":{ "enabled":"TRUE", "load_db":"skip", diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index f0f1539a..9d453d5d 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -135,7 +135,7 @@ ] } }, - "suite_wc_dp":{ + "suite_wc_dp_nightly":{ "lf_help_check":{ "enabled":"TRUE", "load_db":"skip", From 4bad6732f8cca9a5d36b1e0bdb0ded92e0cecfc1 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 17 Nov 2021 11:00:03 -0700 Subject: [PATCH 384/731] ct_us_001_scripts.json : added cleanup for cxs and sta prior to the test Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 75b803ee..2298e41e 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -97,6 +97,12 @@ "args_list":[" --mgr LF_MGR_IP " ] }, + "test_ip_variable_time0-ipv4":{ + "enabled":"TRUE", + "command":"test_ip_variable_time.py", + "args":"", + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"] + }, "lf_qa":{ "enabled":"TRUE", "timeout":"600", @@ -118,6 +124,15 @@ " " ] }, + "lf_cleanup":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + "--mgr LF_MGR_IP --cxs --sta " + ] + }, "create_chamberview_dut_ATH10K_9984__wc":{ "enabled":"TRUE", "load_db":"skip", From 2ea53395b9fe411f83c88d95b38425470c1a9021 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 17 Nov 2021 11:19:27 -0700 Subject: [PATCH 385/731] lf_check.py : check for subtest failures Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 1b93537f..2c849bbc 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1005,7 +1005,10 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) # leave the space in after error to not pick up tx # errors or rx errors elif 'error ' in text.lower(): - self.test_result = "Test Fail" + self.test_result = "Test Errors" + background = self.background_red + elif 'tests failed': + self.test_result = "Tests Failed" background = self.background_orange else: self.test_result = "Success" From 495dafff122e9a27623cae4143147ff29e330c78 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 17 Nov 2021 11:27:29 -0700 Subject: [PATCH 386/731] ct_us_001_scripts.json - minor name change Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 2298e41e..63fb63f3 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -114,7 +114,7 @@ ] } }, - "suite_daily":{ + "suite_scripts":{ "lf_help_check":{ "enabled":"TRUE", "load_db":"skip", From e4bbca94829748701213f648808370abac087e9b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 17 Nov 2021 10:30:03 -0800 Subject: [PATCH 387/731] test_ip_connection: remove redundancies and don't trigger error warnings for non-existant stations during pre-cleanup Signed-off-by: Matthew Stidham --- py-scripts/test_ip_connection.py | 43 +++++++++++++++++--------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/py-scripts/test_ip_connection.py b/py-scripts/test_ip_connection.py index eb69a5e4..161b4ef4 100755 --- a/py-scripts/test_ip_connection.py +++ b/py-scripts/test_ip_connection.py @@ -33,14 +33,12 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) -lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") -LFCliBase = lfcli_base.LFCliBase LFUtils = importlib.import_module("py-json.LANforge.LFUtils") realm = importlib.import_module("py-json.realm") Realm = realm.Realm -class ConnectTest(LFCliBase): +class ConnectTest(Realm): def __init__(self, _ssid=None, _security=None, @@ -48,6 +46,7 @@ class ConnectTest(LFCliBase): _host=None, _port=None, _sta_list=None, + _use_existing_sta=False, _number_template="00000", _radio="wiphy0", _proxy_str=None, @@ -59,23 +58,19 @@ class ConnectTest(LFCliBase): _mode=0, _num_stations=0, _timeout=120): - super().__init__(_host, - _port, + super().__init__(lfclient_host=_host, + lfclient_port=_port, + _exit_on_error=_exit_on_error, + _exit_on_fail=_exit_on_fail, _proxy_str=_proxy_str, - _local_realm=realm.Realm(lfclient_host=_host, - lfclient_port=_port, - _exit_on_error=_exit_on_error, - _exit_on_fail=_exit_on_fail, - _proxy_str=_proxy_str, - debug_=_debug_on), - _debug=_debug_on, - _exit_on_fail=_exit_on_fail) + debug_=_debug_on) self.host = _host self.port = _port self.ssid = _ssid self.security = _security self.password = _password self.sta_list = _sta_list + self.use_existing_sta = _use_existing_sta self.radio = _radio self.timeout = 120 self.number_template = _number_template @@ -85,7 +80,7 @@ class ConnectTest(LFCliBase): self.ipv6 = _ipv6 self.num_stations = _num_stations - self.station_profile = self.local_realm.new_station_profile() + self.station_profile = self.new_station_profile() self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = self.ssid self.station_profile.ssid_pass = self.password @@ -116,9 +111,9 @@ class ConnectTest(LFCliBase): print("Starting test...") for sec in range(self.timeout): for sta_name in sta_list: - shelf = self.local_realm.name_to_eid(sta_name)[0] - resource = self.local_realm.name_to_eid(sta_name)[1] - name = self.local_realm.name_to_eid(sta_name)[2] + shelf = self.name_to_eid(sta_name)[0] + resource = self.name_to_eid(sta_name)[1] + name = self.name_to_eid(sta_name)[2] if self.ipv6: url = "port/%s/%s/%s?fields=port,alias,ipv6+address,ap" % (shelf, resource, name) else: @@ -182,9 +177,15 @@ class ConnectTest(LFCliBase): debug=self.debug) time.sleep(1) + def pre_cleanup(self): + # do not clean up station if existed prior to test + if not self.use_existing_sta: + for sta in self.sta_list: + self.rm_port(sta, check_exists=True, debug_=False) + def main(): - parser = LFCliBase.create_basic_argparse( + parser = Realm.create_basic_argparse( prog='test_ip_connection.py', formatter_class=argparse.RawTextHelpFormatter, epilog='''\ @@ -229,10 +230,11 @@ Generic ipv4 command example: if optional is not None: optional.add_argument("--ipv6", help="Use ipv6 connections instead of ipv4", action="store_true", default=False) optional.add_argument("--ap", help="Add BSSID of access point to connect to") - optional.add_argument('--mode', help=LFCliBase.Help_Mode) + optional.add_argument('--mode', help=Realm.Help_Mode) optional.add_argument('--timeout', help='--timeout sets the length of time to wait until a connection is successful', default=30) + parser.add_argument('--use_existing_sta', help='Used an existing stationsto a particular AP', action='store_true') args = parser.parse_args() @@ -257,6 +259,7 @@ Generic ipv4 command example: _password=args.passwd, _security=args.security, _sta_list=station_list, + _use_existing_sta=args.use_existing_sta, _radio=args.radio, _proxy_str=args.proxy, _debug_on=args.debug, @@ -265,7 +268,7 @@ Generic ipv4 command example: _mode=args.mode, _timeout=args.timeout) - ip_test.cleanup(station_list) + ip_test.pre_cleanup() ip_test.build() if not ip_test.passes(): print(ip_test.get_fail_message()) From f70a59d55120f9386cb9780ec0a25a42f5110223 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 17 Nov 2021 11:24:53 -0800 Subject: [PATCH 388/731] create_l3_stations: Do not flag error messages if ports do not exist during pre-cleanup Signed-off-by: Matthew Stidham --- py-scripts/create_l3_stations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/create_l3_stations.py b/py-scripts/create_l3_stations.py index 354804f3..df5ea5ff 100755 --- a/py-scripts/create_l3_stations.py +++ b/py-scripts/create_l3_stations.py @@ -91,7 +91,7 @@ class CreateL3(Realm): def pre_cleanup(self): self.cx_profile.cleanup_prefix() for sta in self.sta_list: - self.rm_port(sta, check_exists=True) + self.rm_port(sta, check_exists=True, debug_=False) def build(self): From 9d6a19bb7275223aa3a37560b4c29f04242d15cf Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 17 Nov 2021 14:41:38 -0800 Subject: [PATCH 389/731] regression_test improvements Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 8870b308..f0f37d79 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -162,7 +162,11 @@ function create_bridge_and_station() { if [[ ${#SHORT} -gt 0 ]]; then testCommands=( # run_l3_longevity - # "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" + "./test_ip_connection.py --radio $RADIO_USED --num_stations $NUM_STA --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" + "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format excel --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" + "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" + "./test_ip_connection.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --ipv6" + "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" "./lf_ap_auto_test.py --mgr ${MGR} --port 8080 --lf_user lanforge --lf_password lanforge --instance_name ap-auto-instance \ --config_name test_con \ --upstream 1.1.eth2 \ @@ -286,7 +290,7 @@ else --channel 52 \ --radio_mode AUTO" "./lf_snp_test.py --mgr $MGR" - "./lf_tr398_test.py --mgr $MGR" + "./lf_tr398_test.py --mgr $MGR --upstream $UPSTREAM" #./lf_webpage "./lf_wifi_capacity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ --instance_name this_inst --config_name test_con --upstream 1.1.eth2 --batch_size 1,5,25,50,100 --loop_iter 1 \ @@ -296,7 +300,8 @@ else #--influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ #--influx_bucket ben \ #"./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --debug --report_file measure_station_time_up.txt" - "./create_station.py --radio $RADIO_USED --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED && ./modify_station.py \ + "./create_station.py --mgr $MGR --radio $RADIO_USED --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED && ./modify_station.py \ + --mgr $MGR \ --radio $RADIO_USED \ --station 1.1.sta0000 \ --security $SECURITY \ @@ -305,7 +310,6 @@ else --enable_flag osen_enable \ --disable_flag ht160_enable \ --debug" - "./modify_vap.py --radio $RADIO_USED --vap 1.1.vap0000 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --enable_flag osen_enable --disable_flag ht160_enable --debug" #recordinflux.py "./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test Dataplane --test_profile http --cv_scenario ct-us-001" #scenario.py From b83e8676fd921ae3cfe888d0df80fd2aa1994ea7 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 17 Nov 2021 15:00:05 -0800 Subject: [PATCH 390/731] desktop-hostname.bash: bases fill color on end of mac address Signed-off-by: Jed Reynolds --- desktop-hostname.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/desktop-hostname.bash b/desktop-hostname.bash index 9e05f53e..409c4dca 100755 --- a/desktop-hostname.bash +++ b/desktop-hostname.bash @@ -12,10 +12,11 @@ my_hostname=`hostname` my_dev=`ip ro sho | awk '/default via/{print $5}'` my_ip=`ip a sho $my_dev | awk '/inet /{print $2}'` my_mac=`ip a sho | grep -B1 "$my_dev" | awk '/ether /{print $2}'` - +fill_color=${my_mac//:/} +fill_color=${fill_color:6:12} X=220 Y=150 -convert -pointsize 80 -fill cyan \ +convert -pointsize 80 -fill "#$fill_color" \ -draw "text $X,$Y \"$my_hostname\"" \ -draw "text $X,$(( Y + 75 )) \"$my_dev $my_ip\"" \ -draw "text $X,$(( Y + 150 )) \"$my_mac\"" \ From f70ea39f1f5315ef44486c291a86c62b3875da13 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 17 Nov 2021 14:59:36 -0800 Subject: [PATCH 391/731] station_profile: Implement modify_station patch so it can get resource and shelf information from --station flag Signed-off-by: Matthew Stidham --- py-json/station_profile.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/py-json/station_profile.py b/py-json/station_profile.py index 687c7600..912949b5 100644 --- a/py-json/station_profile.py +++ b/py-json/station_profile.py @@ -553,8 +553,15 @@ class StationProfile: self.add_sta_data["flags"] = self.add_named_flags(self.desired_add_sta_flags, add_sta.add_sta_flags) self.add_sta_data["flags_mask"] = self.add_named_flags(self.desired_add_sta_flags_mask, add_sta.add_sta_flags) + + station_eid = self.local_realm.name_to_eid(station) + station_shelf = station_eid[0] + station_resource = station_eid[1] + station_port = station_eid[2] self.add_sta_data["radio"] = radio - self.add_sta_data["sta_name"] = station + self.add_sta_data["shelf"] = station_shelf + self.add_sta_data["resource"] = station_resource + self.add_sta_data["sta_name"] = station_port self.add_sta_data["ssid"] = 'NA' self.add_sta_data["key"] = 'NA' self.add_sta_data['mac'] = 'NA' From 505c21de1f327046a05b22c8eee41e50fea685d1 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 17 Nov 2021 12:56:39 -0700 Subject: [PATCH 392/731] lf_check.py : fixed bug in check for tests failed Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 2c849bbc..55e87517 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1007,8 +1007,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) elif 'error ' in text.lower(): self.test_result = "Test Errors" background = self.background_red - elif 'tests failed': - self.test_result = "Tests Failed" + elif 'tests failed' in text.lower(): + self.test_result = "Some Tests Failed" background = self.background_orange else: self.test_result = "Success" From 2528ab2291fc561b68fa370a9dfe41c3f9e2a470 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 17 Nov 2021 17:27:33 -0800 Subject: [PATCH 393/731] desktop-hostname.bash: adds outline to font Signed-off-by: Jed Reynolds --- desktop-hostname.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop-hostname.bash b/desktop-hostname.bash index 409c4dca..119603a8 100755 --- a/desktop-hostname.bash +++ b/desktop-hostname.bash @@ -16,7 +16,7 @@ fill_color=${my_mac//:/} fill_color=${fill_color:6:12} X=220 Y=150 -convert -pointsize 80 -fill "#$fill_color" \ +convert -pointsize 80 -fill "#$fill_color" -stroke black -strokewidth 1 \ -draw "text $X,$Y \"$my_hostname\"" \ -draw "text $X,$(( Y + 75 )) \"$my_dev $my_ip\"" \ -draw "text $X,$(( Y + 150 )) \"$my_mac\"" \ From 778450718cf1bf452a120b565e33493ac0d8f7aa Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 17 Nov 2021 16:29:38 -0800 Subject: [PATCH 394/731] sta_connect_example.py: Remove useless code. Use mgr and debug flags Signed-off-by: Matthew Stidham --- py-scripts/sta_connect_example.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/py-scripts/sta_connect_example.py b/py-scripts/sta_connect_example.py index 4f193489..ccd26cc6 100755 --- a/py-scripts/sta_connect_example.py +++ b/py-scripts/sta_connect_example.py @@ -25,17 +25,6 @@ def main(): prog='sta_connect_example.py', formatter_class=argparse.RawTextHelpFormatter ) - required_args=None - for group in parser._action_groups: - if group.title == "required arguments": - required_args=group - break; - - optional_args=None - for group in parser._action_groups: - if group.title == "optional arguments": - optional_args=group - break; args = parser.parse_args() if args.upstream_port is None: @@ -48,7 +37,7 @@ def main(): args.security = sta_connect.WPA2 if args.radio is None: args.radio = "wiphy0" - staConnect = StaConnect("localhost", 8080, _debugOn=False) + staConnect = StaConnect(args.mgr, args.mgr_port, _debugOn=args.debug) staConnect.sta_mode = 0 staConnect.upstream_resource = 1 staConnect.upstream_port = args.upstream_port From 3d45174f3bb204c8cd73b7bd559ea00b532cde11 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 17 Nov 2021 17:33:51 -0800 Subject: [PATCH 395/731] regression_test: improve sta_connect and sta_connect_example queries Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index f0f37d79..1f70c016 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -162,30 +162,8 @@ function create_bridge_and_station() { if [[ ${#SHORT} -gt 0 ]]; then testCommands=( # run_l3_longevity - "./test_ip_connection.py --radio $RADIO_USED --num_stations $NUM_STA --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format excel --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" - "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" - "./test_ip_connection.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --ipv6" - "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" - "./lf_ap_auto_test.py --mgr ${MGR} --port 8080 --lf_user lanforge --lf_password lanforge --instance_name ap-auto-instance \ - --config_name test_con \ - --upstream 1.1.eth2 \ - --dut5_0 'linksys-8450 Default-SSID-5gl c4:41:1e:f5:3f:25 (2)' \ - --dut2_0 'linksys-8450 Default-SSID-2g c4:41:1e:f5:3f:24 (1)' \ - --max_stations_2 100 \ - --max_stations_5 100 \ - --max_stations_dual 200 \ - --radio2 1.1.wiphy0 \ - --radio2 1.1.wiphy1 --set 'Basic Client Connectivity' 1 --set 'Multi Band Performance' 1 --set 'Skip 2.4Ghz Tests' 1 \ - --set 'Skip 5Ghz Tests' 1 --set 'Throughput vs Pkt Size' 0 --set 'Capacity' 0 --set 'Stability' 0 \ - --set 'Band-Steering' 0 --set 'Multi-Station Throughput vs Pkt Size' 0 --set 'Long-Term' 0 \ - --pull_report \ - --influx_host c7-graphana \ - --influx_port 8086 \ - --influx_org Candela \ - --influx_token=-u_Wd-8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ - --influx_bucket ben \ - --influx_tag testbed Ferndale-01" + "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 30s" + "./sta_connect.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" ) else testCommands=( @@ -315,8 +293,8 @@ else #scenario.py #"./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C" #./sta_connect_bssid_mac.py - "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED" - #sta_connect.py + "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" + "./sta_connect.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" "./sta_scan_test.py --ssid $SSID_USED --security $SECURITY --passwd $PASSWD_USED --radio $RADIO_USED" #station_layer3.py #stations_connected.py From 81bbc64dbc4444b1fd48e283ea873bf3363b56ba Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 17 Nov 2021 17:34:15 -0800 Subject: [PATCH 396/731] sta_connect_example: Improve argparser and staconnect query Signed-off-by: Matthew Stidham --- py-scripts/sta_connect_example.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/py-scripts/sta_connect_example.py b/py-scripts/sta_connect_example.py index ccd26cc6..685d1961 100755 --- a/py-scripts/sta_connect_example.py +++ b/py-scripts/sta_connect_example.py @@ -25,8 +25,11 @@ def main(): prog='sta_connect_example.py', formatter_class=argparse.RawTextHelpFormatter ) + parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m") args = parser.parse_args() + + monitor_interval = LFCliBase.parse_time(args.test_duration).total_seconds() if args.upstream_port is None: args.upstream_port = "eth2" if args.ssid is None: @@ -37,7 +40,7 @@ def main(): args.security = sta_connect.WPA2 if args.radio is None: args.radio = "wiphy0" - staConnect = StaConnect(args.mgr, args.mgr_port, _debugOn=args.debug) + staConnect = StaConnect(args.mgr, args.mgr_port, _debugOn=args.debug, _runtime_sec=monitor_interval) staConnect.sta_mode = 0 staConnect.upstream_resource = 1 staConnect.upstream_port = args.upstream_port @@ -46,12 +49,12 @@ def main(): staConnect.dut_security = args.security staConnect.dut_ssid = args.ssid staConnect.dut_passwd = args.passwd - staConnect.station_names = [ "sta000" ] + staConnect.station_names = ["sta000"] staConnect.setup() staConnect.start() time.sleep(20) staConnect.stop() - #staConnect.finish() + # staConnect.finish() staConnect.cleanup() is_passing = staConnect.passes() if not is_passing: @@ -67,5 +70,3 @@ def main(): if __name__ == '__main__': main() - -# From 4d7451a287fcfc3a6ce87120a638215b32464856 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 17 Nov 2021 17:34:43 -0800 Subject: [PATCH 397/731] sta_connect: sta_connect works now Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 92 +++++++++++++++------------------------ 1 file changed, 34 insertions(+), 58 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index b0328d4d..f2e5e59f 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -19,8 +19,6 @@ sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") removeCX = LFUtils.removeCX removeEndps = LFUtils.removeEndps -lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") -LFCliBase = lfcli_base.LFCliBase realm = importlib.import_module("py-json.realm") Realm = realm.Realm @@ -31,16 +29,20 @@ WPA2 = "wpa2" MODE_AUTO = 0 -class StaConnect(LFCliBase): +class StaConnect(Realm): def __init__(self, host, port, _dut_ssid="MyAP", _dut_passwd="NA", _dut_bssid="", - _user="", _passwd="", _sta_mode="0", _radio="wiphy0", + _user="lanforge", _passwd="lanforge", _sta_mode="0", _radio="wiphy0", _resource=1, _upstream_resource=1, _upstream_port="eth2", _sta_name=None, _debugOn=False, _dut_security=OPEN, _exit_on_error=False, _cleanup_on_exit=True, _runtime_sec=60, _exit_on_fail=False): # do not use `super(LFCLiBase,self).__init__(self, host, port, _debugOn) # that is py2 era syntax and will force self into the host variable, making you # very confused. - super().__init__(host, port, _debug=_debugOn, _exit_on_fail=_exit_on_fail) + super().__init__(lfclient_host=host, lfclient_port=port, debug_=_debugOn, _exit_on_fail=_exit_on_fail) + fields = "_links,port,alias,ip,ap,port+type" + self.station_results = self.find_ports_like("sta*", fields, debug_=False) + self.host = host + self.port = port self.debugOn = _debugOn self.dut_security = "" self.dut_ssid = _dut_ssid @@ -61,14 +63,12 @@ class StaConnect(LFCliBase): self.cx_names = {} if _sta_name is not None: self.station_names = [ _sta_name ] - # self.localrealm :Realm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 - self.localrealm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 self.resulting_stations = {} self.resulting_endpoints = {} - # def get_realm(self) -> Realm: # py > 3.6 - def get_realm(self): - return self.localrealm + self.cx_profile = self.new_l3_cx_profile() + self.cx_profile.host = self.host + self.cx_profile.port = self.port def get_station_url(self, sta_name_=None): if sta_name_ is None: @@ -100,7 +100,6 @@ class StaConnect(LFCliBase): counter = 0 # print("there are %d results" % len(self.station_results)) fields = "_links,port,alias,ip,ap,port+type" - self.station_results = self.localrealm.find_ports_like("sta*", fields, debug_=False) if (self.station_results is None) or (len(self.station_results) < 1): self.get_failed_result_list() for eid,record in self.station_results.items(): @@ -152,8 +151,7 @@ class StaConnect(LFCliBase): if response is not None: if response["interface"] is not None: print("removing old station") - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) + LFUtils.removePort(self.resource, sta_name, self.lfclient_url, debug=False) LFUtils.waitUntilPortsDisappear(self.resource, self.lfclient_url, self.station_names) # Create stations and turn dhcp on @@ -242,7 +240,6 @@ class StaConnect(LFCliBase): # make a copy of the connected stations for test records - for sta_name in self.station_names: sta_url = self.get_station_url(sta_name) station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") @@ -275,7 +272,6 @@ class StaConnect(LFCliBase): # create endpoints and cxs # Create UDP endpoints - self.cx_names = {} for sta_name in self.station_names: self.cx_names["testUDP-"+sta_name] = { "a": "testUDP-%s-A" % sta_name, @@ -333,8 +329,8 @@ class StaConnect(LFCliBase): self.json_post("/cli-json/set_cx_report_timer", data, suppress_related_commands_=True) # Create TCP endpoints - self.cx_names["testTCP-"+sta_name] = { "a": "testUDP-%s-A" % sta_name, - "b": "testUDP-%s-B" % sta_name} + self.cx_names["testTCP-"+sta_name] = {"a": "testTCP-%s-A" % sta_name, + "b": "testTCP-%s-B" % sta_name} data = { "alias": "testTCP-%s-A" % sta_name, "shelf": 1, @@ -373,6 +369,7 @@ class StaConnect(LFCliBase): } self.json_post("/cli-json/set_cx_report_timer", data, suppress_related_commands_=True) + self.wait_until_endps_appear(self.cx_names) return True def start(self): @@ -396,19 +393,9 @@ class StaConnect(LFCliBase): } self.json_post("/cli-json/show_cxe", data) return True - def stop(self): - # stop cx traffic - print("Stopping CX Traffic") - for cx_name in self.cx_names.keys(): - data = { - "test_mgr": "ALL", - "cx_name": cx_name, - "cx_state": "STOPPED" - } - self.json_post("/cli-json/set_cx_state", data) - return True + self.cx_profile.stop_cx() def finish(self): # Refresh stats @@ -436,7 +423,7 @@ class StaConnect(LFCliBase): ptest_a_tx = ptest['endpoint']['tx bytes'] ptest_a_rx = ptest['endpoint']['rx bytes'] - #ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % self.cx_names[cx_name]["b"]) + # ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % self.cx_names[cx_name]["b"]) endp_url = "/endp/%s" % self.cx_names[cx_name]["b"] ptest = self.json_get(endp_url) self.resulting_endpoints[endp_url] = ptest @@ -458,59 +445,46 @@ class StaConnect(LFCliBase): # self.test_results.append("FAILED message will fail") # print("\n") - def cleanup(self): for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) + LFUtils.removePort(self.resource, sta_name, self.lfclient_url, debug=False) endp_names = [] removeCX(self.lfclient_url, self.cx_names.keys()) for cx_name in self.cx_names: endp_names.append(self.cx_names[cx_name]["a"]) endp_names.append(self.cx_names[cx_name]["b"]) - removeEndps(self.lfclient_url, endp_names) - -# ~class - - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + if self.debug: + print("Removing endpoints %s" % self.cx_names.values()) + removeEndps(self.lfclient_url, endp_names, debug=False) def main(): lfjson_host = "localhost" lfjson_port = 8080 - parser = argparse.ArgumentParser( + parser = Realm.create_basic_argparse( prog="sta_connect.py", formatter_class=argparse.RawTextHelpFormatter, description="""LANforge Unit Test: Connect Station to AP Example: -./sta_connect.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C +./sta_connect.py --mgr 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C """) - parser.add_argument("-d", "--dest", type=str, help="address of the LANforge GUI machine (localhost is default)") parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") - parser.add_argument("-u", "--user", type=str, help="TBD: credential login/username") - parser.add_argument("-p", "--passwd", type=str, help="TBD: credential password") parser.add_argument("--resource", type=str, help="LANforge Station resource ID to use, default is 1") parser.add_argument("--upstream_resource", type=str, help="LANforge Ethernet port resource ID to use, default is 1") - parser.add_argument("--upstream_port", type=str, help="LANforge Ethernet port name, default is eth2") - parser.add_argument("--radio", type=str, help="LANforge radio to use, default is wiphy0") parser.add_argument("--sta_mode", type=str, help="LANforge station-mode setting (see add_sta LANforge CLI documentation, default is 0 (auto))") - parser.add_argument("--dut_ssid", type=str, help="DUT SSID") - parser.add_argument("--dut_passwd", type=str, help="DUT PSK password. Do not set for OPEN auth") parser.add_argument("--dut_bssid", type=str, help="DUT BSSID to which we expect to connect.") + parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m") args = parser.parse_args() - if args.dest is not None: - lfjson_host = args.dest + monitor_interval = Realm.parse_time(args.test_duration).total_seconds() + if args.mgr is not None: + lfjson_host = args.mgr if args.port is not None: lfjson_port = args.port - staConnect = StaConnect(lfjson_host, lfjson_port) - staConnect.station_names = [ "sta0000" ] - if args.user is not None: - staConnect.user = args.user - if args.passwd is not None: - staConnect.passwd = args.passwd + staConnect = StaConnect(lfjson_host, lfjson_port, _runtime_sec=monitor_interval) + staConnect.station_names = ["sta0000"] if args.sta_mode is not None: staConnect.sta_mode = args.sta_mode if args.upstream_resource is not None: @@ -521,12 +495,14 @@ Example: staConnect.radio = args.radio if args.resource is not None: staConnect.resource = args.resource - if args.dut_passwd is not None: - staConnect.dut_passwd = args.dut_passwd + if args.passwd is not None: + staConnect.dut_passwd = args.passwd if args.dut_bssid is not None: staConnect.dut_bssid = args.dut_bssid - if args.dut_ssid is not None: - staConnect.dut_ssid = args.dut_ssid + if args.ssid is not None: + staConnect.dut_ssid = args.ssid + if args.security is not None: + staConnect.dut_security = args.security staConnect.run() From b275c4926bc14d567f98d08a4f1763eb758ee63f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 17 Nov 2021 17:35:12 -0800 Subject: [PATCH 398/731] lf_kpi_csv: Fix incorrect equality Signed-off-by: Matthew Stidham --- py-scripts/lf_kpi_csv.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/py-scripts/lf_kpi_csv.py b/py-scripts/lf_kpi_csv.py index e4df6511..e25af5a4 100644 --- a/py-scripts/lf_kpi_csv.py +++ b/py-scripts/lf_kpi_csv.py @@ -20,8 +20,6 @@ INCLUDE_IN_README ''' # may need pandas if a data frame is passed in # import pandas as pd -import sys -import os import csv import time import argparse @@ -82,7 +80,7 @@ class lf_kpi_csv: try: print("self.kpi_path {kpi_path}".format(kpi_path=self.kpi_path)) print("self.kpi_filename {kpi_filename}".format(kpi_filename=self.kpi_filename)) - if self.kpi_path is "": + if self.kpi_path == "": kpifile = self.kpi_filename else: kpifile = self.kpi_path + '/' + self.kpi_filename From c001661bd2ed6f877bfc3c7aa3c32c7903de0e22 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 10:15:17 -0800 Subject: [PATCH 399/731] lf_report: Use only 4 spaces per indent, this is python, not javascript Signed-off-by: Matthew Stidham --- py-scripts/lf_report.py | 359 ++++++++++++++++++++-------------------- 1 file changed, 180 insertions(+), 179 deletions(-) diff --git a/py-scripts/lf_report.py b/py-scripts/lf_report.py index 717cd63d..12d98e40 100755 --- a/py-scripts/lf_report.py +++ b/py-scripts/lf_report.py @@ -1,20 +1,20 @@ #!/usr/bin/env python3 -''' +""" NAME: lf_report.py -PURPOSE: +PURPOSE: This program is a helper class for reporting results for a lanforge python script. -The class will generate an output directory based on date and time in the /home/lanforge/html-reports/ . +The class will generate an output directory based on date and time in the /home/lanforge/html-reports/ . If the reports-data is not present then the date and time directory will be created in the current directory. -The banner and Candela Technology logo will be copied in the results directory. -The results directory may be over written and many of the other paramaters during construction. +The banner and Candela Technology logo will be copied in the results directory. +The results directory may be over written and many of the other paramaters during construction. Creating the date time directory on construction was a design choice. -EXAMPLE: +EXAMPLE: -This is a helper class, a unit test is included at the bottom of the file. +This is a helper class, a unit test is included at the bottom of the file. To test lf_report.py and lf_graph.py together use the lf_report_test.py file LICENSE: @@ -23,7 +23,7 @@ LICENSE: INCLUDE_IN_README -''' +""" # CAUTION: adding imports to this file which are not in update_dependencies.py is not advised import os import shutil @@ -33,145 +33,148 @@ import pandas as pd import pdfkit import argparse + # internal candela references included during intial phases, to be deleted at future date # https://candelatech.atlassian.net/wiki/spaces/LANFORGE/pages/372703360/Scripting+Data+Collection+March+2021 # base report class -class lf_report(): + +class lf_report: def __init__(self, - #_path the report directory under which the report directories will be created. - _path = "/home/lanforge/html-reports", - _alt_path = "", - _date = "", - _title="LANForge Unit Test Run Heading", - _table_title="LANForge Table Heading", - _graph_title="LANForge Graph Title", - _obj = "", - _obj_title = "", - _output_html="outfile.html", - _output_pdf="outfile.pdf", - _results_dir_name = "LANforge_Test_Results_Unit_Test", - _output_format = 'html', # pass in on the write functionality, current not used - _dataframe="", - _path_date_time="", + # _path the report directory under which the report directories will be created. + _path="/home/lanforge/html-reports", + _alt_path="", + _date="", + _title="LANForge Unit Test Run Heading", + _table_title="LANForge Table Heading", + _graph_title="LANForge Graph Title", + _obj="", + _obj_title="", + _output_html="outfile.html", + _output_pdf="outfile.pdf", + _results_dir_name="LANforge_Test_Results_Unit_Test", + _output_format='html', # pass in on the write functionality, current not used + _dataframe="", + _path_date_time="", _custom_css='custom-example.css'): # this is where the final report is placed. - #other report paths, + # other report paths, - # _path is where the directory with the data time will be created - if _path == "local" or _path == "here": - self.path = os.path.abspath(__file__) - print("path set to file path: {}".format(self.path)) - elif _alt_path != "": - self.path = _alt_path - print("path set to alt path: {}".format(self.path)) - else: - self.path = _path - print("path set: {}".format(self.path)) - - self.dataframe=_dataframe - self.text = "" - self.title=_title - self.table_title=_table_title - self.graph_title=_graph_title - self.date=_date - self.output_html=_output_html - self.path_date_time = _path_date_time - self.write_output_html = "" - self.write_output_index_html = "" - self.output_pdf=_output_pdf - self.write_output_pdf = "" - self.banner_html = "" - self.footer_html = "" - self.graph_titles="" - self.graph_image="" - self.csv_file_name="" - self.html = "" - self.custom_html = "" - self.pdf_link_html = "" - self.objective = _obj - self.obj_title = _obj_title - #self.systeminfopath = "" - self.date_time_directory = "" - self.log_directory = "" - - self.banner_directory = "artifacts" - self.banner_file_name = "banner.png" # does this need to be configurable - self.logo_directory = "artifacts" - self.logo_file_name = "CandelaLogo2-90dpi-200x90-trans.png" # does this need to be configurable. - self.logo_footer_file_name = "candela_swirl_small-72h.png" # does this need to be configurable. - self.current_path = os.path.dirname(os.path.abspath(__file__)) - self.custom_css = _custom_css - # note: the following 3 calls must be in order - self.set_date_time_directory(_date,_results_dir_name) - self.build_date_time_directory() - self.build_log_directory() + # _path is where the directory with the data time will be created + if _path == "local" or _path == "here": + self.path = os.path.abspath(__file__) + print("path set to file path: {}".format(self.path)) + elif _alt_path != "": + self.path = _alt_path + print("path set to alt path: {}".format(self.path)) + else: + self.path = _path + print("path set: {}".format(self.path)) + + self.dataframe = _dataframe + self.text = "" + self.title = _title + self.table_title = _table_title + self.graph_title = _graph_title + self.date = _date + self.output_html = _output_html + self.path_date_time = _path_date_time + self.write_output_html = "" + self.write_output_index_html = "" + self.output_pdf = _output_pdf + self.write_output_pdf = "" + self.banner_html = "" + self.footer_html = "" + self.graph_titles = "" + self.graph_image = "" + self.csv_file_name = "" + self.html = "" + self.custom_html = "" + self.pdf_link_html = "" + self.objective = _obj + self.obj_title = _obj_title + # self.systeminfopath = "" + self.date_time_directory = "" + self.log_directory = "" + + self.banner_directory = "artifacts" + self.banner_file_name = "banner.png" # does this need to be configurable + self.logo_directory = "artifacts" + self.logo_file_name = "CandelaLogo2-90dpi-200x90-trans.png" # does this need to be configurable. + self.logo_footer_file_name = "candela_swirl_small-72h.png" # does this need to be configurable. + self.current_path = os.path.dirname(os.path.abspath(__file__)) + self.custom_css = _custom_css + # note: the following 3 calls must be in order + self.set_date_time_directory(_date, _results_dir_name) + self.build_date_time_directory() + self.build_log_directory() + + self.font_file = "CenturyGothic.woff" + # move the banners and candela images to report path + self.copy_banner() + self.copy_css() + self.copy_logo() + self.copy_logo_footer() - self.font_file = "CenturyGothic.woff" - # move the banners and candela images to report path - self.copy_banner() - self.copy_css() - self.copy_logo() - self.copy_logo_footer() - def copy_banner(self): - banner_src_file = str(self.current_path)+'/'+str(self.banner_directory)+'/'+str(self.banner_file_name) - banner_dst_file = str(self.path_date_time)+'/'+ str(self.banner_file_name) - #print("banner src_file: {}".format(banner_src_file)) - #print("dst_file: {}".format(banner_dst_file)) + banner_src_file = str(self.current_path) + '/' + str(self.banner_directory) + '/' + str(self.banner_file_name) + banner_dst_file = str(self.path_date_time) + '/' + str(self.banner_file_name) + # print("banner src_file: {}".format(banner_src_file)) + # print("dst_file: {}".format(banner_dst_file)) shutil.copy(banner_src_file, banner_dst_file) def copy_css(self): - reportcss_src_file = str(self.current_path)+'/'+str(self.banner_directory)+'/report.css' + reportcss_src_file = str(self.current_path) + '/' + str(self.banner_directory) + '/report.css' # print("copy_css: source file is: "+reportcss_src_file) - reportcss_dest_file = str(self.path_date_time)+'/report.css' + reportcss_dest_file = str(self.path_date_time) + '/report.css' - customcss_src_file = str(self.current_path)+'/'+str(self.banner_directory)+'/'+str(self.custom_css) - customcss_dest_file = str(self.path_date_time)+'/custom.css' + customcss_src_file = str(self.current_path) + '/' + str(self.banner_directory) + '/' + str(self.custom_css) + customcss_dest_file = str(self.path_date_time) + '/custom.css' - font_src_file = str(self.current_path)+'/'+str(self.banner_directory)+'/'+str(self.font_file) - font_dest_file = str(self.path_date_time)+'/'+str(self.font_file) + font_src_file = str(self.current_path) + '/' + str(self.banner_directory) + '/' + str(self.font_file) + font_dest_file = str(self.path_date_time) + '/' + str(self.font_file) shutil.copy(reportcss_src_file, reportcss_dest_file) shutil.copy(customcss_src_file, customcss_dest_file) shutil.copy(font_src_file, font_dest_file) def copy_logo(self): - logo_src_file = str(self.current_path)+'/'+str(self.logo_directory)+'/'+str(self.logo_file_name) - logo_dst_file = str(self.path_date_time)+'/'+ str(self.logo_file_name) - #print("logo_src_file: {}".format(logo_src_file)) - #print("logo_dst_file: {}".format(logo_dst_file)) + logo_src_file = str(self.current_path) + '/' + str(self.logo_directory) + '/' + str(self.logo_file_name) + logo_dst_file = str(self.path_date_time) + '/' + str(self.logo_file_name) + # print("logo_src_file: {}".format(logo_src_file)) + # print("logo_dst_file: {}".format(logo_dst_file)) shutil.copy(logo_src_file, logo_dst_file) def copy_logo_footer(self): - logo_footer_src_file = str(self.current_path)+'/'+str(self.logo_directory)+'/'+str(self.logo_footer_file_name) - logo_footer_dst_file = str(self.path_date_time)+'/'+ str(self.logo_footer_file_name) - #print("logo_footer_src_file: {}".format(logo_footer_src_file)) - #print("logo_footer_dst_file: {}".format(logo_footer_dst_file)) + logo_footer_src_file = str(self.current_path) + '/' + str(self.logo_directory) + '/' + str( + self.logo_footer_file_name) + logo_footer_dst_file = str(self.path_date_time) + '/' + str(self.logo_footer_file_name) + # print("logo_footer_src_file: {}".format(logo_footer_src_file)) + # print("logo_footer_dst_file: {}".format(logo_footer_dst_file)) shutil.copy(logo_footer_src_file, logo_footer_dst_file) - def move_graph_image(self,): + def move_graph_image(self, ): graph_src_file = str(self.graph_image) - graph_dst_file = str(self.path_date_time)+'/'+ str(self.graph_image) + graph_dst_file = str(self.path_date_time) + '/' + str(self.graph_image) print("graph_src_file: {}".format(graph_src_file)) print("graph_dst_file: {}".format(graph_dst_file)) shutil.move(graph_src_file, graph_dst_file) def move_csv_file(self): csv_src_file = str(self.csv_file_name) - csv_dst_file = str(self.path_date_time)+'/'+str(self.csv_file_name) + csv_dst_file = str(self.path_date_time) + '/' + str(self.csv_file_name) print("csv_src_file: {}".format(csv_src_file)) print("csv_dst_file: {}".format(csv_dst_file)) shutil.move(csv_src_file, csv_dst_file) - def set_path(self,_path): + def set_path(self, _path): self.path = _path - def set_date_time_directory(self,_date,_results_dir_name): + def set_date_time_directory(self, _date, _results_dir_name): self.date = _date self.results_dir_name = _results_dir_name if self.date != "": self.date_time_directory = str(self.date) + str("_") + str(self.results_dir_name) else: - self.date = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")).replace(':','-') + self.date = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")).replace(':', '-') self.date_time_directory = self.date + str("_") + str(self.results_dir_name) def build_date_time_directory(self): @@ -179,18 +182,18 @@ class lf_report(): self.set_date_time_directory() self.path_date_time = os.path.join(self.path, self.date_time_directory) print("path_date_time {}".format(self.path_date_time)) - try: + try: if not os.path.exists(self.path_date_time): os.mkdir(self.path_date_time) except: self.path_date_time = os.path.join(self.current_path, self.date_time_directory) if not os.path.exists(self.path_date_time): os.mkdir(self.path_date_time) - print("report path : {}".format(self.path_date_time)) + print("report path : {}".format(self.path_date_time)) def build_log_directory(self): - if self.log_directory =="": - self.log_directory = os.path.join(self.path_date_time,"log") + if self.log_directory == "": + self.log_directory = os.path.join(self.path_date_time, "log") try: if not os.path.exists(self.log_directory): os.mkdir(self.log_directory) @@ -198,16 +201,16 @@ class lf_report(): print("exception making {}".format(self.log_directory)) exit(1) - def set_text(self,_text): + def set_text(self, _text): self.text = _text - def set_title(self,_title): + def set_title(self, _title): self.title = _title - def set_table_title(self,_table_title): + def set_table_title(self, _table_title): self.table_title = _table_title - def set_graph_title(self,_graph_title): + def set_graph_title(self, _graph_title): self.graph_title = _graph_title # sets the csv file name as graph title @@ -216,23 +219,23 @@ class lf_report(): self.csv_file_name = fname + ".csv" # The _date is set when class is enstanciated / created so this set_date should be used with caution, used to synchronize results - def set_date(self,_date): + def set_date(self, _date): self.date = _date - def set_table_dataframe(self,_dataframe): + def set_table_dataframe(self, _dataframe): self.dataframe = _dataframe - def set_table_dataframe_from_csv(self,_csv): + def set_table_dataframe_from_csv(self, _csv): self.dataframe = pd.read_csv(_csv) - def set_custom_html(self,_custom_html): + def set_custom_html(self, _custom_html): self.custom_html = _custom_html - def set_obj_html(self,_obj_title, _obj ): + def set_obj_html(self, _obj_title, _obj): self.objective = _obj self.obj_title = _obj_title - def set_graph_image(self,_graph_image): + def set_graph_image(self, _graph_image): self.graph_image = _graph_image def get_date(self): @@ -256,12 +259,12 @@ class lf_report(): return self.log_directory def file_add_path(self, file): - output_file = str(self.path_date_time)+'/'+ str(file) + output_file = str(self.path_date_time) + '/' + str(file) print("output file {}".format(output_file)) return output_file - def write_html(self): - self.write_output_html = str(self.path_date_time)+'/'+ str(self.output_html) + def write_html(self): + self.write_output_html = str(self.path_date_time) + '/' + str(self.output_html) print("write_output_html: {}".format(self.write_output_html)) try: test_file = open(self.write_output_html, "w") @@ -271,8 +274,8 @@ class lf_report(): print("write_html failed") return self.write_output_html - def write_index_html(self): - self.write_output_index_html = str(self.path_date_time)+'/'+ str("index.html") + def write_index_html(self): + self.write_output_index_html = str(self.path_date_time) + '/' + str("index.html") print("write_output_index_html: {}".format(self.write_output_index_html)) try: test_file = open(self.write_output_index_html, "w") @@ -282,9 +285,8 @@ class lf_report(): print("write_index_html failed") return self.write_output_index_html - - def write_html_with_timestamp(self): - self.write_output_html = "{}/{}-{}".format(self.path_date_time,self.date,self.output_html) + def write_html_with_timestamp(self): + self.write_output_html = "{}/{}-{}".format(self.path_date_time, self.date, self.output_html) print("write_output_html: {}".format(self.write_output_html)) try: test_file = open(self.write_output_html, "w") @@ -294,57 +296,56 @@ class lf_report(): print("write_html failed") return self.write_output_html + # https://wkhtmltopdf.org/usage/wkhtmltopdf.txt + # page_size A4, A3, Letter, Legal + # orientation Portrait , Landscape + def write_pdf(self, _page_size='A4', _orientation='Portrait'): + # write logic to generate pdf here + # wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb + # sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb + + options = {"enable-local-file-access": None, + 'orientation': _orientation, + 'page-size': _page_size} # prevent error Blocked access to file + self.write_output_pdf = str(self.path_date_time) + '/' + str(self.output_pdf) + pdfkit.from_file(self.write_output_html, self.write_output_pdf, options=options) # https://wkhtmltopdf.org/usage/wkhtmltopdf.txt # page_size A4, A3, Letter, Legal # orientation Portrait , Landscape - def write_pdf(self, _page_size = 'A4', _orientation = 'Portrait'): - # write logic to generate pdf here - # wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb - # sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb - - options = {"enable-local-file-access" : None, - 'orientation': _orientation, - 'page-size': _page_size} # prevent error Blocked access to file - self.write_output_pdf = str(self.path_date_time)+'/'+ str(self.output_pdf) - pdfkit.from_file(self.write_output_html, self.write_output_pdf, options=options) + def write_pdf_with_timestamp(self, _page_size='A4', _orientation='Portrait'): + # write logic to generate pdf here + # wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb + # sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb - # https://wkhtmltopdf.org/usage/wkhtmltopdf.txt - # page_size A4, A3, Letter, Legal - # orientation Portrait , Landscape - def write_pdf_with_timestamp(self, _page_size = 'A4', _orientation = 'Portrait'): - # write logic to generate pdf here - # wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb - # sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb - - options = {"enable-local-file-access" : None, - 'orientation': _orientation, - 'page-size': _page_size} # prevent error Blocked access to file - self.write_output_pdf = "{}/{}-{}".format(self.path_date_time,self.date,self.output_pdf) - pdfkit.from_file(self.write_output_html, self.write_output_pdf, options=options) + options = {"enable-local-file-access": None, + 'orientation': _orientation, + 'page-size': _page_size} # prevent error Blocked access to file + self.write_output_pdf = "{}/{}-{}".format(self.path_date_time, self.date, self.output_pdf) + pdfkit.from_file(self.write_output_html, self.write_output_pdf, options=options) def get_pdf_path(self): pdf_link_path = "{}/{}-{}".format(self.path_date_time, self.date, self.output_pdf) return pdf_link_path - - def build_pdf_link(self,_pdf_link_name,_pdf_link_path): + + def build_pdf_link(self, _pdf_link_name, _pdf_link_path): self.pdf_link_html = """ {pdf_link_name}
- """.format(pdf_link_path=_pdf_link_path,pdf_link_name=_pdf_link_name) + """.format(pdf_link_path=_pdf_link_path, pdf_link_name=_pdf_link_name) self.html += self.pdf_link_html - def build_link(self,_link_name,_link_path): + def build_link(self, _link_name, _link_path): self.link = """ {link_name}
- """.format(link_path=_link_path,link_name=_link_name) + """.format(link_path=_link_path, link_name=_link_name) self.html += self.link def generate_report(self): - self.write_html() + self.write_html() self.write_pdf() def build_all(self): @@ -419,7 +420,6 @@ class lf_report(): ) self.html += self.banner_html - def build_table_title(self): self.table_title_html = """ @@ -442,23 +442,24 @@ class lf_report(): self.html += self.text_html def build_date_time(self): - self.date_time = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%m-m-%S-s")).replace(':','-') + self.date_time = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%m-m-%S-s")).replace(':', '-') return self.date_time def build_path_date_time(self): - try: - self.path_date_time = os.path.join(self.path,self.date_time) + try: + self.path_date_time = os.path.join(self.path, self.date_time) os.mkdir(self.path_date_time) except: - curr_dir_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - self.path_date_time = os.path.join(curr_dir_path,self.date_time) - os.mkdir(self.path_date_time) + curr_dir_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + self.path_date_time = os.path.join(curr_dir_path, self.date_time) + os.mkdir(self.path_date_time) def build_table(self): - self.dataframe_html = self.dataframe.to_html(index=False, justify='center') # have the index be able to be passed in. + self.dataframe_html = self.dataframe.to_html(index=False, + justify='center') # have the index be able to be passed in. self.html += self.dataframe_html - def test_setup_table(self,test_setup_data, value): + def test_setup_table(self, test_setup_data, value): if test_setup_data is None: return None else: @@ -471,7 +472,7 @@ class lf_report():
Command NameCommandStatusExecution timeSTDOUTSTDERRCommand NameCommandStatusExecution timeSTDOUTSTDERR
- +
"""+ str(value) + """""" + str(value) + """ """ + var + """ @@ -571,34 +572,35 @@ function copyTextToClipboard(ele) { def end_content_div(self): self.html += "\n\n" + # Unit Test if __name__ == "__main__": parser = argparse.ArgumentParser( prog="lf_report.py", formatter_class=argparse.RawTextHelpFormatter, description="Reporting library Unit Test") - parser.add_argument('--lfmgr', help='sample argument: where LANforge GUI is running', default='localhost') + parser.add_argument('--lfmgr', help='sample argument: where LANforge GUI is running', default='localhost') # the args parser is not really used , this is so the report is not generated when testing # the imports with --help args = parser.parse_args() print("LANforge manager {lfmgr}".format(lfmgr=args.lfmgr)) - - # Testing: generate data frame + # Testing: generate data frame dataframe = pd.DataFrame({ - 'product':['CT521a-264-1ac-1n','CT521a-1ac-1ax','CT522-264-1ac2-1n','CT523c-2ac2-db-10g-cu','CT523c-3ac2-db-10g-cu','CT523c-8ax-ac10g-cu','CT523c-192-2ac2-1ac-10g'], - 'radios':[1,1,2,2,6,9,3], - 'MIMO':['N','N','N','Y','Y','Y','Y'], - 'stations':[200,64,200,128,384,72,192], - 'mbps':[300,300,300,10000,10000,10000,10000] + 'product': ['CT521a-264-1ac-1n', 'CT521a-1ac-1ax', 'CT522-264-1ac2-1n', 'CT523c-2ac2-db-10g-cu', + 'CT523c-3ac2-db-10g-cu', 'CT523c-8ax-ac10g-cu', 'CT523c-192-2ac2-1ac-10g'], + 'radios': [1, 1, 2, 2, 6, 9, 3], + 'MIMO': ['N', 'N', 'N', 'Y', 'Y', 'Y', 'Y'], + 'stations': [200, 64, 200, 128, 384, 72, 192], + 'mbps': [300, 300, 300, 10000, 10000, 10000, 10000] }) print(dataframe) # Testing: generate data frame dataframe2 = pd.DataFrame({ - 'station':[1,2,3,4,5,6,7], - 'time_seconds':[23,78,22,19,45,22,25] + 'station': [1, 2, 3, 4, 5, 6, 7], + 'time_seconds': [23, 78, 22, 19, 45, 22, 25] }) report = lf_report() @@ -617,14 +619,13 @@ if __name__ == "__main__": report.set_table_dataframe(dataframe2) report.build_table() - #report.build_all() - #report.build_footer() + # report.build_all() + # report.build_footer() report.build_footer_no_png() - html_file = report.write_html() + html_file = report.write_html() print("returned file ") print(html_file) report.write_pdf() print("report path {}".format(report.get_path())) - From 098d4bdb81f3360d755b2c7f0d55056e42c67642 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 10:15:40 -0800 Subject: [PATCH 400/731] lf_snp_test: Dropping support for Windows ME Signed-off-by: Matthew Stidham --- py-scripts/lf_snp_test.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/py-scripts/lf_snp_test.py b/py-scripts/lf_snp_test.py index a39ea321..3ea810a5 100755 --- a/py-scripts/lf_snp_test.py +++ b/py-scripts/lf_snp_test.py @@ -154,13 +154,12 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - +from lf_report import lf_report sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") realm = importlib.import_module("py-json.realm") Realm = realm.Realm -lf_report = importlib.import_module("py-scripts.lf_report") # lf_graph = importlib.import_module("py-scripts.lf_graph") # lf_bar_graph = lf_graph.lf_bar_graph @@ -901,7 +900,7 @@ class L3VariableTime(Realm): _exit_on_error=False, _exit_on_fail=False, _proxy_str=None, - _capture_signal_list=[]): + _capture_signal_list=None): super().__init__(lfclient_host=lfclient_host, lfclient_port=lfclient_port, debug_=debug, @@ -909,6 +908,8 @@ class L3VariableTime(Realm): _exit_on_fail=_exit_on_fail, _proxy_str=_proxy_str, _capture_signal_list=_capture_signal_list) + if _capture_signal_list is None: + _capture_signal_list = [] self.scheme = _scheme self.port = _port self.series = _series @@ -1774,7 +1775,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl # Create a report instanciate a reporting class # ############################################### - report = lf_report(_results_dir_name = "Scaling_and_Performance",_output_html="snp.html",_output_pdf="snp.pdf") + report = lf_report(_results_dir_name = "Scaling_and_Performance", _output_html="snp.html", _output_pdf="snp.pdf") if args.csv_outfile != None: current_time = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime()) From 9f42272c23e22e16cea9c96199f6a1512f19cdf7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 10:28:27 -0800 Subject: [PATCH 401/731] lf_ap_auto_test: DO NOT USE MUTABLE DEFAULTS Signed-off-by: Matthew Stidham --- py-scripts/lf_ap_auto_test.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/py-scripts/lf_ap_auto_test.py b/py-scripts/lf_ap_auto_test.py index a991e1e2..c9f62236 100755 --- a/py-scripts/lf_ap_auto_test.py +++ b/py-scripts/lf_ap_auto_test.py @@ -199,17 +199,29 @@ class ApAutoTest(cvtest): max_stations_2=100, max_stations_5=100, max_stations_dual=200, - radio2=[], - radio5=[], - enables=[], - disables=[], - raw_lines=[], + radio2=None, + radio5=None, + enables=None, + disables=None, + raw_lines=None, raw_lines_file="", - sets=[], + sets=None, graph_groups=None ): super().__init__(lfclient_host=lf_host, lfclient_port=lf_port) + if radio2 is None: + radio2 = [] + if radio5 is None: + radio5 = [] + if enables is None: + enables = [] + if disables is None: + disables = [] + if raw_lines is None: + raw_lines = [] + if sets is None: + sets = [] self.lf_host = lf_host self.lf_port = lf_port self.lf_user = lf_user From 39631dd15a9ffa867054e56e676b4c1f9de1b254 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 10:35:59 -0800 Subject: [PATCH 402/731] cv_test_manager: semi-colons in python are used to separate statements. Don't put them at the end of lines because you feel like it. Signed-off-by: Matthew Stidham --- py-json/cv_test_manager.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index f9b3f34d..23785c26 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -87,7 +87,7 @@ class cv_test(Realm): def __init__(self, lfclient_host="localhost", lfclient_port=8080, - lf_report_dir="" + lf_report_dir=None ): super().__init__(lfclient_host=lfclient_host, lfclient_port=lfclient_port) @@ -150,7 +150,7 @@ class cv_test(Realm): rsp = self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, response_json_list_=response_json) try: if response_json[0]["LAST"]["warnings"].startswith("Unknown"): - print("Unknown command?\n"); + print("Unknown command?\n") pprint(response_json) except: # Ignore un-handled structs at this point, let calling code deal with it. @@ -306,7 +306,7 @@ class cv_test(Realm): # cv_cmds: Array of raw chamber-view commands, such as "cv click 'button-name'" # These (and the sets) are applied after the test is created and before it is started. def create_and_run_test(self, load_old_cfg, test_name, instance_name, config_name, sets, - pull_report, lf_host, lf_user, lf_password, cv_cmds, local_lf_report_dir="", ssh_port=22, + pull_report, lf_host, lf_user, lf_password, cv_cmds, local_lf_report_dir=None, ssh_port=22, graph_groups_file=None): load_old = "false" if load_old_cfg: @@ -340,14 +340,14 @@ class cv_test(Realm): response = self.start_test(instance_name) if response[0]["LAST"]["response"].__contains__("Could not find instance:"): - print("ERROR: start_test failed: ", response[0]["LAST"]["response"], "\n"); + print("ERROR: start_test failed: ", response[0]["LAST"]["response"], "\n") # pprint(response) exit(1) not_running = 0 while True: cmd = "cv get_and_close_dialog" - dialog = self.run_cv_cmd(cmd); + dialog = self.run_cv_cmd(cmd) if dialog[0]["LAST"]["response"] != "NO-DIALOG": print("Popup Dialog:\n") print(dialog[0]["LAST"]["response"]) @@ -396,7 +396,7 @@ class cv_test(Realm): # Clean up any remaining popups. while True: - dialog = self.run_cv_cmd(cmd); + dialog = self.run_cv_cmd(cmd) if dialog[0]["LAST"]["response"] != "NO-DIALOG": print("Popup Dialog:\n") print(dialog[0]["LAST"]["response"]) @@ -406,7 +406,7 @@ class cv_test(Realm): # Takes cmd-line args struct or something that looks like it. # See csv_to_influx.py::influx_add_parser_args for options, or --help. def check_influx_kpi(self, args): - if self.lf_report_dir == "": + if self.lf_report_dir is None: # Nothing to report on. print("Not submitting to influx, no report-dir.\n") return @@ -428,12 +428,12 @@ class cv_test(Realm): # lf_wifi_capacity_test.py may be run / initiated by a remote system against a lanforge # the local_lf_report_dir is where data is stored, if there is no local_lf_report_dir then the test is run directly on lanforge - if self.local_lf_report_dir == "": - csv_path = "%s/kpi.csv" % (self.lf_report_dir) + if self.local_lf_report_dir is None: + csv_path = "%s/kpi.csv" % self.lf_report_dir else: kpi_location = self.local_lf_report_dir + "/" + os.path.basename(self.lf_report_dir) # the local_lf_report_dir is the parent directory, need to get the directory name - csv_path = "%s/kpi.csv" % (kpi_location) + csv_path = "%s/kpi.csv" % kpi_location print("Attempt to submit kpi: ", csv_path) print("Posting to influx...\n") @@ -513,7 +513,7 @@ class cv_test(Realm): def get_popup_info_and_close(self): cmd = "cv get_and_close_dialog" - dialog = self.run_cv_cmd(cmd); + dialog = self.run_cv_cmd(cmd) if dialog[0]["LAST"]["response"] != "NO-DIALOG": print("Popup Dialog:\n") print(dialog[0]["LAST"]["response"]) From e1edb3fad0bf31ca72c8c66b0840173561743dfc Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 11:04:00 -0800 Subject: [PATCH 403/731] lf_kpi_csv: Fix all warnings Signed-off-by: Matthew Stidham --- py-scripts/lf_kpi_csv.py | 106 ++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 56 deletions(-) diff --git a/py-scripts/lf_kpi_csv.py b/py-scripts/lf_kpi_csv.py index e25af5a4..60eacbb4 100644 --- a/py-scripts/lf_kpi_csv.py +++ b/py-scripts/lf_kpi_csv.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -''' +""" NAME: lf_kpi_csv.py PURPOSE: @@ -17,14 +17,13 @@ COPYWRITE License: Free to distribute and modify. LANforge systems must be licensed. INCLUDE_IN_README -''' +""" # may need pandas if a data frame is passed in # import pandas as pd import csv import time import argparse - ''' Note teh delimiter for the kpi.csv is a tab @@ -49,21 +48,25 @@ A blank entry is a valid entry in some cases. ''' + class lf_kpi_csv: def __init__(self, - _kpi_headers = ['Date','test-rig','test-tag','dut-hw-version','dut-sw-version','dut-model-num','dut-serial-num', - 'test-priority','test-id','short-description','pass/fail','numeric-score', - 'test details','Units','Graph-Group','Subtest-Pass','Subtest-Fail'], - _kpi_filename = 'kpi.csv', #Currently this is the only file name accepted - _kpi_path = "", - _kpi_test_rig = "TEST_RIG", - _kpi_test_tag = "TEST_TAG", - _kpi_dut_hw_version = "HW_VERSION", - _kpi_dut_sw_version = "SW_VERSION", - _kpi_dut_model_num = "MODEL_NUM", - _kpi_dut_serial_num = "SERIAL_NUM", - _kpi_test_id = "TEST_ID" - ): + _kpi_headers=None, + _kpi_filename='kpi.csv', # Currently this is the only file name accepted + _kpi_path="", + _kpi_test_rig="TEST_RIG", + _kpi_test_tag="TEST_TAG", + _kpi_dut_hw_version="HW_VERSION", + _kpi_dut_sw_version="SW_VERSION", + _kpi_dut_model_num="MODEL_NUM", + _kpi_dut_serial_num="SERIAL_NUM", + _kpi_test_id="TEST_ID" + ): + if _kpi_headers is None: + _kpi_headers = ['Date', 'test-rig', 'test-tag', 'dut-hw-version', 'dut-sw-version', 'dut-model-num', + 'dut-serial-num', + 'test-priority', 'test-id', 'short-description', 'pass/fail', 'numeric-score', + 'test details', 'Units', 'Graph-Group', 'Subtest-Pass', 'Subtest-Fail'] self.kpi_headers = _kpi_headers self.kpi_filename = _kpi_filename self.kpi_full_path = '' @@ -82,13 +85,13 @@ class lf_kpi_csv: print("self.kpi_filename {kpi_filename}".format(kpi_filename=self.kpi_filename)) if self.kpi_path == "": kpifile = self.kpi_filename - else: + else: kpifile = self.kpi_path + '/' + self.kpi_filename print("kpifile {kpifile}".format(kpifile=kpifile)) - self.kpi_file = open(kpifile,'w') + self.kpi_file = open(kpifile, 'w') self.kpi_writer = csv.DictWriter(self.kpi_file, delimiter="\t", fieldnames=self.kpi_headers) self.kpi_writer.writeheader() - except BaseException: + except: print("lf_kpi_csv.py: {} WARNING unable to open".format(self.kpi_file)) self.kpi_dict = dict() @@ -110,18 +113,15 @@ class lf_kpi_csv: self.kpi_dict['Subtest-Pass'] = '' self.kpi_dict['Subtest-Fail'] = '' - - def kpi_csv_get_dict(self): - return self.kpi_dict - def kpi_csv_get_dict_update_time(self): self.kpi_dict['Date'] = '{date}'.format(date=round(time.time() * 1000)) return self.kpi_dict - def kpi_csv_write_dict(self,kpi_dict): + def kpi_csv_write_dict(self, kpi_dict): self.kpi_writer.writerow(kpi_dict) self.kpi_file.flush() + def main(): # arguments parser = argparse.ArgumentParser( @@ -166,12 +166,18 @@ Example : '--local_lf_report_dir', help='--local_lf_report_dir override the report path, primary use when running test in test suite', default="") - parser.add_argument("--test_rig", default="lanforge", help="test rig for kpi.csv, testbed that the tests are run on") - parser.add_argument("--test_tag", default="kpi_generation", help="test tag for kpi.csv, test specific information to differenciate the test") - parser.add_argument("--dut_hw_version", default="hw_01", help="dut hw version for kpi.csv, hardware version of the device under test") - parser.add_argument("--dut_sw_version", default="sw_01", help="dut sw version for kpi.csv, software version of the device under test") - parser.add_argument("--dut_model_num", default="can_ap", help="dut model for kpi.csv, model number / name of the device under test") - parser.add_argument("--test_priority", default="95", help="dut model for kpi.csv, test-priority is arbitrary number") + parser.add_argument("--test_rig", default="lanforge", + help="test rig for kpi.csv, testbed that the tests are run on") + parser.add_argument("--test_tag", default="kpi_generation", + help="test tag for kpi.csv, test specific information to differenciate the test") + parser.add_argument("--dut_hw_version", default="hw_01", + help="dut hw version for kpi.csv, hardware version of the device under test") + parser.add_argument("--dut_sw_version", default="sw_01", + help="dut sw version for kpi.csv, software version of the device under test") + parser.add_argument("--dut_model_num", default="can_ap", + help="dut model for kpi.csv, model number / name of the device under test") + parser.add_argument("--test_priority", default="95", + help="dut model for kpi.csv, test-priority is arbitrary number") parser.add_argument("--test_id", default="kpi_unit_test", help="test-id for kpi.csv, script or test name") ''' Other values that are included in the kpi.csv row. @@ -185,29 +191,18 @@ Example : args = parser.parse_args() - local_lf_report_dir = args.local_lf_report_dir - - test_rig = args.test_rig - test_tag = args.test_tag - dut_hw_version = args.dut_hw_version - dut_sw_version = args.dut_sw_version - dut_model_num = args.dut_model_num - test_priority = args.test_priority # this may need to be set per test - test_id = args.test_id - # Get the report path to create the kpi.csv path # kpi_path = report.get_report_path() in normal use case would get from lf_report.py library - kpi_path = local_lf_report_dir = args.local_lf_report_dir kpi_csv = lf_kpi_csv( - _kpi_path = kpi_path, - _kpi_test_rig = test_rig, - _kpi_test_tag = test_tag, - _kpi_dut_hw_version = dut_hw_version, - _kpi_dut_sw_version = dut_sw_version, - _kpi_dut_model_num = dut_model_num, - _kpi_test_id = test_id) + _kpi_path=args.local_lf_report_dir, + _kpi_test_rig=args.test_rig, + _kpi_test_tag=args.test_tag, + _kpi_dut_hw_version=args.dut_hw_version, + _kpi_dut_sw_version=args.dut_sw_version, + _kpi_dut_model_num=args.dut_model_num, + _kpi_test_id=args.test_id) - results_dict = kpi_csv.kpi_csv_get_dict() + results_dict = kpi_csv.kpi_dict results_dict['Graph-Group'] = "graph_group" results_dict['short-description'] = "short_description" @@ -219,7 +214,6 @@ Example : kpi_csv.kpi_csv_write_dict(results_dict) - # reuse the dictionary results_dict['Graph-Group'] = "graph_group_1_5" results_dict['short-description'] = "short_description_1_5" @@ -229,17 +223,17 @@ Example : kpi_csv.kpi_csv_write_dict(results_dict) # append to a row to the existing dictionary - results_dict_2 = kpi_csv.kpi_csv_get_dict() + results_dict_2 = kpi_csv.kpi_dict # modify an entry results_dict_2['test-tag'] = 'kpi_generation_2' - results_dict['Graph-Group'] = "graph_group" - results_dict['short-description'] = "short_description" - results_dict['numeric-score'] = "100" - results_dict['Units'] = "Mbps" + results_dict_2['Graph-Group'] = "graph_group" + results_dict_2['short-description'] = "short_description" + results_dict_2['numeric-score'] = "100" + results_dict_2['Units'] = "Mbps" print("results_dict_2 {results_dict_2}".format(results_dict_2=results_dict_2)) print("date 2 {date}".format(date=results_dict_2['Date'])) kpi_csv.kpi_csv_write_dict(results_dict_2) if __name__ == "__main__": - main() + main() From 4667bf5a0b04bf0648a53ae328082772a587a420 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 11:04:30 -0800 Subject: [PATCH 404/731] update_dependencies: Fix all warnings Signed-off-by: Matthew Stidham --- py-scripts/update_dependencies.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/py-scripts/update_dependencies.py b/py-scripts/update_dependencies.py index 5f4788f4..15c8741a 100755 --- a/py-scripts/update_dependencies.py +++ b/py-scripts/update_dependencies.py @@ -4,6 +4,7 @@ import subprocess import argparse import os + def main(): parser = argparse.ArgumentParser( prog="update_dependencies.py", @@ -23,15 +24,15 @@ def main(): args = parser.parse_args() print("Installing Script Python3 Dependencies") - packages = ['pandas', 'plotly', 'numpy', 'cryptography', 'paramiko', 'bokeh','pyarrow', 'websocket-client', 'xlsxwriter',\ - 'pyshark', 'influxdb', 'influxdb-client', 'matplotlib', 'pdfkit', 'pip-search', 'pyserial', 'pexpect-serial' ,'scp',\ - 'dash', 'kaleido'] + packages = ['pandas', 'plotly', 'numpy', 'cryptography', 'paramiko', 'bokeh', 'pyarrow', 'websocket-client', + 'xlsxwriter', 'pyshark', 'influxdb', 'influxdb-client', 'matplotlib', 'pdfkit', 'pip-search', 'pyserial', + 'pexpect-serial', 'scp', 'dash', 'kaleido'] if args.pyjwt: packages.append('pyjwt') else: print('Not installing PyJWT') packages_installed = [] - packages_failed =[] + packages_failed = [] subprocess.call("pip3 uninstall jwt", shell=True) subprocess.call('pip3 install --upgrade pip', shell=True) for package in packages: @@ -54,5 +55,6 @@ def main(): return print("Packages Failed (Some scripts may not need these packages): {}".format(packages_failed)) + if __name__ == "__main__": main() From 0087f8916b0898af2b3544f948910e49bdbf6121 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 11:04:47 -0800 Subject: [PATCH 405/731] testgroup: Fix all warnings Signed-off-by: Matthew Stidham --- py-scripts/testgroup.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/py-scripts/testgroup.py b/py-scripts/testgroup.py index e70bd1a4..67d103df 100755 --- a/py-scripts/testgroup.py +++ b/py-scripts/testgroup.py @@ -22,13 +22,17 @@ Realm = realm.Realm class TestGroup(LFCliBase): def __init__(self, host, port, group_name=None, - add_cx_list=[], - rm_cx_list=[], + add_cx_list=None, + rm_cx_list=None, tg_action=None, cx_action=None, list_groups=None, show_group=None): + if add_cx_list is None: + add_cx_list = [] + if rm_cx_list is None: + rm_cx_list = [] self.local_realm = realm.Realm(lfclient_host=host, lfclient_port=port) self.tg_profile = self.local_realm.new_test_group_profile() if group_name is None and list_groups is None and (tg_action is not None or cx_action is not None or @@ -42,13 +46,15 @@ class TestGroup(LFCliBase): self.cx_action = cx_action self.list_groups = list_groups self.show_group = show_group - if add_cx_list is not None and len(add_cx_list) == 1 and ',' in add_cx_list[0]: - self.add_cx_list = add_cx_list[0].split(',') + if add_cx_list: + if len(add_cx_list) == 1 and ',' in add_cx_list[0]: + self.add_cx_list = add_cx_list[0].split(',') else: self.add_cx_list = add_cx_list - if rm_cx_list is not None and len(rm_cx_list) == 1 and ',' in rm_cx_list[0]: - self.rm_cx_list = rm_cx_list[0].split(',') + if rm_cx_list: + if len(rm_cx_list) == 1 and ',' in rm_cx_list[0]: + self.rm_cx_list = rm_cx_list[0].split(',') else: self.rm_cx_list = rm_cx_list From 674682692f7488ec1439e0cffce6077f853e477c Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 11:13:42 -0800 Subject: [PATCH 406/731] lf_ap_auto_test: Cleanup whitespace Signed-off-by: Matthew Stidham --- py-scripts/lf_ap_auto_test.py | 62 +++++++++++++++++------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/py-scripts/lf_ap_auto_test.py b/py-scripts/lf_ap_auto_test.py index c9f62236..6cea0755 100755 --- a/py-scripts/lf_ap_auto_test.py +++ b/py-scripts/lf_ap_auto_test.py @@ -172,7 +172,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) cv_test_manager = importlib.import_module("py-json.cv_test_manager") @@ -225,7 +224,7 @@ class ApAutoTest(cvtest): self.lf_host = lf_host self.lf_port = lf_port self.lf_user = lf_user - self.lf_password =lf_password + self.lf_password = lf_password self.instance_name = instance_name self.config_name = config_name self.upstream = upstream @@ -252,13 +251,12 @@ class ApAutoTest(cvtest): # Nothing to do at this time. return - def run(self): self.sync_cv() time.sleep(2) self.sync_cv() - blob_test = "%s-"%(self.test_name) + blob_test = "%s-" % self.test_name self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name self.show_text_blob(None, None, False) @@ -268,12 +266,12 @@ class ApAutoTest(cvtest): ridx = 0 for r in self.radio2: - cfg_options.append("radio2-%i: %s"%(ridx, r[0])) + cfg_options.append("radio2-%i: %s" % (ridx, r[0])) ridx += 1 ridx = 0 for r in self.radio5: - cfg_options.append("radio5-%i: %s"%(ridx, r[0])) + cfg_options.append("radio5-%i: %s" % (ridx, r[0])) ridx += 1 self.apply_cfg_options(cfg_options, self.enables, self.disables, self.raw_lines, self.raw_lines_file) @@ -306,7 +304,6 @@ class ApAutoTest(cvtest): def main(): - parser = argparse.ArgumentParser( prog="lf_ap_auto_test.py", formatter_class=argparse.RawTextHelpFormatter, @@ -332,7 +329,7 @@ def main(): --influx_bucket ben \\ --influx_tag testbed Ferndale-01 """ - ) + ) cv_add_base_parser(parser) # see cv_test_manager.py parser.add_argument("-u", "--upstream", type=str, default="", @@ -353,39 +350,42 @@ def main(): help="Specify 2.4Ghz radio. May be specified multiple times.") parser.add_argument("--radio5", action='append', nargs=1, default=[], help="Specify 5Ghz radio. May be specified multiple times.") - parser.add_argument("--local_lf_report_dir", help="--local_lf_report_dir default '' put where dataplane script run from",default="") + parser.add_argument("--local_lf_report_dir", + help="--local_lf_report_dir default '' put where dataplane script run from", + default="") args = parser.parse_args() cv_base_adjust_parser(args) - CV_Test = ApAutoTest(lf_host = args.mgr, - lf_port = args.port, - lf_user = args.lf_user, - lf_password = args.lf_password, - instance_name = args.instance_name, - config_name = args.config_name, - upstream = args.upstream, - pull_report = args.pull_report, - local_lf_report_dir = args.local_lf_report_dir, - dut5_0 = args.dut5_0, - dut2_0 = args.dut2_0, - load_old_cfg = args.load_old_cfg, - max_stations_2 = args.max_stations_2, - max_stations_5 = args.max_stations_5, - max_stations_dual = args.max_stations_dual, - radio2 = args.radio2, - radio5 = args.radio5, - enables = args.enable, - disables = args.disable, - raw_lines = args.raw_line, - raw_lines_file = args.raw_lines_file, - sets = args.set + CV_Test = ApAutoTest(lf_host=args.mgr, + lf_port=args.port, + lf_user=args.lf_user, + lf_password=args.lf_password, + instance_name=args.instance_name, + config_name=args.config_name, + upstream=args.upstream, + pull_report=args.pull_report, + local_lf_report_dir=args.local_lf_report_dir, + dut5_0=args.dut5_0, + dut2_0=args.dut2_0, + load_old_cfg=args.load_old_cfg, + max_stations_2=args.max_stations_2, + max_stations_5=args.max_stations_5, + max_stations_dual=args.max_stations_dual, + radio2=args.radio2, + radio5=args.radio5, + enables=args.enable, + disables=args.disable, + raw_lines=args.raw_line, + raw_lines_file=args.raw_lines_file, + sets=args.set ) CV_Test.setup() CV_Test.run() CV_Test.check_influx_kpi(args) + if __name__ == "__main__": main() From bdb850ef54d2dce81ae72f55b1cae66dcdc1b648 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 11:14:15 -0800 Subject: [PATCH 407/731] test_status_msg: Cleanup whitespace Signed-off-by: Matthew Stidham --- py-scripts/test_status_msg.py | 75 +++++++++++++++++------------------ 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/py-scripts/test_status_msg.py b/py-scripts/test_status_msg.py index ed1297f6..b9093db1 100755 --- a/py-scripts/test_status_msg.py +++ b/py-scripts/test_status_msg.py @@ -10,7 +10,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -24,20 +23,23 @@ class TestStatusMessage(LFCliBase): _exit_on_error=False, _exit_on_fail=False): super().__init__(host, port, _debug=_debug_on, _exit_on_fail=_exit_on_fail) + self.exit_on_error = False + self.status_msg_url = "/status-msg" + self.session_url = None + self.msg_count = 0 self.deep_clean = _deep_clean self.check_connect() def build(self): """create a new session""" new_session = uuid1() - self.status_msg_url = "/status-msg" - self.session_url = "/status-msg/"+str(new_session) + self.session_url = "/status-msg/" + str(new_session) # print("----- ----- ----- ----- ----- PUT ----- ----- ----- ----- ----- ----- ") self.json_put(self.session_url, _data={}) # we should see list of sessions try: - #print("----- ----- ----- ----- ----- GET ----- ----- ----- ----- ----- ----- ") + # print("----- ----- ----- ----- ----- GET ----- ----- ----- ----- ----- ----- ") session_response = self.json_get(self.status_msg_url) if self.debug: pprint(session_response) @@ -47,7 +49,7 @@ class TestStatusMessage(LFCliBase): if len(session_response["sessions"]) < 2: self._fail("why do we have less than two sessions?") for session in session_response["sessions"]: - #print("----- ----- ----- ----- ----- SESSION ----- ----- ----- ----- ----- ----- ") + # print("----- ----- ----- ----- ----- SESSION ----- ----- ----- ----- ----- ----- ") pprint(session) self._pass("session created") except ValueError as ve: @@ -55,12 +57,12 @@ class TestStatusMessage(LFCliBase): self._fail(ve) return - def start(self, print_pass=False, print_fail=False): + def start(self): """ create a series of messages :return: None """ - #print("----- ----- ----- ----- ----- START ----- %s ----- ----- ----- ----- ----- " % self.session_url) + # print("----- ----- ----- ----- ----- START ----- %s ----- ----- ----- ----- ----- " % self.session_url) message_response = self.json_get(self.session_url) if self.debug: pprint(message_response) @@ -71,21 +73,21 @@ class TestStatusMessage(LFCliBase): if len(messages_a) > 0: self._fail("we should have zero messages") - for msg_num in ( 1, 2, 3, 4, 5 ): - #print("----- ----- ----- ----- ----- ----- %s ----- ----- ----- ----- ----- " % msg_num) - #print("session url: "+self.session_url) + for msg_num in (1, 2, 3, 4, 5): + # print("----- ----- ----- ----- ----- ----- %s ----- ----- ----- ----- ----- " % msg_num) + # print("session url: "+self.session_url) self.msg_count = msg_num self.json_post(self.session_url, { "key": "test_status_message.py", - "content-type":"application/json", - "message":"message %s"%msg_num + "content-type": "application/json", + "message": "message %s" % msg_num }) message_response = self.json_get(self.session_url) if len(message_response["messages"]) != msg_num: pprint(message_response) - self._fail("we should have %s messages"%msg_num) + self._fail("we should have %s messages" % msg_num) - self._pass("created and listed %s messages counted"%msg_num) + self._pass("created and listed %s messages counted" % msg_num) def stop(self): """ @@ -99,13 +101,12 @@ class TestStatusMessage(LFCliBase): msg_num = 0 for message_o in message_list_response["messages"]: msg_url = message_o["_links"] - print("Message url: "+msg_url) + print("Message url: " + msg_url) message_response = self.json_get(msg_url) if self.debug: pprint(message_response) - for message_o in message_response["messages"]: + for content_o in message_response["messages"]: msg_num += 1 - content_o = message_o print("id %s" % content_o["message_id"]) print("key %s" % content_o["message"]["key"]) print("content-type %s" % content_o["message"]["content-type"]) @@ -125,7 +126,6 @@ class TestStatusMessage(LFCliBase): last_link = "" msg_num = 0 for message_o in message_list_response["messages"]: - msg_url = message_o["_links"] # print("Delete Message url: "+msg_url) last_link = message_o["_links"] msg_num += 1 @@ -157,7 +157,7 @@ class TestStatusMessage(LFCliBase): elif "empty" in message_list_response: msg_num = 0 - if (msg_num == 0): + if msg_num == 0: self._pass("deleted all messages in session") else: self._fail("failed to delete all messages in session") @@ -166,8 +166,8 @@ class TestStatusMessage(LFCliBase): try: if self.debug: print("--- del -------------------- -------------------- --------------------") - self.exit_on_error=False - message_response = self.json_delete(self.session_url, debug_=False) + self.exit_on_error = False + self.json_delete(self.session_url, debug_=False) if self.debug: print("--- ~del -------------------- -------------------- --------------------") except ValueError as ve: @@ -193,8 +193,7 @@ class TestStatusMessage(LFCliBase): try: if self.debug: print("--- del -------------------- -------------------- --------------------") - self.exit_on_error=False - message_response = self.json_delete(self.session_url+"/this", debug_=False) + self.json_delete(self.session_url + "/this", debug_=False) if self.debug: print("--- ~del -------------------- -------------------- --------------------") except ValueError as ve: @@ -208,7 +207,7 @@ class TestStatusMessage(LFCliBase): for session_o in session_list: if session_o["_links"] == self.session_url: counter += 1 - self._fail("session not deleted: "+session_o["_links"]) + self._fail("session not deleted: " + session_o["_links"]) break if counter == 0: self._pass("session correctly deleted") @@ -222,14 +221,14 @@ class TestStatusMessage(LFCliBase): counter = 0 for session_o in session_list: counter += 1 - self.json_delete(session_o["_links"]+"/all") + self.json_delete(session_o["_links"] + "/all") print("cleaned %s sessions" % counter) counter = 0 for session_o in session_list: if session_o["session-id"] == "0": continue counter += 1 - self.json_delete(session_o["_links"]+"/this") + self.json_delete(session_o["_links"] + "/this") print("deleted %s sessions" % counter) @@ -258,10 +257,10 @@ Actions can be: list : list messages from session delete : delete message, all messages using session/all or session using session/this """) - parser.add_argument('--session', type=str, help='explicit session or session/message-id') + parser.add_argument('--session', type=str, help='explicit session or session/message-id') parser.add_argument('--deep_clean', type=bool, help='remove all messages and all sessions') - parser.add_argument('--key', type=str, help='how to key the message') - parser.add_argument('--message', type=str, help='message to include') + parser.add_argument('--key', type=str, help='how to key the message') + parser.add_argument('--message', type=str, help='message to include') args = parser.parse_args() status_messages = TestStatusMessage(args.mgr, @@ -271,11 +270,11 @@ Actions can be: _exit_on_fail=False) if args.action == "new": if args.session is not None: - status_messages.json_put("/status-msg/"+args.session, {}) + status_messages.json_put("/status-msg/" + args.session, {}) else: a_uuid = uuid1() - status_messages.json_put("/status-msg/"+str(a_uuid), {}) - print("created session /status-msg/"+str(a_uuid)) + status_messages.json_put("/status-msg/" + str(a_uuid), {}) + print("created session /status-msg/" + str(a_uuid)) return if args.action == "update": @@ -288,7 +287,7 @@ Actions can be: if args.message is None: print("requires --message") return - status_messages.json_post("/status-msg/"+args.session, { + status_messages.json_post("/status-msg/" + args.session, { "key": args.key, "content-type": "text/plain", "message": args.message @@ -300,7 +299,7 @@ Actions can be: response_o = status_messages.json_get("/status-msg/") pprint(response_o["sessions"]) else: - response_o = status_messages.json_get("/status-msg/"+args.session) + response_o = status_messages.json_get("/status-msg/" + args.session) pprint(response_o["messages"]) return @@ -311,7 +310,7 @@ Actions can be: if args.key is None: print("requires --key") return - response_o = status_messages.json_get("/status-msg/%s/%s"%(args.session, args.key)) + response_o = status_messages.json_get("/status-msg/%s/%s" % (args.session, args.key)) pprint(response_o) return @@ -319,11 +318,10 @@ Actions can be: if args.session is None: print("requires --session") return - response_o = status_messages.json_delete("/status-msg/"+args.session) + response_o = status_messages.json_delete("/status-msg/" + args.session) pprint(response_o) return - if args.action == "run_test": if args.deep_clean: status_messages.deep_clean = True @@ -331,7 +329,7 @@ Actions can be: if not status_messages.passes(): print(status_messages.get_fail_message()) exit(1) - status_messages.start(False, False) + status_messages.start() status_messages.stop() if not status_messages.passes(): print(status_messages.get_fail_message()) @@ -341,5 +339,6 @@ Actions can be: print("Full test passed, all messages read and cleaned up") exit(0) + if __name__ == "__main__": main() From 74cdc984eca176a5a5bcbab9cfc89fa1f2eb6ddf Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 11:22:45 -0800 Subject: [PATCH 408/731] cv_test_manager: Clean up warnings Signed-off-by: Matthew Stidham --- py-json/cv_test_manager.py | 90 +++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index 23785c26..d9f19207 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -9,13 +9,11 @@ import importlib import time import json from pprint import pprint -import argparse if sys.version_info[0] != 3: print("This script requires Python 3") exit() - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -106,7 +104,7 @@ class cv_test(Realm): print("adding- " + text + " " + "to test config") - rsp = self.json_post(req_url, data) + self.json_post(req_url, data) # time.sleep(1) # Tell LANforge GUI Chamber View to launch a test @@ -119,22 +117,22 @@ class cv_test(Realm): cmd = "cv load '{0}' '{1}'".format(instance, scenario) self.run_cv_cmd(cmd) - #load test config for a chamber view test instance. + # load test config for a chamber view test instance. def load_test_config(self, test_config, instance): cmd = "cv load '{0}' '{1}'".format(instance, test_config) self.run_cv_cmd(cmd) - #start the test + # start the test def start_test(self, instance): cmd = "cv click '%s' Start" % instance return self.run_cv_cmd(cmd) - #close test + # close test def close_test(self, instance): cmd = "cv click '%s' 'Close'" % instance self.run_cv_cmd(cmd) - #Cancel + # Cancel def cancel_test(self, instance): cmd = "cv click '%s' Cancel" % instance self.run_cv_cmd(cmd) @@ -142,61 +140,61 @@ class cv_test(Realm): # Send chamber view commands to the LANforge GUI def run_cv_cmd(self, command): response_json = [] - req_url = "/gui-json/cmd" data = { "cmd": command } debug_par = "" - rsp = self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, response_json_list_=response_json) + self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, response_json_list_=response_json) try: if response_json[0]["LAST"]["warnings"].startswith("Unknown"): print("Unknown command?\n") pprint(response_json) - except: - # Ignore un-handled structs at this point, let calling code deal with it. + else: + pass + finally: pass return response_json - #For auto save report + # For auto save report def auto_save_report(self, instance): cmd = "cv click %s 'Auto Save Report'" % instance self.run_cv_cmd(cmd) - #To get the report location + # To get the report location def get_report_location(self, instance): cmd = "cv get %s 'Report Location:'" % instance location = self.run_cv_cmd(cmd) return location - #To get if test is running or not + # To get if test is running or not def get_is_running(self, instance): cmd = "cv get %s 'StartStop'" % instance val = self.run_cv_cmd(cmd) - #pprint(val) + # pprint(val) return val[0]["LAST"]["response"] == 'StartStop::Stop' - #To save to html + # To save to html def save_html(self, instance): cmd = "cv click %s 'Save HTML'" % instance self.run_cv_cmd(cmd) - #Check if test instance exists + # Check if test instance exists def get_exists(self, instance): cmd = "cv exists %s" % instance val = self.run_cv_cmd(cmd) - #pprint(val) + # pprint(val) return val[0]["LAST"]["response"] == 'YES' - #Check if chamberview is built + # Check if chamberview is built def get_cv_is_built(self): cmd = "cv is_built" val = self.run_cv_cmd(cmd) - #pprint(val) + # pprint(val) rv = val[0]["LAST"]["response"] == 'YES' print("is-built: ", rv) return rv - #delete the test instance + # delete the test instance def delete_instance(self, instance): cmd = "cv delete %s" % instance self.run_cv_cmd(cmd) @@ -205,9 +203,9 @@ class cv_test(Realm): tries = 0 while True: if self.get_exists(instance): - print("Waiting %i/60 for test instance: %s to be deleted."%(tries, instance)) + print("Waiting %i/60 for test instance: %s to be deleted." % (tries, instance)) tries += 1 - if (tries > 60): + if tries > 60: break time.sleep(1) else: @@ -217,15 +215,15 @@ class cv_test(Realm): tries = 0 while True: if not self.get_cv_is_built(): - print("Waiting %i/60 for Chamber-View to be built."%(tries)) + print("Waiting %i/60 for Chamber-View to be built." % tries) tries += 1 - if (tries > 60): + if tries > 60: break time.sleep(1) else: break - #Get port listing + # Get port listing def get_ports(self, url="/ports/"): response = self.json_get(url) return response @@ -235,12 +233,12 @@ class cv_test(Realm): response_json = [] data = {"type": "Plugin-Settings"} if config_name and blob_test_name: - data["name"] = "%s%s"%(blob_test_name, config_name) # config name + data["name"] = "%s%s" % (blob_test_name, config_name) # config name else: data["name"] = "ALL" if brief: data["brief"] = "brief" - self.json_post(req_url, data, response_json_list_=response_json) + self.json_post(req_url, data, response_json_list_=response_json) return response_json def rm_text_blob(self, config_name, blob_test_name): @@ -249,17 +247,18 @@ class cv_test(Realm): "type": "Plugin-Settings", "name": str(blob_test_name + config_name), # config name } - rsp = self.json_post(req_url, data) + self.json_post(req_url, data) - def rm_cv_text_blob(self, type="Network-Connectivity", name=None): + def rm_cv_text_blob(self, cv_type="Network-Connectivity", name=None): req_url = "/cli-json/rm_text_blob" data = { - "type": type, + "type": cv_type, "name": name, # config name } - rsp = self.json_post(req_url, data) + self.json_post(req_url, data) - def apply_cfg_options(self, cfg_options, enables, disables, raw_lines, raw_lines_file): + @staticmethod + def apply_cfg_options(cfg_options, enables, disables, raw_lines, raw_lines_file): # Read in calibration data and whatever else. if raw_lines_file != "": @@ -271,10 +270,10 @@ class cv_test(Realm): fp.close() for en in enables: - cfg_options.append("%s: 1"%(en[0])) + cfg_options.append("%s: 1" % (en[0])) for en in disables: - cfg_options.append("%s: 0"%(en[0])) + cfg_options.append("%s: 0" % (en[0])) for r in raw_lines: cfg_options.append(r[0]) @@ -318,7 +317,7 @@ class cv_test(Realm): if response[0]["LAST"]["response"] == "OK": break else: - print("Could not create test, try: %i/60:\n"%(start_try)) + print("Could not create test, try: %i/60:\n" % start_try) pprint(response) start_try += 1 if start_try > 60: @@ -381,6 +380,8 @@ class cv_test(Realm): print("SCP failed, user %s, password %s, dest %s" % (lf_user, lf_password, lf_host)) raise e # Exception("Could not find Reports") break + else: + print('Not reporting to kpi file') # Of if test stopped for some reason and could not generate report. if not self.get_is_running(instance_name): @@ -416,7 +417,7 @@ class cv_test(Realm): print("Not submitting to influx, influx_host not configured.\n") return - print("Creating influxdb connection, host: %s:%s org: %s token: %s bucket: %s\n"% + print("Creating influxdb connection, host: %s:%s org: %s token: %s bucket: %s\n" % (args.influx_host, args.influx_port, args.influx_org, args.influx_token, args.influx_bucket)) # lfjson_host would be if we are reading out of LANforge or some other REST # source, which we are not. So dummy those out. @@ -434,7 +435,7 @@ class cv_test(Realm): kpi_location = self.local_lf_report_dir + "/" + os.path.basename(self.lf_report_dir) # the local_lf_report_dir is the parent directory, need to get the directory name csv_path = "%s/kpi.csv" % kpi_location - + print("Attempt to submit kpi: ", csv_path) print("Posting to influx...\n") influxdb.csv_to_influx(csv_path) @@ -465,7 +466,7 @@ class cv_test(Realm): "text": text_blob } - rsp = self.json_post(req_url, data) + self.json_post(req_url, data) def pass_raw_lines_to_cv(self, scenario_name="Automation", @@ -476,7 +477,7 @@ class cv_test(Realm): "name": scenario_name, "text": Rawline } - rsp = self.json_post(req_url, data) + self.json_post(req_url, data) # This is for chamber view buttons @@ -502,13 +503,12 @@ class cv_test(Realm): def run_cv_cmd(self, command): # Send chamber view commands response_json = [] req_url = "/gui-json/cmd" - data = { - "cmd": command - } - rsp = self.json_post(req_url, data, debug_=False, response_json_list_=response_json) + data = {"cmd": command} + self.json_post(req_url, data, debug_=False, response_json_list_=response_json) return response_json - def get_response_string(self, response): + @staticmethod + def get_response_string(response): return response[0]["LAST"]["response"] def get_popup_info_and_close(self): From edb7bb2e901d49975b3cb27ee882857d424aadf8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 11:36:28 -0800 Subject: [PATCH 409/731] cv_test_manager: Remove unused code Signed-off-by: Matthew Stidham --- py-json/cv_test_manager.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index d9f19207..a764d2a1 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -137,24 +137,6 @@ class cv_test(Realm): cmd = "cv click '%s' Cancel" % instance self.run_cv_cmd(cmd) - # Send chamber view commands to the LANforge GUI - def run_cv_cmd(self, command): - response_json = [] - data = { - "cmd": command - } - debug_par = "" - self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, response_json_list_=response_json) - try: - if response_json[0]["LAST"]["warnings"].startswith("Unknown"): - print("Unknown command?\n") - pprint(response_json) - else: - pass - finally: - pass - return response_json - # For auto save report def auto_save_report(self, instance): cmd = "cv click %s 'Auto Save Report'" % instance From 2979b00cdb0e665f5969d3330bed9eceed5ef23e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 15:26:14 -0800 Subject: [PATCH 410/731] lf_ap_auto_test: Fix lf_attenmod_test Signed-off-by: Matthew Stidham --- py-json/lf_attenmod.py | 43 ++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/py-json/lf_attenmod.py b/py-json/lf_attenmod.py index f9652453..b13eca5e 100644 --- a/py-json/lf_attenmod.py +++ b/py-json/lf_attenmod.py @@ -18,15 +18,15 @@ class ATTENUATORProfile(LFCliBase): super().__init__(lfclient_host, lfclient_port, debug_) self.lfclient_host = lfclient_host self.COMMANDS = ["show_attenuators", "set_attenuator"] - self.atten_serno = "" - self.atten_idx = "" - self.atten_val = "" + self.atten_serno = None + self.atten_idx = None + self.atten_val = None self.atten_data = { "shelf": 1, "resource": 1, - "serno": None, - "atten_idx": None, - "val": None, + "serno": self.atten_serno, + "atten_idx": self.atten_idx, + "val": self.atten_val, "mode": None, "pulse_width_us5": None, "pulse_interval_ms": None, @@ -37,10 +37,10 @@ class ATTENUATORProfile(LFCliBase): def set_command_param(self, command_name, param_name, param_value): # we have to check what the param name is - if (command_name is None) or (command_name == ""): - return - if (param_name is None) or (param_name == ""): - return + if not command_name: + raise ValueError("Command Name is required") + if not param_name: + raise ValueError("Paramater is required") if command_name not in self.COMMANDS: raise ValueError("Command name name [%s] not defined in %s" % (command_name, self.COMMANDS)) if command_name == "set_attenuator": @@ -53,19 +53,27 @@ class ATTENUATORProfile(LFCliBase): if response is None: print(response) raise ValueError("Cannot find any endpoints") - else: - attenuator_resp = response["attenuators"] + elif 'attenuator' or 'attenuators' in response.keys(): + try: + attenuator_resp = response["attenuators"] + except KeyError: + attenuator_resp = [response["attenuator"]] for attenuator in attenuator_resp: for key, val in attenuator.items(): if key == "entity id": serial_num = val.split(".") print("Serial-num : %s" % serial_num[-1]) - print("%s : %s" % (key, val)) - print("\n") + print("%s : %s" % (key, val)) + print('\n') + + else: + raise ValueError('No attenuators in response') def create(self): - if type(self.atten_serno) == str or len(self.atten_idx) == 0 or type(self.atten_val) == str: - print("ERROR: Must specify atten_serno, atten_idx, and atten_val when setting attenuator.\n") + if int(self.atten_val) > 955: + raise ValueError("Attenuation ddB value must be 955 or less") + if int(self.atten_idx) > 7: + raise ValueError("Attenuation ddB value must be 7 or less") print("Setting Attenuator...") self.set_command_param("set_attenuator", "serno", self.atten_serno) self.set_command_param("set_attenuator", "atten_idx", self.atten_idx) @@ -73,7 +81,6 @@ class ATTENUATORProfile(LFCliBase): set_attenuators = LFRequest.LFRequest(self.lfclient_url + "/cli-json/set_attenuator", debug_=self.debug) set_attenuators.addPostData(self.atten_data) time.sleep(0.01) - json_response = set_attenuators.jsonPost(self.debug) + set_attenuators.jsonPost(self.debug) time.sleep(10) print("\n") - From 9a810353fa396ee9c6be505a24cd4eed86da5fec Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 15:34:33 -0800 Subject: [PATCH 411/731] Update regression test Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 43 ++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 1f70c016..04bd839b 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -120,8 +120,8 @@ MGRLEN=${#MGR} COL_NAMES="name,tx_bytes,rx_bytes,dropped" if [[ ${#DUT2} -eq 0 ]]; then - DUT5="linksys-8450 Default-SSID-5gl c4:41:1e:f5:3f:25" - DUT2="linksys-8450 Default-SSID-2g c4:41:1e:f5:3f:24" + DUT5="linksys-8450 j-wpa2-153 c4:41:1e:f5:3f:25 (1)" + DUT2="linksys-8450 j-wpa2-153 c4:41:1e:f5:3f:25 (1)" fi #CURR_TEST_NUM=0 CURR_TEST_NAME="BLANK" @@ -161,9 +161,36 @@ function create_bridge_and_station() { if [[ ${#SHORT} -gt 0 ]]; then testCommands=( - # run_l3_longevity - "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 30s" - "./sta_connect.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" + "./lf_ap_auto_test.py \ + --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ + --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth1 \ + --dut5_0 '$DUT5' \ + --dut2_0 '$DUT2' \ + --max_stations_2 100 \ + --max_stations_5 100 \ + --max_stations_dual 200 \ + --radio2 1.1.wiphy0 \ + --radio2 1.1.wiphy1 \ + --set 'Basic Client Connectivity' 1 \ + --set 'Multi Band Performance' 1 \ + --set 'Skip 2.4Ghz Tests' 1 \ + --set 'Skip 5Ghz Tests' 1 \ + --set 'Throughput vs Pkt Size' 0 \ + --set 'Capacity' 0 \ + --set 'Stability' 0 \ + --set 'Band-Steering' 0 \ + --set 'Multi-Station Throughput vs Pkt Size' 0 \ + --set 'Long-Term' 0 \ + --pull_report \ + --influx_host c7-graphana \ + --influx_port 8086 \ + --influx_org Candela \ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ + --influx_bucket ben \ + --influx_tag testbed Ferndale-01 \ + --local_lf_report_dir /home/matthew/html-reports/" + + ) else testCommands=( @@ -198,9 +225,9 @@ else # "./layer4_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" "./lf_ap_auto_test.py \ --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth2 \ - --dut5_0 '$DUT5 (2)' \ - --dut2_0 '$DUT2 (1)' \ + --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth1 \ + --dut5_0 '$DUT5' \ + --dut2_0 '$DUT2' \ --max_stations_2 100 \ --max_stations_5 100 \ --max_stations_dual 200 \ From 948b60a3935f4bf0ff7a80538634e46b5f0986f5 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 16:24:15 -0800 Subject: [PATCH 412/731] base_profile.py: Fix all errors in base_profile.py Signed-off-by: Matthew Stidham --- py-json/base_profile.py | 50 +++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/py-json/base_profile.py b/py-json/base_profile.py index c73fed0d..0209a290 100644 --- a/py-json/base_profile.py +++ b/py-json/base_profile.py @@ -2,7 +2,8 @@ import datetime import random import string -from pprint import pprint +from pprint import pformat + class BaseProfile: def __init__(self, local_realm, debug=False): @@ -11,9 +12,8 @@ class BaseProfile: self.debug = debug or local_realm.debug self.profiles = [] - def json_get(self, _req_url, debug_=False): - return self.parent_realm.json_get(_req_url, debug_=False) + return self.parent_realm.json_get(_req_url, debug_=debug_) def json_post(self, req_url=None, data=None, debug_=False, suppress_related_commands_=None): return self.parent_realm.json_post(_req_url=req_url, @@ -34,52 +34,56 @@ class BaseProfile: return self.parent_realm.rm_cx(cx_name) def rm_endp(self, ename, debug_=False, suppress_related_commands_=True): - self.parent_realm.rm_endp(ename, debug_=False, suppress_related_commands_=True) + self.parent_realm.rm_endp(ename, debug_=debug_, suppress_related_commands_=suppress_related_commands_) def name_to_eid(self, eid): return self.parent_realm.name_to_eid(eid) def set_endp_tos(self, ename, _tos, debug_=False, suppress_related_commands_=True): - return self.parent_realm.set_endp_tos(ename, _tos, debug_=False, suppress_related_commands_=True) + return self.parent_realm.set_endp_tos(ename, _tos, debug_=debug_, suppress_related_commands_=suppress_related_commands_) def wait_until_endps_appear(self, these_endp, debug=False): - return self.parent_realm.wait_until_endps_appear(these_endp, debug=False) + return self.parent_realm.wait_until_endps_appear(these_endp, debug=debug) def wait_until_cxs_appear(self, these_cx, debug=False): - return self.parent_realm.wait_until_cxs_appear(these_cx, debug=False) + return self.parent_realm.wait_until_cxs_appear(these_cx, debug=debug) def logg(self, message=None, audit_list=None): if audit_list is None: self.parent_realm.logg(message) for item in audit_list: - if (item is None): + if item is None: continue - message += ("\n" + pprint.pformat(item, indent=4)) + message += ("\n" + pformat(item, indent=4)) self.parent_realm.logg(message) - def replace_special_char(self, str): - return str.replace('+', ' ').replace('_', ' ').strip(' ') + @staticmethod + def replace_special_char(original): + return original.replace('+', ' ').replace('_', ' ').strip(' ') # @deprecate me - def get_milliseconds(self, timestamp): - return (timestamp - datetime.datetime(1970,1,1)).total_seconds()*1000 + @staticmethod + def get_milliseconds(timestamp): + return (timestamp - datetime.datetime(1970, 1, 1)).total_seconds() * 1000 # @deprecate me - def get_seconds(self, timestamp): - return (timestamp - datetime.datetime(1970,1,1)).total_seconds() + @staticmethod + def get_seconds(timestamp): + return (timestamp - datetime.datetime(1970, 1, 1)).total_seconds() - def read_file(self, filename): + @staticmethod + def read_file(filename): filename = open(filename, 'r') return [line.split(',') for line in filename.readlines()] - #Function to create random characters made of letters - def random_chars(self, size, chars=None): + # Function to create random characters made of letters + @staticmethod + def random_chars(size, chars=None): if chars is None: chars = string.ascii_letters - return ''.join(random.choice(chars) for x in range(size)) + return ''.join(random.choice(chars) for _ in range(size)) - - #--------------- create file path / find file path code - to be put into functions + # --------------- create file path / find file path code - to be put into functions # #Find file path to save data/csv to: # if args.report_file is None: # new_file_path = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':', @@ -100,7 +104,7 @@ class BaseProfile: # print('Not supporting this report format or cannot find report format provided. Defaulting to csv data file output type, naming it data.csv.') # report_f = str(path) + '/data.csv' # output = 'csv' - + # else: # report_f = args.report_file # if args.output_format is None: @@ -118,5 +122,3 @@ class BaseProfile: # exit(1) # else: # compared_rept=args.compared_report - - From 87edf9813e156001b76fbd6d4e603354b151670d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 16:30:48 -0800 Subject: [PATCH 413/731] Deprecate unused files Signed-off-by: Matthew Stidham --- py-json/{ => deprecated}/base_profile.py | 0 py-json/{ => deprecated}/l3_cxprofile2.py | 0 py-json/{ => deprecated}/vr_profile2.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename py-json/{ => deprecated}/base_profile.py (100%) rename py-json/{ => deprecated}/l3_cxprofile2.py (100%) rename py-json/{ => deprecated}/vr_profile2.py (100%) diff --git a/py-json/base_profile.py b/py-json/deprecated/base_profile.py similarity index 100% rename from py-json/base_profile.py rename to py-json/deprecated/base_profile.py diff --git a/py-json/l3_cxprofile2.py b/py-json/deprecated/l3_cxprofile2.py similarity index 100% rename from py-json/l3_cxprofile2.py rename to py-json/deprecated/l3_cxprofile2.py diff --git a/py-json/vr_profile2.py b/py-json/deprecated/vr_profile2.py similarity index 100% rename from py-json/vr_profile2.py rename to py-json/deprecated/vr_profile2.py From d89adcc6e100234c14a1487c22a6c7d25367d3c0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 17:08:01 -0800 Subject: [PATCH 414/731] logger_example.py: Initial commit Signed-off-by: Matthew Stidham --- py-scripts/sandbox/logger_example.py | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 py-scripts/sandbox/logger_example.py diff --git a/py-scripts/sandbox/logger_example.py b/py-scripts/sandbox/logger_example.py new file mode 100644 index 00000000..bc0d296e --- /dev/null +++ b/py-scripts/sandbox/logger_example.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 + +import logging +from random import choice + + +class ContextFilter(logging.Filter): + """ + This is a filter which injects contextual information into the log. + + Rather than use actual contextual information, we just use random + data in this demo. + """ + + USERS = ['jim', 'fred', 'sheila'] + IPS = ['123.231.231.123', '127.0.0.1', '192.168.0.1'] + + def filter(self, record): + + record.ip = choice(ContextFilter.IPS) + record.user = choice(ContextFilter.USERS) + return True + + +def main(): + levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL) + logging.basicConfig(level=logging.DEBUG, + format='%(asctime)-15s %(name)-5s %(levelname)-8s IP: %(ip)-15s User: %(user)-8s %(message)s') + a1 = logging.getLogger('a.b.c') + a2 = logging.getLogger('d.e.f') + + logging.basicConfig(filename='example.log', level=logging.DEBUG) + logging.warning('this is a tutorial') + logging.info('It includes the basic logging functions') + + logging.info("Don't include certain strings") + logging.info('define a filter') + f = ContextFilter() + a1.addFilter(f) + a2.addFilter(f) + a1.debug('A debug message') + a1.info('An info message with %s', 'some parameters') + for x in range(10): + lvl = choice(levels) + lvlname = logging.getLevelName(lvl) + a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, 'parameters') + + +if __name__ == '__main__': + main() From 42345dd0a8df2b88e800007a32190bb1a90cb81e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 17:28:14 -0800 Subject: [PATCH 415/731] lf_attenmod: self.atten_idx can also be all Signed-off-by: Matthew Stidham --- py-json/lf_attenmod.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/lf_attenmod.py b/py-json/lf_attenmod.py index b13eca5e..053573bc 100644 --- a/py-json/lf_attenmod.py +++ b/py-json/lf_attenmod.py @@ -72,7 +72,7 @@ class ATTENUATORProfile(LFCliBase): def create(self): if int(self.atten_val) > 955: raise ValueError("Attenuation ddB value must be 955 or less") - if int(self.atten_idx) > 7: + if int(self.atten_idx) > 7 or self.atten_idx == 'all': raise ValueError("Attenuation ddB value must be 7 or less") print("Setting Attenuator...") self.set_command_param("set_attenuator", "serno", self.atten_serno) From c3c2e09950a0f6641d2e86fd76d211196da6f608 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 17:30:06 -0800 Subject: [PATCH 416/731] realm: l3_cxprofile2 is deprecated Signed-off-by: Matthew Stidham --- py-json/realm.py | 152 +++++++++++++++++++++++------------------------ 1 file changed, 74 insertions(+), 78 deletions(-) diff --git a/py-json/realm.py b/py-json/realm.py index 207b3cc5..afc2b148 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -16,7 +16,7 @@ from pprint import pprint # ---- ---- ---- ---- LANforge Base Imports ---- ---- ---- ---- - + sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LANforge = importlib.import_module("py-json.LANforge") @@ -28,8 +28,6 @@ LFCliBase = lfcli_base.LFCliBase l3_cxprofile = importlib.import_module("py-json.l3_cxprofile") L3CXProfile = l3_cxprofile.L3CXProfile -l3_cxprofile2 = importlib.import_module("py-json.l3_cxprofile2") -L3CXProfile2 = l3_cxprofile2.L3CXProfile2 l4_cxprofile = importlib.import_module("py-json.l4_cxprofile") L4CXProfile = l4_cxprofile.L4CXProfile lf_attenmod = importlib.import_module("py-json.lf_attenmod") @@ -63,6 +61,7 @@ LFDataCollection = lfdata.LFDataCollection vr_profile2 = importlib.import_module("py-json.vr_profile2") VRProfile = vr_profile2.VRProfile + def wpa_ent_list(): return [ "DEFAULT", @@ -239,7 +238,7 @@ class Realm(LFCliBase): "shelf": eid[0], "resource": eid[1], "port": eid[2] - } + } self.json_post(req_url, data, debug_=debug_) return True @@ -409,7 +408,8 @@ class Realm(LFCliBase): name = list(endp_list[idx])[0] found_endps[name] = name except: - print("non-fatal exception endp_list = list(endp_list['endpoint'] did not exist, will wait some more") + print( + "non-fatal exception endp_list = list(endp_list['endpoint'] did not exist, will wait some more") for req in these_endp: if not req in found_endps: @@ -451,7 +451,7 @@ class Realm(LFCliBase): return not wait_more - #def wait_until_database_loaded(self): + # def wait_until_database_loaded(self): # Returns map of all stations with port+type == WIFI-STATION # Key is the EID, value is the map of key/values for the port values. @@ -522,9 +522,9 @@ class Realm(LFCliBase): "shelf": eid_toks[0], "resource": eid_toks[1], "serno": eid_toks[2], - "atten_idx":eid_toks[3], - "val":atten_ddb, - } + "atten_idx": eid_toks[3], + "val": atten_ddb, + } self.json_post(req_url, data) # removes port by eid/eidpn @@ -613,7 +613,7 @@ class Realm(LFCliBase): def name_to_eid(self, eid, debug=False, non_port=False): if debug: - self.logg(level="debug", mesg="name_to_eid: "+str(eid)) + self.logg(level="debug", mesg="name_to_eid: " + str(eid)) if (type(eid) is list) or (type(eid) is tuple): return eid return LFUtils.name_to_eid(eid, non_port=non_port) @@ -764,7 +764,6 @@ class Realm(LFCliBase): raise ValueError("time_string must be of type str. Type %s provided" % type(time_string)) return duration_sec - def remove_all_stations(self, resource): port_list = self.station_list() sta_list = [] @@ -837,80 +836,74 @@ class Realm(LFCliBase): link = self.lfclient_url + link info = () - def new_station_profile(self, ver = 1): + def new_station_profile(self, ver=1): if ver == 1: station_prof = StationProfile(self.lfclient_url, local_realm=self, debug_=self.debug, up=False) - #elif ver == 2: - # import station_profile2 - # station_prof = station_profile2.StationProfile2(self.lfclient_url, local_realm=self, debug_=self.debug, up=False) + # elif ver == 2: + # import station_profile2 + # station_prof = station_profile2.StationProfile2(self.lfclient_url, local_realm=self, debug_=self.debug, up=False) return station_prof - def new_multicast_profile(self, ver = 1): + def new_multicast_profile(self, ver=1): if ver == 1: multi_prof = MULTICASTProfile(self.lfclient_host, self.lfclient_port, - local_realm=self, debug_=self.debug, report_timer_=3000) - #elif ver == 2: - # import multicast_profile2 - # multi_prof = multicast_profile2.MULTICASTProfile2(self.lfclient_host, self.lfclient_port, - # local_realm=self, debug_=self.debug, report_timer_=3000) + local_realm=self, debug_=self.debug, report_timer_=3000) + # elif ver == 2: + # import multicast_profile2 + # multi_prof = multicast_profile2.MULTICASTProfile2(self.lfclient_host, self.lfclient_port, + # local_realm=self, debug_=self.debug, report_timer_=3000) return multi_prof - def new_wifi_monitor_profile(self, resource_=1, debug_=False, up_=False, ver = 1): + def new_wifi_monitor_profile(self, resource_=1, debug_=False, up_=False, ver=1): if ver == 1: wifi_mon_prof = WifiMonitor(self.lfclient_url, - local_realm=self, - resource_=resource_, - up=up_, - debug_=(self.debug or debug_)) - #elif ver == 2: - # import wifi_monitor_profile2 - # wifi_mon_prof = wifi_monitor_profile2.WifiMonitor2(self.lfclient_url, - # local_realm=self, - # resource_=resource_, - # up=up_, - # debug_=(self.debug or debug_)) + local_realm=self, + resource_=resource_, + up=up_, + debug_=(self.debug or debug_)) + # elif ver == 2: + # import wifi_monitor_profile2 + # wifi_mon_prof = wifi_monitor_profile2.WifiMonitor2(self.lfclient_url, + # local_realm=self, + # resource_=resource_, + # up=up_, + # debug_=(self.debug or debug_)) return wifi_mon_prof - def new_l3_cx_profile(self, ver=1): - if ver == 1: - cx_prof = L3CXProfile(self.lfclient_host, - self.lfclient_port, - local_realm=self, - debug_=self.debug, - report_timer_=3000) - elif ver == 2: - cx_prof = L3CXProfile2(self.lfclient_host, - self.lfclient_port, - local_realm=self, - debug_=self.debug, - report_timer_=3000) - return cx_prof + def new_l3_cx_profile(self): + return L3CXProfile(self.lfclient_host, + self.lfclient_port, + local_realm=self, + debug_=self.debug, + report_timer_=3000) def new_l4_cx_profile(self, ver=1): if ver == 1: cx_prof = L4CXProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) - #elif ver == 2: - # import l4_cxprofile2 - # cx_prof = l4_cxprofile2.L4CXProfile2(self.lfclient_host, - # self.lfclient_port, - # local_realm=self, - # debug_=self.debug, - # report_timer_=3000) + # elif ver == 2: + # import l4_cxprofile2 + # cx_prof = l4_cxprofile2.L4CXProfile2(self.lfclient_host, + # self.lfclient_port, + # local_realm=self, + # debug_=self.debug, + # report_timer_=3000) return cx_prof + def new_attenuator_profile(self, ver=1): if ver == 1: atten_prof = ATTENUATORProfile(self.lfclient_host, self.lfclient_port, debug_=self.debug) - return atten_prof + return atten_prof + def new_generic_endp_profile(self, ver=1): - if ver == 1 : + if ver == 1: endp_prof = GenCXProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) - #elif ver == 2: - # import gen_cxprofile2 - # endp_prof = gen_cxprofile2.GenCXProfile(self.lfclient_host, - # self.lfclient_port, - # local_realm=self, - # debug_=self.debug, - # report_timer_=3000) + # elif ver == 2: + # import gen_cxprofile2 + # endp_prof = gen_cxprofile2.GenCXProfile(self.lfclient_host, + # self.lfclient_port, + # local_realm=self, + # debug_=self.debug, + # report_timer_=3000) return endp_prof def new_generic_cx_profile(self, ver=1): @@ -920,19 +913,19 @@ class Realm(LFCliBase): """ if ver == 1: cx_prof = GenCXProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) - #elif ver == 2: - # import gen_cxprofile2 - # cx_prof = gen_cxprofile2.GenCXProfile(self.lfclient_host, - # self.lfclient_port, - # local_realm=self, - # debug_=self.debug, - # report_timer_=3000) + # elif ver == 2: + # import gen_cxprofile2 + # cx_prof = gen_cxprofile2.GenCXProfile(self.lfclient_host, + # self.lfclient_port, + # local_realm=self, + # debug_=self.debug, + # report_timer_=3000) return cx_prof def new_vap_profile(self, ver=1): if ver == 1: vap_prof = VAPProfile(lfclient_host=self.lfclient_host, lfclient_port=self.lfclient_port, local_realm=self, - debug_=self.debug) + debug_=self.debug) # elif ver == 2: # import vap_profile2 # vap_prof = vap_profile2.VAPProfile2(lfclient_host=self.lfclient_host, lfclient_port=self.lfclient_port, local_realm=self, @@ -944,7 +937,7 @@ class Realm(LFCliBase): debug=self.debug) return vr_prof - def new_http_profile(self, ver = 1): + def new_http_profile(self, ver=1): if ver == 1: http_prof = HTTPProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) # elif ver == 2: @@ -952,7 +945,7 @@ class Realm(LFCliBase): # http_prof = http_profile2.HTTPProfile2(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) return http_prof - def new_fio_endp_profile(self, ver = 1): + def new_fio_endp_profile(self, ver=1): if ver == 1: cx_prof = FIOEndpProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) # elif ver == 2: @@ -960,7 +953,7 @@ class Realm(LFCliBase): # cx_prof = fio_endp_profile2.FIOEndpProfile2(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) return cx_prof - def new_dut_profile(self, ver = 1): + def new_dut_profile(self, ver=1): if ver == 1: dut_profile = DUTProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) # elif ver == 2: @@ -968,9 +961,10 @@ class Realm(LFCliBase): # dut_profile = dut_profile2.DUTProfile2(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) return dut_profile - def new_mvlan_profile(self, ver = 1): + def new_mvlan_profile(self, ver=1): if ver == 1: - mac_vlan_profile = MACVLANProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) + mac_vlan_profile = MACVLANProfile(self.lfclient_host, self.lfclient_port, local_realm=self, + debug_=self.debug) # elif ver == 2: # import mac_vlan_profile2 # mac_vlan_profile = mac_vlan_profile2.MACVLANProfile2(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) @@ -979,9 +973,10 @@ class Realm(LFCliBase): def new_qvlan_profile(self): return QVLANProfile(self.host, self.port, local_realm=self, debug_=self.debug) - def new_test_group_profile(self, ver = 1): + def new_test_group_profile(self, ver=1): if ver == 1: - test_group_profile = TestGroupProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) + test_group_profile = TestGroupProfile(self.lfclient_host, self.lfclient_port, local_realm=self, + debug_=self.debug) # elif ver == 2: # import test_group_profile2 # test_group_profile = test_group_profile2.TestGroupProfile2(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) @@ -990,6 +985,7 @@ class Realm(LFCliBase): def new_lf_data_collection(self): return LFDataCollection(local_realm=self) + class PacketFilter(): def get_filter_wlan_assoc_packets(self, ap_mac, sta_mac): From bb366408b5c74c71bbbd7c2c5cf1eb125530983f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 18 Nov 2021 17:32:03 -0800 Subject: [PATCH 417/731] realm: vrprofile is deprecated Signed-off-by: Matthew Stidham --- py-json/realm.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/py-json/realm.py b/py-json/realm.py index afc2b148..2ebf6400 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -58,8 +58,6 @@ port_utils = importlib.import_module("py-json.port_utils") PortUtils = port_utils.PortUtils lfdata = importlib.import_module("py-json.lfdata") LFDataCollection = lfdata.LFDataCollection -vr_profile2 = importlib.import_module("py-json.vr_profile2") -VRProfile = vr_profile2.VRProfile def wpa_ent_list(): @@ -932,10 +930,9 @@ class Realm(LFCliBase): # debug_=self.debug) return vap_prof - def new_vr_profile(self): - vr_prof = VRProfile(local_realm=self, - debug=self.debug) - return vr_prof + # def new_vr_profile(self): + # return VRProfile(local_realm=self, + # debug=self.debug) def new_http_profile(self, ver=1): if ver == 1: From 78d712e03ee4d83288ac5986db03d5e960f01081 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 19 Nov 2021 09:36:18 -0800 Subject: [PATCH 418/731] lfcli_base: Mutable defaults at the root of our code are a wonderful way to create unexpected problems. Signed-off-by: Matthew Stidham --- py-json/LANforge/lfcli_base.py | 43 +++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index f54df4b1..581bf9e8 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -50,7 +50,9 @@ class LFCliBase: _exit_on_fail=False, _local_realm=None, _proxy_str=None, - _capture_signal_list=[]): + _capture_signal_list=None): + if _capture_signal_list is None: + _capture_signal_list = [] self.fail_pref = "FAILED: " self.pass_pref = "PASSED: " self.lfclient_host = _lfjson_host @@ -82,7 +84,7 @@ class LFCliBase: if len(_capture_signal_list) > 0: for zignal in _capture_signal_list: - self.captured_signal(zignal, self.my_captured_signal) + self.captured_signal(zignal) # def _finish(self): @@ -149,7 +151,8 @@ class LFCliBase: print("sending signal %s to thread %s" % (signum, name)) # do a thing - def my_captured_signal(self, signum): + @staticmethod + def my_captured_signal(signum): """ Override me to process signals, otherwise superclass signal handler is called. You may use _finish() or _halt() to indicate finishing soon or halting immediately. @@ -205,7 +208,8 @@ class LFCliBase: else: self.log_register_tag(reserved_tag) - def log_set_filename(self, filename=None): + @staticmethod + def log_set_filename(filename=None): if not filename: return logging.basicConfig(filename=filename) @@ -399,7 +403,8 @@ class LFCliBase: return reverse_map - def error(self, exception): + @staticmethod + def error(exception): # print("lfcli_base error: %s" % exception) pprint.pprint(exception) traceback.print_exception(Exception, exception, exception.__traceback__, chain=True) @@ -513,16 +518,17 @@ class LFCliBase: # pprint.pprint(self.proxy) - def logg2(self, level="debug", mesg=None): + @staticmethod + def logg2(level="debug", mesg=None): if (mesg is None) or (mesg == ""): return print("[{level}]: {msg}".format(level=level, msg=mesg)) - def logg(self, - level=None, - mesg=None, - filename=None, - scriptname=None): + @staticmethod + def logg(level=None, + mesg=None, + filename=None, + scriptname=None): """ This method is used by vr_profile2, lf_create_bcast, and shadowed by base_profile.py :param level: @@ -725,23 +731,28 @@ class LFCliBase: } self.json_post("/cli-json/add_event", data, debug_=debug_) - def read_file(self, filename): + @staticmethod + def read_file(filename): filename = open(filename, 'r') return [line.split(',') for line in filename.readlines()] #Function creates random characters made of letters - def random_chars(self, size, chars=None): + @staticmethod + def random_chars(size, chars=None): if chars is None: chars = string.ascii_letters return ''.join(random.choice(chars) for x in range(size)) - def get_milliseconds(self, timestamp): + @staticmethod + def get_milliseconds(timestamp): return (timestamp - datetime.datetime(1970,1,1)).total_seconds()*1000 - def get_seconds(self, timestamp): + @staticmethod + def get_seconds(timestamp): return (timestamp - datetime.datetime(1970,1,1)).total_seconds() - def replace_special_char(self, special_str): + @staticmethod + def replace_special_char(special_str): return special_str.replace('+', ' ').replace('_', ' ').strip(' ') Help_Mode = """Station WiFi modes: use the number value below: From 703749772cecc32c81f1311e950bd7042db1eda3 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 19 Nov 2021 10:05:36 -0800 Subject: [PATCH 419/731] lf_dataplane_test: Remove unused argument Signed-off-by: Matthew Stidham --- py-scripts/lf_dataplane_test.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/py-scripts/lf_dataplane_test.py b/py-scripts/lf_dataplane_test.py index 90362952..fa8761e6 100755 --- a/py-scripts/lf_dataplane_test.py +++ b/py-scripts/lf_dataplane_test.py @@ -138,7 +138,6 @@ class DataplaneTest(cv_test): raw_lines_file="", sets=[], graph_groups=None, - report_dir="", test_rig="" ): super().__init__(lfclient_host=lf_host, lfclient_port=lf_port) @@ -164,7 +163,6 @@ class DataplaneTest(cv_test): self.raw_lines_file = raw_lines_file self.sets = sets self.graph_groups = graph_groups - self.report_dir = report_dir self.ssh_port = ssh_port self.local_lf_report_dir = local_lf_report_dir self.test_rig = test_rig @@ -313,7 +311,6 @@ def main(): help="Specify duration of each traffic run") parser.add_argument( "--graph_groups", help="File to save graph_groups to", default=None) - parser.add_argument("--report_dir", default="") parser.add_argument("--local_lf_report_dir", help="--local_lf_report_dir default '' put where dataplane script run from", default="") From 6dd06ea69235bb27a17c6bb499e60651d447d1ec Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 19 Nov 2021 10:33:06 -0800 Subject: [PATCH 420/731] cv_test_manager: Clean up code which is redundant in the argparser Signed-off-by: Matthew Stidham --- py-json/cv_test_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index a764d2a1..353e8f0c 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -55,9 +55,9 @@ def cv_add_base_parser(parser): parser.add_argument("-c", "--config_name", type=str, default="cv_dflt_cfg", help="Config file name") - parser.add_argument("-r", "--pull_report", default=False, action='store_true', + parser.add_argument("-r", "--pull_report", action='store_true', help="pull reports from lanforge (by default: False)") - parser.add_argument("--load_old_cfg", default=False, action='store_true', + parser.add_argument("--load_old_cfg", action='store_true', help="Should we first load defaults from previous run of the capacity test? Default is False") parser.add_argument("--enable", action='append', nargs=1, default=[], From 55db4b8b963dcd1296145d520683048f6e6b53e6 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 19 Nov 2021 13:33:57 -0700 Subject: [PATCH 421/731] test_l3_longevity.py : pass in the dut information lf_qa.py : bug fix for serial number Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 6 ++++++ py-scripts/tools/lf_check.py | 10 +++++----- py-scripts/tools/lf_qa.py | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 9a9cae77..86054132 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -2545,6 +2545,10 @@ Setting wifi_settings per radio "--dut_model_num", default="", help="dut model for kpi.csv, model number / name of the device under test") + parser.add_argument( + "--dut_serial_num", + default="", + help="dut serial for kpi.csv, serial number / serial number of the device under test") parser.add_argument( "--test_priority", default="", @@ -2764,6 +2768,7 @@ Setting wifi_settings per radio dut_hw_version = args.dut_hw_version dut_sw_version = args.dut_sw_version dut_model_num = args.dut_model_num + dut_serial_num = args.dut_serial_num # test_priority = args.test_priority # this may need to be set per test test_id = args.test_id @@ -2870,6 +2875,7 @@ Setting wifi_settings per radio _kpi_dut_hw_version=dut_hw_version, _kpi_dut_sw_version=dut_sw_version, _kpi_dut_model_num=dut_model_num, + _kpi_dut_serial_num=dut_serial_num, _kpi_test_id=test_id) if args.csv_outfile is not None: diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 55e87517..df5b4fc4 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -874,8 +874,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.test_start_time = str(datetime.datetime.now().strftime( "%Y-%m-%d-%H-%M-%S")).replace(':', '-') print( - "Test start: {time}".format( - time=self.test_start_time)) + "Test start: {time} Timeout: {timeout}".format( + time=self.test_start_time,timeout=self.test_timeout)) start_time = datetime.datetime.now() try: process = subprocess.Popen(command_to_run, shell=False, stdout=stdout_log, stderr=stderr_log, @@ -1099,9 +1099,9 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) # self.logger.info("row: {}".format(row)) self.logger.info("test: {} executed".format(test)) - else: - self.logger.info( - "enable value {} invalid for test: {}, test skipped".format(self.test_dict[test]['enabled'], test)) + else: + self.logger.info( + "enable value {} for test: {} ".format(self.test_dict[test]['enabled'], test)) self.finish_html_results() diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 0000ffc9..b309cad8 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -428,7 +428,7 @@ class csv_sql: self.dut_serial_num_list = list( set(list(df_tmp['dut-serial-num']))) if self.dut_serial_num_list[0] is not None: - self.dut_serial_num_ = self.dut_serial_num_list[0] + self.dut_serial_num = self.dut_serial_num_list[0] print( "In png DUT: {DUT} SW:{SW} HW:{HW} SN:{SN}" .format( From 2cdb09b0789443e0f26591cb978e1a889c1ab7f0 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Fri, 19 Nov 2021 13:28:20 -0800 Subject: [PATCH 422/731] desktop-hostname: fixes grep that provided bad mac address Signed-off-by: Jed Reynolds --- desktop-hostname.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop-hostname.bash b/desktop-hostname.bash index 119603a8..c0f11fa9 100755 --- a/desktop-hostname.bash +++ b/desktop-hostname.bash @@ -11,7 +11,7 @@ my_version=`cat /var/www/html/installed-ver.txt` my_hostname=`hostname` my_dev=`ip ro sho | awk '/default via/{print $5}'` my_ip=`ip a sho $my_dev | awk '/inet /{print $2}'` -my_mac=`ip a sho | grep -B1 "$my_dev" | awk '/ether /{print $2}'` +my_mac=`ip a sho | grep -A1 "$my_dev" | awk '/ether /{print $2}'` fill_color=${my_mac//:/} fill_color=${fill_color:6:12} X=220 From fe0b2b5c58da5fa3232f9a756354a2fc5d3ea8c3 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 19 Nov 2021 15:02:50 -0700 Subject: [PATCH 423/731] test_l3_longevity.py : updated pdf report to lanscape Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 86054132..55816ef6 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -3126,7 +3126,8 @@ Setting wifi_settings per radio report.write_html_with_timestamp() report.write_index_html() # report.write_pdf(_page_size = 'A3', _orientation='Landscape') - report.write_pdf_with_timestamp(_page_size='A4', _orientation='Portrait') + # report.write_pdf_with_timestamp(_page_size='A4', _orientation='Portrait') + report.write_pdf_with_timestamp(_page_size='A4', _orientation='Landscape') # ap scheduler results and write to a file if ap_scheduler_stats: From c1492964f1def7e6883b6ddbfaff6fb73ace1b6c Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 19 Nov 2021 15:30:07 -0800 Subject: [PATCH 424/731] cv_test_manager: Fix report directory Signed-off-by: Matthew Stidham --- py-json/cv_test_manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index 353e8f0c..41e45497 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -411,11 +411,11 @@ class cv_test(Realm): # lf_wifi_capacity_test.py may be run / initiated by a remote system against a lanforge # the local_lf_report_dir is where data is stored, if there is no local_lf_report_dir then the test is run directly on lanforge - if self.local_lf_report_dir is None: + if self.lf_report_dir: csv_path = "%s/kpi.csv" % self.lf_report_dir else: - kpi_location = self.local_lf_report_dir + "/" + os.path.basename(self.lf_report_dir) - # the local_lf_report_dir is the parent directory, need to get the directory name + kpi_location = self.lf_report_dir + "/" + os.path.basename(self.lf_report_dir) + # the lf_report_dir is the parent directory, need to get the directory name csv_path = "%s/kpi.csv" % kpi_location print("Attempt to submit kpi: ", csv_path) From e270f69b87abc3ca79ec612bcea52f370e3ce6a5 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 19 Nov 2021 15:30:24 -0800 Subject: [PATCH 425/731] lf_ap_auto_test: Make upstream port argument required Signed-off-by: Matthew Stidham --- py-scripts/lf_ap_auto_test.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/py-scripts/lf_ap_auto_test.py b/py-scripts/lf_ap_auto_test.py index 6cea0755..84ced2bd 100755 --- a/py-scripts/lf_ap_auto_test.py +++ b/py-scripts/lf_ap_auto_test.py @@ -178,6 +178,7 @@ cv_test_manager = importlib.import_module("py-json.cv_test_manager") cvtest = cv_test_manager.cv_test cv_add_base_parser = cv_test_manager.cv_add_base_parser cv_base_adjust_parser = cv_test_manager.cv_base_adjust_parser +LFUtils = importlib.import_module("py-json.LANforge.LFUtils") class ApAutoTest(cvtest): @@ -187,10 +188,11 @@ class ApAutoTest(cvtest): lf_user="lanforge", lf_password="lanforge", ssh_port=22, - local_lf_report_dir="", + local_lf_report_dir=None, + lf_report_dir=None, instance_name="ap_auto_instance", config_name="ap_auto_config", - upstream="1.1.eth1", + upstream=None, pull_report=False, dut5_0="NA", dut2_0="NA", @@ -245,6 +247,7 @@ class ApAutoTest(cvtest): self.sets = sets self.ssh_port = ssh_port self.graph_groups = graph_groups + self.lf_report_dir = lf_report_dir self.local_lf_report_dir = local_lf_report_dir def setup(self): @@ -277,8 +280,8 @@ class ApAutoTest(cvtest): self.apply_cfg_options(cfg_options, self.enables, self.disables, self.raw_lines, self.raw_lines_file) # Command line args take precedence. - if self.upstream != "": - cfg_options.append("upstream_port: " + self.upstream) + if self.upstream: + cfg_options.append("upstream-port: %s" % self.upstream) if self.dut5_0 != "": cfg_options.append("dut5-0: " + self.dut5_0) if self.dut2_0 != "": @@ -332,7 +335,7 @@ def main(): ) cv_add_base_parser(parser) # see cv_test_manager.py - parser.add_argument("-u", "--upstream", type=str, default="", + parser.add_argument("-u", "--upstream", type=str, required=True, help="Upstream port for wifi capacity test ex. 1.1.eth1") parser.add_argument("--max_stations_2", type=int, default=-1, @@ -353,6 +356,9 @@ def main(): parser.add_argument("--local_lf_report_dir", help="--local_lf_report_dir default '' put where dataplane script run from", default="") + parser.add_argument("--lf_report_dir", + help="--lf_report_dir default '' put where dataplane script run from", + default="") args = parser.parse_args() @@ -367,6 +373,7 @@ def main(): upstream=args.upstream, pull_report=args.pull_report, local_lf_report_dir=args.local_lf_report_dir, + lf_report_dir=args.lf_report_dir, dut5_0=args.dut5_0, dut2_0=args.dut2_0, load_old_cfg=args.load_old_cfg, From cf2d3a98a7ebdeba691f000a433a92cfbcffdc2d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 19 Nov 2021 15:30:59 -0800 Subject: [PATCH 426/731] Fix lf_ap_auto_test command Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 04bd839b..9e8b7063 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -166,9 +166,6 @@ if [[ ${#SHORT} -gt 0 ]]; then --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth1 \ --dut5_0 '$DUT5' \ --dut2_0 '$DUT2' \ - --max_stations_2 100 \ - --max_stations_5 100 \ - --max_stations_dual 200 \ --radio2 1.1.wiphy0 \ --radio2 1.1.wiphy1 \ --set 'Basic Client Connectivity' 1 \ @@ -228,9 +225,9 @@ else --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth1 \ --dut5_0 '$DUT5' \ --dut2_0 '$DUT2' \ - --max_stations_2 100 \ - --max_stations_5 100 \ - --max_stations_dual 200 \ + --max_stations_2 64 \ + --max_stations_5 64 \ + --max_stations_dual 64 \ --radio2 1.1.wiphy0 \ --radio2 1.1.wiphy1 \ --set 'Basic Client Connectivity' 1 \ From ebd8733ea43bd74eda500a17c2a01db927ad214d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 19 Nov 2021 16:35:27 -0800 Subject: [PATCH 427/731] lf_ap_auto_test: Default upstream port to None Signed-off-by: Matthew Stidham --- py-scripts/lf_ap_auto_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/lf_ap_auto_test.py b/py-scripts/lf_ap_auto_test.py index 84ced2bd..410f5bac 100755 --- a/py-scripts/lf_ap_auto_test.py +++ b/py-scripts/lf_ap_auto_test.py @@ -335,7 +335,7 @@ def main(): ) cv_add_base_parser(parser) # see cv_test_manager.py - parser.add_argument("-u", "--upstream", type=str, required=True, + parser.add_argument("-u", "--upstream", type=str, default=None, help="Upstream port for wifi capacity test ex. 1.1.eth1") parser.add_argument("--max_stations_2", type=int, default=-1, From af6083f7a1df71efe12af053ec29c218837bb3f6 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 22 Nov 2021 11:57:16 -0500 Subject: [PATCH 428/731] lf_check.py : added server override , and abiltiy to set sever in json Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_test_rig.json | 1 + py-scripts/tools/ct_us_001_rig.json | 1 + py-scripts/tools/ct_us_002_rig.json | 1 + py-scripts/tools/lf_check.py | 29 +++++++++++++++++++---------- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/py-scripts/tools/ct_test_rig.json b/py-scripts/tools/ct_test_rig.json index 53343414..9023d491 100644 --- a/py-scripts/tools/ct_test_rig.json +++ b/py-scripts/tools/ct_test_rig.json @@ -7,6 +7,7 @@ "test_rig_parameters":{ "TEST_BED": "CT-TEST-001", "TEST_RIG": "CT-TEST-001", + "TEST_SERVER": "http://127.0.0.1/", "DATABASE_SQLITE": "./tools/qa_sqlite3.db", "LF_MGR_IP": "192.168.100.116", "LF_MGR_PORT": "8080", diff --git a/py-scripts/tools/ct_us_001_rig.json b/py-scripts/tools/ct_us_001_rig.json index ef67ceed..125b8454 100644 --- a/py-scripts/tools/ct_us_001_rig.json +++ b/py-scripts/tools/ct_us_001_rig.json @@ -7,6 +7,7 @@ "test_rig_parameters":{ "TEST_BED": "CT-US-001", "TEST_RIG": "CT-US-001", + "TEST_SERVER": "http://192.168.95.6/", "DATABASE_SQLITE": "./tools/qa_001.db", "LF_MGR_IP": "192.168.100.116", "LF_MGR_PORT": "8080", diff --git a/py-scripts/tools/ct_us_002_rig.json b/py-scripts/tools/ct_us_002_rig.json index 43819d0d..2f6b8651 100644 --- a/py-scripts/tools/ct_us_002_rig.json +++ b/py-scripts/tools/ct_us_002_rig.json @@ -7,6 +7,7 @@ "test_rig_parameters":{ "TEST_BED": "CT-US-002", "TEST_RIG": "CT-US-002", + "TEST_SERVER": "http://192.168.95.6/", "DATABASE_SQLITE": "./tools/qa_002.db", "LF_MGR_IP": "192.168.100.200", "LF_MGR_PORT": "8080", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index df5b4fc4..7adde930 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -131,7 +131,7 @@ class lf_check(): _json_dut, _json_test, _test_suite, - _test_server, + _server_override, _db_override, _production, _csv_results, @@ -143,7 +143,7 @@ class lf_check(): self.json_dut = _json_dut self.json_test = _json_test self.test_suite = _test_suite - self.test_server = _test_server + self.server_override = _server_override self.db_override = _db_override self.production_run = _production self.report_path = _report_path @@ -186,6 +186,7 @@ class lf_check(): self.upstream_port = "" # results + self.test_server = "" self.database_sqlite = "" self.test_start_time = "" self.test_end_time = "" @@ -547,6 +548,16 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.test_rig = self.json_rig["test_rig_parameters"]["TEST_RIG"] else: self.logger.info("test_rig not in test_rig_parameters json") + + if self.server_override is None: + if "TEST_SERVER" in self.json_rig["test_rig_parameters"]: + self.test_server = self.json_rig["test_rig_parameters"]["TEST_SERVER"] + else: + self.logger.info( + "TEST_SERVER not in test_rig_parameters json") + else: + self.test_server = self.server_override + if self.db_override is None: if "DATABASE_SQLITE" in self.json_rig["test_rig_parameters"]: self.database_sqlite = self.json_rig["test_rig_parameters"]["DATABASE_SQLITE"] @@ -875,7 +886,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) "%Y-%m-%d-%H-%M-%S")).replace(':', '-') print( "Test start: {time} Timeout: {timeout}".format( - time=self.test_start_time,timeout=self.test_timeout)) + time=self.test_start_time, timeout=self.test_timeout)) start_time = datetime.datetime.now() try: process = subprocess.Popen(command_to_run, shell=False, stdout=stdout_log, stderr=stderr_log, @@ -1155,9 +1166,9 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a help="--suite default TEST_DICTIONARY", default="TEST_DICTIONARY") parser.add_argument( - '--server', - help="--server http:/// example: http://192.168.95.6/ default: ''", - default='') + '--server_override', + help="--server_override http:/// example: http://192.168.95.6/", + default=None) parser.add_argument( '--db_override', help="--db_override override for json DATABASE_SQLITE''", @@ -1204,12 +1215,10 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # select test suite test_suite = args.suite - - test_server = args.server - __dir = args.dir __path = args.path + server_override = args.server_override db_override = args.db_override if args.production: @@ -1238,7 +1247,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a _json_dut=json_dut, _json_test=json_test, _test_suite=test_suite, - _test_server=test_server, + _server_override=server_override, _db_override=db_override, _production=production, _csv_results=csv_results, From c1e91fa395f110ec33b3018d37f955d10e52159a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 22 Nov 2021 11:58:29 -0500 Subject: [PATCH 429/731] ct_us_003_rig.json ct_us_004_rig.json : updated for TEST_SERVER usage Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_003_rig.json | 1 + py-scripts/tools/ct_us_004_rig.json | 1 + 2 files changed, 2 insertions(+) diff --git a/py-scripts/tools/ct_us_003_rig.json b/py-scripts/tools/ct_us_003_rig.json index 053ea38f..e5683a1e 100644 --- a/py-scripts/tools/ct_us_003_rig.json +++ b/py-scripts/tools/ct_us_003_rig.json @@ -7,6 +7,7 @@ "test_rig_parameters":{ "TEST_BED": "CT-US-003", "TEST_RIG": "CT-US-003", + "TEST_SERVER": "http://192.168.95.6/", "DATABASE_SQLITE": "./tools/qa_003.db", "LF_MGR_IP": "192.168.100.233", "LF_MGR_PORT": "8080", diff --git a/py-scripts/tools/ct_us_004_rig.json b/py-scripts/tools/ct_us_004_rig.json index 6d386d46..304427d7 100644 --- a/py-scripts/tools/ct_us_004_rig.json +++ b/py-scripts/tools/ct_us_004_rig.json @@ -7,6 +7,7 @@ "test_rig_parameters":{ "TEST_BED": "CT-US-004", "TEST_RIG": "CT-US-004", + "TEST_SERVER": "http://192.168.95.6/", "DATABASE_SQLITE": "./tools/qa_004.db", "LF_MGR_IP": "192.168.100.194", "LF_MGR_PORT": "8080", From 6daca2c3d59d61efd136c76bd99753b5fcc5f6b1 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 22 Nov 2021 10:24:35 -0700 Subject: [PATCH 430/731] ct_us_001_tests.json : add ap_auto bc test Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 4fec6d2b..9cf03bf3 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -906,6 +906,68 @@ "args_list":[ " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] + }, + "suite_ap_bc":{ + "create_chamberview_dut_ap":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" + ]}, + "create_chamberview_ap":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ap_auto", + " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " + ] + }, + "ap_auto": { + "enabled": "TRUE", + "command": "lf_ap_auto_test.py", + "timeout":"25200", + "iterations":"1", + "args": "", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", + " --instance_name ap_auto --config_name test_con --upstream eth2", + " --dut5_0 'USE_DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'USE_DUT_NAME lanforge DUT_BSSID_2G (1)'", + " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", + " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", + " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", + " --set 'Basic Client Connectivity' 1", + " --set 'Multi Band Performance' 1", + " --set 'Stability' 0", + " --set 'Multi-Station Throughput vs Pkt Size' 0,", + " --set 'Throughput vs Pkt Size' 0", + " --set 'Capacity' 0", + " --set 'Band-Steering' 0", + " --set 'Skip 2.4 Ghz Tests' 0", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } } } } From fdc2b903361606213c9ef8a5f249be734c5cf553 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 22 Nov 2021 10:41:17 -0700 Subject: [PATCH 431/731] ct_us_001_tests.json : syntax fix Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 122 +++++++++++++------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 9cf03bf3..ac378a13 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -906,68 +906,68 @@ "args_list":[ " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] + } + }, + "suite_ap_bc":{ + "create_chamberview_dut_ap":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview_dut.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" + ]}, + "create_chamberview_ap":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"create_chamberview.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", + " --create_scenario ap_auto", + " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " + ] }, - "suite_ap_bc":{ - "create_chamberview_dut_ap":{ - "enabled":"TRUE", - "load_db":"skip", - "command":"create_chamberview_dut.py", - "args":"", - "args_list":[ - " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" - ]}, - "create_chamberview_ap":{ - "enabled":"TRUE", - "load_db":"skip", - "command":"create_chamberview.py", - "args":"", - "args_list":[ - " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", - " --create_scenario ap_auto", - " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-1' NA AUTO,AUTO -1 NA\" ", - " --raw_line \"profile_link 1.1 STA-AUTO 4 'DUT: DUT_NAME Radio-2' NA AUTO,AUTO -1 NA\" ", - " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA \" " - ] - }, - "ap_auto": { - "enabled": "TRUE", - "command": "lf_ap_auto_test.py", - "timeout":"25200", - "iterations":"1", - "args": "", - "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", - " --instance_name ap_auto --config_name test_con --upstream eth2", - " --dut5_0 'USE_DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'USE_DUT_NAME lanforge DUT_BSSID_2G (1)'", - " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", - " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", - " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", - " --set 'Basic Client Connectivity' 1", - " --set 'Multi Band Performance' 1", - " --set 'Stability' 0", - " --set 'Multi-Station Throughput vs Pkt Size' 0,", - " --set 'Throughput vs Pkt Size' 0", - " --set 'Capacity' 0", - " --set 'Band-Steering' 0", - " --set 'Skip 2.4 Ghz Tests' 0", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", - " --test_rig TEST_RIG", - " --set DUT_SET_NAME" - ] - }, - "lf_qa":{ - "enabled":"TRUE", - "timeout":"600", - "load_db":"skip", - "command":"./tools/lf_qa.py", - "args":"", - "args_list":[ - " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" - ] - } + "ap_auto": { + "enabled": "TRUE", + "command": "lf_ap_auto_test.py", + "timeout":"25200", + "iterations":"1", + "args": "", + "args_list":[ + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", + " --instance_name ap_auto --config_name test_con --upstream eth2", + " --dut5_0 'USE_DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'USE_DUT_NAME lanforge DUT_BSSID_2G (1)'", + " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", + " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", + " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", + " --set 'Basic Client Connectivity' 1", + " --set 'Multi Band Performance' 1", + " --set 'Stability' 0", + " --set 'Multi-Station Throughput vs Pkt Size' 0,", + " --set 'Throughput vs Pkt Size' 0", + " --set 'Capacity' 0", + " --set 'Band-Steering' 0", + " --set 'Skip 2.4 Ghz Tests' 0", + " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", + " --test_rig TEST_RIG", + " --set DUT_SET_NAME" + ] + }, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] } } } From f50d420e5c4510d6dcd96d730fec37e48d248062 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 22 Nov 2021 10:52:45 -0700 Subject: [PATCH 432/731] ct_us_001_tests.json : updated to remove multiband performance Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index ac378a13..10e27ae0 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -947,7 +947,7 @@ " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", " --set 'Basic Client Connectivity' 1", - " --set 'Multi Band Performance' 1", + " --set 'Multi Band Performance' 0", " --set 'Stability' 0", " --set 'Multi-Station Throughput vs Pkt Size' 0,", " --set 'Throughput vs Pkt Size' 0", From 07550300b1e270110a88986a8b9d5dc885b0fa82 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 22 Nov 2021 09:55:52 -0800 Subject: [PATCH 433/731] lf-atten_mod_test: trying to turn a string 'all' into an integer will always generate an error Signed-off-by: Matthew Stidham --- py-json/lf_attenmod.py | 6 ++++-- py-scripts/lf_atten_mod_test.py | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/py-json/lf_attenmod.py b/py-json/lf_attenmod.py index 053573bc..49fc1885 100644 --- a/py-json/lf_attenmod.py +++ b/py-json/lf_attenmod.py @@ -70,10 +70,12 @@ class ATTENUATORProfile(LFCliBase): raise ValueError('No attenuators in response') def create(self): + if self.atten_idx == 'all': + self.atten_idx = 8 if int(self.atten_val) > 955: raise ValueError("Attenuation ddB value must be 955 or less") - if int(self.atten_idx) > 7 or self.atten_idx == 'all': - raise ValueError("Attenuation ddB value must be 7 or less") + if int(self.atten_idx) > 7: + raise ValueError("Attenuation idx value must be 7 or less") print("Setting Attenuator...") self.set_command_param("set_attenuator", "serno", self.atten_serno) self.set_command_param("set_attenuator", "atten_idx", self.atten_idx) diff --git a/py-scripts/lf_atten_mod_test.py b/py-scripts/lf_atten_mod_test.py index d6badd26..fd376e77 100755 --- a/py-scripts/lf_atten_mod_test.py +++ b/py-scripts/lf_atten_mod_test.py @@ -54,6 +54,7 @@ class CreateAttenuator(Realm): self.attenuator_profile.create() self.attenuator_profile.show() + def main(): parser = Realm.create_basic_argparse( prog='lf_atten_mod_test.py', @@ -63,13 +64,13 @@ def main(): lf_atten_mod_test.py -------------------- set and show Attenuator: - python3 lf_atten_mod_test.py -hst 192.168.200.12 -port 8080 -atten_serno all --atten_idx all --atten_val 220 + python3 lf_atten_mod_test.py -hst 192.168.200.12 -port 8080 -atten_serno all --atten_idx 7 --atten_val 220 ''') parser.add_argument('-hst', '--host', help='host name', default='192.168.200.12') parser.add_argument('-port', '--port', help='port name', default=8080) parser.add_argument('-atten_serno', '--atten_serno', help='Serial number for requested Attenuator, or \'all\'', default=2222) - parser.add_argument('-atten_idx', '--atten_idx', help='Attenuator index eg. For module 1 = 0,module 2 = 1', default='all') + parser.add_argument('-atten_idx', '--atten_idx', help='Attenuator index eg. For module 1 = 0,module 2 = 1', default=7) parser.add_argument('-atten_val', '--atten_val', help='Requested attenution in 1/10ths of dB (ddB).', default=550) args = parser.parse_args() From 92341c6c33d53721eead8182b31a4878aaa26cd1 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 22 Nov 2021 09:59:34 -0800 Subject: [PATCH 434/731] regression_test: Incorrect argument for create_chamberview.py Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 9e8b7063..ee9f0f75 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -194,7 +194,7 @@ else "./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" create_bridge_and_station "./create_chamberview.py -m $MGR -cs 'regression_test' \ - --line 'Resource=1.1 Profile=STA-AC Amount=1 Uses-1 $RADIO_USED Freq=-1 DUT=TEST DUT_RADIO=$RADIO_USED Traffic=http' \ + --line 'Resource=1.1 Profile=STA-AC Amount=1 Uses-1=$RADIO_USED Freq=-1 DUT=TEST DUT_RADIO=$RADIO_USED Traffic=http' \ --line 'Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=Test DUT_RADIO=$RADIO_USED Traffic=http'" "./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ --ssid 'ssid_idx=0 ssid='$SSID_USED' security='$SECURITY' password='$PASSWD_USED' bssid=04:f0:21:2c:41:84'" From 6b45fc4b8e17a54418c98ee7c96acae3bbf9811e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 22 Nov 2021 10:40:46 -0800 Subject: [PATCH 435/731] create_chamberview: Fix obtuse logic which breaks without clear warnings Signed-off-by: Matthew Stidham --- py-scripts/create_chamberview.py | 70 ++++++++++++++++---------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/py-scripts/create_chamberview.py b/py-scripts/create_chamberview.py index 3cc440ff..526ea066 100755 --- a/py-scripts/create_chamberview.py +++ b/py-scripts/create_chamberview.py @@ -90,47 +90,45 @@ class CreateChamberview(cv): Freq = "-1" VLAN = "" - for i in range(len(line)): - if " " in line[i][0]: - line[i][0] = (re.split(' ', line[i][0])) - elif "," in line[i][0]: - line[i][0] = (re.split(',', line[i][0])) - elif ", " in line[i][0]: - line[i][0] = (re.split(',', line[i][0])) - elif " ," in line[i][0]: - line[i][0] = (re.split(',', line[i][0])) + for item in line: + if " " in item[0]: + item[0] = (re.split(' ', item[0])) + elif "," in item[0]: + item[0] = (re.split(',', item[0])) + elif ", " in item[0]: + item[0] = (re.split(',', item[0])) + elif " ," in item[0]: + item[0] = (re.split(',', item[0])) else: print("Wrong arguments entered !") exit(1) print("creating %s scenario" % scenario_name) - for j in range(len(line[i][0])): - line[i][0][j] = line[i][0][j].split("=") - for k in range(len(line[i][0][j])): - name = line[i][0][j][k] - if str(name) == "Resource" or str( - name) == "Res" or str(name) == "R": - Resource = line[i][0][j][k + 1] - elif str(name) == "Profile" or str(name) == "Prof" or str(name) == "P": - Profile = line[i][0][j][k + 1] - elif str(name) == "Amount" or str(name) == "Sta" or str(name) == "A": - Amount = line[i][0][j][k + 1] - elif str(name) == "Uses-1" or str(name) == "U1" or str(name) == "U-1": - Uses1 = line[i][0][j][k + 1] - elif str(name) == "Uses-2" or str(name) == "U2" or str(name) == "U-2": - Uses2 = line[i][0][j][k + 1] - elif str(name) == "Freq" or str(name) == "Freq" or str(name) == "F": - Freq = line[i][0][j][k + 1] - elif str(name) == "DUT" or str(name) == "dut" or str(name) == "D": - DUT = line[i][0][j][k + 1] - elif str(name) == "DUT_Radio" or str(name) == "dr" or str(name) == "DR": - DUT_Radio = line[i][0][j][k + 1] - elif str(name) == "Traffic" or str(name) == "Traf" or str(name) == "T": - Traffic = line[i][0][j][k + 1] - elif str(name) == "VLAN" or str(name) == "Vlan" or str(name) == "V": - VLAN = line[i][0][j][k + 1] - else: - continue + for sub_item in item[0]: + sub_item = sub_item.split("=") + if sub_item[0] == "Resource" or str( + sub_item[0]) == "Res" or sub_item[0] == "R": + Resource = sub_item[1] + elif sub_item[0] == "Profile" or sub_item[0] == "Prof" or sub_item[0] == "P": + Profile = sub_item[1] + elif sub_item[0] == "Amount" or sub_item[0] == "Sta" or sub_item[0] == "A": + Amount = sub_item[1] + elif sub_item[0] == "Uses-1" or sub_item[0] == "U1" or sub_item[0] == "U-1": + Uses1 = sub_item[1] + elif sub_item[0] == "Uses-2" or sub_item[0] == "U2" or sub_item[0] == "U-2": + Uses2 = sub_item[1] + elif sub_item[0] == "Freq" or sub_item[0] == "Freq" or sub_item[0] == "F": + Freq = sub_item[1] + elif sub_item[0] == "DUT" or sub_item[0] == "dut" or sub_item[0] == "D": + DUT = sub_item[1] + elif sub_item[0] == "DUT_Radio" or sub_item[0] == "dr" or sub_item[0] == "DR": + DUT_Radio = sub_item[1] + elif sub_item[0] == "Traffic" or sub_item[0] == "Traf" or sub_item[0] == "T": + Traffic = sub_item[1] + elif sub_item[0] == "VLAN" or sub_item[0] == "Vlan" or sub_item[0] == "V": + VLAN = sub_item[1] + else: + continue self.add_text_blob_line(scenario_name, Resource, From c33cc7e512980a02f8d0e9c8fb3cf592611b0d1a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 22 Nov 2021 12:57:29 -0800 Subject: [PATCH 436/731] test_status_msg: Cleanup broken cleanup function. Don't send an error message if no error has occured. Signed-off-by: Matthew Stidham --- py-scripts/test_status_msg.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/py-scripts/test_status_msg.py b/py-scripts/test_status_msg.py index b9093db1..1a5f1cc2 100755 --- a/py-scripts/test_status_msg.py +++ b/py-scripts/test_status_msg.py @@ -29,6 +29,7 @@ class TestStatusMessage(LFCliBase): self.msg_count = 0 self.deep_clean = _deep_clean self.check_connect() + self.debug = _debug_on def build(self): """create a new session""" @@ -158,22 +159,19 @@ class TestStatusMessage(LFCliBase): msg_num = 0 if msg_num == 0: - self._pass("deleted all messages in session") + return "deleted all messages in session" else: self._fail("failed to delete all messages in session") - # make sure we fail on removing session incorrectly - try: + if 'empty' in self.json_get(self.session_url).keys(): if self.debug: print("--- del -------------------- -------------------- --------------------") self.exit_on_error = False - self.json_delete(self.session_url, debug_=False) + self.json_delete("%s/this" % self.session_url, debug_=False) if self.debug: print("--- ~del -------------------- -------------------- --------------------") - except ValueError as ve: - print("- - - - - - - - - - - - - - - - - - - - - - -") - print(ve) - print("- - - - - - - - - - - - - - - - - - - - - - -") + else: + return 'ports deleted successfully' sessions_list_response = self.json_get("/status-msg") if self.debug: @@ -189,6 +187,8 @@ class TestStatusMessage(LFCliBase): break if counter == 0: self._fail("session incorrectly deleted") + else: + return "Sessions properly deleted" try: if self.debug: @@ -247,6 +247,9 @@ Test the status message passing functions of /status-msg: - delete message: DELETE /status-msg//message-id - delete session: DELETE /status-msg//this - delete all messages in session: DELETE /status-msg//all + +Example: +./test_status_msg.py """) parser.add_argument('--action', default="run_test", help=""" Actions can be: @@ -265,7 +268,7 @@ Actions can be: status_messages = TestStatusMessage(args.mgr, args.mgr_port, - _debug_on=False, + _debug_on=args.debug, _exit_on_error=False, _exit_on_fail=False) if args.action == "new": From 211bede2192f87d6b07de500d805046364f18978 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 22 Nov 2021 15:53:57 -0800 Subject: [PATCH 437/731] logger_example: basicConfig is required Signed-off-by: Matthew Stidham --- py-scripts/sandbox/logger_example.py | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 py-scripts/sandbox/logger_example.py diff --git a/py-scripts/sandbox/logger_example.py b/py-scripts/sandbox/logger_example.py old mode 100644 new mode 100755 index bc0d296e..75079561 --- a/py-scripts/sandbox/logger_example.py +++ b/py-scripts/sandbox/logger_example.py @@ -2,6 +2,7 @@ import logging from random import choice +logging.basicConfig() class ContextFilter(logging.Filter): From 2c57e3e7b796a5fb83c6fa7ef53dacecea936235 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 22 Nov 2021 16:26:38 -0800 Subject: [PATCH 438/731] logger_example_1.py: Initial commit Signed-off-by: Matthew Stidham --- py-scripts/sandbox/logger_example_1.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 py-scripts/sandbox/logger_example_1.py diff --git a/py-scripts/sandbox/logger_example_1.py b/py-scripts/sandbox/logger_example_1.py new file mode 100755 index 00000000..8f2f6484 --- /dev/null +++ b/py-scripts/sandbox/logger_example_1.py @@ -0,0 +1,25 @@ +#!/usr/bin/python3 + +import logging +import argparse + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--debug', + type=int, + default=2, + help="Set logging level, range 0 through 4. 0 is DEBUG, 4 is CRITICAL") + + args = parser.parse_args() + levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL] + logging.basicConfig(level=levels[args.debug]) + + logging.debug('This is debug output, level 0') + logging.info('This is info output, level 1') + logging.warning('This is warning output, level 2') + logging.error('This is error output, level 3') + logging.critical('This is error output, level 4') + +if __name__ == "__main__": + main() \ No newline at end of file From 45ff9caade9f1fd7df76e749f8ba46043fe0b585 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 22 Nov 2021 16:27:15 -0800 Subject: [PATCH 439/731] logger_example_1: Proper spacing Signed-off-by: Matthew Stidham --- py-scripts/sandbox/logger_example_1.py | 1 + 1 file changed, 1 insertion(+) diff --git a/py-scripts/sandbox/logger_example_1.py b/py-scripts/sandbox/logger_example_1.py index 8f2f6484..318d1c5c 100755 --- a/py-scripts/sandbox/logger_example_1.py +++ b/py-scripts/sandbox/logger_example_1.py @@ -21,5 +21,6 @@ def main(): logging.error('This is error output, level 3') logging.critical('This is error output, level 4') + if __name__ == "__main__": main() \ No newline at end of file From abffc4708591126234f857dd7fd357056c133160 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 22 Nov 2021 17:38:34 -0800 Subject: [PATCH 440/731] to_pip.sh: Remove old files from py_scripts/__init__.py Signed-off-by: Matthew Stidham --- to_pip.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/to_pip.sh b/to_pip.sh index 46a96536..2b29a6c7 100755 --- a/to_pip.sh +++ b/to_pip.sh @@ -105,8 +105,6 @@ from .csv_to_grafana import UseGrafana from .example_security_connection import IPv4Test from .grafana_profile import UseGrafana from .influx import RecordInflux -from .layer3_test import Layer3Test -from .layer4_test import HTTPTest from .lf_ap_auto_test import ApAutoTest from .lf_atten_mod_test import CreateAttenuator from .lf_csv import lf_csv From e137a35ee71f60df807f5258bd5a300c50e78e9f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 23 Nov 2021 09:42:41 -0800 Subject: [PATCH 441/731] test_ipv4_ttls: Remove redundant imports Signed-off-by: Matthew Stidham --- py-scripts/test_ipv4_ttls.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/py-scripts/test_ipv4_ttls.py b/py-scripts/test_ipv4_ttls.py index e1ee49fc..947f1d49 100755 --- a/py-scripts/test_ipv4_ttls.py +++ b/py-scripts/test_ipv4_ttls.py @@ -13,8 +13,6 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) -lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") -LFCliBase = lfcli_base.LFCliBase LFUtils = importlib.import_module("py-json.LANforge.LFUtils") realm = importlib.import_module("py-json.realm") Realm = realm.Realm @@ -22,7 +20,7 @@ test_ip_variable_time = importlib.import_module("py-scripts.test_ip_variable_tim IPVariableTime = test_ip_variable_time.IPVariableTime -class TTLSTest(LFCliBase): +class TTLSTest(Realm): def __init__(self, host="localhost", port=8080, ssid="[BLANK]", security="wpa2", @@ -65,7 +63,7 @@ class TTLSTest(LFCliBase): _debug_on=False, _exit_on_error=False, _exit_on_fail=False): - super().__init__(host, port, _debug=_debug_on, _exit_on_fail=_exit_on_fail) + super().__init__(lfclient_host=host, lfclient_port=port, _debug=_debug_on, _exit_on_fail=_exit_on_fail) self.host = host self.port = port self.ssid = ssid @@ -111,13 +109,12 @@ class TTLSTest(LFCliBase): self.timeout = 120 self.number_template = number_template self.debug = _debug_on - self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port) - self.station_profile = self.local_realm.new_station_profile() + self.station_profile = self.new_station_profile() self.vap = vap self.upstream_port = "eth1" self.upstream_resource = 1 if self.vap: - self.vap_profile = self.local_realm.new_vap_profile() + self.vap_profile = self.new_vap_profile() self.vap_profile.vap_name = "TestNet" self.station_profile.lfclient_url = self.lfclient_url @@ -319,7 +316,7 @@ class TTLSTest(LFCliBase): def main(): - parser = LFCliBase.create_basic_argparse( + parser = Realm.create_basic_argparse( prog='test_ipv4_ttls.py', # formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawTextHelpFormatter, @@ -359,7 +356,7 @@ test_ipv4_ttls.py: parser.add_argument('--vap', help='Create VAP on host device', default=True) args = parser.parse_args() num_sta = 2 - if (args.num_stations is not None) and (int(args.num_stations) > 0): + if args.num_stations: num_stations_converted = int(args.num_stations) num_sta = num_stations_converted From 8dcde027f88c3941f0b1afe766b273fbcdb4ccf0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 23 Nov 2021 10:01:00 -0800 Subject: [PATCH 442/731] lfcli_base: set type of num_stations to always be an integer. Dot not ever, ever, ever set a flag as default=False. Use action='store_true', and do not ever ever ever use both at the same time. Signed-off-by: Matthew Stidham --- py-json/LANforge/lfcli_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 581bf9e8..3fe4004a 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -657,6 +657,7 @@ class LFCliBase: default='1.eth1', help='non-station port that generates traffic: ., e.g: 1.eth1') optional.add_argument('--num_stations', + type=int, default=0, help='Number of stations to create') optional.add_argument('--test_id', @@ -664,7 +665,6 @@ class LFCliBase: help='Test ID (intended to use for ws events)') optional.add_argument('-d', '--debug', - default=False, action="store_true", help='Enable debugging') optional.add_argument('--proxy', From 6a5e688b58042ecd92438440e5750db0f5a04429 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 23 Nov 2021 10:03:55 -0800 Subject: [PATCH 443/731] test_ipv4_ttls: Realm has debug_, unlike lfcli_base which is _debug Signed-off-by: Matthew Stidham --- py-scripts/test_ipv4_ttls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/test_ipv4_ttls.py b/py-scripts/test_ipv4_ttls.py index 947f1d49..264de171 100755 --- a/py-scripts/test_ipv4_ttls.py +++ b/py-scripts/test_ipv4_ttls.py @@ -63,7 +63,7 @@ class TTLSTest(Realm): _debug_on=False, _exit_on_error=False, _exit_on_fail=False): - super().__init__(lfclient_host=host, lfclient_port=port, _debug=_debug_on, _exit_on_fail=_exit_on_fail) + super().__init__(lfclient_host=host, lfclient_port=port, debug_=_debug_on, _exit_on_fail=_exit_on_fail) self.host = host self.port = port self.ssid = ssid From 648491247ad078a1f56d211ce3611cb0ba5a10cc Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 23 Nov 2021 12:01:42 -0700 Subject: [PATCH 444/731] lf_check.py : updated to add the lanforge fedora version to the report Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 7adde930..47a4099d 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -167,6 +167,7 @@ class lf_check(): # LANforge information self.lanforge_system_node_version = "" + self.lanforge_fedora_version = "" self.lanforge_kernel_version = "" self.lanforge_server_version_full = "" self.lanforge_server_version = "" @@ -296,6 +297,21 @@ class lf_check(): time.sleep(1) return self.lanforge_system_node_version + def get_lanforge_fedora_version(self): + # creating shh client object we use this object to connect to router + ssh = paramiko.SSHClient() + # automatically adds the missing host key + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + ssh.connect(hostname=self.lf_mgr_ip, port=22, username=self.lf_mgr_user, password=self.lf_mgr_pass, + allow_agent=False, look_for_keys=False, banner_timeout=600) + stdin, stdout, stderr = ssh.exec_command('cat /etc/fedora-release') + self.lanforge_fedora_version = stdout.readlines() + self.lanforge_fedora_version = [line.replace( + '\n', '') for line in self.lanforge_fedora_version] + ssh.close() + time.sleep(1) + return self.lanforge_fedora_version + def get_lanforge_kernel_version(self): # creating shh client object we use this object to connect to router ssh = paramiko.SSHClient() @@ -979,6 +995,9 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) meta_data_fd.write( "lanforge_kernel_version {lanforge_kernel_version}\n".format( lanforge_kernel_version=self.lanforge_kernel_version[0])) + meta_data_fd.write( + "lanforge_fedora_version {lanforge_fedora_version}\n".format( + lanforge_fedora_version=self.lanforge_fedora_version[0])) meta_data_fd.write( "lanforge_gui_version_full {lanforge_gui_version_full}\n".format( lanforge_gui_version_full=self.lanforge_gui_version_full)) @@ -1210,6 +1229,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # Test-rig information information lanforge_system_node_version = 'NO_LF_NODE_VER' scripts_git_sha = 'NO_GIT_SHA' + lanforge_fedora_version = 'NO_FEDORA_VER' lanforge_kernel_version = 'NO_KERNEL_VER' lanforge_server_version_full = 'NO_LF_SERVER_VER' @@ -1291,6 +1311,14 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a except BaseException: print("lanforge_system_node_version exception") + try: + lanforge_fedora_version = check.get_lanforge_fedora_version() + print("lanforge_fedora_version {fedora_ver}".format( + fedora_ver=lanforge_fedora_version)) + except BaseException: + print("lanforge_fedora_version exception, tests aborted check lanforge ip") + exit(1) + try: lanforge_kernel_version = check.get_lanforge_kernel_version() print("lanforge_kernel_version {kernel_ver}".format( @@ -1365,6 +1393,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # LANforge and scripts config for results lf_test_setup = pd.DataFrame() lf_test_setup['LANforge'] = lanforge_system_node_version + lf_test_setup['fedora version'] = lanforge_fedora_version lf_test_setup['kernel version'] = lanforge_kernel_version lf_test_setup['server version'] = lanforge_server_version_full lf_test_setup['gui version'] = lanforge_gui_version From 19752da2ebcb66b3c814ffe593b74405a033936a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 23 Nov 2021 14:02:42 -0700 Subject: [PATCH 445/731] lf_check.py : removed \n from the scripts git sha Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 47a4099d..9d052caa 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -250,6 +250,7 @@ class lf_check(): "get_scripts_get_sha exit_code: {exit_code}".format( exit_code=exit_code)) scripts_git_sha = commit_hash.decode('utf-8', 'ignore') + scripts_git_sha = scripts_git_sha.replace('\n','') return scripts_git_sha ''' From c9bae8fd2316356514cac65be16dce4c56142bcb Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 23 Nov 2021 13:32:24 -0800 Subject: [PATCH 446/731] regression_test: Remove create_vr for now Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index ee9f0f75..208e475c 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -205,7 +205,7 @@ else "./create_qvlan.py --first_qvlan_ip 192.168.1.50 --mgr $MGR --qvlan_parent eth1" "./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./create_vap.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - "./create_vr.py --mgr $MGR --vr_name 2.vr0 --ports 2.br0,2.vap2 --services 1.br0=dhcp,nat --services 1.vr0=radvd --debug" + #"./create_vr.py --mgr $MGR --vr_name 2.vr0 --ports 2.br0,2.vap2 --services 1.br0=dhcp,nat --services 1.vr0=radvd --debug" #./csv_convert #./csv_processor #./csv_to_grafana From 245e05b7960ac55d35d4b3e7595be3707b309c3b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 23 Nov 2021 13:47:03 -0800 Subject: [PATCH 447/731] regression_test: lf_snp_test requires radio to be defined Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 208e475c..34ff6c93 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -291,7 +291,7 @@ else --duration 20 \ --channel 52 \ --radio_mode AUTO" - "./lf_snp_test.py --mgr $MGR" + "./lf_snp_test.py --mgr $MGR --radio $RADIO_USED" "./lf_tr398_test.py --mgr $MGR --upstream $UPSTREAM" #./lf_webpage "./lf_wifi_capacity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ From 52b6905ffb6779ed05496ac9732ef49adcbba415 Mon Sep 17 00:00:00 2001 From: Scott Wedge Date: Tue, 23 Nov 2021 12:10:54 -0800 Subject: [PATCH 448/731] lf_ftp.py: modified generic command in --help Signed-off-by: Scott Wedge --- py-scripts/lf_ftp.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/py-scripts/lf_ftp.py b/py-scripts/lf_ftp.py index f964ac9b..549e2b5c 100755 --- a/py-scripts/lf_ftp.py +++ b/py-scripts/lf_ftp.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ lf_ftp.py will verify that N clients connected on specified band and can simultaneously download/upload some amount of file from FTP server and measuring the time taken by client to download/upload the file. - cli- python3 lf_ftp.py --mgr localhost --mgr_port 8080 --upstream_port eth1 --ssid FTP --security open --passwd BLANK --ap_name WAC505 --ap_ip 192.168.213.90 --bands Both --directions Download --twog_radio wiphy1 --fiveg_radio wiphy0 --file_size 2MB --num_stations 40 --both_duration 1 --traffic_duration 2 --ssh_port 22_ + cli- ./lf_ftp.py --ssid --passwd --file_sizes 2MB --fiveg_duration 4 --mgr 192.168.1.101 --traffic_duration 2 --security wpa2 --bands 5G --fiveg_radio wiphy1 --directions Download Upload Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. """ @@ -705,7 +705,14 @@ def main(): parser = argparse.ArgumentParser( prog='lf_ftp.py', formatter_class=argparse.RawTextHelpFormatter, - description="FTP Test Script") + description='''\ +--------------------------- +FTP Test Script - lf_ftp.py +--------------------------- +CLI Example: +./lf_ftp.py --ssid --passwd --file_sizes 2MB --fiveg_duration 4 --mgr 192.168.1.101 --traffic_duration 2 --security wpa2 --bands 5G --fiveg_radio wiphy1 --directions Download Upload +--------------------------- + ''') parser.add_argument('--mgr', help='hostname for where LANforge GUI is running', default='localhost') parser.add_argument('--mgr_port', help='port LANforge GUI HTTP service is running on', default=8080) parser.add_argument('--upstream_port', help='non-station port that generates traffic: eg: eth1', default='eth1') From 48228f6da2f47d817130d38ec4ec01de45b30ccd Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 23 Nov 2021 16:51:22 -0800 Subject: [PATCH 449/731] sta_scan_test: Fix regression, create csv_output option Signed-off-by: Matthew Stidham --- py-scripts/sta_scan_test.py | 69 +++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/py-scripts/sta_scan_test.py b/py-scripts/sta_scan_test.py index f75aba01..13f3b468 100755 --- a/py-scripts/sta_scan_test.py +++ b/py-scripts/sta_scan_test.py @@ -15,6 +15,7 @@ License: Free to distribute and modify. LANforge systems must be licensed. import sys import os import importlib +import pandas as pd if sys.version_info[0] != 3: print("This script requires Python 3") @@ -25,8 +26,6 @@ import time sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) -lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") -LFCliBase = lfcli_base.LFCliBase realm = importlib.import_module("py-json.realm") Realm = realm.Realm LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -37,17 +36,20 @@ class StaScan(Realm): ssid=None, security=None, password=None, - sta_list=[], + sta_list=None, upstream=None, radio=None, host="localhost", port=8080, mode=0, number_template="00000", + csv_output=False, use_ht160=False, _debug_on=False, _exit_on_error=False, _exit_on_fail=False): + if sta_list is None: + sta_list = [] super().__init__(lfclient_host=host, lfclient_port=port), self.upstream = upstream @@ -60,6 +62,7 @@ class StaScan(Realm): self.radio = radio self.mode = mode self.number_template = number_template + self.csv_output = csv_output self.debug = _debug_on self.station_profile = self.new_station_profile() self.station_profile.lfclient_url = self.lfclient_url @@ -77,22 +80,50 @@ class StaScan(Realm): def start(self): self.station_profile.admin_up() print(self.sta_list) - print("Sleeping 15s while waiting for scan") - data = { - "shelf": 1, - "resource": 1, - "port": self.sta_list - } - self.json_post("/cli-json/scan_wifi", data) - time.sleep(15) - scan_results = self.json_get("scanresults/1/1/%s" % ','.join(self.sta_list)) - - print("{0:<23}".format("BSS"), "{0:<7}".format("Signal"), "{0:<5}".format("SSID")) - for result in scan_results['scan-results']: - for name, info in result.items(): - print("%s\t%s\t%s" % (info['bss'], info['signal'], info['ssid'])) - + LFUtils.wait_until_ports_admin_up(base_url=self.lfclient_url, port_list=self.station_profile.station_names, + debug_=self.debug) + stations = [LFUtils.name_to_eid(x) for x in self.sta_list] + stations = pd.DataFrame(stations) + resources = stations[1].unique() + interfaces = list() + for resource in resources: + shelf = stations[0][0] + resource_station = list(stations[stations[1] == resource][2]) + url = '/port/%s/%s/%s' % (shelf, resource, ','.join(resource_station)) + response = self.json_get(url) + if 'interface' in response.keys(): + interface = response['interface'] + interfaces.append(interface) + elif 'interfaces' in response.keys(): + response_interfaces = response['interfaces'] + for interface in response_interfaces: + for item in interface.values(): + interfaces.append(item) + df = pd.DataFrame(interfaces) + stations = df[df['port type'] == 'WIFI-STA'] + stations = list(stations.drop_duplicates('parent dev')['alias']) + stations = [station for station in stations if station in self.sta_list] + for port in stations: + port = LFUtils.name_to_eid(port) + data = { + "shelf": port[0], + "resource": port[1], + "port": port[2] + } + self.json_post("/cli-json/scan_wifi", data) + time.sleep(15) + scan_results = self.json_get("scanresults/%s/%s/%s" % (port[0], port[1], port[2])) + if self.csv_output: + results = scan_results['scan-results'] + df = pd.DataFrame([list(result.values())[0] for result in results]) + df.to_csv(self.csv_output) + print('CSV output saved at %s' % self.csv_output) + else: + print("{0:<23}".format("BSS"), "{0:<7}".format("Signal"), "{0:<5}".format("SSID")) + for result in scan_results['scan-results']: + for name, info in result.items(): + print("%s\t%s\t%s" % (info['bss'], info['signal'], info['ssid'])) def pre_cleanup(self): for sta in self.sta_list: @@ -133,6 +164,7 @@ def main(): parser.add_argument('--mode', help='Used to force mode of stations') parser.add_argument('--sta_name', help='Optional: User defined station names, can be a comma or space separated list', nargs='+', default=["sta0000"]) + parser.add_argument('--csv_output', help='create CSV from scan results, otherwise print it in the terminal', default=None) args = parser.parse_args() @@ -147,6 +179,7 @@ def main(): radio=args.radio, security=args.security, use_ht160=False, + csv_output=args.csv_output, mode=args.mode, _debug_on=args.debug) From daa5a29ba3b44ad9c30eae1a7b7e578ca9fa3a1a Mon Sep 17 00:00:00 2001 From: Scott Wedge Date: Tue, 23 Nov 2021 18:20:56 -0800 Subject: [PATCH 450/731] lf_ftp.py: add kpi_csv object Signed-off-by: Scott Wedge --- py-scripts/lf_ftp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py-scripts/lf_ftp.py b/py-scripts/lf_ftp.py index 549e2b5c..4de260eb 100755 --- a/py-scripts/lf_ftp.py +++ b/py-scripts/lf_ftp.py @@ -28,13 +28,14 @@ realm = importlib.import_module("py-json.realm") Realm = realm.Realm lf_report = importlib.import_module("py-scripts.lf_report") lf_graph = importlib.import_module("py-scripts.lf_graph") +lf_kpi_csv = importlib.import_module("py-scripts.lf_kpi_csv") class FtpTest(LFCliBase): def __init__(self, lfclient_host="localhost", lfclient_port=8080, sta_prefix="sta", start_id=0, num_sta=None, dut_ssid=None, dut_security=None, dut_passwd=None, file_size=None, band=None, twog_radio=None, fiveg_radio=None, upstream="eth1", _debug_on=False, _exit_on_error=False, _exit_on_fail=False, - direction=None, duration=None, traffic_duration=None, ssh_port=None): + direction=None, duration=None, traffic_duration=None, ssh_port=None, kpi_csv=None): super().__init__(lfclient_host, lfclient_port, _debug=_debug_on, _exit_on_fail=_exit_on_fail) print("Test is about to start") self.host = lfclient_host @@ -49,6 +50,7 @@ class FtpTest(LFCliBase): self.password = dut_passwd self.requests_per_ten = 1 self.band = band + self.kpi_csv = kpi_csv self.file_size = file_size self.direction = direction self.twog_radio = twog_radio From 999358c98f571f676239e60b8de1ac5cd86c3ecf Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 00:07:55 -0800 Subject: [PATCH 451/731] pipupgrade: Initial commit, meant to replace update_dependencies Signed-off-by: Matthew Stidham --- pipupgrade.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 pipupgrade.sh diff --git a/pipupgrade.sh b/pipupgrade.sh new file mode 100755 index 00000000..24a729eb --- /dev/null +++ b/pipupgrade.sh @@ -0,0 +1,2 @@ +#!/bin/bash +pip3 install --user -r requirements.txt --upgrade From 0a29ea091e523c26117e218155c59b516b8741c3 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 10:29:50 -0800 Subject: [PATCH 452/731] regression_test: Check for any pip generated errors Signed-off-by: Matthew Stidham --- py-scripts/cv_examples/ap_auto_example.bash | 0 py-scripts/regression_test.sh | 21 +++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 py-scripts/cv_examples/ap_auto_example.bash diff --git a/py-scripts/cv_examples/ap_auto_example.bash b/py-scripts/cv_examples/ap_auto_example.bash new file mode 100644 index 00000000..e69de29b diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 34ff6c93..5c0acf89 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -259,9 +259,9 @@ else --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ --influx_bucket ben \ --influx_tag testbed Ferndale-01" - #"./lf_dut_sta_vap_test.py --mgr $MGR --radio $RADIO_USED \ - #--num_sta 1 --sta_id 1 --ssid $SSID_USED --security $SECURITY --upstream $UPSTREAM \ - #--protocol lf_udp --min_mbps 1000 --max_mbps 10000 --duration 1" + "./lf_dut_sta_vap_test.py --mgr $MGR --radio $RADIO_USED \ + --num_sta 1 --sta_id 1 --ssid $SSID_USED --security $SECURITY --upstream $UPSTREAM \ + --protocol lf_udp --min_mbps 1000 --max_mbps 10000 --duration 1" "./lf_graph.py --mgr $MGR" "./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line 'selected_dut2 RootAP wactest $BSSID'" #"./lf_multipsk.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --debug" @@ -301,7 +301,7 @@ else #--influx_host c7-graphana --influx_port 8086 --influx_org Candela \ #--influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ #--influx_bucket ben \ - #"./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --debug --report_file measure_station_time_up.txt" + "./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --debug --report_file measure_station_time_up.txt" "./create_station.py --mgr $MGR --radio $RADIO_USED --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED && ./modify_station.py \ --mgr $MGR \ --radio $RADIO_USED \ @@ -315,7 +315,7 @@ else #recordinflux.py "./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test Dataplane --test_profile http --cv_scenario ct-us-001" #scenario.py - #"./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C" + "./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C" #./sta_connect_bssid_mac.py "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" "./sta_connect.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" @@ -334,12 +334,12 @@ else # --debug" #test_client_admission.py "./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 --test_duration 30s --mgr $MGR" # Better tested on Kelly, where VRF is turned off - #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug --mgr $MGR" + "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug --mgr $MGR" #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security $SECURITY --debug --mgr $MGR" #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type iperf3 --debug --mgr $MGR" #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfcurl --dest $TEST_HTTP_IP --file_output ${HOMEPATH}/Documents/lfcurl_output.txt --debug --mgr $MGR" "./testgroup.py --group_name group1 --add_group --list_groups --debug --mgr $MGR" - #"./testgroup2.py --num_stations 4 --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --group_name group0 --add_group --mgr $MGR" + "./testgroup2.py --num_stations 4 --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --group_name group0 --add_group --mgr $MGR" "./test_ip_connection.py --radio $RADIO_USED --num_stations $NUM_STA --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format excel --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" @@ -349,20 +349,21 @@ else "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_udp lf_tcp' --upstream_port 1.1.$UPSTREAM --radio 'radio==1.1.wiphy0 stations==10 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --radio 'radio==1.1.wiphy1 stations==1 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --test_duration 5s --influx_host c7-graphana --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --influx_tag testbed regression_test --influx_tag DUT ROG -o longevity.csv" "./test_l3_powersave_traffic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - #"./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput -m $MGR" + "./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput -m $MGR" #./test_l3_unicast_traffic_gen #./test_l3_unicast_traffic_gen #./test_l3_WAN_LAN "./test_l4.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_status_msg.py --debug --mgr $MGR" #this is all which is needed to run - #"./test_wanlink.py --name my_wanlink4 --latency_A 20 --latency_B 69 --rate 1000 --jitter_A 53 --jitter_B 73 --jitter_freq 6 --drop_A 12 --drop_B 11 --debug --mgr $MGR" + "./test_wanlink.py --name my_wanlink4 --latency_A 20 --latency_B 69 --rate 1000 --jitter_A 53 --jitter_B 73 --jitter_freq 6 --drop_A 12 --drop_B 11 --debug --mgr $MGR" #./test_wpa_passphrases #./tip_station_powersave #./video_rates "./wlan_capacity_calculator.py -sta 11abg -t Voice -p 48 -m 106 -e WEP -q Yes -b 1 2 5.5 11 -pre Long -s N/A -co G.711 -r Yes -c Yes" "./wlan_capacity_calculator.py -sta 11n -t Voice -d 17 -ch 40 -gu 800 -high 9 -e WEP -q Yes -ip 5 -mc 42 -b 6 9 12 24 -m 1538 -co G.729 -pl Greenfield -cw 15 -r Yes -c Yes" "./wlan_capacity_calculator.py -sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes" - #"./ws_generic_monitor_test.py --mgr $MGR" + "./ws_generic_monitor_test.py --mgr $MGR" + "python3 -c 'import lanforge_scripts'" ) fi #declare -A name_to_num From b5a89c956986a3187aba4b7fdc72edd50e3271b4 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 10:32:05 -0800 Subject: [PATCH 453/731] regression_test: Update packages at the beginning of a regression_test Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 5c0acf89..eaf4e3d0 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -20,6 +20,8 @@ Help() echo "If using the help flag, put the H flag at the end of the command after other flags." } +pip3 install --user -r ../requirements.txt --upgrade + while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:L:H:" option; do case "${option}" in h) # display Help From 0749253c4c27cafdfb7f30301b787b361282c80f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 10:39:52 -0800 Subject: [PATCH 454/731] test_ipv4_ttls: Clean up unused parameters and move all self methods to init Signed-off-by: Matthew Stidham --- py-scripts/test_ipv4_ttls.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/py-scripts/test_ipv4_ttls.py b/py-scripts/test_ipv4_ttls.py index 264de171..d3115166 100755 --- a/py-scripts/test_ipv4_ttls.py +++ b/py-scripts/test_ipv4_ttls.py @@ -64,6 +64,7 @@ class TTLSTest(Realm): _exit_on_error=False, _exit_on_fail=False): super().__init__(lfclient_host=host, lfclient_port=port, debug_=_debug_on, _exit_on_fail=_exit_on_fail) + self.resulting_endpoints = {} self.host = host self.port = port self.ssid = ssid @@ -154,7 +155,6 @@ class TTLSTest(Realm): def build(self, extra_securities=None): # Build stations - keyphrase = "[BLANK]" self.station_profile.use_security(self.security, self.ssid, passwd=self.password) if extra_securities is not None: @@ -277,7 +277,6 @@ class TTLSTest(Realm): debug=self.debug) def collect_endp_stats(self, endp_map, traffic_type="TCP"): - self.resulting_endpoints = {} print("Collecting Data") fields = "?fields=name,tx+bytes,rx+bytes" for (cx_name, endps) in endp_map.items(): @@ -302,7 +301,6 @@ class TTLSTest(Realm): self.compare_vals("test" + traffic_type + "-B TX", ptest_b_tx) self.compare_vals("test" + traffic_type + "-B RX", ptest_b_rx) - except Exception as e: print("Is this the function having the error?") self.error(e) From 978765739c63000afd2fa604732c5092c07cb6f7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:17:15 -0800 Subject: [PATCH 455/731] check_argparse: fix bare except error Signed-off-by: Matthew Stidham --- py-scripts/check_argparse.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/py-scripts/check_argparse.py b/py-scripts/check_argparse.py index 56331928..cdd65ce7 100644 --- a/py-scripts/check_argparse.py +++ b/py-scripts/check_argparse.py @@ -5,13 +5,6 @@ import pandas as pd import argparse -def get_tag(x, tag): - try: - return x[tag] - except: - return False - - def main(): parser = argparse.ArgumentParser( prog="check_argparse.py", @@ -48,7 +41,9 @@ def main(): 'description', 'epilog', 'usage']: - df[tag] = [get_tag(x, tag) for x in df['results']] + for result in df['results']: + if tag in result: + df[tag] = df['results'][tag] df['details'] = df['description'] + df['epilog'] + df['usage'] df.to_csv(args.output + '.csv', index=False) From 1d43c55bd9e79a92fd02bd48c7ecd5a6a7f65fd8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:17:31 -0800 Subject: [PATCH 456/731] create_chamberview_dut: Fix bare except error Signed-off-by: Matthew Stidham --- py-scripts/create_chamberview_dut.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/py-scripts/create_chamberview_dut.py b/py-scripts/create_chamberview_dut.py index 3172e204..9951ec45 100755 --- a/py-scripts/create_chamberview_dut.py +++ b/py-scripts/create_chamberview_dut.py @@ -121,10 +121,8 @@ class DUT(dut): self.ssid[j]['security'] = self.ssid[j]['security'].split( '|') for security in self.ssid[j]['security']: - try: + if security.lower() in flags: flag |= flags[security.lower()] - except BaseException: - pass self.ssid[j]['flag'] = flag if 'bssid' not in self.ssid[j].keys(): From 15424cc7a39209166e56f16e245ea09f3824bda0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:25:16 -0800 Subject: [PATCH 457/731] create_chamberview: Fix problems, I've grown as a programmer Signed-off-by: Matthew Stidham --- py-scripts/create_chamberview.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/py-scripts/create_chamberview.py b/py-scripts/create_chamberview.py index 526ea066..1dfff7b6 100755 --- a/py-scripts/create_chamberview.py +++ b/py-scripts/create_chamberview.py @@ -95,10 +95,6 @@ class CreateChamberview(cv): item[0] = (re.split(' ', item[0])) elif "," in item[0]: item[0] = (re.split(',', item[0])) - elif ", " in item[0]: - item[0] = (re.split(',', item[0])) - elif " ," in item[0]: - item[0] = (re.split(',', item[0])) else: print("Wrong arguments entered !") exit(1) From 2576a7977f461dbacee69ef63771501e527ac60e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:26:15 -0800 Subject: [PATCH 458/731] create_qvlan: Fix possible reference before creation error Signed-off-by: Matthew Stidham --- py-scripts/create_qvlan.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/py-scripts/create_qvlan.py b/py-scripts/create_qvlan.py index 673f625e..3df7d731 100755 --- a/py-scripts/create_qvlan.py +++ b/py-scripts/create_qvlan.py @@ -86,6 +86,7 @@ def main(): default=None) parser.add_argument( '--num_ports', + type=int, help='number of ports to create', default=1) parser.add_argument( @@ -135,29 +136,26 @@ def main(): update_group_args['cxs'] = args.cxs port_list = [] ip_list = [] - if args.first_port is not None and args.use_ports is not None: + if args.first_port and args.use_ports: if args.first_port.startswith("sta"): - if (args.num_ports is not None) and (int(args.num_ports) > 0): + if args.num_ports and args.num_ports > 0: start_num = int(args.first_port[3:]) - num_ports = int(args.num_ports) port_list = LFUtils.port_name_series( prefix="sta", start_id=start_num, - end_id=start_num + num_ports - 1, + end_id=start_num + args.num_ports - 1, padding_number=10000, radio=args.radio) print(1) else: - if (args.num_ports is not None) and args.qvlan_parent is not None and ( - int(args.num_ports) > 0) and args.qvlan_parent in args.first_port: + if args.num_ports and args.qvlan_parent and (args.num_ports > 0) and args.qvlan_parent in args.first_port: start_num = int( args.first_port[args.first_port.index('#') + 1:]) - num_ports = int(args.num_ports) port_list = LFUtils.port_name_series( prefix=str( args.qvlan_parent) + "#", start_id=start_num, - end_id=start_num + num_ports - 1, + end_id=start_num + args.num_ports - 1, padding_number=10000, radio=args.radio) print(2) @@ -167,7 +165,7 @@ def main(): "first_port must contain parent port and num_ports must be greater than 0" % (args.num_ports, args.qvlan_parent, args.first_port)) else: - if args.use_ports is None: + if not args.use_ports: num_ports = int(args.num_ports) port_list = LFUtils.port_name_series( prefix=str( @@ -204,7 +202,7 @@ def main(): ip_list=ip_list, debug=args.debug) create_qvlan.build() - print('Created %s QVLAN stations' % num_ports) + print('Created %s QVLAN stations' % args.num_ports) if __name__ == "__main__": From 4b34b679a407a0ed5d9400cca30b74d420f71554 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:26:34 -0800 Subject: [PATCH 459/731] create_station_from_df: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/create_station_from_df.py | 45 +++++++++++++--------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/py-scripts/create_station_from_df.py b/py-scripts/create_station_from_df.py index 29189dbd..04741ecf 100755 --- a/py-scripts/create_station_from_df.py +++ b/py-scripts/create_station_from_df.py @@ -13,7 +13,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -62,7 +61,6 @@ class CreateStation(Realm): pprint.pprint(self.sta_list) print("---- ~Station List ----- ----- ----- ----- ----- ----- \n") - def build(self): # Build stations self.station_profile.use_security(self.security, self.ssid, self.password) @@ -80,8 +78,6 @@ class CreateStation(Realm): def main(): - required=[] - required.append({'name':'--df','help':'Which file you want to build stations off of?'}) parser = LFCliBase.create_basic_argparse( prog='create_station_from_df.py', formatter_class=argparse.RawTextHelpFormatter, @@ -99,29 +95,29 @@ def main(): --ssid netgear --passwd BLANK --debug - ''', - more_required=required) - + ''') + required = parser.add_argument_group('required arguments') + required.add_argument('df', help='Which file do you want to build stations off of?', required=True) args = parser.parse_args() - df=pd.read_csv(args.df) - unique=df[['radio','ssid','passwd','security']].drop_duplicates().reset_index(drop=True) + df = pd.read_csv(args.df) + unique = df[['radio', 'ssid', 'passwd', 'security']].drop_duplicates().reset_index(drop=True) for item in unique.index: - uniquedf=unique.iloc[item] - df1=df.merge(pd.DataFrame(uniquedf).transpose(),on=['radio','ssid','passwd','security']) - try: - radio=uniquedf['radio'] - except: - radio=args.radio - station_list=df1['station'] - try: - ssid=uniquedf['ssid'] - passwd=uniquedf['passwd'] - security=uniquedf['security'] - except: - ssid=args.ssid - passwd=args.passwd - security=args.security + uniquedf = unique.iloc[item] + df1 = df.merge(pd.DataFrame(uniquedf).transpose(), on=['radio', 'ssid', 'passwd', 'security']) + if uniquedf['radio']: + radio = uniquedf['radio'] + else: + radio = args.radio + station_list = df1['station'] + if uniquedf['ssid']: + ssid = uniquedf['ssid'] + passwd = uniquedf['passwd'] + security = uniquedf['security'] + else: + ssid = args.ssid + passwd = args.passwd + security = args.security create_station = CreateStation(_host=args.mgr, _port=args.mgr_port, _ssid=ssid, @@ -135,5 +131,6 @@ def main(): create_station.build() print('Created %s stations' % len(unique.index)) + if __name__ == "__main__": main() From 635592e9d58bb645e669a7650bf228305c45c8a5 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:26:47 -0800 Subject: [PATCH 460/731] csv_convert: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/csv_convert.py | 40 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/py-scripts/csv_convert.py b/py-scripts/csv_convert.py index a0ac5255..fc184756 100755 --- a/py-scripts/csv_convert.py +++ b/py-scripts/csv_convert.py @@ -23,14 +23,12 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) -class CSVParcer(): - def __init__(self,csv_infile=None,csv_outfile=None): +class CSVParcer: + def __init__(self, csv_infile=None, csv_outfile=None): - idx = 0 i_atten = -1 i_rotation = -1 i_rxbps = -1 @@ -46,34 +44,33 @@ class CSVParcer(): x = line.split(",") cni = 0 for cn in x: - if (cn == "Attenuation [dB]"): + if cn == "Attenuation [dB]": i_atten = cni - if (cn == "Position [Deg]"): + if cn == "Position [Deg]": i_rotation = cni - if (cn == "Throughput [Mbps]"): + if cn == "Throughput [Mbps]": i_rxbps = cni - if (cn == "Beacon RSSI [dBm]"): + if cn == "Beacon RSSI [dBm]": i_beacon_rssi = cni - if (cn == "Data RSSI [dBm]"): + if cn == "Data RSSI [dBm]": i_data_rssi = cni cni += 1 # Write out out header for the new file. - fpo.write("Test Run,Position [Deg],Attenuation 1 [dB],Pal Stats Endpoint 1 Control Rssi [dBm],Pal Stats Endpoint 1 Data Rssi [dBm]\n") + fpo.write( + "Test Run,Position [Deg],Attenuation 1 [dB],Pal Stats Endpoint 1 Control Rssi [dBm],Pal Stats Endpoint 1 Data Rssi [dBm]\n") # Read rest of the input lines, processing one at a time. Covert the columns as # needed, and write out new data to the output file. line = fp.readline() - bottom_half="Step Index,Position [Deg],Attenuation [dB],Traffic Pair 1 Throughput [Mbps]\n" + bottom_half = "Step Index,Position [Deg],Attenuation [dB],Traffic Pair 1 Throughput [Mbps]\n" - test_run="1" + test_run = "1" step_i = 0 while line: x = line.split(",") - #print(x) - #print([test_run, x[i_rotation], x[i_atten], x[i_beacon_rssi], x[i_data_rssi]]) fpo.write("%s,%s,%s,%s,%s" % (test_run, x[i_rotation], x[i_atten], x[i_beacon_rssi], x[i_data_rssi])) bottom_half += ("%s,%s,%s,%s\n" % (step_i, x[i_rotation], x[i_atten], x[i_rxbps])) line = fp.readline() @@ -83,37 +80,36 @@ class CSVParcer(): fpo.write("\n\n# RvRvO Data\n\n") fpo.write(bottom_half) -def main(): - #debug_on = False +def main(): parser = argparse.ArgumentParser( prog='csv_convert.py', formatter_class=argparse.RawTextHelpFormatter, epilog='''\ Useful Information: ''', - + description=''' csv_convert.py: converts the candela brief csv into the data for specific customer, ''') - # for testing parser.add_argument('-i','--infile', help="input file of csv data", default='text-csv-0-candela.csv') - parser.add_argument('-i','--infile', help="input file of csv data", required=True) - parser.add_argument('-o','--outfile', help="output file in .csv format", default='outfile.csv') - + parser.add_argument('-i', '--infile', help="input file of csv data", required=True) + parser.add_argument('-o', '--outfile', help="output file in .csv format", default='outfile.csv') args = parser.parse_args() csv_outfile_name = None + csv_infile_name = None if args.infile: csv_infile_name = args.infile if args.outfile: csv_outfile_name = args.outfile - print("infile: %s outfile: %s"%(csv_infile_name, csv_outfile_name)) + print("infile: %s outfile: %s" % (csv_infile_name, csv_outfile_name)) CSVParcer(csv_infile_name, csv_outfile_name) + if __name__ == "__main__": main() From ef10fa88780dfcffbaf05af9d13eca904bc0ba29 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:27:24 -0800 Subject: [PATCH 461/731] create_station: Remove unused argument Signed-off-by: Matthew Stidham --- py-scripts/create_station.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/py-scripts/create_station.py b/py-scripts/create_station.py index 7bfa0af8..78feaa9b 100755 --- a/py-scripts/create_station.py +++ b/py-scripts/create_station.py @@ -167,16 +167,6 @@ def main(): radio=args.radio) print("station_list {}".format(station_list)) - set_txo_data = { - "txo_enable": 1, - "txpower": 255, - "pream": 0, - "mcs": 0, - "nss": 0, - "bw": 3, - "retries": 1, - "sgi": 0 - } create_station = CreateStation(_host=args.mgr, _port=args.mgr_port, From 4311e5483f6ecf58cce749076ea711d5894d1419 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:28:18 -0800 Subject: [PATCH 462/731] cv_manager: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/cv_manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py-scripts/cv_manager.py b/py-scripts/cv_manager.py index 57bf23cd..5476c375 100755 --- a/py-scripts/cv_manager.py +++ b/py-scripts/cv_manager.py @@ -8,7 +8,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) cv_test_manager = importlib.import_module("py-json.cv_test_manager") @@ -29,6 +28,7 @@ class CVManager(cv_test): self.apply_cv_scenario(self.scenario) self.build_cv_scenario() + def main(): parser = argparse.ArgumentParser( prog='cv_manager.py', @@ -45,5 +45,6 @@ def main(): lfclient_host=args.mgr) manager.apply_and_build_scenario() -if __name__ =="__main__": + +if __name__ == "__main__": main() From 04ed5ef55a38d2f12d50754d3499f4c12b3132bc Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:28:55 -0800 Subject: [PATCH 463/731] cv_to_grafana: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/cv_to_grafana.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/py-scripts/cv_to_grafana.py b/py-scripts/cv_to_grafana.py index e15b0b5a..bcef055f 100755 --- a/py-scripts/cv_to_grafana.py +++ b/py-scripts/cv_to_grafana.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -''' +""" This script loads and builds a Chamber View Scenario, runs WiFi Capacity Test, runs Dataplane Test, and posts the results to Influx. There are optional arguments which will create a Grafana dashboard which will import the data posted to @@ -59,7 +59,7 @@ AP Auto test has the following argument: DUT syntax is somewhat tricky: DUT-name SSID BSID (bssid-idx), example: linksys-8450 Default-SSID-5gl c4:41:1e:f5:3f:25 (2) * radio2: Specify 2.4Ghz radio. May be specified multiple times. * radio5: Specify 5Ghz radio. May be specified multiple times. -''' +""" import sys import os import importlib @@ -70,7 +70,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lf_wifi_capacity_test = importlib.import_module("py-scripts.lf_wifi_capacity_test") @@ -79,7 +78,7 @@ cv_test_manager = importlib.import_module("py-json.cv_test_manager") create_chamberview = importlib.import_module("py-scripts.create_chamberview") CreateChamberview = create_chamberview.CreateChamberview create_chamberview_dut = importlib.import_module("py-scripts.create_chamberview_dut") -DUT = create_chamberview_dut.DUT +DUT = create_chamberview_dut.DUT lf_dataplane_test = importlib.import_module("py-scripts.lf_dataplane_test") DataplaneTest = lf_dataplane_test.DataplaneTest grafana_profile = importlib.import_module("py-scripts.grafana_profile") @@ -89,7 +88,6 @@ lf_ap_auto_test = importlib.import_module("py-scripts.lf_ap_auto_test") cv_add_base_parser = cv_test_manager.cv_add_base_parser - def main(): parser = argparse.ArgumentParser( prog='cv_to_grafana.py', @@ -173,7 +171,7 @@ def main(): parser.add_argument('--grafana_port', help='Grafana port if different from 3000', default=3000) parser.add_argument('--grafana_host', help='Grafana host', default='localhost') - #Flags for AP-Auto Test config + # Flags for AP-Auto Test config parser.add_argument("--max_stations_2", type=int, default=-1, help="Specify maximum 2.4Ghz stations") @@ -191,14 +189,15 @@ def main(): parser.add_argument("--radio5", action='append', nargs=1, default=[], help="Specify 5Ghz radio. May be specified multiple times.") - #Flags for Grafana + # Flags for Grafana parser.add_argument('--dashboard_title', help='Titles of dashboards', default=None, action='append') parser.add_argument('--scripts', help='Scripts to graph in Grafana', default=None, action='append') parser.add_argument('--title', help='title of your Grafana Dashboard', default=None) parser.add_argument('--testbed', help='Which testbed you want to query', default=None) - parser.add_argument('--graph_groups_file', help='File which determines how you want to filter your graphs on your dashboard', - default=None) + parser.add_argument('--graph_groups_file', + help='File which determines how you want to filter your graphs on your dashboard', + default=None) parser.add_argument('--kpi', help='KPI file(s) which you want to graph form', action='append', default=None) parser.add_argument('--datasource', help='Name of Influx database if different from InfluxDB', default='InfluxDB') parser.add_argument('--from_date', help='Date you want to start your Grafana dashboard from', default='now-1y') From bba11cfcefd73c597e2fbdbd674f9c4f60d24f71 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:30:33 -0800 Subject: [PATCH 464/731] cv_to_grafana: Fix unresolved references Signed-off-by: Matthew Stidham --- py-scripts/cv_to_grafana.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py-scripts/cv_to_grafana.py b/py-scripts/cv_to_grafana.py index bcef055f..b05be51d 100755 --- a/py-scripts/cv_to_grafana.py +++ b/py-scripts/cv_to_grafana.py @@ -84,8 +84,10 @@ DataplaneTest = lf_dataplane_test.DataplaneTest grafana_profile = importlib.import_module("py-scripts.grafana_profile") UseGrafana = grafana_profile.UseGrafana lf_ap_auto_test = importlib.import_module("py-scripts.lf_ap_auto_test") +ApAutoTest = lf_ap_auto_test.ApAutoTest cv_add_base_parser = cv_test_manager.cv_add_base_parser +cv_base_adjust_parser = cv_add_base_parser.cv_base_adjust_parser def main(): From eb6d4a4e70891889a1a73acecb180945ad5ad96d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:34:39 -0800 Subject: [PATCH 465/731] test_ip_variable_time: Fix bare except error Signed-off-by: Matthew Stidham --- py-scripts/test_ip_variable_time.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index 3b81f8b9..f3052732 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -72,6 +72,7 @@ class IPVariableTime(Realm): influx_org=None, influx_token=None, influx_bucket=None, + influx_tag=None, compared_report=None, ipv6=False, _debug_on=False, @@ -117,7 +118,7 @@ class IPVariableTime(Realm): if self.station_profile.use_ht160: self.station_profile.mode = 9 self.station_profile.mode = mode - if self.ap is not None: + if self.ap: self.station_profile.set_command_param("add_sta", "ap", self.ap) if self.use_existing_sta: self.station_profile.station_names = self.sta_list @@ -138,6 +139,7 @@ class IPVariableTime(Realm): self.influx_org = influx_org self.influx_token = influx_token self.influx_bucket = influx_bucket + self.influx_tag = influx_tag self.compared_report = compared_report self.cx_profile.name_prefix = self.name_prefix self.cx_profile.side_a_min_bps = side_a_min_rate @@ -145,7 +147,7 @@ class IPVariableTime(Realm): self.cx_profile.side_b_min_bps = side_b_min_rate self.cx_profile.side_b_max_bps = side_b_max_rate - def start(self, print_pass=False, print_fail=False): + def start(self): # if self.use_existing_station: # to-do- check here if upstream port got IP self.station_profile.admin_up() @@ -199,10 +201,10 @@ class IPVariableTime(Realm): if self.report_file is None: new_file_path = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':', '-') + '_test_ip_variable_time' # create path name - try: + if os.path.exists('/home/lanforge/report-data'): path = os.path.join('/home/lanforge/report-data/', new_file_path) os.mkdir(path) - except: + else: curr_dir_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) path = os.path.join(curr_dir_path, new_file_path) os.mkdir(path) @@ -237,7 +239,7 @@ class IPVariableTime(Realm): try: layer3connections = ','.join([[*x.keys()][0] for x in self.json_get('endp')['endpoint']]) - except: + except ValueError: raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') if type(self.layer3_cols) is not list: @@ -264,7 +266,7 @@ class IPVariableTime(Realm): print(error) return ValueError( "The time string provided for monitor_interval argument is invalid. Please see supported time stamp increments and inputs for monitor_interval in --help. ") - self.start(False, False) + self.start() if self.influx_org is not None: grapher = RecordInflux(_influx_host=self.influx_host, @@ -275,11 +277,9 @@ class IPVariableTime(Realm): devices = [station.split('.')[-1] for station in self.sta_list] tags = dict() tags['script'] = 'test_ip_variable_time' - try: + if self.influx_tag: for k in self.influx_tag: tags[k[0]] = k[1] - except: - pass grapher.monitor_port_data(longevity=Realm.parse_time(self.test_duration).total_seconds(), devices=devices, monitor_interval=Realm.parse_time(self.monitor_interval).total_seconds(), @@ -617,7 +617,6 @@ python3 ./test_ip_variable_time.py print("args.sta_names: {create}".format(create=args.sta_names)) print("args.use_existing_sta: {create} {typeof}".format(create=args.use_existing_sta, typeof=type(args.use_existing_sta))) print("station_list: {sta}".format(sta=station_list)) - # Create directory # if file path with output file extension is not given... @@ -626,7 +625,7 @@ python3 ./test_ip_variable_time.py CX_TYPES = ("tcp", "udp", "lf_tcp", "lf_udp") - if (args.traffic_type is None) or (args.traffic_type not in CX_TYPES): + if not args.traffic_type or (args.traffic_type not in CX_TYPES): print("cx_type needs to be lf_tcp, lf_udp, tcp, or udp, bye") exit(1) @@ -668,6 +667,7 @@ python3 ./test_ip_variable_time.py influx_org=args.influx_org, influx_token=args.influx_token, influx_bucket=args.influx_bucket, + influx_tag=args.influx_tag, compared_report=args.compared_report, ipv6=args.ipv6, traffic_type=args.traffic_type, From 661e42712851c1bd35fbe69cf4d128726b9ef313 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:44:54 -0800 Subject: [PATCH 466/731] test_l3_scenario_throughut: Make file pip compliant Signed-off-by: Matthew Stidham --- py-scripts/test_l3_scenario_throughput.py | 259 +++++++++------------- 1 file changed, 108 insertions(+), 151 deletions(-) diff --git a/py-scripts/test_l3_scenario_throughput.py b/py-scripts/test_l3_scenario_throughput.py index eda0ccdd..6670a8eb 100755 --- a/py-scripts/test_l3_scenario_throughput.py +++ b/py-scripts/test_l3_scenario_throughput.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -''' +""" This Script Loads the Existing Scenario and Run the Simultaenous Throughput over time and Generate Report and Plot the Graph This Script has three classes : 1. LoadScenario : It will load the existing saved scenario to the Lanforge (Here used for Loading Bridged VAP) @@ -23,7 +23,7 @@ This Script is intended to automate the testing of DUT That has stations as well as AP. To automate the simultaenous testing and check the DUT Temperature -''' +""" import sys import os import importlib @@ -31,7 +31,6 @@ import argparse import time import logging import paramiko as pmgo -from paramiko.ssh_exception import NoValidConnectionsError as exception import xlsxwriter from bokeh.io import show from bokeh.plotting import figure @@ -43,7 +42,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -57,104 +55,96 @@ Realm = realm.Realm class Login_DUT: def __init__(self, threadID, name, HOST): - self.threadID = threadID - self.name = name - self.host=HOST - self.USERNAME = "lanforge" - self.PASSWORD = "lanforge" - self.CLIENT= pmgo.SSHClient() - self.LF1= self.Connect() - self.data_core1=[] - self.data_core2=[] - if self.CLIENT == 0: - exit() - print("Connected to " +HOST+" DUT to Measure the Core Temperature") + self.threadID = threadID + self.name = name + self.host = HOST + self.USERNAME = "lanforge" + self.PASSWORD = "lanforge" + self.CLIENT = pmgo.SSHClient() + self.data_core1 = [] + self.data_core2 = [] + if self.CLIENT == 0: + exit() + print("Connected to " + HOST + " DUT to Measure the Core Temperature") + self.Connect() + def run(self): - stdin, stdout, stderr= self.CLIENT.exec_command("sensors") + stdin, stdout, stderr = self.CLIENT.exec_command("sensors") out_lines = stdout.readlines() err_lines = stderr.readlines() - print(out_lines[len(out_lines)-3], out_lines[len(out_lines)-2]) - self.data_core1.append(out_lines[len(out_lines)-3]) - self.data_core2.append(out_lines[len(out_lines)-2]) - + print(out_lines[len(out_lines) - 3], out_lines[len(out_lines) - 2]) + self.data_core1.append(out_lines[len(out_lines) - 3]) + self.data_core2.append(out_lines[len(out_lines) - 2]) def Connect(self): self.CLIENT.load_system_host_keys() self.CLIENT.set_missing_host_key_policy(pmgo.AutoAddPolicy()) - try: - self.CLIENT.connect(self.host, username=self.USERNAME, password=self.PASSWORD,timeout=10) - return None - except exception as error: - self.CLIENT = 0; - return None - + self.CLIENT.connect(self.host, username=self.USERNAME, password=self.PASSWORD, timeout=10) # Class to Load a Scenario that has been Created in Chamber View saved under DB/[Database_Name] class LoadScenario(LFCliBase): - def __init__(self, host, port, db_name, security_debug_on=False, _exit_on_error=False,_exit_on_fail=False): + def __init__(self, host, port, db_name, security_debug_on=False, _exit_on_error=False, _exit_on_fail=False): super().__init__(host, port, _debug=security_debug_on, _exit_on_fail=_exit_on_fail) self.host = host self.port = port - self.json_post("/cli-json/load", { "name": db_name, "action": 'overwrite' }) - print(host+ " : Scenario Loaded...") + self.json_post("/cli-json/load", {"name": db_name, "action": 'overwrite'}) + print(host + " : Scenario Loaded...") time.sleep(2) - - # Generates XLSX Report -def GenerateReport(scenario, detail, throughput_sta, throughput_vap, absolute_time, relative_time, core1_temp, core2_temp, duration, name): +def GenerateReport(scenario, detail, throughput_sta, throughput_vap, absolute_time, relative_time, core1_temp, + core2_temp, duration, name): workbook = xlsxwriter.Workbook(name) worksheet = workbook.add_worksheet() - worksheet.write('A1',"Scenario Runned: "+scenario+"\n Scenario Details: "+detail) + worksheet.write('A1', "Scenario Runned: " + scenario + "\n Scenario Details: " + detail) worksheet.write('A2', 'ABSOLUTE TIME') worksheet.write('B2', 'RELATIVE TIME (ms)') worksheet.write('C2', 'THROUGHPUT STATION SIDE (Mbps)') worksheet.write('D2', 'THROUGHPUT VAP SIDE (Mbps)') worksheet.write('E2', 'CORE 0 TEMP (Degree Celsius)') worksheet.write('F2', 'CORE 1 TEMP (Degree Celsius)') - core1=[] - core2=[] + core1 = [] + core2 = [] - - j=3 + j = 3 for i in absolute_time: - worksheet.write('A'+str(j),i) - j=j+1 + worksheet.write('A' + str(j), i) + j = j + 1 - j=3 + j = 3 for i in relative_time: - worksheet.write('B'+str(j),i) - j=j+1 + worksheet.write('B' + str(j), i) + j = j + 1 - sta_throu=[] - vap_throu=[] - j=3 + sta_throu = [] + vap_throu = [] + j = 3 for i in throughput_sta: print(i) - sta_throu.append(i/1000000) - worksheet.write('C'+str(j), str(i/1000000)+" Mbps") - j=j+1 - j=3 + sta_throu.append(i / 1000000) + worksheet.write('C' + str(j), str(i / 1000000) + " Mbps") + j = j + 1 + j = 3 for i in throughput_vap: print(i) - vap_throu.append(i/1000000) - worksheet.write('D'+str(j), str(i/1000000)+" Mbps") - j=j+1 - j=3 + vap_throu.append(i / 1000000) + worksheet.write('D' + str(j), str(i / 1000000) + " Mbps") + j = j + 1 + j = 3 for i in core1_temp: core1.append(int(str(i).split(':')[1].split('(')[0].split('.')[0].split('+')[1])) - worksheet.write('E'+str(j),str(i).split(':')[1].split('(')[0] ) - j=j+1 - j=3 + worksheet.write('E' + str(j), str(i).split(':')[1].split('(')[0]) + j = j + 1 + j = 3 for i in core2_temp: core2.append(int(str(i).split(':')[1].split('(')[0].split('.')[0].split('+')[1])) - worksheet.write('F'+str(j), str(i).split(':')[1].split('(')[0]) - j=j+1 + worksheet.write('F' + str(j), str(i).split(':')[1].split('(')[0]) + j = j + 1 - Time =[] - for i in range(0,int(duration)*5): + Time = [] + for i in range(0, int(duration) * 5): Time.append(i) plot(sta_throu, vap_throu, core1, core2, Time) workbook.close() @@ -162,27 +152,26 @@ def GenerateReport(scenario, detail, throughput_sta, throughput_vap, absolute_ti # Plotting Function for Parameters def plot(throughput_sta, throughput_vap, core1_temp, core2_temp, Time): - print(throughput_vap) s1 = figure(plot_width=1000, plot_height=600) s1.title.text = "WIFI Throughput vs Temperature Plot" s1.xaxis.axis_label = "Time " s1.yaxis.axis_label = "Throughput in Mbps" - s1.line( Time, throughput_sta, color='black', legend_label ="Throughput Over Station Connections ") - #s1.circle(Time, throughput_sta, color='red') + s1.line(Time, throughput_sta, color='black', legend_label="Throughput Over Station Connections ") + # s1.circle(Time, throughput_sta, color='red') - s1.line( Time, throughput_vap, color='blue', legend_label ="Throughput Over VAP ") - #s1.circle(Time, throughput_vap, color='blue') + s1.line(Time, throughput_vap, color='blue', legend_label="Throughput Over VAP ") + # s1.circle(Time, throughput_vap, color='blue') s1.extra_y_ranges = {"Temperature": Range1d(start=0, end=150)} s1.add_layout(LinearAxis(y_range_name="Temperature", axis_label="Temperature in Degree Celsius"), 'right') - s1.line(Time, core1_temp, y_range_name='Temperature', color='red', legend_label ="CPU CORE 0 TEMPERATURE ") - #s1.circle(Time, core1_temp, y_range_name='Temperature', color='red') + s1.line(Time, core1_temp, y_range_name='Temperature', color='red', legend_label="CPU CORE 0 TEMPERATURE ") + # s1.circle(Time, core1_temp, y_range_name='Temperature', color='red') - s1.line(Time, core2_temp, y_range_name='Temperature', color='green', legend_label ="CPU CORE 1 TEMPERATURE ") - #s1.circle(Time, core2_temp, y_range_name='Temperature', color='blue') + s1.line(Time, core2_temp, y_range_name='Temperature', color='green', legend_label="CPU CORE 1 TEMPERATURE ") + # s1.circle(Time, core2_temp, y_range_name='Temperature', color='blue') show(s1) @@ -193,46 +182,40 @@ class VAP_Measure(LFCliBase): super().__init__(lfclient_host, lfclient_port) - - - - # Added Standard Function to Fetch L3 CX and VAP Directly class FindPorts(LFCliBase): - def __init__(self, host, port, security_debug_on=False, _exit_on_error=False,_exit_on_fail=False): + def __init__(self, host, port, security_debug_on=False, _exit_on_error=False, _exit_on_fail=False): super().__init__(host, port, _debug=security_debug_on, _exit_on_fail=_exit_on_fail) self.host = host self.port = port - #Creating a Realm Object + # Creating a Realm Object self.local_realm = Realm(lfclient_host=host, lfclient_port=port) + def FindExistingCX(self): + return self.local_realm.cx_list() - def FindExistingCX(self): + def FindVAP(self): + return self.local_realm.vap_list() - return self.local_realm.cx_list() - - def FindVAP(self): - return self.local_realm.vap_list() # Utility to Find the Traffic Running on Existing CX and VAP def PortUtility(host, port, duration, report_name, scenario, detail): - lf_utils = FindPorts(host, port) # cx data will be having all parameters of L3 Connections available in the Realm. It is needed to get the names of all L3 CX, which is stored in cx_names. It is required so as we can extract the real time data running on that CX cx_data = lf_utils.FindExistingCX() - #print(cx_data) + # print(cx_data) # vap_list will have the List of all the vap ports available, This is required to get the VAP names in order to fetch the throughput over that vap - vap_list =lf_utils.FindVAP() - vap_measure_obj=VAP_Measure(host,port) - - hostname=socket.gethostbyname(socket.gethostname()) + vap_list = lf_utils.FindVAP() + vap_measure_obj = VAP_Measure(host, port) + + hostname = socket.gethostbyname(socket.gethostname()) dut_temp_obj = Login_DUT(1, "Thread-1", hostname) - #print(vap_list) - vap_names=[] + # print(vap_list) + vap_names = [] for i in vap_list: vap_names.append(str(i.keys()).split('.')[2].split('\'')[0]) print(vap_names[0]) @@ -240,95 +223,69 @@ def PortUtility(host, port, duration, report_name, scenario, detail): cx_names = list(cx_data.keys()) cx_names.remove('handler') cx_names.remove('uri') - absolute_time=[] - temp_time =[] + absolute_time = [] + temp_time = [] - Total_Throughput_CX_Side =[] - Total_Throughput_VAP_Side =[] - print(lf_utils.local_realm.json_get("/cx/"+cx_names[0]).get(cx_names[0]).get('state')) - for i in cx_names: - while(lf_utils.local_realm.json_get("/cx/"+cx_names[0]).get(cx_names[0]).get('state') != 'Run'): + Total_Throughput_CX_Side = [] + Total_Throughput_VAP_Side = [] + print(lf_utils.local_realm.json_get("/cx/" + cx_names[0]).get(cx_names[0]).get('state')) + for _ in cx_names: + while lf_utils.local_realm.json_get("/cx/" + cx_names[0]).get(cx_names[0]).get('state') != 'Run': continue - offset=int(round(time.time() * 1000)) - for i in range(0,int(duration)): - temp=0 - for i in cx_names: - temp=temp+int(lf_utils.local_realm.json_get("/cx/"+i).get(i).get('bps rx a')) - #temp=temp+lf_utils.local_realm.json_get("/cx/"+i).get(i).get('bps rx b') - for i in vap_names: - Total_Throughput_VAP_Side.append(int(vap_measure_obj.json_get("/port/1/1/"+str(i)).get('interface').get('bps rx'))) + offset = int(round(time.time() * 1000)) + for _ in range(0, int(duration)): + temp = 0 + for _ in cx_names: + temp = temp + int(lf_utils.local_realm.json_get("/cx/" + i).get(i).get('bps rx a')) + # temp=temp+lf_utils.local_realm.json_get("/cx/"+i).get(i).get('bps rx b') + for _ in vap_names: + Total_Throughput_VAP_Side.append( + int(vap_measure_obj.json_get("/port/1/1/" + str(i)).get('interface').get('bps rx'))) absolute_time.append(datetime.now().strftime("%H:%M:%S")) - temp_time.append(int(round(time.time() * 1000)-offset)) + temp_time.append(int(round(time.time() * 1000) - offset)) Total_Throughput_CX_Side.append(temp) dut_temp_obj.run() time.sleep(5) - relative_time=[] - relative_time.append(0) - for i in range (0,len(temp_time)-1): - relative_time.append(temp_time[i+1]-temp_time[i]) + relative_time = [0] + for i in range(0, len(temp_time) - 1): + relative_time.append(temp_time[i + 1] - temp_time[i]) print(Total_Throughput_CX_Side) print(Total_Throughput_VAP_Side) - GenerateReport(scenario, detail, Total_Throughput_CX_Side, Total_Throughput_VAP_Side, absolute_time, relative_time, dut_temp_obj.data_core1, dut_temp_obj.data_core2, duration, report_name) + GenerateReport(scenario, detail, Total_Throughput_CX_Side, Total_Throughput_VAP_Side, absolute_time, relative_time, + dut_temp_obj.data_core1, dut_temp_obj.data_core2, duration, report_name) + # main method def main(): - - parser = argparse.ArgumentParser( prog="test_l3_scenario_throughput.py", formatter_class=argparse.RawTextHelpFormatter, description="Test Scenario of DUT Temperature measurement along with simultaneous throughput on VAP as well as stations") - parser.add_argument("-m", "--manager", type=str, help="Enter the address of Lanforge Manager (By default localhost)") - parser.add_argument("-sc", "--scenario", type=str, help="Enter the Name of the Scenario you want to load (by Default DFLT)") + parser.add_argument("-m", "--manager", type=str, + help="Enter the address of Lanforge Manager (By default localhost)") + parser.add_argument("-sc", "--scenario", type=str, + help="Enter the Name of the Scenario you want to load (by Default DFLT)") parser.add_argument("-t", "--duration", type=str, help="Enter the Time for which you want to run test") - parser.add_argument("-o", "--report_name", type=str, help="Enter the Name of the Output file ('Report.xlsx')") - parser.add_argument("-td", "--test_detail", type=str, help="Enter the Test Detail in Quotes ") + parser.add_argument("-o", "--report_name", type=str, help="Enter the Name of the Output file ('Report.xlsx')", default='report.xlsx') + parser.add_argument("-td", "--test_detail", type=str, help="Enter the Test Detail in Quotes ", default='Blank test') - args = None + args = parser.parse_args() - try: - args = parser.parse_args() - # Lanforge Manager IP Address - if (args.manager is None): - manager = "localhost" - if (args.manager is not None): - manager = args.manager - if (args.scenario is not None): - scenario = args.scenario - if (args.report_name is not None): - report_name = args.report_name - if (args.duration is None): - duration = (1 * 60)/5 - if (args.report_name is None): - report_name = "report.xlsx" - if (args.test_detail is not None): - test_detail = args.test_detail - if (args.test_detail is None): - test_detail = "Blank test" - except Exception as e: - logging.exception(e) - exit(2) - - - hostname=socket.gethostbyname(socket.gethostname()) + hostname = socket.gethostbyname(socket.gethostname()) # Loading DUT Scenario Scenario_1 = LoadScenario("192.168.200.18", 8080, "Lexus_Dut") - # Loading LF Scenario DB_Lanforge_2 = "LF_Device" - Scenario_2 = LoadScenario(manager, 8080, scenario) - #Wait for Sometime + Scenario_2 = LoadScenario(args.manager, 8080, args.scenario) + # Wait for Sometime time.sleep(10) - duration_sec=Realm.parse_time(args.duration).total_seconds() * 60 + duration_sec = Realm.parse_time(args.duration).total_seconds() * 60 # Port Utility function for reading CX and VAP - PortUtility(manager,8080, duration_sec, report_name, scenario, test_detail) - - - + PortUtility(args.manager, 8080, duration_sec, args.report_name, args.scenario, args.test_detail) if __name__ == '__main__': From 554b284c96c490270c03dd4810529b3f5b81a219 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 13:45:51 -0800 Subject: [PATCH 467/731] test_l3_scenario_throughput: Fix variable name errors Signed-off-by: Matthew Stidham --- py-scripts/test_l3_scenario_throughput.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/test_l3_scenario_throughput.py b/py-scripts/test_l3_scenario_throughput.py index 6670a8eb..345046d8 100755 --- a/py-scripts/test_l3_scenario_throughput.py +++ b/py-scripts/test_l3_scenario_throughput.py @@ -235,12 +235,12 @@ def PortUtility(host, port, duration, report_name, scenario, detail): offset = int(round(time.time() * 1000)) for _ in range(0, int(duration)): temp = 0 - for _ in cx_names: - temp = temp + int(lf_utils.local_realm.json_get("/cx/" + i).get(i).get('bps rx a')) + for cx_name in cx_names: + temp = temp + int(lf_utils.local_realm.json_get("/cx/" + cx_name).get(cx_name).get('bps rx a')) # temp=temp+lf_utils.local_realm.json_get("/cx/"+i).get(i).get('bps rx b') - for _ in vap_names: + for vap_name in vap_names: Total_Throughput_VAP_Side.append( - int(vap_measure_obj.json_get("/port/1/1/" + str(i)).get('interface').get('bps rx'))) + int(vap_measure_obj.json_get("/port/1/1/" + str(vap_name)).get('interface').get('bps rx'))) absolute_time.append(datetime.now().strftime("%H:%M:%S")) temp_time.append(int(round(time.time() * 1000) - offset)) Total_Throughput_CX_Side.append(temp) From 6cb474a36924f00eecd3005f06107305e441212b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 15:10:22 -0800 Subject: [PATCH 468/731] regression_test: Remove unused flag Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index eaf4e3d0..4d22d71e 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -22,7 +22,7 @@ Help() pip3 install --user -r ../requirements.txt --upgrade -while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:L:H:" option; do +while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:" option; do case "${option}" in h) # display Help Help @@ -62,9 +62,6 @@ while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:L:H:" option; do DUT5=${OPTARG} DUT2=${OPTARG} ;; - L) - LANFORGE_DUT=${OPTARG} - ;; H) ./lf_help_check.bash ;; From 776bc795aee63844916171c727f09bdff8f83c8f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 15:15:15 -0800 Subject: [PATCH 469/731] lf_dfs_test: Fix whitespace error Signed-off-by: Matthew Stidham --- py-scripts/lf_dfs_test.py | 2382 +++++++++++++++++++++---------------- 1 file changed, 1387 insertions(+), 995 deletions(-) diff --git a/py-scripts/lf_dfs_test.py b/py-scripts/lf_dfs_test.py index afdfc249..6db17b14 100755 --- a/py-scripts/lf_dfs_test.py +++ b/py-scripts/lf_dfs_test.py @@ -15,10 +15,10 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) import argparse + LFUtils = importlib.import_module("py-json.LANforge.LFUtils") realm = importlib.import_module("py-json.realm") Realm = realm.Realm @@ -28,15 +28,18 @@ Realm = realm.Realm FORMAT = '%(asctime)s %(name)s %(levelname)s: %(message)s' + # see https://stackoverflow.com/a/13306095/11014343 class FileAdapter(object): def __init__(self, logger): self.logger = logger + def write(self, data): # NOTE: data can be a partial line, multiple lines - data = data.strip() # ignore leading/trailing whitespace - if data: # non-blank - self.logger.info(data) + data = data.strip() # ignore leading/trailing whitespace + if data: # non-blank + self.logger.info(data) + def flush(self): pass # leave it to logging to flush properly @@ -46,27 +49,27 @@ class FileAdapter(object): # Scaling and Performance to be self contained and not impact other tests ################################################################################ -class CreateCtlr(): +class CreateCtlr: def __init__(self, - _scheme, - _port, - _series, - _ctlr, - _prompt, - _user, - _passwd, - _ap, - _band, - _chan_5ghz, - _chan_24ghz, - _chan_width, - _ap_mode, - _tx_power, - _client_density, - _cap_ctl_out): + _scheme, + _port, + _series, + _ctlr, + _prompt, + _user, + _passwd, + _ap, + _band, + _chan_5ghz, + _chan_24ghz, + _chan_width, + _ap_mode, + _tx_power, + _client_density, + _cap_ctl_out): self.scheme = _scheme - self.port = _port + self.port = _port self.series = _series self.ctlr = _ctlr self.prompt = _prompt @@ -82,44 +85,50 @@ class CreateCtlr(): self.cap_ctl_out = _cap_ctl_out self.client_density = 0 - def verify_controller(self,client_density): + def verify_controller(self, client_density): self.client_density = client_density try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"summary")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "summary")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series,"--action", "summary"], capture_output=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--action", "summary"], capture_output=True) pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}" - .format(process_error.returncode, process_error.output)) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}" + .format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) - + # Find our station count searchap = False for line in pss.splitlines(): - if (line.startswith("---------")): + if line.startswith("---------"): searchap = True continue - #TODO need to test with 9800 series to chelck the values - if (searchap): - pat = "%s\s+\S+\s+\S+\s+\S+\s+\S+.* \S+\s+\S+\s+(\S+)\s+\["%(self.ap) - #logg.info("AP line: %s"%(line)) + # TODO need to test with 9800 series to chelck the values + if searchap: + pat = "%s\s+\S+\s+\S+\s+\S+\s+\S+.* \S+\s+\S+\s+(\S+)\s+\[" % self.ap + # logg.info("AP line: %s"%(line)) m = re.search(pat, line) - if (m != None): + if m != None: sta_count = m.group(1) - logg.info("AP line: %s"%(line)) - logg.info("sta-count: %s"%(sta_count)) - if (int(sta_count) != int(self.client_density)): - logg.info("WARNING: Controller reported %s stations, should be %s"%(sta_count, self.client_density)) + logg.info("AP line: %s" % line) + logg.info("sta-count: %s" % sta_count) + if int(sta_count) != int(self.client_density): + logg.info( + "WARNING: Controller reported %s stations, should be %s" % (sta_count, self.client_density)) - #show summary (to get AP) (3400/9800) - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 --action summary --series 9800 --log stdout + # show summary (to get AP) (3400/9800) + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 --action summary --series 9800 --log stdout def controller_show_summary(self): pss = "" try: @@ -134,589 +143,697 @@ class CreateCtlr(): series: {} \ band: {} \ action: {}".format( - self.scheme, - self.ctlr, - self.port, - self.prompt, - self.user, - self.passwd, - self.ap, - self.series, - self.band, - "summary")) + self.scheme, + self.ctlr, + self.port, + self.prompt, + self.user, + self.passwd, + self.ap, + self.series, + self.band, + "summary")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", - "--scheme", self.scheme, - "--prompt", self.prompt, - "--port", self.port, - "-d", self.ctlr, - "-u", self.user, - "-p", self.passwd, - "-a", self.ap, - "--series", self.series, - "--band", self.band, - "--action", "summary"], - capture_output=self.cap_ctl_out, + ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", + "--scheme", self.scheme, + "--prompt", self.prompt, + "--port", self.port, + "-d", self.ctlr, + "-u", self.user, + "-p", self.passwd, + "-a", self.ap, + "--series", self.series, + "--band", self.band, + "--action", "summary"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}" - .format(process_error.returncode, process_error.output)) - time.sleep(1) - exit(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}" + .format(process_error.returncode, process_error.output)) + time.sleep(1) + exit(1) return pss - #show ap dot11 5ghz summary (band defaults to 5ghz) --band a - #show ap dot11 24ghz summary use --band b for 2.4 ghz - #action advanced (3400/9800) - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 --action advanced --series 9800 --log stdout + # show ap dot11 5ghz summary (band defaults to 5ghz) --band a + # show ap dot11 24ghz summary use --band b for 2.4 ghz + # action advanced (3400/9800) + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 --action advanced --series 9800 --log stdout def controller_show_ap_summary(self): pss = "" try: logg.info("\ - scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"advanced")) + scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "advanced")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "advanced"], - capture_output=True, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "advanced"], + capture_output=True, check=True) pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) return pss - #show wlan summary + # show wlan summary def controller_show_wlan_summary(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"show wlan summary")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "show wlan summary")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "show_wlan_summary"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "show_wlan_summary"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - #disable AP - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable --series 9800 + # disable AP + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable --series 9800 def controller_disable_ap(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"disable")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "disable")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", - self.ctlr, "-u",self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "disable"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", + self.ctlr, "-u", self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "disable"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - - #disable wlan - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_wlan --series 9800 + # disable wlan + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_wlan --series 9800 def controller_disable_wlan(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} wlan: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,self.wlan,"disable_wlan")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} wlan: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, self.wlan, "disable_wlan")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band,"--wlan", self.wlan, "--action", "disable_wlan"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--wlan", self.wlan, "--action", + "disable_wlan"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - - #disable network 5ghz - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_network_5ghz --series 9800 + # disable network 5ghz + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_network_5ghz --series 9800 def controller_disable_network_5ghz(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"disable_network_5ghz")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "disable_network_5ghz")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "disable_network_5ghz"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "disable_network_5ghz"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) else: try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"cmd","config 802.11a disable network")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "cmd", "config 802.11a disable network")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "cmd", "--value", "config 802.11a disable network"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "cmd", "--value", + "config 802.11a disable network"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - - #disable network 24ghz - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_network_24ghz --series 9800 + # disable network 24ghz + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_network_24ghz --series 9800 def controller_disable_network_24ghz(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"disable_network_24ghz")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "disable_network_24ghz")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "disable_network_24ghz"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "disable_network_24ghz"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) else: try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"cmd","config 802.11b disable network")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "cmd", "config 802.11b disable network")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "cmd", "--value", "config 802.11b disable network"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "cmd", "--value", + "config 802.11b disable network"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - - - #set manual mode - Series 9800 must be set to manual mode - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action manual --series 9800 + # set manual mode - Series 9800 must be set to manual mode + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action manual --series 9800 # ap name dot11 5ghz radio role manual client-serving def controller_role_manual(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"manual")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "manual")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "manual"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "manual"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) else: - logg.info("Check the controller scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) + logg.info( + "Check the controller scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) - #set manual mode - Series 9800 must be set to auto mode - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action auto --series 9800 + # set manual mode - Series 9800 must be set to auto mode + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action auto --series 9800 # ap name dot11 5ghz radio role manual client-serving def controller_role_auto(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"auto")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "auto")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "auto"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "auto"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) else: - logg.info("Check the controller scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) + logg.info( + "Check the controller scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) - #test parameters summary (txPower 1-8) - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action txPower --value 5 --series 9800 + # test parameters summary (txPower 1-8) + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action txPower --value 5 --series 9800 def controller_set_tx_power(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"txPower", self.tx_power )) # TODO fix txPower to tx_power in wifi_ctl_9800_3504.py - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "txPower","--value", self.tx_power], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "txPower", self.tx_power)) # TODO fix txPower to tx_power in wifi_ctl_9800_3504.py + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "txPower", "--value", self.tx_power], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - #set channel [36, 64, 100] - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action channel --value 36 --series 9800 + # set channel [36, 64, 100] + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action channel --value 36 --series 9800 # 9800 : ap name dot11 [5ghz | 24ghz] channel # 3504 : (controller Controller) >config 802.11a channel ap APA453.0E7B.CF9C 52 def controller_set_channel(self): try: - if (self.band == "a"): + if self.band == "a": controller_channel = self.chan_5ghz else: controller_channel = self.chan_24ghz - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"channel", controller_channel )) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "channel","--value", controller_channel], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "channel", controller_channel)) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "channel", "--value", controller_channel], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) def controller_set_bandwidth_20(self): controller_chan_width_20 = "20" try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"channel", controller_chan_width_20 )) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "channel","--value", controller_chan_width_20], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "channel", controller_chan_width_20)) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "channel", "--value", controller_chan_width_20], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) - + except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - - #set bandwidth [20 40 80 160] - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action bandwidth --value 40 --series 9800 + # set bandwidth [20 40 80 160] + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action bandwidth --value 40 --series 9800 def controller_set_bandwidth(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"channel", self.chan_width )) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "channel","--value", self.chan_width], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "channel", self.chan_width)) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "channel", "--value", self.chan_width], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) - + except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - - #create wlan - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action create_wlan --wlan "open-wlan" --wlanID 1 --series 9800 + # create wlan + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action create_wlan --wlan "open-wlan" --wlanID 1 --series 9800 def controller_create_wlan(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} wlan {} wlanID {} wlanSSID {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"create_wlan", self.wlan, self.wlanID, self.wlanSSID )) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "create_wlan","--wlan", self.wlan, "--wlanID", self.wlanID, "--wlanSSID", self.wlanSSID], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} wlan {} wlanID {} wlanSSID {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "create_wlan", self.wlan, self.wlanID, self.wlanSSID)) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "create_wlan", "--wlan", self.wlan, "--wlanID", self.wlanID, "--wlanSSID", + self.wlanSSID], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) - + except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) else: - logg.info("Check the controller_scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) + logg.info( + "Check the controller_scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) - #create wireless tag policy --9800 series needs to have wireless tag policy set - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action wireless_tag_policy --series 9800 + # create wireless tag policy --9800 series needs to have wireless tag policy set + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action wireless_tag_policy --series 9800 def controller_set_wireless_tag_policy(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"wireless_tag_policy" )) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "wireless_tag_policy"], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "wireless_tag_policy")) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "wireless_tag_policy"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) else: - logg.info("Check the controller_scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) + logg.info( + "Check the controller_scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) - - #enable wlan - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_wlan --series 9800 + # enable wlan + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_wlan --series 9800 def controller_enable_wlan(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} wlan: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band, self.wlan,"enable_wlan")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--wlan", self.wlan, - "--action", "enable_wlan"], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} wlan: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, self.wlan, "enable_wlan")) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--wlan", self.wlan, + "--action", "enable_wlan"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) - + except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - - #enable 5ghz - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_network_5ghz --series 9800 + # enable 5ghz + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_network_5ghz --series 9800 def controller_enable_network_5ghz(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"enable_network_5ghz")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "enable_network_5ghz"], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "enable_network_5ghz")) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "enable_network_5ghz"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) - + except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) else: try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"cmd","config 802.11a enable network")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "cmd", "config 802.11a enable network")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "cmd", "--value", "config 802.11a enable network"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "cmd", "--value", + "config 802.11a enable network"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - - - #enable 24ghz - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_network_24ghz --series 9800 + # enable 24ghz + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_network_24ghz --series 9800 def controller_enable_network_24ghz(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"enable_network_24ghz")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "enable_network_24ghz"], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "enable_network_24ghz")) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "enable_network_24ghz"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) else: try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"cmd","config 802.11b enable network")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "cmd", "config 802.11b enable network")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "cmd", "--value", "config 802.11b enable network"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "cmd", "--value", + "config 802.11b enable network"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - - - #enable (band a) - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable --series 9800 + # enable (band a) + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable --series 9800 def controller_enable_ap(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"enable")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "enable"], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "enable")) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "enable"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) - - #advanced (showes summary) - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action advanced --series 9800 + # advanced (showes summary) + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action advanced --series 9800 def controller_show_ap_channel(self): - advanced = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--action", "ap_channel"], capture_output=True) + advanced = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", + self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--action", "ap_channel"], capture_output=True) pss = advanced.stdout.decode('utf-8', 'ignore') logg.info(pss) if self.series == "9800": - if (self.band == "a"): + if self.band == "a": controller_channel = self.chan_5ghz else: controller_channel = self.chan_24ghz @@ -726,45 +843,53 @@ class CreateCtlr(): logg.info("line {}".format(line)) element_list = line.lstrip().split() logg.info("element_list {}".format(element_list)) - if (line.lstrip().startswith(search_str)): + if line.lstrip().startswith(search_str): logg.info("line {}".format(line)) element_list = line.lstrip().split() logg.info("element_list {}".format(element_list)) # AP Name (0) mac (1) slot (2) Admin State [enable/disable] (3) Oper State [Up/Down] (4) Width (5) Txpwr (6,7) channel (8) mode (9) - logg.info("ap: {} slof {} channel {} chan_width {}".format(element_list[0],element_list[2],element_list[8],element_list[5])) - if (str(controller_channel) in str(element_list[8])) and (str(self.chan_width) in str(element_list[5])): - logg.info("ap {} configuration successful: channel {} in expected {} chan_width {} in expected {}" - .format(element_list[0],controller_channel,element_list[8],self.chan_width,element_list[5])) + logg.info("ap: {} slof {} channel {} chan_width {}".format(element_list[0], element_list[2], + element_list[8], element_list[5])) + if (str(controller_channel) in str(element_list[8])) and ( + str(self.chan_width) in str(element_list[5])): + logg.info( + "ap {} configuration successful: channel {} in expected {} chan_width {} in expected {}" + .format(element_list[0], controller_channel, element_list[8], self.chan_width, + element_list[5])) else: logg.info("WARNING ap {} configuration: channel {} in expected {} chan_width {} in expected {}" - .format(element_list[0],controller_channel,element_list[8],self.chan_width,element_list[5])) + .format(element_list[0], controller_channel, element_list[8], self.chan_width, + element_list[5])) break else: logg.info("checking for 802.11{}".format(self.band)) - if (self.band == "a"): + if self.band == "a": controller_channel = self.chan_5ghz else: controller_channel = self.chan_24ghz for line in pss.splitlines(): - #logg.info("line {}".format(line)) + # logg.info("line {}".format(line)) search_str = "802.11{}".format(self.band) - if (line.lstrip().startswith(search_str)): + if line.lstrip().startswith(search_str): logg.info("line {}".format(line)) element_list = line.lstrip().split() logg.info("element_list {}".format(element_list)) - logg.info("ap: {} channel {} chan_width {}".format(self.ap,element_list[4],element_list[5])) - if (str(controller_channel) in str(element_list[4])) and (str(self.chan_width) in str(element_list[5])): + logg.info("ap: {} channel {} chan_width {}".format(self.ap, element_list[4], element_list[5])) + if (str(controller_channel) in str(element_list[4])) and ( + str(self.chan_width) in str(element_list[5])): logg.info("ap configuration successful: channel {} in expected {} chan_width {} in expected {}" - .format(controller_channel,element_list[4],self.chan_width,element_list[5])) + .format(controller_channel, element_list[4], self.chan_width, element_list[5])) else: logg.info("AP WARNING: channel {} expected {} chan_width {} expected {}" - .format(element_list[4],controller_channel,element_list[5],self.chan_width)) + .format(element_list[4], controller_channel, element_list[5], self.chan_width)) break - - logg.info("configure ap {} channel {} chan_width {}".format(self.ap,self.channel,self.chan_width)) + + logg.info("configure ap {} channel {} chan_width {}".format(self.ap, self.channel, self.chan_width)) # Verify channel and channel width. -########################################## + + +########################################## # End of controller controller class ########################################## @@ -773,68 +898,68 @@ class CreateCtlr(): ########################################## class L3VariableTime(Realm): - def __init__(self, - args, - _dfs, - _dfs_time, - _radar_duration, - _scheme, - _port, - _series, - _ctlr, - _prompt, - _user, - _passwd, - _ap, - _ap_slot, - _band, - _chan_5ghz, - _chan_24ghz, - _chan_width, - _ap_mode, - _tx_power, - _client_density, - _cap_ctl_out, - _ap_dict, - endp_type, - 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, - results, - test_keys, - test_config, - reset_port_enable_list, - reset_port_time_min_list, - reset_port_time_max_list, - csv_started=False, - side_a_min_bps=560000, - side_a_max_bps=0, - side_a_min_pdu=1518, - side_a_max_pdu=0, - side_b_min_bps=560000, - side_b_max_bps=0, - side_b_min_pdu=1518, - side_b_max_pdu=0, - number_template="00", - test_duration="256s", - polling_interval="60s", - lfclient_host="localhost", - lfclient_port=8080, - debug=False, - wait_timeout=120, - _exit_on_error=False, - _exit_on_fail=False, - _proxy_str=None, - _capture_signal_list=[]): + def __init__(self, + args, + _dfs, + _dfs_time, + _radar_duration, + _scheme, + _port, + _series, + _ctlr, + _prompt, + _user, + _passwd, + _ap, + _ap_slot, + _band, + _chan_5ghz, + _chan_24ghz, + _chan_width, + _ap_mode, + _tx_power, + _client_density, + _cap_ctl_out, + _ap_dict, + endp_type, + 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, + results, + test_keys, + test_config, + reset_port_enable_list, + reset_port_time_min_list, + reset_port_time_max_list, + csv_started=False, + side_a_min_bps=560000, + side_a_max_bps=0, + side_a_min_pdu=1518, + side_a_max_pdu=0, + side_b_min_bps=560000, + side_b_max_bps=0, + side_b_min_pdu=1518, + side_b_max_pdu=0, + number_template="00", + test_duration="256s", + polling_interval="60s", + lfclient_host="localhost", + lfclient_port=8080, + debug=False, + wait_timeout=120, + _exit_on_error=False, + _exit_on_fail=False, + _proxy_str=None, + _capture_signal_list=[]): super().__init__(lfclient_host=lfclient_host, lfclient_port=lfclient_port, debug_=debug, @@ -848,16 +973,16 @@ class L3VariableTime(Realm): self.radar_duration_seconds = self.duration_time_to_seconds(_radar_duration) self.dfs_time_seconds = self.duration_time_to_seconds(_dfs_time) self.scheme = _scheme - self.port = _port + self.port = _port self.series = _series - self.ctlr = _ctlr + self.ctlr = _ctlr self.prompt = _prompt - self.user = _user + self.user = _user self.passwd = _passwd - self.ap = _ap + self.ap = _ap self.ap_slot = _ap_slot - self.band = _band - self.chan_5ghz = _chan_5ghz + self.band = _band + self.chan_5ghz = _chan_5ghz self.chan_24ghz = _chan_24ghz self.chan_width = _chan_width self.ap_mode = _ap_mode @@ -870,7 +995,7 @@ class L3VariableTime(Realm): self.side_b = side_b self.ssid_list = ssid_list self.ssid_password_list = ssid_password_list - self.station_lists = station_lists + self.station_lists = station_lists self.ssid_security_list = ssid_security_list self.wifimode_list = wifimode_list self.reset_port_enable_list = reset_port_enable_list @@ -880,8 +1005,8 @@ class L3VariableTime(Realm): self.name_prefix = name_prefix self.test_duration = test_duration self.radio_name_list = radio_name_list - self.number_of_stations_per_radio_list = number_of_stations_per_radio_list - #self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=debug_on) + self.number_of_stations_per_radio_list = number_of_stations_per_radio_list + # self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=debug_on) self.polling_interval_seconds = self.duration_time_to_seconds(polling_interval) self.cx_profile = self.new_l3_cx_profile() self.multicast_profile = self.new_multicast_profile() @@ -892,13 +1017,13 @@ class L3VariableTime(Realm): self.results = results self.csv_started = csv_started self.epoch_time = int(time.time()) - self.dfs_epoch_start = 0 + self.dfs_epoch_start = 0 self.dfs_epoch_detect = 0 - #[*07/07/2020 23:37:48.1460] changed to DFS channel 52, running CAC for 60 seconds. + # [*07/07/2020 23:37:48.1460] changed to DFS channel 52, running CAC for 60 seconds. self.CAC_TIMER = "" - #[*07/07/2020 23:38:48.7240] CAC_EXPIRY_EVT: CAC finished on DFS channel 52 + # [*07/07/2020 23:38:48.7240] CAC_EXPIRY_EVT: CAC finished on DFS channel 52 self.CAC_EXPIRY_EVT = "" - #[*07/07/2020 23:44:27.8060] DOT11_DRV[1]: set_dfs Channel set to 36/20, CSA count 10 + # [*07/07/2020 23:44:27.8060] DOT11_DRV[1]: set_dfs Channel set to 36/20, CSA count 10 self.CSA_COUNT = "" self.BLACK_LIST = "" self.debug = debug_on @@ -906,36 +1031,39 @@ class L3VariableTime(Realm): self.test_keys = test_keys self.test_config = test_config - self.test_config_dict = dict(map(lambda x: x.split('=='), str(self.test_config).replace('[','').replace(']','').replace("'","").split())) - + self.test_config_dict = dict(map(lambda x: x.split('=='), + str(self.test_config).replace('[', '').replace(']', '').replace("'", + "").split())) # Full spread-sheet data if self.outfile is not None: - self.csv_file = open(self.outfile, "a+") + self.csv_file = open(self.outfile, "a+") self.csv_writer = csv.writer(self.csv_file, delimiter=",") - + if self.results is not None: - self.csv_results = open(self.results, "a+") + self.csv_results = open(self.results, "a+") self.csv_results_writer = csv.writer(self.csv_results, delimiter=",") - for (radio_, ssid_, ssid_password_, ssid_security_, wifimode_,\ - reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ - in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, wifimode_list,\ - reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): + for (radio_, ssid_, ssid_password_, ssid_security_, wifimode_, + reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ + in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, wifimode_list, + reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): self.station_profile = self.new_station_profile() self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = ssid_ self.station_profile.ssid_pass = ssid_password_ self.station_profile.security = ssid_security_ - self.station_profile.mode = wifimode_ + self.station_profile.mode = wifimode_ self.station_profile.number_template = self.number_template - self.station_profile.mode = wifimode_ - self.station_profile.set_reset_extra(reset_port_enable=reset_port_enable_,\ - test_duration=self.duration_time_to_seconds(self.test_duration),\ - reset_port_min_time=self.duration_time_to_seconds(reset_port_time_min_),\ - reset_port_max_time=self.duration_time_to_seconds(reset_port_time_max_)) + self.station_profile.mode = wifimode_ + self.station_profile.set_reset_extra(reset_port_enable=reset_port_enable_, + test_duration=self.duration_time_to_seconds(self.test_duration), + reset_port_min_time=self.duration_time_to_seconds( + reset_port_time_min_), + reset_port_max_time=self.duration_time_to_seconds( + reset_port_time_max_)) self.station_profiles.append(self.station_profile) - + self.multicast_profile.host = self.lfclient_host self.cx_profile.host = self.lfclient_host self.cx_profile.port = self.lfclient_port @@ -974,14 +1102,14 @@ class L3VariableTime(Realm): def time_stamp(self): return time.strftime('%Y-%m-%d %H %M %S', time.localtime(self.epoch_time)) - def __record_rx_dropped_percent(self,rx_drop_percent): + def __record_rx_dropped_percent(self, rx_drop_percent): csv_rx_drop_percent_data = [] print("test_keys {}".format(self.test_keys)) print("self.test_config_dict {}".format(self.test_config_dict)) for key in self.test_keys: csv_rx_drop_percent_data.append(self.test_config_dict[key]) - csv_rx_drop_percent_data.extend([self.epoch_time, self.time_stamp(),'rx_drop_percent']) + csv_rx_drop_percent_data.extend([self.epoch_time, self.time_stamp(), 'rx_drop_percent']) # remove multi cast since downstream only if selected for key in [key for key in rx_drop_percent if "mtx" in key]: del rx_drop_percent[key] @@ -990,25 +1118,25 @@ class L3VariableTime(Realm): elif "downstream" in self.test_config_dict.values(): for key in [key for key in rx_drop_percent if "-B" in key]: del rx_drop_percent[key] - - filtered_values = [v for _, v in rx_drop_percent.items() if v !=0] + filtered_values = [v for _, v in rx_drop_percent.items() if v != 0] average_rx_drop_percent = sum(filtered_values) / len(filtered_values) if len(filtered_values) != 0 else 0 - csv_performance_rx_drop_percent_values=sorted(rx_drop_percent.items(), key=lambda x: (x[1],x[0]), reverse=False) - csv_performance_rx_drop_percent_values=self.csv_validate_list(csv_performance_rx_drop_percent_values,5) + csv_performance_rx_drop_percent_values = sorted(rx_drop_percent.items(), key=lambda x: (x[1], x[0]), + reverse=False) + csv_performance_rx_drop_percent_values = self.csv_validate_list(csv_performance_rx_drop_percent_values, 5) for i in range(5): - csv_rx_drop_percent_data.append(str(csv_performance_rx_drop_percent_values[i]).replace(',',';')) - for i in range(-1,-6,-1): - csv_rx_drop_percent_data.append(str(csv_performance_rx_drop_percent_values[i]).replace(',',';')) + csv_rx_drop_percent_data.append(str(csv_performance_rx_drop_percent_values[i]).replace(',', ';')) + for i in range(-1, -6, -1): + csv_rx_drop_percent_data.append(str(csv_performance_rx_drop_percent_values[i]).replace(',', ';')) csv_rx_drop_percent_data.append(average_rx_drop_percent) for item, value in rx_drop_percent.items(): - #logg.info(item, "rx drop percent: ", rx_drop_percent[item]) + # logg.info(item, "rx drop percent: ", rx_drop_percent[item]) csv_rx_drop_percent_data.append(rx_drop_percent[item]) - self.csv_add_row(csv_rx_drop_percent_data,self.csv_writer,self.csv_file) - self.csv_add_row(csv_rx_drop_percent_data,self.csv_results_writer,self.csv_results) + self.csv_add_row(csv_rx_drop_percent_data, self.csv_writer, self.csv_file) + self.csv_add_row(csv_rx_drop_percent_data, self.csv_results_writer, self.csv_results) def __compare_vals(self, old_list, new_list): passes = 0 @@ -1021,27 +1149,26 @@ class L3VariableTime(Realm): csv_rx_delta_dict = {} test_id = "" - #for key in self.test_keys: + # for key in self.test_keys: # csv_rx_row_data.append(self.test_config_dict[key]) # csv_rx_delta_row_data.append(self.test_config_dict[key]) - for key in [key for key in old_list if "mtx" in key]: del old_list[key] for key in [key for key in new_list if "mtx" in key]: del new_list[key] - filtered_values = [v for _, v in new_list.items() if v !=0] - average_rx= sum(filtered_values) / len(filtered_values) if len(filtered_values) != 0 else 0 + filtered_values = [v for _, v in new_list.items() if v != 0] + average_rx = sum(filtered_values) / len(filtered_values) if len(filtered_values) != 0 else 0 # only evaluate upstream or downstream new_evaluate_list = new_list.copy() - print("new_evaluate_list before",new_evaluate_list) + print("new_evaluate_list before", new_evaluate_list) if "upstream" in self.test_config_dict.values(): for key in [key for key in new_evaluate_list if "-A" in key]: del new_evaluate_list[key] print("upstream in dictionary values") - elif "downstream" in self.test_config_dict.values(): + elif "downstream" in self.test_config_dict.values(): for key in [key for key in new_evaluate_list if "-B" in key]: del new_evaluate_list[key] print("downstream in dictionary values") - #follow code left in for now, provides the best 5 worst 5 + # follow code left in for now, provides the best 5 worst 5 '''print("new_evaluate_list after",new_evaluate_list) csv_performance_values=sorted(new_evaluate_list.items(), key=lambda x: (x[1],x[0]), reverse=False) csv_performance_values=self.csv_validate_list(csv_performance_values,5) @@ -1056,24 +1183,24 @@ class L3VariableTime(Realm): if "upstream" in self.test_config_dict.values(): for key in [key for key in old_evaluate_list if "-A" in key]: del old_evaluate_list[key] print("upstream in dictionary values") - elif "downstream" in self.test_config_dict.values(): + elif "downstream" in self.test_config_dict.values(): for key in [key for key in old_evaluate_list if "-B" in key]: del old_evaluate_list[key] print("downstream in dictionary values") if len(old_evaluate_list) == len(new_evaluate_list): for item, value in old_evaluate_list.items(): - expected_passes +=1 + expected_passes += 1 print("ITEM: {} VALUE: {}".format(item, value)) if new_evaluate_list[item] > old_evaluate_list[item]: passes += 1 - #if self.debug: logg.info(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", new_evaluate_list[item] - old_evaluate_list[item]) - print(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", new_evaluate_list[item] - old_evaluate_list[item]) + # if self.debug: logg.info(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", new_evaluate_list[item] - old_evaluate_list[item]) + print(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", + new_evaluate_list[item] - old_evaluate_list[item]) else: print("Failed to increase rx data: ", item, new_evaluate_list[item], old_evaluate_list[item]) if not self.csv_started: csv_rx_headers.append(item) - csv_rx_delta_dict.update({item:(new_evaluate_list[item] - old_evaluate_list[item])}) - + csv_rx_delta_dict.update({item: (new_evaluate_list[item] - old_evaluate_list[item])}) if not self.csv_started: csv_header = self.csv_generate_column_headers() @@ -1081,7 +1208,7 @@ class L3VariableTime(Realm): logg.info(csv_header) self.csv_add_column_headers(csv_header) csv_results = self.csv_generate_column_results_headers() - #csv_results += csv_rx_headers + # csv_results += csv_rx_headers self.csv_add_column_headers_results(csv_results) print("###################################") print(csv_results) @@ -1090,24 +1217,23 @@ class L3VariableTime(Realm): self.csv_started = True # need to generate list first to determine worst and best - filtered_values = [v for _, v in csv_rx_delta_dict.items() if v !=0] - #average_rx_delta= sum(filtered_values) / len(filtered_values) if len(filtered_values) != 0 else 0 + filtered_values = [v for _, v in csv_rx_delta_dict.items() if v != 0] + # average_rx_delta= sum(filtered_values) / len(filtered_values) if len(filtered_values) != 0 else 0 for key in self.test_keys: csv_rx_row_data.append(self.test_config_dict[key]) csv_result_row_data.append(self.test_config_dict[key]) csv_rx_delta_row_data.append(self.test_config_dict[key]) - - max_tp_mbps = sum(filtered_values) + + max_tp_mbps = sum(filtered_values) csv_rx_row_data.append(max_tp_mbps) csv_result_row_data.append(max_tp_mbps) - #To do needs to be read or passed in based on test type - expected_tp_mbps = max_tp_mbps + # To do needs to be read or passed in based on test type + expected_tp_mbps = max_tp_mbps csv_rx_row_data.append(expected_tp_mbps) csv_result_row_data.append(expected_tp_mbps) - - #Generate TestID + # Generate TestID for key in self.test_keys: test_id = test_id + "_" + self.test_config_dict[key] @@ -1125,11 +1251,11 @@ class L3VariableTime(Realm): csv_rx_row_data.append("fail") csv_result_row_data.append("fail")''' - csv_rx_row_data.extend([self.epoch_time, self.time_stamp(),'rx_delta']) + csv_rx_row_data.extend([self.epoch_time, self.time_stamp(), 'rx_delta']) csv_result_row_data.extend([self.epoch_time, self.time_stamp()]) print("csv_rx_row_data {}".format(csv_rx_row_data)) - #TODO: may want to pass in the information that needs to be in the csv file into the class + # TODO: may want to pass in the information that needs to be in the csv file into the class ''' csv_rx_row_data.extend([self.epoch_time, self.time_stamp(),'rx']) csv_rx_delta_row_data.extend([self.epoch_time, self.time_stamp(),'rx_delta']) @@ -1142,55 +1268,65 @@ class L3VariableTime(Realm): csv_rx_delta_row_data.append(str(csv_performance_delta_values[i]).replace(',',';')) csv_rx_delta_row_data.append(average_rx_delta)''' - + for item, value in old_evaluate_list.items(): - expected_passes +=1 + expected_passes += 1 if new_evaluate_list[item] > old_evaluate_list[item]: passes += 1 - #if self.debug: logg.info(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", new_evaluate_list[item] - old_evaluate_list[item]) - print(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", new_evaluate_list[item] - old_evaluate_list[item]) + # if self.debug: logg.info(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", new_evaluate_list[item] - old_evaluate_list[item]) + print(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", + new_evaluate_list[item] - old_evaluate_list[item]) else: print("Failed to increase rx data: ", item, new_evaluate_list[item], old_evaluate_list[item]) if not self.csv_started: csv_rx_headers.append(item) # note need to have all upstream and downstream in the csv table thus new_list and old_list - #csv_rx_row_data.append(new_list[item]) + # csv_rx_row_data.append(new_list[item]) # provide delta csv_rx_row_data.append(new_list[item] - old_list[item]) - self.csv_add_row(csv_rx_row_data,self.csv_writer,self.csv_file) - #self.csv_add_row(csv_rx_row_data,self.csv_results_writer,self.csv_results) + self.csv_add_row(csv_rx_row_data, self.csv_writer, self.csv_file) + # self.csv_add_row(csv_rx_row_data,self.csv_results_writer,self.csv_results) - #self.csv_add_row(csv_rx_delta_row_data,self.csv_writer,self.csv_file) + # self.csv_add_row(csv_rx_delta_row_data,self.csv_writer,self.csv_file) if passes == expected_passes: return True, max_tp_mbps, csv_result_row_data else: return False, max_tp_mbps, csv_result_row_data else: - print("Old-list length: %i new: %i does not match in compare-vals."%(len(old_list), len(new_list))) - print("old-list:",old_list) - print("new-list:",new_list) - return False, None, None # check to see if this is valid + print("Old-list length: %i new: %i does not match in compare-vals." % (len(old_list), len(new_list))) + print("old-list:", old_list) + print("new-list:", new_list) + return False, None, None # check to see if this is valid def reset_port_check(self): for station_profile in self.station_profiles: if station_profile.reset_port_extra_data['reset_port_enable']: if not station_profile.reset_port_extra_data['reset_port_timer_started']: - logg.info("reset_port_time_min: {}".format(station_profile.reset_port_extra_data['reset_port_time_min'])) - logg.info("reset_port_time_max: {}".format(station_profile.reset_port_extra_data['reset_port_time_max'])) + logg.info( + "reset_port_time_min: {}".format(station_profile.reset_port_extra_data['reset_port_time_min'])) + logg.info( + "reset_port_time_max: {}".format(station_profile.reset_port_extra_data['reset_port_time_max'])) station_profile.reset_port_extra_data['seconds_till_reset'] = \ - random.randint(station_profile.reset_port_extra_data['reset_port_time_min'],\ - station_profile.reset_port_extra_data['reset_port_time_max']) + random.randint(station_profile.reset_port_extra_data['reset_port_time_min'], + station_profile.reset_port_extra_data['reset_port_time_max']) station_profile.reset_port_extra_data['reset_port_timer_started'] = True - logg.info("on radio {} seconds_till_reset {}".format(station_profile.add_sta_data['radio'],station_profile.reset_port_extra_data['seconds_till_reset'])) + logg.info("on radio {} seconds_till_reset {}".format(station_profile.add_sta_data['radio'], + station_profile.reset_port_extra_data[ + 'seconds_till_reset'])) else: - station_profile.reset_port_extra_data['seconds_till_reset'] = station_profile.reset_port_extra_data['seconds_till_reset'] - 1 - if self.debug: logg.info("radio: {} countdown seconds_till_reset {}".format(station_profile.add_sta_data['radio'] ,station_profile.reset_port_extra_data['seconds_till_reset'])) - if ((station_profile.reset_port_extra_data['seconds_till_reset'] <= 0)): + station_profile.reset_port_extra_data['seconds_till_reset'] = station_profile.reset_port_extra_data[ + 'seconds_till_reset'] - 1 + if self.debug: logg.info( + "radio: {} countdown seconds_till_reset {}".format(station_profile.add_sta_data['radio'], + station_profile.reset_port_extra_data[ + 'seconds_till_reset'])) + if station_profile.reset_port_extra_data['seconds_till_reset'] <= 0: station_profile.reset_port_extra_data['reset_port_timer_started'] = False - port_to_reset = random.randint(0,len(station_profile.station_names)-1) - logg.info("reset on radio {} station: {}".format(station_profile.add_sta_data['radio'],station_profile.station_names[port_to_reset])) + port_to_reset = random.randint(0, len(station_profile.station_names) - 1) + logg.info("reset on radio {} station: {}".format(station_profile.add_sta_data['radio'], + station_profile.station_names[port_to_reset])) self.reset_port(station_profile.station_names[port_to_reset]) def pre_cleanup(self): @@ -1204,12 +1340,12 @@ class L3VariableTime(Realm): # Make sure they are gone count = 0 - while (count < 10): + while count < 10: more = False for station_list in self.station_lists: for sta in station_list: rv = self.rm_port(sta, check_exists=True) - if (rv): + if rv: more = True if not more: break @@ -1223,32 +1359,35 @@ class L3VariableTime(Realm): station_profile.set_number_template(station_profile.number_template) logg.info("Creating stations") - station_profile.create(radio=self.radio_name_list[index], sta_names_=self.station_lists[index], debug=self.debug, sleep_time=0) + station_profile.create(radio=self.radio_name_list[index], sta_names_=self.station_lists[index], + debug=self.debug, sleep_time=0) index += 1 # 12/4/2020 put back in multi cast - #for etype in self.endp_types: + # for etype in self.endp_types: # if etype == "mc_udp" or etype == "mc_udp6": # logg.info("Creating Multicast connections for endpoint type: %s"%(etype)) # self.multicast_profile.create_mc_tx(etype, self.side_b, etype) # self.multicast_profile.create_mc_rx(etype, side_rx=station_profile.station_names) - + for _tos in self.tos: - logg.info("Creating connections for endpoint type: {} TOS: {} stations_names {}".format(self.endp_type, _tos, station_profile.station_names)) - self.cx_profile.create(endp_type=self.endp_type, side_a=station_profile.station_names, side_b=self.side_b, sleep_time=0, tos=_tos) - self._pass("PASS: Stations build finished") - + logg.info( + "Creating connections for endpoint type: {} TOS: {} stations_names {}".format(self.endp_type, _tos, + station_profile.station_names)) + self.cx_profile.create(endp_type=self.endp_type, side_a=station_profile.station_names, + side_b=self.side_b, sleep_time=0, tos=_tos) + self._pass("PASS: Stations build finished") + def station_bringup(self): client_density = 0 logg.info("Bringing up stations") - self.admin_up(self.side_b) + self.admin_up(self.side_b) for station_profile in self.station_profiles: for sta in station_profile.station_names: - logg.info("Bringing up station %s"%(sta)) + logg.info("Bringing up station %s" % sta) self.admin_up(sta) client_density += 1 - temp_stations_list = [] temp_stations_list.append(self.side_b) for station_profile in self.station_profiles: @@ -1258,8 +1397,8 @@ class L3VariableTime(Realm): logg.info("ip's acquired") else: logg.info("print failed to get IP's") - exit(1) # why continue - + exit(1) # why continue + return client_density def read_channel(self): @@ -1268,22 +1407,26 @@ class L3VariableTime(Realm): pss = "" try: logg.info("\ - scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"advanced")) + scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "advanced")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "advanced"], - capture_output=True, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "advanced"], + capture_output=True, check=True) pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) logg.info("controller_show_ap_summary::: pss {}".format(pss)) @@ -1295,25 +1438,28 @@ class L3VariableTime(Realm): cc_power = "" cc_dbm = "" for line in pss.splitlines(): - if (line.startswith("---------")): + if line.startswith("---------"): searchap = True continue # if the pattern changes save the output of the advanced command and re parse https://regex101.com - if (searchap): - pat = "%s\s+(\S+)\s+(%s)\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+(\S+)\s+dBm\)+\s+(\S+)+\s"%(self.ap,self.ap_slot) + if searchap: + pat = "%s\s+(\S+)\s+(%s)\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+(\S+)\s+dBm\)+\s+(\S+)+\s" % ( + self.ap, self.ap_slot) m = re.search(pat, line) - if (m != None): - if(m.group(2) == self.ap_slot): + if m != None: + if m.group(2) == self.ap_slot: cc_mac = m.group(1) cc_slot = m.group(2) - cc_ch = m.group(6); # (132,136,140,144) + cc_ch = m.group(6) # (132,136,140,144) cc_power = m.group(4) - cc_power = cc_power.replace("/", " of ") # spread-sheets turn 1/8 into a date + cc_power = cc_power.replace("/", " of ") # spread-sheets turn 1/8 into a date cc_dbm = m.group(5) - cc_dbm = cc_dbm.replace("(","") + cc_dbm = cc_dbm.replace("(", "") cc_ch_count = cc_ch.count(",") + 1 cc_bw = m.group(3) - logg.info("group 1: {} 2: {} 3: {} 4: {} 5: {} 6: {}".format(m.group(1),m.group(2),m.group(3),m.group(4),m.group(5),m.group(6))) + logg.info( + "group 1: {} 2: {} 3: {} 4: {} 5: {} 6: {}".format(m.group(1), m.group(2), m.group(3), + m.group(4), m.group(5), m.group(6))) logg.info("9800 test_parameters cc_mac: read : {}".format(cc_mac)) logg.info("9800 test_parameters cc_slot: read : {}".format(cc_slot)) logg.info("9800 test_parameters cc_count: read : {}".format(cc_ch_count)) @@ -1331,22 +1477,22 @@ class L3VariableTime(Realm): cc_dbm = "" ch_count = "" for line in pss.splitlines(): - if (line.startswith("---------")): + if line.startswith("---------"): searchap = True continue - - if (searchap): - pat = "%s\s+(\S+)\s+\S+\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+\(\s*(\S+)\s+dBm"%(self.ap) + + if searchap: + pat = "%s\s+(\S+)\s+\S+\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+\(\s*(\S+)\s+dBm" % self.ap m = re.search(pat, line) - if (m != None): + if m != None: cc_mac = m.group(1) - cc_ch = m.group(2); # (132,136,140,144) + cc_ch = m.group(2) # (132,136,140,144) cc_power = m.group(3) - cc_power = cc_power.replace("/", " of ", 1) # spread-sheets turn 1/8 into a date + cc_power = cc_power.replace("/", " of ", 1) # spread-sheets turn 1/8 into a date cc_dbm = m.group(4) ch_count = cc_ch.count(",") cc_bw = 20 * (ch_count + 1) - + logg.info("3504 test_parameters cc_mac: read : {}".format(cc_mac)) logg.info("3504 test_parameters cc_count: read : {}".format(ch_count)) logg.info("3504 test_parameters cc_bw: read : {}".format(cc_bw)) @@ -1354,7 +1500,7 @@ class L3VariableTime(Realm): logg.info("3504 test_parameters cc_dbm: read : {}".format(cc_dbm)) logg.info("3504 test_parameters cc_ch: read : {}".format(cc_ch)) - return cc_ch + return cc_ch def read_auto_rf(self): @@ -1362,34 +1508,38 @@ class L3VariableTime(Realm): pss = "" try: logg.info("\ - scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"advanced")) + scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "advanced")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "auto_rf"], - capture_output=True, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "auto_rf"], + capture_output=True, check=True) pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". format(process_error.returncode, process_error.output)) - time.sleep(1) + time.sleep(1) exit(1) blacklist_time = "" for line in pss.splitlines(): - pat = 'Channel\s+%s\S+\s+(\S+)\s+\S+\s+remaining'%(self.chan_5ghz) + pat = 'Channel\s+%s\S+\s+(\S+)\s+\S+\s+remaining' % self.chan_5ghz m = re.search(pat, line) - if ( m != None ): + if m != None: blacklist_time = m.group(1) - logg.info("dfs_channel: {} blacklist_time: {}".format(self.chan_5ghz,blacklist_time)) + logg.info("dfs_channel: {} blacklist_time: {}".format(self.chan_5ghz, blacklist_time)) return blacklist_time - def dfs_waveforms(self,waveform): + def dfs_waveforms(self, waveform): # 1, 2, 3, 4, 5, 11, 12, 13, 14, 15, 16 # "FCCO" , "FCC1" , "FCC2" , "FCC3", "FCC4", "FCC5", "ETSI1", "ETSI2", "ETSI3", "ETSI4", "ETSI5", "ETSI6" if waveform == "FCCO": @@ -1443,10 +1593,10 @@ class L3VariableTime(Realm): return width, interval, count - def dfs_get_frequency(self,channel): + def dfs_get_frequency(self, channel): # possibly have a dictionary - if channel == "36": + if channel == "36": frequency = "5180000" elif channel == "38": frequency = "5190000" @@ -1511,15 +1661,14 @@ class L3VariableTime(Realm): logg.info("Invalid Channel") exit(1) return frequency - - def dfs_send_radar(self,channel): + def dfs_send_radar(self, channel): # Hard coded to FCC0 - need to support others width_ = "1" interval_ = "1428" count_ = "18" frequency_ = "5260000" # channel 52 - #sweep_time_ = "1000" + # sweep_time_ = "1000" sweep_time_ = "0" if_gain_ = "40" bb_gain_ = "20" @@ -1537,7 +1686,7 @@ class L3VariableTime(Realm): time.sleep(0.4) # for testing bash - i = child.expect([r'\$',pexpect.TIMEOUT],timeout=2) + i = child.expect([r'\$', pexpect.TIMEOUT], timeout=2) if i == 0: logg.info("i: {} received bash prompt for hackrf command".format(i)) if i == 1: @@ -1574,65 +1723,91 @@ class L3VariableTime(Realm): ################################# # With timeouts ################################# - command_hackRF = "sudo python lf_hackrf.py --pulse_width {} --pulse_interval {} --pulse_count {} --sweep_time {} --freq {} --if_gain {} --bb_gain {} --gain {}".format(width_,interval_,count_,sweep_time_,frequency_,if_gain_,bb_gain_,gain_) + command_hackRF = "sudo python lf_hackrf.py --pulse_width {} --pulse_interval {} --pulse_count {} --sweep_time {} --freq {} --if_gain {} --bb_gain {} --gain {}".format( + width_, interval_, count_, sweep_time_, frequency_, if_gain_, bb_gain_, gain_) logg.info("hackrf command {}".format(command_hackRF)) child.sendline(command_hackRF) time.sleep(0.4) - i = child.expect(['lanforge:',pexpect.TIMEOUT], timeout=2) + i = child.expect(['lanforge:', pexpect.TIMEOUT], timeout=2) if i == 0: - logg.info("lanforge prompt received i: {} before {} after {}".format(i,child.before.decode('utf-8', 'ignore'),child.after.decode('utf-8', 'ignore'))) + logg.info( + "lanforge prompt received i: {} before {} after {}".format(i, child.before.decode('utf-8', 'ignore'), + child.after.decode('utf-8', 'ignore'))) child.sendline('lanforge') time.sleep(0.4) self.dfs_epoch_start = int(time.time()) - j = child.expect(['>>>',pexpect.TIMEOUT], timeout=5) + j = child.expect(['>>>', pexpect.TIMEOUT], timeout=5) if j == 0: - logg.info(">>> prompt received i: {} j: {} before {} after {}".format(i,j,child.before.decode('utf-8', 'ignore'),child.after.decode('utf-8', 'ignore'))) + logg.info(">>> prompt received i: {} j: {} before {} after {}".format(i, j, child.before.decode('utf-8', + 'ignore'), + child.after.decode('utf-8', + 'ignore'))) logg.info("Let the radar run for {}".format(self.radar_duration_seconds)) time.sleep(self.radar_duration_seconds) - child.sendline('s') # stop + child.sendline('s') # stop time.sleep(0.4) - k = child.expect(['>>>',pexpect.TIMEOUT], timeout=2) + k = child.expect(['>>>', pexpect.TIMEOUT], timeout=2) if k == 0: - logg.info(">>> prompt received i: {} j: {} k: {} before {} after {}".format(i,j,k,child.before.decode('utf-8', 'ignore'),child.after.decode('utf-8', 'ignore'))) + logg.info(">>> prompt received i: {} j: {} k: {} before {} after {}".format(i, j, k, + child.before.decode( + 'utf-8', 'ignore'), + child.after.decode( + 'utf-8', 'ignore'))) logg.info("send q - for quit") child.sendline('q') time.sleep(1) if k == 1: - logg.info("TIMEOUT hackrf >>> prompt i: {} j: {} k: {} before {} after {}".format(i,j,k,child.before.decode('utf-8', 'ignore'),child.after)) + logg.info("TIMEOUT hackrf >>> prompt i: {} j: {} k: {} before {} after {}".format(i, j, k, + child.before.decode( + 'utf-8', + 'ignore'), + child.after)) if j == 1: - logg.info("TIMEOUT hackrf >>> prompt i: {} j: {} before {} after {}".format(i,j,child.before.decode('utf-8', 'ignore'),child.after)) + logg.info("TIMEOUT hackrf >>> prompt i: {} j: {} before {} after {}".format(i, j, + child.before.decode('utf-8', + 'ignore'), + child.after)) if i == 1: - logg.info("TIMEOUT lanforge password prompt i: {} before {} after {}".format(i,child.before.decode('utf-8', 'ignore'),child.after)) - + logg.info("TIMEOUT lanforge password prompt i: {} before {} after {}".format(i, child.before.decode('utf-8', + 'ignore'), + child.after)) + time.sleep(2) def ap_cac_verify(self): - if(bool(self.ap_dict)): + if bool(self.ap_dict): pss = "" # will need to verify that timer has timed out on AP - need in results logg.info("DFS channel 5ghz {} done waiting CAC time, 2.4 ghz: {}".format(self.chan_5ghz, self.chan_24ghz)) - logg.info("##################################################################") + logg.info("##################################################################") logg.info("# READ changed to DFS channel {}, running CAC for 60 seconds.".format(self.chan_5ghz)) - logg.info("# READ AP CAC_EXPIRY_EVT: CAC finished on DFS channel ") + logg.info("# READ AP CAC_EXPIRY_EVT: CAC finished on DFS channel ") logg.info("##################################################################") logg.info("ap_dict {}".format(self.ap_dict)) - logg.info("Read AP action: {} ap_scheme: {} ap_ip: {} ap_port: {} ap_user: {} ap_pw: {} ap_tty: {} ap_baud: {}".format("show_log",self.ap_dict['ap_scheme'],self.ap_dict['ap_ip'],self.ap_dict["ap_port"], - self.ap_dict['ap_user'],self.ap_dict['ap_pw'],self.ap_dict['ap_tty'],self.ap_dict['ap_baud'])) + logg.info( + "Read AP action: {} ap_scheme: {} ap_ip: {} ap_port: {} ap_user: {} ap_pw: {} ap_tty: {} ap_baud: {}".format( + "show_log", self.ap_dict['ap_scheme'], self.ap_dict['ap_ip'], self.ap_dict["ap_port"], + self.ap_dict['ap_user'], self.ap_dict['ap_pw'], self.ap_dict['ap_tty'], self.ap_dict['ap_baud'])) try: logg.info("ap_ctl.py: read for CAC timer and CAC_EXPIRY_EVT") # TODO remove position dependence if in tree - ap_info= subprocess.run(["./../ap_ctl.py", "--scheme", self.ap_dict['ap_scheme'], "--prompt", self.ap_dict['ap_prompt'],"--dest", self.ap_dict['ap_ip'], "--port", self.ap_dict["ap_port"], - "--user", self.ap_dict['ap_user'], "--passwd", self.ap_dict['ap_pw'],"--tty", self.ap_dict['ap_tty'],"--baud", self.ap_dict['ap_baud'],"--action", "show_log"],capture_output=True, check=True) + ap_info = subprocess.run( + ["./../ap_ctl.py", "--scheme", self.ap_dict['ap_scheme'], "--prompt", self.ap_dict['ap_prompt'], + "--dest", self.ap_dict['ap_ip'], "--port", self.ap_dict["ap_port"], + "--user", self.ap_dict['ap_user'], "--passwd", self.ap_dict['ap_pw'], "--tty", + self.ap_dict['ap_tty'], "--baud", self.ap_dict['ap_baud'], "--action", "show_log"], + capture_output=True, check=True) try: pss = ap_info.stdout.decode('utf-8', 'ignore') except: logg.info("ap_info was of type NoneType will set pss empty") - + except subprocess.CalledProcessError as process_error: - logg.info("###################################################") - logg.info("# CHECK IF AP HAS CONNECTION ALREADY ACTIVE") - logg.info("###################################################") - logg.info("# Unable to commicate to AP error code: {} output {}".format(process_error.returncode, process_error.output)) + logg.info("###################################################") + logg.info("# CHECK IF AP HAS CONNECTION ALREADY ACTIVE") + logg.info("###################################################") + logg.info("# Unable to commicate to AP error code: {} output {}".format(process_error.returncode, + process_error.output)) logg.info("###################################################") logg.info(pss) # fine CAC_TIMER @@ -1640,10 +1815,10 @@ class L3VariableTime(Realm): logg.info("ap: CAC_EXPIRY_EVT {}".format(line)) pat = 'changed to DFS channel\s+(\S+),\s+\S+\s+\S+\s+\S+\s+(\S+)' m = re.search(pat, line) - if (m != None): + if m != None: dfs_channel = m.group(1) cac_time = m.group(2) - logg.info("dfs_channel: {} cac_time: {}".format(dfs_channel,cac_time)) + logg.info("dfs_channel: {} cac_time: {}".format(dfs_channel, cac_time)) logg.info("dfs_cac line: {}".format(line)) self.CAC_TIMER = line break @@ -1653,7 +1828,7 @@ class L3VariableTime(Realm): logg.info("ap: CAC_EXPIRY_EVT {}".format(line)) pat = 'CAC_EXPIRY_EVT:\s+\S+\s+\S+\s+\S+\s\S+\s\S+\s(\S+)' m = re.search(pat, line) - if (m != None): + if m != None: dfs_channel = m.group(1) logg.info("dfs_channel: {}".format(dfs_channel)) logg.info("dfs_channel line: {}".format(line)) @@ -1661,15 +1836,13 @@ class L3VariableTime(Realm): else: logg.info("ap_dict not set") - def start(self, print_pass=False, print_fail=False): + def start(self, print_pass=False, print_fail=False): best_max_tp_mbps = 0 best_csv_rx_row_data = " " max_tp_mbps = 0 csv_rx_row_data = " " Result = False - - # verify the AP CAC timer and experation self.ap_cac_verify() @@ -1680,13 +1853,14 @@ class L3VariableTime(Realm): logg.info("# INITIAL CHANNEL: {}".format(initial_channel)) logg.info("###########################################") - if (initial_channel != self.chan_5ghz): + if initial_channel != self.chan_5ghz: logg.info("##################################################################") - logg.info("# DFS LOCKOUT? COMMAND LINE CHANNEL: {} NOT EQUAL INITIAL CONTROLLER CHANNEL: {}".format(self.chan_5ghz,initial_channel)) + logg.info("# DFS LOCKOUT? COMMAND LINE CHANNEL: {} NOT EQUAL INITIAL CONTROLLER CHANNEL: {}".format( + self.chan_5ghz, initial_channel)) logg.info("##################################################################") time.sleep(30) - + logg.info("Starting multicast traffic (if any configured)") self.multicast_profile.start_mc(debug_=self.debug) self.multicast_profile.refresh_mc(debug_=self.debug) @@ -1700,7 +1874,7 @@ class L3VariableTime(Realm): end_time = self.parse_time(self.test_duration) + cur_time - logg.info("Monitoring throughput for duration: %s"%(self.test_duration)) + logg.info("Monitoring throughput for duration: %s" % self.test_duration) passes = 0 expected_passes = 0 @@ -1725,7 +1899,7 @@ class L3VariableTime(Realm): logg.info("################################################################") time.sleep(1) - + self.epoch_time = int(time.time()) new_rx_values, rx_drop_percent = self.__get_rx_values() @@ -1752,39 +1926,39 @@ class L3VariableTime(Realm): self._fail("FAIL: Not all stations increased traffic", print_fail) old_rx_values = new_rx_values - #percentage dropped not needed for scaling and performance , needed for longevity - #self.__record_rx_dropped_percent(rx_drop_percent) + # percentage dropped not needed for scaling and performance , needed for longevity + # self.__record_rx_dropped_percent(rx_drop_percent) cur_time = datetime.datetime.now() - final_channel = self.read_channel() logg.info("###########################################") logg.info("# FINAL CHANNEL : {}".format(final_channel)) logg.info("###########################################") - dfs_channel_bw20_values = [52, 56, 60, 64, 68, 96, 100, 104, 108, 112, 116, 120, 124 ,128, 132, 136, 140, 144] + dfs_channel_bw20_values = [52, 56, 60, 64, 68, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144] pass_fail = "pass" if int(final_channel) in dfs_channel_bw20_values: logg.info("FAIL: The DFS channel did not change or initial channel was not DFS") pass_fail = "fail" - if (initial_channel != self.chan_5ghz): - logg.info("FAIL: channel set on command line: {} not configured in controller: {} is there a DFS lockout condition".format(self.chan_5ghz,initial_channel)) + if initial_channel != self.chan_5ghz: + logg.info( + "FAIL: channel set on command line: {} not configured in controller: {} is there a DFS lockout condition".format( + self.chan_5ghz, initial_channel)) pass_fail = "fail" blacklist_time = self.read_auto_rf() - best_csv_rx_row_data.append(initial_channel) best_csv_rx_row_data.append(final_channel) best_csv_rx_row_data.append(pass_fail) best_csv_rx_row_data.append(self.CAC_TIMER) best_csv_rx_row_data.append(self.CAC_EXPIRY_EVT) best_csv_rx_row_data.append(blacklist_time) - self.csv_add_row(best_csv_rx_row_data,self.csv_results_writer,self.csv_results) + self.csv_add_row(best_csv_rx_row_data, self.csv_results_writer, self.csv_results) # TO DO check to see if the data is still being transmitted if passes == expected_passes: @@ -1802,12 +1976,10 @@ class L3VariableTime(Realm): self.multicast_profile.cleanup() for station_profile in self.station_profiles: station_profile.cleanup() - - + def csv_generate_column_headers(self): - csv_rx_headers = self.test_keys.copy() - csv_rx_headers.extend - csv_rx_headers.extend(['max_tp_mbps','expected_tp','test_id','epoch_time','time','monitor','pass_fail']) + csv_rx_headers = self.test_keys.copy() + csv_rx_headers.extend(['max_tp_mbps', 'expected_tp', 'test_id', 'epoch_time', 'time', 'monitor', 'pass_fail']) '''for i in range(1,6): csv_rx_headers.append("least_rx_data {}".format(i)) for i in range(1,6): @@ -1816,9 +1988,10 @@ class L3VariableTime(Realm): return csv_rx_headers def csv_generate_column_results_headers(self): - csv_rx_headers = self.test_keys.copy() - csv_rx_headers.extend - csv_rx_headers.extend(['max_tp_mbps','expected_tp','test_id','epoch_time','time','initial_channel','final_channel','pass_fail','cac_timer','cac_expiry_evt','blacklist_time_sec_remaining']) + csv_rx_headers = self.test_keys.copy() + csv_rx_headers.extend( + ['max_tp_mbps', 'expected_tp', 'test_id', 'epoch_time', 'time', 'initial_channel', 'final_channel', + 'pass_fail', 'cac_timer', 'cac_expiry_evt', 'blacklist_time_sec_remaining']) '''for i in range(1,6): csv_rx_headers.append("least_rx_data {}".format(i)) for i in range(1,6): @@ -1826,27 +1999,27 @@ class L3VariableTime(Realm): csv_rx_headers.append("average_rx_data")''' return csv_rx_headers - - def csv_add_column_headers(self,headers): + def csv_add_column_headers(self, headers): if self.csv_file is not None: self.csv_writer.writerow(headers) self.csv_file.flush() - def csv_add_column_headers_results(self,headers): + def csv_add_column_headers_results(self, headers): if self.csv_results is not None: self.csv_results_writer.writerow(headers) - self.csv_results.flush() + self.csv_results.flush() def csv_validate_list(self, csv_list, length): if len(csv_list) < length: - csv_list = csv_list + [('no data','no data')] * (length - len(csv_list)) + csv_list = csv_list + [('no data', 'no data')] * (length - len(csv_list)) return csv_list - def csv_add_row(self,row,writer,csv_file): # can make two calls eventually + def csv_add_row(self, row, writer, csv_file): # can make two calls eventually if csv_file is not None: writer.writerow(row) csv_file.flush() + ######################################### # # AP helper functions @@ -1856,13 +2029,15 @@ class L3VariableTime(Realm): def valid_endp_types(_endp_type): etypes = _endp_type.split() for endp_type in etypes: - valid_endp_type=['lf_udp','lf_udp6','lf_tcp','lf_tcp6','mc_udp','mc_udp6'] + valid_endp_type = ['lf_udp', 'lf_udp6', 'lf_tcp', 'lf_tcp6', 'mc_udp', 'mc_udp6'] if not (str(endp_type) in valid_endp_type): - logg.info('invalid endp_type: %s. Valid types lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6' % endp_type) + logg.info( + 'invalid endp_type: %s. Valid types lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6' % endp_type) exit(1) return _endp_type -########################################## + +########################################## # Traffic Generation End ########################################## @@ -1876,12 +2051,12 @@ def main(): parser = argparse.ArgumentParser( prog='lf_dfs_test.py', - #formatter_class=argparse.RawDescriptionHelpFormatter, + # formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawTextHelpFormatter, epilog='''\ Scaling and Performance ''', - + description='''\ lf_dfs_test.py: -------------------- @@ -2095,95 +2270,136 @@ Sample script 2/11/2021 # reorder to follow looping - parser.add_argument('-cca' ,'--controller_ap', help='--controller_ap List of APs to test default: Axel',default="APA453.0E7B.CF9C") - parser.add_argument('-ccf' ,'--controller_band', help='--controller_band default a',default="a") + parser.add_argument('-cca', '--controller_ap', help='--controller_ap List of APs to test default: Axel', + default="APA453.0E7B.CF9C") + parser.add_argument('-ccf', '--controller_band', help='--controller_band default a', default="a") # controller wanted 11ax , 11ac, 11n, 11gb - parser.add_argument('-cwm' ,'--controller_wifimode', help='List of of wifi mode to test <11ax 11ac 11n 11gb> default: an',default="an", - choices=[ "auto", "a", "b", "g", "abg", "abgn", "bgn", "bg", "abgnAC", "anAC", "an", "bgnAC", "abgnAX", "bgnAX", "anAX"]) + parser.add_argument('-cwm', '--controller_wifimode', + help='List of of wifi mode to test <11ax 11ac 11n 11gb> default: an', default="an", + choices=["auto", "a", "b", "g", "abg", "abgn", "bgn", "bg", "abgnAC", "anAC", "an", "bgnAC", + "abgnAX", "bgnAX", "anAX"]) - parser.add_argument('-cc5','--controller_chan_5ghz', help='--controller_chan_5ghz <36 40 ...> default 36',default="36") - parser.add_argument('-cc2','--controller_chan_24ghz', help='--controller_chan_24ghz <1 2 ...> default 1',default="1") - parser.add_argument('-ccw','--controller_chan_width', help='--controller_chan_width <20 40 80 160> default: 20',default="20") - parser.add_argument('-cam','--controller_ap_mode', help='--controller_ap_mode default local',default="local") - parser.add_argument('-cps','--controller_packet_size', help='--controller_packet_size List of packet sizes <88 512 1370 1518> default 1518 ',default="1518" ) - parser.add_argument('-ctd','--controller_directions', help='--controller_directions default: upstream downstream ',default="upstream downstream" ) - parser.add_argument('-ccd','--controller_client_density', help='--controller_client_density List of client densities <1 10 20 50 100 200> default 1 ', - default="1" ) - #TODO set str for ones that are str - parser.add_argument('-cde','--controller_data_encryption', help='--controller_data_encryption \"enable disable\"',default="disable" ) - parser.add_argument('-cs' ,'--controller_series', help='--controller_series <9800 | 3504>',default="3504",choices=["9800","3504"]) - parser.add_argument('-ccp','--controller_prompt', type=str,help="controller prompt default WLC",default="WLC") - parser.add_argument('-cas','--controller_ap_slot', type=str,help="AP slot, default 1",default="1") + parser.add_argument('-cc5', '--controller_chan_5ghz', help='--controller_chan_5ghz <36 40 ...> default 36', + default="36") + parser.add_argument('-cc2', '--controller_chan_24ghz', help='--controller_chan_24ghz <1 2 ...> default 1', + default="1") + parser.add_argument('-ccw', '--controller_chan_width', help='--controller_chan_width <20 40 80 160> default: 20', + default="20") + parser.add_argument('-cam', '--controller_ap_mode', help='--controller_ap_mode default local', + default="local") + parser.add_argument('-cps', '--controller_packet_size', + help='--controller_packet_size List of packet sizes <88 512 1370 1518> default 1518 ', + default="1518") + parser.add_argument('-ctd', '--controller_directions', + help='--controller_directions default: upstream downstream ', + default="upstream downstream") + parser.add_argument('-ccd', '--controller_client_density', + help='--controller_client_density List of client densities <1 10 20 50 100 200> default 1 ', + default="1") + # TODO set str for ones that are str + parser.add_argument('-cde', '--controller_data_encryption', help='--controller_data_encryption \"enable disable\"', + default="disable") + parser.add_argument('-cs', '--controller_series', help='--controller_series <9800 | 3504>', default="3504", + choices=["9800", "3504"]) + parser.add_argument('-ccp', '--controller_prompt', type=str, help="controller prompt default WLC", default="WLC") + parser.add_argument('-cas', '--controller_ap_slot', type=str, help="AP slot, default 1", default="1") - parser.add_argument('-cc' ,'--controller_ip', help='--controller_ip default 192.168.100.178',default="192.168.100.178") - parser.add_argument('-cp' ,'--controller_port', help='--controller_port ssh default 22',default="22") - parser.add_argument('-cu' ,'--controller_user', help='--controller_user ',default="admin") - parser.add_argument('-cpw','--controller_passwd', help='--controller_passwd ',default="controller123") - parser.add_argument('-ccs','--controller_scheme', help='--controller_scheme (serial|telnet|ssh): connect via serial, ssh or telnet',default="ssh",choices=["serial","telnet","ssh"]) - parser.add_argument('-cw' ,'--controller_wlan', help='--controller_wlan ',required=True) - parser.add_argument('-cwi','--controller_wlanID', help='--controller_wlanID ',required=True) - parser.add_argument('-cws' ,'--controller_wlanSSID', help='--controller_wlanSSID ',required=True) + parser.add_argument('-cc', '--controller_ip', + help='--controller_ip default 192.168.100.178', + default="192.168.100.178") + parser.add_argument('-cp', '--controller_port', + help='--controller_port ssh default 22', default="22") + parser.add_argument('-cu', '--controller_user', help='--controller_user ', + default="admin") + parser.add_argument('-cpw', '--controller_passwd', help='--controller_passwd ', + default="controller123") + parser.add_argument('-ccs', '--controller_scheme', + help='--controller_scheme (serial|telnet|ssh): connect via serial, ssh or telnet', + default="ssh", choices=["serial", "telnet", "ssh"]) + parser.add_argument('-cw', '--controller_wlan', help='--controller_wlan ', required=True) + parser.add_argument('-cwi', '--controller_wlanID', help='--controller_wlanID ', required=True) + parser.add_argument('-cws', '--controller_wlanSSID', help='--controller_wlanSSID ', required=True) - parser.add_argument('-ctp','--controller_tx_power', help='--controller_tx_power <1 | 2 | 3 | 4 | 5 | 6 | 7 | 8> 1 is highest power default NA NA means no change',default="NA" - ,choices=["1","2","3","4","5","6","7","8","NA"]) - parser.add_argument('-dfs','--controller_dfs', help='--controller_dfs, switch to enable dfs testing', action='store_true') - parser.add_argument('-dft','--controller_dfs_time', help='--controller_dfs_time, time to wait prior to sending radar signal default 30s', default='30s') - parser.add_argument('-hrd','--radar_duration', help='--radar_duration, hack rf radar duration default 5s', default='5s') - parser.add_argument('-cco','--cap_ctl_out', help='--cap_ctl_out , switch the controller controller output will be captured', action='store_true') - + parser.add_argument('-ctp', '--controller_tx_power', + help='--controller_tx_power <1 | 2 | 3 | 4 | 5 | 6 | 7 | 8> 1 is highest power default NA NA means no change', + default="NA" + , choices=["1", "2", "3", "4", "5", "6", "7", "8", "NA"]) + parser.add_argument('-dfs', '--controller_dfs', help='--controller_dfs, switch to enable dfs testing', + action='store_true') + parser.add_argument('-dft', '--controller_dfs_time', + help='--controller_dfs_time, time to wait prior to sending radar signal default 30s', + default='30s') + parser.add_argument('-hrd', '--radar_duration', help='--radar_duration, hack rf radar duration default 5s', + default='5s') + parser.add_argument('-cco', '--cap_ctl_out', + help='--cap_ctl_out , switch the controller controller output will be captured', + action='store_true') - parser.add_argument('-apr','--amount_ports_to_reset', help='--amount_ports_to_reset \" \" ', default=None) - parser.add_argument('-prs','--port_reset_seconds', help='--ports_reset_seconds \" \" ', default="10 30") + parser.add_argument('-apr', '--amount_ports_to_reset', + help='--amount_ports_to_reset \" \" ', default=None) + parser.add_argument('-prs', '--port_reset_seconds', help='--ports_reset_seconds \" \" ', + default="10 30") - parser.add_argument('-lm','--mgr', help='--mgr ',default='localhost') - parser.add_argument('-d','--test_duration', help='--test_duration example --time 5d (5 days) default: 2m options: number followed by d, h, m or s',default='2m') - parser.add_argument('-pi','--polling_interval', help="--polling_interval ", default='30s') - parser.add_argument('--tos', help='--tos: Support different ToS settings: BK | BE | VI | VO | numeric',default="BE") - parser.add_argument('-db','--debug', help='--debug: Enable debugging',action='store_true') - parser.add_argument('-t', '--endp_type', help='--endp_type example --endp_type \"lf_udp lf_tcp mc_udp\" Default: lf_tcp, options: lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6', + parser.add_argument('-lm', '--mgr', help='--mgr ', default='localhost') + parser.add_argument('-d', '--test_duration', + help='--test_duration example --time 5d (5 days) default: 2m options: number followed by d, h, m or s', + default='2m') + parser.add_argument('-pi', '--polling_interval', help="--polling_interval ", default='30s') + parser.add_argument('--tos', help='--tos: Support different ToS settings: BK | BE | VI | VO | numeric', + default="BE") + parser.add_argument('-db', '--debug', help='--debug: Enable debugging', action='store_true') + parser.add_argument('-t', '--endp_type', + help='--endp_type example --endp_type \"lf_udp lf_tcp mc_udp\" Default: lf_tcp, options: lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6', default='lf_tcp', type=valid_endp_types) - parser.add_argument('-u', '--upstream_port', help='--upstream_port example: --upstream_port eth1',default='eth1') - parser.add_argument('-o','--csv_outfile', help="--csv_outfile ", default='dfs') - parser.add_argument("-l", "--log", action='store_true', help="create logfile for messages, default stdout") - parser.add_argument('-c','--csv_output', help="Generate csv output", default=True) + parser.add_argument('-u', '--upstream_port', + help='--upstream_port example: --upstream_port eth1', + default='eth1') + parser.add_argument('-o', '--csv_outfile', help="--csv_outfile ", default='dfs') + parser.add_argument("-l", "--log", action='store_true', help="create logfile for messages, default stdout") + parser.add_argument('-c', '--csv_output', help="Generate csv output", default=True) - #to do add wifimode - parser.add_argument('-r','--radio', action='append', nargs=1, help='--radio \ - \"radio== ssid== ssid_pw== security== wifimode==\" '\ + # to do add wifimode + parser.add_argument('-r', '--radio', action='append', nargs=1, help='--radio \ + \"radio== ssid== ssid_pw== security== wifimode==\" ' , required=False) - parser.add_argument('-amr','--side_a_min_bps', help='--side_a_min_bps, station min tx bits per second default 9600', default=9600) - parser.add_argument('-amp','--side_a_min_pdu', help='--side_a_min_pdu , station ipdu size default 1518', default=1518) - parser.add_argument('-bmr','--side_b_min_bps', help='--side_b_min_bps , upstream min tx rate default 256000', default=9600) - parser.add_argument('-bmp','--side_b_min_pdu', help='--side_b_min_pdu , upstream pdu size default 1518', default=1518) + parser.add_argument('-amr', '--side_a_min_bps', + help='--side_a_min_bps, station min tx bits per second default 9600', default=9600) + parser.add_argument('-amp', '--side_a_min_pdu', help='--side_a_min_pdu , station ipdu size default 1518', + default=1518) + parser.add_argument('-bmr', '--side_b_min_bps', help='--side_b_min_bps , upstream min tx rate default 256000', + default=9600) + parser.add_argument('-bmp', '--side_b_min_pdu', help='--side_b_min_pdu , upstream pdu size default 1518', + default=1518) # AP parameters - parser.add_argument('-api','--ap_info', action='append', nargs=1, type=str, \ - help='(enter 0 if does not apply) --ap_info \"ap_scheme== ap_prompt== ap_ip== ap_port== ap_user== ap_pw== ap_tty==\" ') - #--ap_info "ap_scheme==serial ap_prompt==APA53.0E7B.CF9C ap_ip==0 ap_port==0 ap_user==admin ap_pw==Admin123 ap_tty==/dev/ttyUSB2" + parser.add_argument('-api', '--ap_info', action='append', nargs=1, type=str, + help='(enter 0 if does not apply) --ap_info \"ap_scheme== ap_prompt== ap_ip== ap_port== ap_user== ap_pw== ap_tty==\" ') + # --ap_info "ap_scheme==serial ap_prompt==APA53.0E7B.CF9C ap_ip==0 ap_port==0 ap_user==admin ap_pw==Admin123 ap_tty==/dev/ttyUSB2" '''./lf_dfs_test.py -cc 192.168.100.112 -cu admin -cpw controller123 -cca APA453.0E7B.CF9C -ccf "a" -cwm "auto" -cc5 "36" \ -ccw "20" -ccd "1" -cs "3504" --endp_type 'lf_udp' --upstream_port eth2 --controller_wlan "test_candela" --controller_wlanID 1 \ --controller_wlanSSID "test_candela" --controller_directions "upstream" --controller_prompt "(controller Controller)" \ --radio "radio==1.wiphy0 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto" \ - --ap_info "ap_scheme==serial ap_prompt--APA53.0E7B.EF9C ap_ip==0 ap_port==0 ap_baud==9600 ap_user==admin ap_pw==Admin123 ap_tty==/dev/ttyUSB2" ''' - + --ap_info "ap_scheme==serial ap_prompt--APA53.0E7B.EF9C ap_ip==0 ap_port==0 ap_baud==9600 ap_user==admin ap_pw==Admin123 ap_tty==/dev/ttyUSB2" ''' # Parameters that allow for testing - parser.add_argument('-noc','--no_controller', help='--no_controller no configuration of the controller', action='store_true') - parser.add_argument('-nos','--no_stations', help='--no_stations , no stations', action='store_true') - parser.add_argument('-wto','--wait_timeout', help='--wait_timeout , time to wait for stations to get IP ', default="120") + parser.add_argument('-noc', '--no_controller', help='--no_controller no configuration of the controller', + action='store_true') + parser.add_argument('-nos', '--no_stations', help='--no_stations , no stations', action='store_true') + parser.add_argument('-wto', '--wait_timeout', help='--wait_timeout , time to wait for stations to get IP ', + default="120") args = parser.parse_args() controller_args = args - #logg.info("args: {}".format(args)) + # logg.info("args: {}".format(args)) debug_on = args.debug ################################################################## # Gather Test Data ################################################################# - + if args.test_duration: test_duration = args.test_duration @@ -2204,19 +2420,19 @@ Sample script 2/11/2021 if args.csv_outfile != None: current_time = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime()) - csv_outfile = "{}_{}.csv".format(args.csv_outfile,current_time) - csv_results = "results_{}_{}.csv".format(args.csv_outfile,current_time) + csv_outfile = "{}_{}.csv".format(args.csv_outfile, current_time) + csv_results = "results_{}_{}.csv".format(args.csv_outfile, current_time) print("csv output file : {}".format(csv_outfile)) - + if args.log: - outfile_log = "{}_{}_output_log.log".format(args.outfile,current_time) + outfile_log = "{}_{}_output_log.log".format(args.outfile, current_time) print("output file log: {}".format(outfile_log)) else: outfile_log = "stdout" - print("output file log: {}".format(outfile_log)) + print("output file log: {}".format(outfile_log)) if args.wait_timeout: - wait_timeout = int(args.wait_timeout) + wait_timeout = int(args.wait_timeout) if args.controller_scheme: __scheme = args.controller_scheme @@ -2231,7 +2447,7 @@ Sample script 2/11/2021 __prompt = args.controller_prompt if args.controller_series: - __series = args.controller_series + __series = args.controller_series if args.controller_user: __user = args.controller_user @@ -2243,7 +2459,7 @@ Sample script 2/11/2021 __cap_ctl_out = args.cap_ctl_out else: __cap_ctl_out = False - + if args.controller_ap_slot: __ap_slot = args.controller_ap_slot @@ -2263,27 +2479,27 @@ Sample script 2/11/2021 ap_info = args.ap_info for _ap_info in ap_info: print("ap_info {}".format(_ap_info)) - ap_keys = ['ap_scheme','ap_prompt','ap_ip','ap_port','ap_user','ap_pw', 'ap_tty', 'ap_baud'] - ap_dict = dict(map(lambda x: x.split('=='), str(_ap_info).replace('[','').replace(']','').replace("'","").split())) + ap_keys = ['ap_scheme', 'ap_prompt', 'ap_ip', 'ap_port', 'ap_user', 'ap_pw', 'ap_tty', 'ap_baud'] + ap_dict = dict( + map(lambda x: x.split('=='), str(_ap_info).replace('[', '').replace(']', '').replace("'", "").split())) for key in ap_keys: if key not in ap_dict: - print("missing ap config, for the {}, all these need to be set {} ".format(key,ap_keys)) + print("missing ap config, for the {}, all these need to be set {} ".format(key, ap_keys)) exit(1) print("ap_dict: {}".format(ap_dict)) - console_handler = logging.StreamHandler() formatter = logging.Formatter(FORMAT) logg = logging.getLogger(__name__) logg.setLevel(logging.DEBUG) file_handler = None - if (args.log): + if args.log: file_handler = logging.FileHandler(outfile_log, "w") file_handler.setLevel(logging.DEBUG) file_handler.setFormatter(formatter) logg.addHandler(file_handler) - logg.addHandler(logging.StreamHandler(sys.stdout)) # allows to logging to file and stderr + logg.addHandler(logging.StreamHandler(sys.stdout)) # allows to logging to file and stderr # if loggin.basicConfig is called this will result in duplicating log entries # logging.basicConfig(format=FORMAT, handlers=[file_handler]) else: @@ -2291,7 +2507,7 @@ Sample script 2/11/2021 logging.basicConfig(format=FORMAT, handlers=[console_handler]) MAX_NUMBER_OF_STATIONS = 200 - + radio_name_list = [] number_of_stations_per_radio_list = [] ssid_list = [] @@ -2299,58 +2515,56 @@ Sample script 2/11/2021 ssid_security_list = [] wifimode_list = [] - #optional radio configuration + # optional radio configuration reset_port_enable_list = [] reset_port_time_min_list = [] reset_port_time_max_list = [] wifi_mode_dict = { - "auto" : "0", - "a" : "1", - "b" : "2", - "g" : "3", - "abg" : "4", - "abgn" : "5", - "bgn" : "6", - "bg" : "7", - "abgnAC" : "8", - "anAC" : "9", - "an" : "10", - "bgnAC" : "11", - "abgnAX" : "12", - "bgnAX" : "13", - "anAX" : "14" - } + "auto": "0", + "a": "1", + "b": "2", + "g": "3", + "abg": "4", + "abgn": "5", + "bgn": "6", + "bg": "7", + "abgnAC": "8", + "anAC": "9", + "an": "10", + "bgnAC": "11", + "abgnAX": "12", + "bgnAX": "13", + "anAX": "14" + } - dfs_channel_bw20_values = [52, 56, 60, 64, 68, 96, 100, 104, 108, 112, 116, 120, 124 ,128, 132, 136, 140, 144] + dfs_channel_bw20_values = [52, 56, 60, 64, 68, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144] - - - - controller_aps = args.controller_ap.split() - controller_bands = args.controller_band.split() - controller_wifimodes = args.controller_wifimode.split() + controller_aps = args.controller_ap.split() + controller_bands = args.controller_band.split() + controller_wifimodes = args.controller_wifimode.split() for mode in controller_wifimodes: if mode in wifi_mode_dict.keys(): pass else: - logg.info("wifimode [{}] not recognised. Please use: auto, a, b, g, abg, abgn, bgn, bg, abgnAC, anAC, an, bgnAC, abgnAX, bgnAX, anAX".format(mode)) + logg.info( + "wifimode [{}] not recognised. Please use: auto, a, b, g, abg, abgn, bgn, bg, abgnAC, anAC, an, bgnAC, abgnAX, bgnAX, anAX".format( + mode)) exit(1) - controller_tx_powers = "3".split() - controller_chan_5ghzs = args.controller_chan_5ghz.split() - controller_chan_24ghzs = args.controller_chan_24ghz.split() - controller_chan_widths = args.controller_chan_width.split() - controller_ap_modes = args.controller_ap_mode.split() - controller_client_densities = args.controller_client_density.split() - controller_packet_types = args.endp_type.split() - controller_directions = args.controller_directions.split() - #controller_directions = "upstream".split() - controller_packet_sizes = args.controller_packet_size.split() - controller_data_encryptions = args.controller_data_encryption.split() - controller_side_a_min_bps = args.side_a_min_bps - controller_side_b_min_bps = args.side_b_min_bps + controller_tx_powers = "3".split() + controller_chan_5ghzs = args.controller_chan_5ghz.split() + controller_chan_24ghzs = args.controller_chan_24ghz.split() + controller_chan_widths = args.controller_chan_width.split() + controller_ap_modes = args.controller_ap_mode.split() + controller_client_densities = args.controller_client_density.split() + controller_packet_types = args.endp_type.split() + controller_directions = args.controller_directions.split() + # controller_directions = "upstream".split() + controller_packet_sizes = args.controller_packet_size.split() + controller_data_encryptions = args.controller_data_encryption.split() + controller_side_a_min_bps = args.side_a_min_bps + controller_side_b_min_bps = args.side_b_min_bps - logg.info(controller_aps) logg.info(controller_bands) logg.info(controller_wifimodes) @@ -2368,18 +2582,17 @@ Sample script 2/11/2021 else: logg.info("AP NO login information") + __ap_set = None + __band_set = None + __chan_width_set = None + __ap_mode_set = None + __tx_power_set = None + __chan_5ghz_set = None + __chan_24ghz_set = None + __csv_started = False - __ap_set = None - __band_set = None - __chan_width_set = None - __ap_mode_set = None - __tx_power_set = None - __chan_5ghz_set = None - __chan_24ghz_set = None - __csv_started = False - - __dfs_channel = None - __cac_timer_time = 0 + __dfs_channel = None + __cac_timer_time = 0 __dfs_chan_switch_to = None for controller_ap in controller_aps: @@ -2387,79 +2600,96 @@ Sample script 2/11/2021 for controller_wifimode in controller_wifimodes: # check for valid frequency and wifi_mode combination put here to simplify logic since all radios do not support all modes # "an anAX anAC abgn bg" - if((controller_band == "a" and controller_wifimode == "bg") or (controller_band == "b" and controller_wifimode == "anAC")): + if ((controller_band == "a" and controller_wifimode == "bg") or ( + controller_band == "b" and controller_wifimode == "anAC")): logg.info("#######################################################################") - logg.info("# Skipping combination controller_band {} controller_wifimode {}".format(controller_band,controller_wifimode)) + logg.info("# Skipping combination controller_band {} controller_wifimode {}".format(controller_band, + controller_wifimode)) logg.info("#######################################################################") - pass # invalid combination continue + pass # invalid combination continue else: # TODO the following - #[(x, y, z) for x in [1,2,3] for y in [4,5,6] for z in [7,8,9] if x != z]: + # [(x, y, z) for x in [1,2,3] for y in [4,5,6] for z in [7,8,9] if x != z]: for controller_tx_power in controller_tx_powers: for controller_chan_5ghz in controller_chan_5ghzs: for controller_chan_24ghz in controller_chan_24ghzs: - for controller_chan_width in controller_chan_widths: #bandwidth + for controller_chan_width in controller_chan_widths: # bandwidth for controller_data_encryption in controller_data_encryptions: for controller_ap_mode in controller_ap_modes: for controller_client_density in controller_client_densities: for controller_packet_type in controller_packet_types: for controller_direction in controller_directions: for controller_packet_size in controller_packet_sizes: - logg.info("#####################################################") - logg.info("# TEST RUNNING , TEST RUNNING ######################") - logg.info("#####################################################") + logg.info( + "#####################################################") + logg.info( + "# TEST RUNNING , TEST RUNNING ######################") + logg.info( + "#####################################################") test_config = "AP=={} Band=={} chan_5ghz=={} chan_24ghz=={} wifi_mode=={} BW=={} encryption=={} ap_mode=={} clients=={} packet_type=={} direction=={} packet_size=={}".format( - controller_ap,controller_band,controller_chan_5ghz,controller_chan_24ghz,controller_wifimode,controller_chan_width,controller_data_encryption,controller_ap_mode,controller_client_density, - controller_packet_type,controller_direction,controller_packet_size) - test_keys = ['AP','Band','wifi_mode','chan_5ghz','chan_24ghz','BW','encryption','ap_mode','clients','packet_type','direction','packet_size'] - logg.info("# controller run settings: {}".format(test_config)) - if(args.no_controller): - logg.info("################################################") + controller_ap, controller_band, controller_chan_5ghz, + controller_chan_24ghz, controller_wifimode, + controller_chan_width, controller_data_encryption, + controller_ap_mode, controller_client_density, + controller_packet_type, controller_direction, + controller_packet_size) + test_keys = ['AP', 'Band', 'wifi_mode', 'chan_5ghz', + 'chan_24ghz', 'BW', 'encryption', 'ap_mode', + 'clients', 'packet_type', 'direction', + 'packet_size'] + logg.info( + "# controller run settings: {}".format(test_config)) + if args.no_controller: + logg.info( + "################################################") logg.info("# NO CONTROLLER SET , TEST MODE") - logg.info("################################################") + logg.info( + "################################################") else: - if( controller_ap != __ap_set or - controller_band != __band_set or - controller_chan_width != __chan_width_set or - controller_ap_mode != __ap_mode_set or - controller_tx_power != __tx_power_set or - controller_chan_5ghz != __chan_5ghz_set or - controller_chan_24ghz != __chan_24ghz_set - ): - logg.info("###############################################") + if (controller_ap != __ap_set or + controller_band != __band_set or + controller_chan_width != __chan_width_set or + controller_ap_mode != __ap_mode_set or + controller_tx_power != __tx_power_set or + controller_chan_5ghz != __chan_5ghz_set or + controller_chan_24ghz != __chan_24ghz_set + ): + logg.info( + "###############################################") logg.info("# NEW CONTROLLER CONFIG") - logg.info("###############################################") - __ap_set = controller_ap - __band_set = controller_band - __chan_width_set = controller_chan_width - __ap_mode_set = controller_ap_mode - __tx_power_set = controller_tx_power - __chan_5ghz_set = controller_chan_5ghz - __chan_24ghz_set = controller_chan_24ghz - __client_density = controller_client_density + logg.info( + "###############################################") + __ap_set = controller_ap + __band_set = controller_band + __chan_width_set = controller_chan_width + __ap_mode_set = controller_ap_mode + __tx_power_set = controller_tx_power + __chan_5ghz_set = controller_chan_5ghz + __chan_24ghz_set = controller_chan_24ghz + __client_density = controller_client_density controller = CreateCtlr( - _scheme=__scheme, - _port=__port, - _series=__series, - _ctlr=__ctlr, - _prompt=__prompt, - _user=__user, - _passwd=__passwd, - _ap=__ap_set, - _band=__band_set, - _chan_5ghz=__chan_5ghz_set, - _chan_24ghz=__chan_24ghz_set, - _chan_width=__chan_width_set, - _ap_mode=__ap_mode_set, - _tx_power=__tx_power_set, - _client_density=__client_density, - _cap_ctl_out=__cap_ctl_out - ) - #Disable AP + _scheme=__scheme, + _port=__port, + _series=__series, + _ctlr=__ctlr, + _prompt=__prompt, + _user=__user, + _passwd=__passwd, + _ap=__ap_set, + _band=__band_set, + _chan_5ghz=__chan_5ghz_set, + _chan_24ghz=__chan_24ghz_set, + _chan_width=__chan_width_set, + _ap_mode=__ap_mode_set, + _tx_power=__tx_power_set, + _client_density=__client_density, + _cap_ctl_out=__cap_ctl_out + ) + # Disable AP # # Controller Configuration # - #if controller_args.controller_series == "9800": + # if controller_args.controller_series == "9800": # controller_controller_no_loggin_console() pss = controller.controller_show_ap_summary() logg.info("pss {}".format(pss)) @@ -2480,54 +2710,98 @@ Sample script 2/11/2021 controller.controller_create_wlan() controller.controller_set_wireless_tag_policy() controller.controller_enable_wlan() - if controller_band == "a": + if controller_band == "a": controller.controller_enable_network_5ghz() - else: + else: controller.controller_enable_network_24ghz() # clear logs on AP /dev/ttyUSB2 - candelatech - if(bool(ap_dict)): + if bool(ap_dict): logg.info("ap_dict {}".format(ap_dict)) - logg.info("Read AP action: {} ap_scheme: {} ap_ip: {} ap_port: {} ap_user: {} ap_pw: {} ap_tty: {} ap_baud: {}".format("show_log",ap_dict['ap_scheme'],ap_dict['ap_ip'],ap_dict["ap_port"], - ap_dict['ap_user'],ap_dict['ap_pw'],ap_dict['ap_tty'],ap_dict['ap_baud'])) + logg.info( + "Read AP action: {} ap_scheme: {} ap_ip: {} ap_port: {} ap_user: {} ap_pw: {} ap_tty: {} ap_baud: {}".format( + "show_log", ap_dict['ap_scheme'], + ap_dict['ap_ip'], ap_dict["ap_port"], + ap_dict['ap_user'], ap_dict['ap_pw'], + ap_dict['ap_tty'], ap_dict['ap_baud'])) # clear log (AP) try: logg.info("ap_ctl.py: clear log") # TODO remove position dependence if in tree - ap_info= subprocess.run(["./../ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], - "--user", ap_dict['ap_user'], "--passwd", ap_dict['ap_pw'],"--tty", ap_dict['ap_tty'],"--baud", ap_dict['ap_baud'],"--action", "clear_log"],capture_output=True, check=True)#stdout=subprocess.PIPE) + ap_info = subprocess.run( + ["./../ap_ctl.py", "--scheme", + ap_dict['ap_scheme'], "--prompt", + ap_dict['ap_prompt'], "--dest", + ap_dict['ap_ip'], "--port", + ap_dict["ap_port"], + "--user", ap_dict['ap_user'], + "--passwd", ap_dict['ap_pw'], "--tty", + ap_dict['ap_tty'], "--baud", + ap_dict['ap_baud'], "--action", + "clear_log"], capture_output=True, + check=True) # stdout=subprocess.PIPE) try: - pss = ap_info.stdout.decode('utf-8', 'ignore') + pss = ap_info.stdout.decode('utf-8', + 'ignore') except: - logg.info("ap_info was of type NoneType will set pss empty") + logg.info( + "ap_info was of type NoneType will set pss empty") pss = "empty" except subprocess.CalledProcessError as process_error: - logg.info("####################################################################################################") - logg.info("# CHECK IF AP HAS CONNECTION ALREADY ACTIVE") - logg.info("####################################################################################################") - logg.info("####################################################################################################") - logg.info("# Unable to commicate to AP error code: {} output {}".format(process_error.returncode, process_error.output)) - logg.info("####################################################################################################") + logg.info( + "####################################################################################################") + logg.info( + "# CHECK IF AP HAS CONNECTION ALREADY ACTIVE") + logg.info( + "####################################################################################################") + logg.info( + "####################################################################################################") + logg.info( + "# Unable to commicate to AP error code: {} output {}".format( + process_error.returncode, + process_error.output)) + logg.info( + "####################################################################################################") logg.info(pss) # show log (AP) try: logg.info("ap_ctl.py: show log") # TODO remove position dependence if in tree - ap_info= subprocess.run(["./../ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], - "--user", ap_dict['ap_user'], "--passwd", ap_dict['ap_pw'],"--tty", ap_dict['ap_tty'],"--baud", ap_dict['ap_baud'],"--action", "show_log"],capture_output=True, check=True) #stdout=subprocess.PIPE + ap_info = subprocess.run( + ["./../ap_ctl.py", "--scheme", + ap_dict['ap_scheme'], "--prompt", + ap_dict['ap_prompt'], "--dest", + ap_dict['ap_ip'], "--port", + ap_dict["ap_port"], + "--user", ap_dict['ap_user'], + "--passwd", ap_dict['ap_pw'], "--tty", + ap_dict['ap_tty'], "--baud", + ap_dict['ap_baud'], "--action", + "show_log"], capture_output=True, + check=True) # stdout=subprocess.PIPE try: - pss = ap_info.stdout.decode('utf-8', 'ignore') + pss = ap_info.stdout.decode('utf-8', + 'ignore') except: - logg.info("ap_info was of type NoneType will set pss empty") + logg.info( + "ap_info was of type NoneType will set pss empty") pss = "empty" except subprocess.CalledProcessError as process_error: - logg.info("####################################################################################################") - logg.info("# CHECK IF AP HAS CONNECTION ALREADY ACTIVE") - logg.info("####################################################################################################") - logg.info("####################################################################################################") - logg.info("# Unable to commicate to AP error code: {} output {}".format(process_error.returncode, process_error.output)) - logg.info("####################################################################################################") + logg.info( + "####################################################################################################") + logg.info( + "# CHECK IF AP HAS CONNECTION ALREADY ACTIVE") + logg.info( + "####################################################################################################") + logg.info( + "####################################################################################################") + logg.info( + "# Unable to commicate to AP error code: {} output {}".format( + process_error.returncode, + process_error.output)) + logg.info( + "####################################################################################################") logg.info(pss) controller.controller_enable_ap() @@ -2535,48 +2809,87 @@ Sample script 2/11/2021 time.sleep(10) # When the AP moves to another DFS channel, the wait time is 60 second # the CAC (Channel Avaiability Check Time) - if (int(__chan_5ghz_set) in dfs_channel_bw20_values): - logg.info("DFS 5ghz channel {} being set wait CAC time 60, 2.4 ghz: {} : ".format(__chan_5ghz_set, __chan_24ghz_set)) + if ( + int(__chan_5ghz_set) in dfs_channel_bw20_values): + logg.info( + "DFS 5ghz channel {} being set wait CAC time 60, 2.4 ghz: {} : ".format( + __chan_5ghz_set, __chan_24ghz_set)) # read AP to verify CAC timer set # will need to use time to verify CAC from AP - need in results - cac_sleeptime = "65" # 65 - logg.info("CAC start sleeptime: {}".format(cac_sleeptime)) + cac_sleeptime = "65" # 65 + logg.info("CAC start sleeptime: {}".format( + cac_sleeptime)) time.sleep(int(cac_sleeptime)) - logg.info("CAC done sleeptime: {}".format(cac_sleeptime)) - if(bool(ap_dict)): + logg.info("CAC done sleeptime: {}".format( + cac_sleeptime)) + if bool(ap_dict): # will need to verify that timer has timed out on AP - need in results - logg.info("DFS channel 5ghz {} done waiting CAC time, 2.4 ghz: {}".format(__chan_5ghz_set, __chan_24ghz_set)) - logg.info("####################################################################################################") - logg.info("# READ changed to DFS channel {}, running CAC for 60 seconds.".format(__chan_5ghz_set)) - logg.info("# READ AP CAC_EXPIRY_EVT: CAC finished on DFS channel ") - logg.info("####################################################################################################") + logg.info( + "DFS channel 5ghz {} done waiting CAC time, 2.4 ghz: {}".format( + __chan_5ghz_set, __chan_24ghz_set)) + logg.info( + "####################################################################################################") + logg.info( + "# READ changed to DFS channel {}, running CAC for 60 seconds.".format( + __chan_5ghz_set)) + logg.info( + "# READ AP CAC_EXPIRY_EVT: CAC finished on DFS channel ") + logg.info( + "####################################################################################################") logg.info("ap_dict {}".format(ap_dict)) - logg.info("Read AP action: {} ap_scheme: {} ap_ip: {} ap_port: {} ap_user: {} ap_pw: {} ap_tty: {} ap_baud: {}".format("show_log",ap_dict['ap_scheme'],ap_dict['ap_ip'],ap_dict["ap_port"], - ap_dict['ap_user'],ap_dict['ap_pw'],ap_dict['ap_tty'],ap_dict['ap_baud'],)) + logg.info( + "Read AP action: {} ap_scheme: {} ap_ip: {} ap_port: {} ap_user: {} ap_pw: {} ap_tty: {} ap_baud: {}".format( + "show_log", ap_dict['ap_scheme'], + ap_dict['ap_ip'], + ap_dict["ap_port"], + ap_dict['ap_user'], + ap_dict['ap_pw'], ap_dict['ap_tty'], + ap_dict['ap_baud'], )) try: - logg.info("ap_ctl.py: read for CAC timer and CAC_EXPIRY_EVT") + logg.info( + "ap_ctl.py: read for CAC timer and CAC_EXPIRY_EVT") # TODO remove position dependence if in tree - #ap_info= subprocess.run(["./../ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], + # ap_info= subprocess.run(["./../ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], # "--user", ap_dict['ap_user'], "--passwd", ap_dict['ap_pw'],"--tty", ap_dict['ap_tty'],"--baud", ap_dict['ap_baud'],"--action", "cac_expiry_evt"],capture_output=True, check=True) - ap_info= subprocess.run(["./../ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], - "--user", ap_dict['ap_user'], "--passwd", ap_dict['ap_pw'],"--tty", ap_dict['ap_tty'],"--baud", ap_dict['ap_baud'],"--action", "show_log"],capture_output=True, check=True) + ap_info = subprocess.run( + ["./../ap_ctl.py", "--scheme", + ap_dict['ap_scheme'], "--prompt", + ap_dict['ap_prompt'], "--dest", + ap_dict['ap_ip'], "--port", + ap_dict["ap_port"], + "--user", ap_dict['ap_user'], + "--passwd", ap_dict['ap_pw'], + "--tty", ap_dict['ap_tty'], + "--baud", ap_dict['ap_baud'], + "--action", "show_log"], + capture_output=True, check=True) try: - pss = ap_info.stdout.decode('utf-8', 'ignore') + pss = ap_info.stdout.decode('utf-8', + 'ignore') except: - logg.info("ap_info was of type NoneType will set pss empty") + logg.info( + "ap_info was of type NoneType will set pss empty") pss = "empty" except subprocess.CalledProcessError as process_error: - logg.info("####################################################################################################") - logg.info("# CHECK IF AP HAS CONNECTION ALREADY ACTIVE") - logg.info("####################################################################################################") + logg.info( + "####################################################################################################") + logg.info( + "# CHECK IF AP HAS CONNECTION ALREADY ACTIVE") + logg.info( + "####################################################################################################") - logg.info("####################################################################################################") - logg.info("# Unable to commicate to AP error code: {} output {}".format(process_error.returncode, process_error.output)) - logg.info("####################################################################################################") + logg.info( + "####################################################################################################") + logg.info( + "# Unable to commicate to AP error code: {} output {}".format( + process_error.returncode, + process_error.output)) + logg.info( + "####################################################################################################") logg.info(pss) # find the DFS Channel @@ -2584,29 +2897,47 @@ Sample script 2/11/2021 logg.info("ap: {}".format(line)) pat = 'CAC_EXPIRY_EVT:\s+\S+\s+\S+\s+\S+\s\S+\s\S+\s(\S+)' m = re.search(pat, line) - if (m != None): + if m != None: __dfs_channel = m.group(1) - logg.info("__dfs_channel: {}".format(__dfs_channel)) - logg.info("__dfs_channel line: {}".format(line)) + logg.info( + "__dfs_channel: {}".format( + __dfs_channel)) + logg.info( + "__dfs_channel line: {}".format( + line)) break else: - logg.info("Non-DFS 5ghz channel {} being set sleep 30, 2.4 ghz: {} ".format(__chan_5ghz_set, __chan_24ghz_set)) + logg.info( + "Non-DFS 5ghz channel {} being set sleep 30, 2.4 ghz: {} ".format( + __chan_5ghz_set, __chan_24ghz_set)) time.sleep(30) ########################################## # end of controller controller code ########################################## - + else: - logg.info("###############################################") + logg.info( + "###############################################") logg.info("# NO CHANGE TO CONTROLLER CONFIG") - logg.info("###############################################") - logg.info("controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}" - .format(controller_ap,controller_band, controller_chan_width, controller_ap_mode, controller_tx_power, controller_chan_5ghz, controller_chan_24ghz)) - logg.info("__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}" - .format(__ap_set,__band_set, __chan_width_set, __ap_mode_set, __tx_power_set, __chan_5ghz_set, __chan_24ghz_set)) - logg.info("controller_wifi_mode {}".format(controller_wifimode)) + logg.info( + "###############################################") + logg.info( + "controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}" + .format(controller_ap, controller_band, + controller_chan_width, + controller_ap_mode, controller_tx_power, + controller_chan_5ghz, + controller_chan_24ghz)) + logg.info( + "__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}" + .format(__ap_set, __band_set, __chan_width_set, + __ap_mode_set, __tx_power_set, + __chan_5ghz_set, __chan_24ghz_set)) + logg.info("controller_wifi_mode {}".format( + controller_wifimode)) pss = controller.controller_show_ap_summary() - logg.info("controller_show_ap_summary::: pss {}".format(pss)) + logg.info( + "controller_show_ap_summary::: pss {}".format(pss)) if args.controller_series == "9800": searchap = False cc_mac = "" @@ -2615,34 +2946,55 @@ Sample script 2/11/2021 cc_power = "" cc_dbm = "" for line in pss.splitlines(): - if (line.startswith("---------")): + if line.startswith("---------"): searchap = True continue # if the pattern changes save the output of the advanced command and re parse https://regex101.com - if (searchap): - pat = "%s\s+(\S+)\s+(%s)\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+(\S+)\s+dBm\)+\s+(\S+)+\s"%(__ap_set,__ap_slot) + if searchap: + pat = "%s\s+(\S+)\s+(%s)\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+(\S+)\s+dBm\)+\s+(\S+)+\s" % ( + __ap_set, __ap_slot) m = re.search(pat, line) - if (m != None): - if(m.group(2) == __ap_slot): + if m != None: + if m.group(2) == __ap_slot: cc_mac = m.group(1) cc_slot = m.group(2) - cc_ch = m.group(6); # (132,136,140,144) + cc_ch = m.group( + 6) # (132,136,140,144) cc_power = m.group(4) - cc_power = cc_power.replace("/", " of ") # spread-sheets turn 1/8 into a date + cc_power = cc_power.replace("/", + " of ") # spread-sheets turn 1/8 into a date cc_dbm = m.group(5) - cc_dbm = cc_dbm.replace("(","") - + cc_dbm = cc_dbm.replace("(", "") + cc_ch_count = cc_ch.count(",") + 1 cc_bw = m.group(3) - logg.info("group 1: {} 2: {} 3: {} 4: {} 5: {} 6: {}".format(m.group(1),m.group(2),m.group(3),m.group(4),m.group(5),m.group(6))) - - logg.info("9800 test_parameters cc_mac: read : {}".format(cc_mac)) - logg.info("9800 test_parameters cc_slot: read : {}".format(cc_slot)) - logg.info("9800 test_parameters cc_count: read : {}".format(cc_ch_count)) - logg.info("9800 test_parameters cc_bw: read : {}".format(cc_bw)) - logg.info("9800 test_parameters cc_power: read : {}".format(cc_power)) - logg.info("9800 test_parameters cc_dbm: read : {}".format(cc_dbm)) - logg.info("9800 test_parameters cc_ch: read : {}".format(cc_ch)) + logg.info( + "group 1: {} 2: {} 3: {} 4: {} 5: {} 6: {}".format( + m.group(1), m.group(2), + m.group(3), m.group(4), + m.group(5), m.group(6))) + + logg.info( + "9800 test_parameters cc_mac: read : {}".format( + cc_mac)) + logg.info( + "9800 test_parameters cc_slot: read : {}".format( + cc_slot)) + logg.info( + "9800 test_parameters cc_count: read : {}".format( + cc_ch_count)) + logg.info( + "9800 test_parameters cc_bw: read : {}".format( + cc_bw)) + logg.info( + "9800 test_parameters cc_power: read : {}".format( + cc_power)) + logg.info( + "9800 test_parameters cc_dbm: read : {}".format( + cc_dbm)) + logg.info( + "9800 test_parameters cc_ch: read : {}".format( + cc_ch)) break else: searchap = False @@ -2653,33 +3005,49 @@ Sample script 2/11/2021 cc_dbm = "" ch_count = "" for line in pss.splitlines(): - if (line.startswith("---------")): + if line.startswith("---------"): searchap = True continue - - if (searchap): - pat = "%s\s+(\S+)\s+\S+\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+\(\s*(\S+)\s+dBm"%(__ap_set) + + if searchap: + pat = "%s\s+(\S+)\s+\S+\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+\(\s*(\S+)\s+dBm" % ( + __ap_set) m = re.search(pat, line) - if (m != None): + if m != None: cc_mac = m.group(1) - cc_ch = m.group(2); # (132,136,140,144) + cc_ch = m.group(2) # (132,136,140,144) cc_power = m.group(3) - cc_power = cc_power.replace("/", " of ", 1) # spread-sheets turn 1/8 into a date + cc_power = cc_power.replace("/", " of ", + 1) # spread-sheets turn 1/8 into a date cc_dbm = m.group(4) - + ch_count = cc_ch.count(",") cc_bw = 20 * (ch_count + 1) - - logg.info("3504 test_parameters cc_mac: read : {}".format(cc_mac)) - logg.info("3504 test_parameters cc_count: read : {}".format(ch_count)) - logg.info("3504 test_parameters cc_bw: read : {}".format(cc_bw)) - logg.info("3504 test_parameters cc_power: read : {}".format(cc_power)) - logg.info("3504 test_parameters cc_dbm: read : {}".format(cc_dbm)) - logg.info("3504 test_parameters cc_ch: read : {}".format(cc_ch)) + + logg.info( + "3504 test_parameters cc_mac: read : {}".format( + cc_mac)) + logg.info( + "3504 test_parameters cc_count: read : {}".format( + ch_count)) + logg.info( + "3504 test_parameters cc_bw: read : {}".format( + cc_bw)) + logg.info( + "3504 test_parameters cc_power: read : {}".format( + cc_power)) + logg.info( + "3504 test_parameters cc_dbm: read : {}".format( + cc_dbm)) + logg.info( + "3504 test_parameters cc_ch: read : {}".format( + cc_ch)) break - if(cc_ch != controller_chan_5ghz): - logg.info("configured channel {} not equal controller channel {}".format(controller_chan_5ghz,cc_ch)) + if cc_ch != controller_chan_5ghz: + logg.info( + "configured channel {} not equal controller channel {}".format( + controller_chan_5ghz, cc_ch)) ###################################################### # end of controller controller code no change to controller ###################################################### @@ -2687,131 +3055,156 @@ Sample script 2/11/2021 radios = args.radio logg.info("radios {}".format(radios)) for radio_ in radios: - radio_keys = ['radio','stations','ssid','ssid_pw','security','wifimode'] - radio_info_dict = dict(map(lambda x: x.split('=='), str(radio_).replace('[','').replace(']','').replace("'","").split())) + radio_keys = ['radio', 'stations', 'ssid', + 'ssid_pw', 'security', 'wifimode'] + radio_info_dict = dict(map(lambda x: x.split('=='), + str(radio_).replace('[', + '').replace( + ']', '').replace("'", + "").split())) logg.info("radio_dict {}".format(radio_info_dict)) for key in radio_keys: if key not in radio_info_dict: - logg.info("missing config, for the {}, all of the following need to be present {} ".format(key,radio_keys)) + logg.info( + "missing config, for the {}, all of the following need to be present {} ".format( + key, radio_keys)) exit(1) radio_name_list.append(radio_info_dict['radio']) ssid_list.append(radio_info_dict['ssid']) - ssid_password_list.append(radio_info_dict['ssid_pw']) - ssid_security_list.append(radio_info_dict['security']) + ssid_password_list.append( + radio_info_dict['ssid_pw']) + ssid_security_list.append( + radio_info_dict['security']) if args.radio: - number_of_stations_per_radio_list.append(radio_info_dict['stations']) - wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) - else: - number_of_stations_per_radio_list.append(radio_info_dict['stations']) - wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) + number_of_stations_per_radio_list.append( + radio_info_dict['stations']) + wifimode_list.append(int(wifi_mode_dict[ + radio_info_dict[ + 'wifimode']])) + else: + number_of_stations_per_radio_list.append( + radio_info_dict['stations']) + wifimode_list.append(int(wifi_mode_dict[ + radio_info_dict[ + 'wifimode']])) optional_radio_reset_keys = ['reset_port_enable'] radio_reset_found = True for key in optional_radio_reset_keys: if key not in radio_info_dict: - #logg.info("port reset test not enabled") + # logg.info("port reset test not enabled") radio_reset_found = False break - + if radio_reset_found: reset_port_enable_list.append(True) - reset_port_time_min_list.append(radio_info_dict['reset_port_time_min']) - reset_port_time_max_list.append(radio_info_dict['reset_port_time_max']) + reset_port_time_min_list.append( + radio_info_dict['reset_port_time_min']) + reset_port_time_max_list.append( + radio_info_dict['reset_port_time_max']) else: reset_port_enable_list.append(False) reset_port_time_min_list.append('0s') reset_port_time_max_list.append('0s') # no stations for testing reconfiguration of the controller - - if(args.no_stations): + if args.no_stations: logg.info("##################################") logg.info("# NO STATIONS") logg.info("##################################") else: index = 0 station_lists = [] - for (radio_name_, number_of_stations_per_radio_) in zip(radio_name_list,number_of_stations_per_radio_list): - number_of_stations = int(number_of_stations_per_radio_) + for (radio_name_, number_of_stations_per_radio_) in zip( + radio_name_list, + number_of_stations_per_radio_list): + number_of_stations = int( + number_of_stations_per_radio_) if number_of_stations > MAX_NUMBER_OF_STATIONS: - logg.info("number of stations per radio exceeded max of : {}".format(MAX_NUMBER_OF_STATIONS)) + logg.info( + "number of stations per radio exceeded max of : {}".format( + MAX_NUMBER_OF_STATIONS)) quit(1) - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_= 1 + index*1000, end_id_= number_of_stations + index*1000, - padding_number_=10000, radio=radio_name_) + station_list = LFUtils.portNameSeries(prefix_="sta", + start_id_=1 + index * 1000, + end_id_=number_of_stations + index * 1000, + padding_number_=10000, + radio=radio_name_) station_lists.append(station_list) index += 1 # Run Traffic Upstream (STA to AP) - if(controller_direction == "upstream"): - side_a_min_bps = controller_side_a_min_bps - side_b_min_bps = 0 - # Run Traffic Downstream (AP to STA) + if controller_direction == "upstream": + side_a_min_bps = controller_side_a_min_bps + side_b_min_bps = 0 + # Run Traffic Downstream (AP to STA) else: - side_a_min_bps = 0 - side_b_min_bps = controller_side_b_min_bps - # current default is to have a values + side_a_min_bps = 0 + side_b_min_bps = controller_side_b_min_bps + # current default is to have a values ip_var_test = L3VariableTime( - args=args, - _dfs=__dfs, - _dfs_time=__dfs_time, - _radar_duration=__radar_duration, - _scheme=__scheme, - _port=__port, - _series=__series, - _ctlr=__ctlr, - _prompt=__prompt, - _user=__user, - _passwd=__passwd, - _ap=__ap_set, - _ap_slot=__ap_slot, - _band=__band_set, - _chan_5ghz=__chan_5ghz_set, - _chan_24ghz=__chan_24ghz_set, - _chan_width=__chan_width_set, - _ap_mode=__ap_mode_set, - _tx_power=__tx_power_set, - _client_density=__client_density, - _cap_ctl_out=__cap_ctl_out, - _ap_dict = ap_dict, - endp_type=controller_packet_type, - tos=args.tos, - side_b=side_b, - radio_name_list=radio_name_list, - number_of_stations_per_radio_list=number_of_stations_per_radio_list, - ssid_list=ssid_list, - ssid_password_list=ssid_password_list, - ssid_security_list=ssid_security_list, - wifimode_list=wifimode_list, - station_lists= station_lists, - name_prefix="LT-", - debug_on=debug_on, - wait_timeout=wait_timeout, - outfile=csv_outfile, - results=csv_results, - test_keys=test_keys, - test_config=test_config, - reset_port_enable_list=reset_port_enable_list, - reset_port_time_min_list=reset_port_time_min_list, - reset_port_time_max_list=reset_port_time_max_list, - csv_started=__csv_started, - side_a_min_bps =side_a_min_bps, - side_a_max_bps =0, - side_a_min_pdu =controller_packet_size, - side_a_max_pdu =0, - side_b_min_bps =side_b_min_bps, - side_b_max_bps =0, - side_b_min_pdu =controller_packet_size, - side_b_max_pdu = 0, - number_template="00", - test_duration=test_duration, - polling_interval= polling_interval, - lfclient_host=lfjson_host, - lfclient_port=lfjson_port) + args=args, + _dfs=__dfs, + _dfs_time=__dfs_time, + _radar_duration=__radar_duration, + _scheme=__scheme, + _port=__port, + _series=__series, + _ctlr=__ctlr, + _prompt=__prompt, + _user=__user, + _passwd=__passwd, + _ap=__ap_set, + _ap_slot=__ap_slot, + _band=__band_set, + _chan_5ghz=__chan_5ghz_set, + _chan_24ghz=__chan_24ghz_set, + _chan_width=__chan_width_set, + _ap_mode=__ap_mode_set, + _tx_power=__tx_power_set, + _client_density=__client_density, + _cap_ctl_out=__cap_ctl_out, + _ap_dict=ap_dict, + endp_type=controller_packet_type, + tos=args.tos, + side_b=side_b, + radio_name_list=radio_name_list, + number_of_stations_per_radio_list=number_of_stations_per_radio_list, + ssid_list=ssid_list, + ssid_password_list=ssid_password_list, + ssid_security_list=ssid_security_list, + wifimode_list=wifimode_list, + station_lists=station_lists, + name_prefix="LT-", + debug_on=debug_on, + wait_timeout=wait_timeout, + outfile=csv_outfile, + results=csv_results, + test_keys=test_keys, + test_config=test_config, + reset_port_enable_list=reset_port_enable_list, + reset_port_time_min_list=reset_port_time_min_list, + reset_port_time_max_list=reset_port_time_max_list, + csv_started=__csv_started, + side_a_min_bps=side_a_min_bps, + side_a_max_bps=0, + side_a_min_pdu=controller_packet_size, + side_a_max_pdu=0, + side_b_min_bps=side_b_min_bps, + side_b_max_bps=0, + side_b_min_pdu=controller_packet_size, + side_b_max_pdu=0, + number_template="00", + test_duration=test_duration, + polling_interval=polling_interval, + lfclient_host=lfjson_host, + lfclient_port=lfjson_port) __csv_started = True ip_var_test.pre_cleanup() ip_var_test.build() if not ip_var_test.passes(): logg.info("build step failed.") logg.info(ip_var_test.get_fail_message()) - exit(1) - client_density = ip_var_test.station_bringup() - #controller.verify_controller(client_density) + exit(1) + client_density = ip_var_test.station_bringup() + # controller.verify_controller(client_density) ip_var_test.start(False, False) ip_var_test.stop() if not ip_var_test.passes(): @@ -2825,16 +3218,16 @@ Sample script 2/11/2021 ssid_security_list = [] wifimode_list = [] ip_var_test.cleanup() - if ( args.no_stations): + if args.no_stations: pass else: ip_var_test.passes() logg.info("Test Complete") + if __name__ == "__main__": main() - ''' SAMPLE Command 2/15/2021 ./lf_dfs_test.py -cc 192.168.100.112 -cu admin -cpw Controller123 -cca APA453.0E7B.CF9C -ccf "a" -cwm "auto" -cc5 "52 56 60 64 68 96 100 104 108 112 116 120 124 128 132 136 140 144" -ccw "20" -ccd "1" -cs "3504" --endp_type 'lf_udp' --upstream_port eth2 --controller_wlan "test_candela" --controller_wlanID 1 --controller_wlanSSID "test_candela" --controller_directions "upstream" --controller_prompt "(controller Controller)" --radio "radio==1.wiphy0 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto" @@ -2842,4 +3235,3 @@ SAMPLE Command 2/15/2021 SAMPLE Command with AP (need root if using serial) sudo ./lf_dfs_test.py -cc 192.168.100.112 -cu admin -cpw Controller123 -cca APA453.0E7B.CF9C -ccf "a" -cwm "auto" -cc5 "56" -ccw "20" -ccd "1" -cs "3504" --endp_type 'lf_udp' --upstream_port eth2 --controller_wlan "test_candela" --controller_wlanID 1 --controller_wlanSSID "test_candela" --controller_directions "upstream" --controller_prompt "(controller Controller)" --radio "radio==1.wiphy0 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto" --ap_info "ap_scheme==serial ap_prompt==APA453.0E7B.CF9C ap_ip==0 ap_port==0 ap_user==admin ap_pw==Admin123 ap_tty==/dev/ttyUSB2 ap_baud==9600" --controller_dfs ''' - From b18ee0d70eedd8cb67bb6dd45a07c5529212cb35 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 15:43:59 -0800 Subject: [PATCH 470/731] lf_dfs_test: Fix errors Signed-off-by: Matthew Stidham --- py-scripts/lf_dfs_test.py | 281 +++++++++++++++++--------------------- 1 file changed, 128 insertions(+), 153 deletions(-) diff --git a/py-scripts/lf_dfs_test.py b/py-scripts/lf_dfs_test.py index 6db17b14..bcd2eeb6 100755 --- a/py-scripts/lf_dfs_test.py +++ b/py-scripts/lf_dfs_test.py @@ -10,6 +10,7 @@ import re import csv import random import logging +import argparse if sys.version_info[0] != 3: print("This script requires Python 3") @@ -17,8 +18,6 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) -import argparse - LFUtils = importlib.import_module("py-json.LANforge.LFUtils") realm = importlib.import_module("py-json.realm") Realm = realm.Realm @@ -103,8 +102,8 @@ class CreateCtlr: logg.info(pss) except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}" - .format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -119,7 +118,7 @@ class CreateCtlr: pat = "%s\s+\S+\s+\S+\s+\S+\s+\S+.* \S+\s+\S+\s+(\S+)\s+\[" % self.ap # logg.info("AP line: %s"%(line)) m = re.search(pat, line) - if m != None: + if m: sta_count = m.group(1) logg.info("AP line: %s" % line) logg.info("sta-count: %s" % sta_count) @@ -173,8 +172,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}" - .format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -205,8 +204,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) return pss @@ -233,8 +232,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -261,8 +260,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -290,8 +289,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -319,8 +318,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -345,8 +344,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -374,8 +373,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -400,8 +399,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -430,8 +429,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -463,8 +462,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -494,8 +493,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -529,8 +528,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -556,8 +555,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -584,8 +583,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -614,8 +613,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -646,8 +645,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -677,8 +676,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -706,8 +705,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -732,8 +731,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -761,8 +760,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -787,8 +786,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -815,8 +814,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -853,9 +852,9 @@ class CreateCtlr: if (str(controller_channel) in str(element_list[8])) and ( str(self.chan_width) in str(element_list[5])): logg.info( - "ap {} configuration successful: channel {} in expected {} chan_width {} in expected {}" - .format(element_list[0], controller_channel, element_list[8], self.chan_width, - element_list[5])) + "ap {} configuration successful: channel {} in expected {} chan_width {} in expected {}".format( + element_list[0], controller_channel, element_list[8], self.chan_width, + element_list[5])) else: logg.info("WARNING ap {} configuration: channel {} in expected {} chan_width {} in expected {}" .format(element_list[0], controller_channel, element_list[8], self.chan_width, @@ -942,11 +941,9 @@ class L3VariableTime(Realm): reset_port_time_max_list, csv_started=False, side_a_min_bps=560000, - side_a_max_bps=0, side_a_min_pdu=1518, side_a_max_pdu=0, side_b_min_bps=560000, - side_b_max_bps=0, side_b_min_pdu=1518, side_b_max_pdu=0, number_template="00", @@ -959,7 +956,7 @@ class L3VariableTime(Realm): _exit_on_error=False, _exit_on_fail=False, _proxy_str=None, - _capture_signal_list=[]): + _capture_signal_list=None): super().__init__(lfclient_host=lfclient_host, lfclient_port=lfclient_port, debug_=debug, @@ -967,6 +964,9 @@ class L3VariableTime(Realm): _exit_on_fail=_exit_on_fail, _proxy_str=_proxy_str, _capture_signal_list=_capture_signal_list) + if _capture_signal_list is None: + _capture_signal_list = [] + self.total_stas = 0 self.dfs = _dfs self.dfs_time = _dfs_time self.radar_duration = _radar_duration @@ -1111,12 +1111,15 @@ class L3VariableTime(Realm): csv_rx_drop_percent_data.extend([self.epoch_time, self.time_stamp(), 'rx_drop_percent']) # remove multi cast since downstream only if selected - for key in [key for key in rx_drop_percent if "mtx" in key]: del rx_drop_percent[key] + for key in [key for key in rx_drop_percent if "mtx" in key]: + del rx_drop_percent[key] if "upstream" in self.test_config_dict.values(): - for key in [key for key in rx_drop_percent if "-A" in key]: del rx_drop_percent[key] + for key in [key for key in rx_drop_percent if "-A" in key]: + del rx_drop_percent[key] elif "downstream" in self.test_config_dict.values(): - for key in [key for key in rx_drop_percent if "-B" in key]: del rx_drop_percent[key] + for key in [key for key in rx_drop_percent if "-B" in key]: + del rx_drop_percent[key] filtered_values = [v for _, v in rx_drop_percent.items() if v != 0] average_rx_drop_percent = sum(filtered_values) / len(filtered_values) if len(filtered_values) != 0 else 0 @@ -1141,7 +1144,6 @@ class L3VariableTime(Realm): def __compare_vals(self, old_list, new_list): passes = 0 expected_passes = 0 - csv_performance_values = [] csv_rx_headers = [] csv_rx_row_data = [] csv_result_row_data = [] @@ -1153,8 +1155,10 @@ class L3VariableTime(Realm): # csv_rx_row_data.append(self.test_config_dict[key]) # csv_rx_delta_row_data.append(self.test_config_dict[key]) - for key in [key for key in old_list if "mtx" in key]: del old_list[key] - for key in [key for key in new_list if "mtx" in key]: del new_list[key] + for key in [key for key in old_list if "mtx" in key]: + del old_list[key] + for key in [key for key in new_list if "mtx" in key]: + del new_list[key] filtered_values = [v for _, v in new_list.items() if v != 0] average_rx = sum(filtered_values) / len(filtered_values) if len(filtered_values) != 0 else 0 @@ -1163,10 +1167,12 @@ class L3VariableTime(Realm): new_evaluate_list = new_list.copy() print("new_evaluate_list before", new_evaluate_list) if "upstream" in self.test_config_dict.values(): - for key in [key for key in new_evaluate_list if "-A" in key]: del new_evaluate_list[key] + for key in [key for key in new_evaluate_list if "-A" in key]: + del new_evaluate_list[key] print("upstream in dictionary values") elif "downstream" in self.test_config_dict.values(): - for key in [key for key in new_evaluate_list if "-B" in key]: del new_evaluate_list[key] + for key in [key for key in new_evaluate_list if "-B" in key]: + del new_evaluate_list[key] print("downstream in dictionary values") # follow code left in for now, provides the best 5 worst 5 '''print("new_evaluate_list after",new_evaluate_list) @@ -1181,10 +1187,12 @@ class L3VariableTime(Realm): old_evaluate_list = old_list.copy() if "upstream" in self.test_config_dict.values(): - for key in [key for key in old_evaluate_list if "-A" in key]: del old_evaluate_list[key] + for key in [key for key in old_evaluate_list if "-A" in key]: + del old_evaluate_list[key] print("upstream in dictionary values") elif "downstream" in self.test_config_dict.values(): - for key in [key for key in old_evaluate_list if "-B" in key]: del old_evaluate_list[key] + for key in [key for key in old_evaluate_list if "-B" in key]: + del old_evaluate_list[key] print("downstream in dictionary values") if len(old_evaluate_list) == len(new_evaluate_list): @@ -1318,10 +1326,11 @@ class L3VariableTime(Realm): else: station_profile.reset_port_extra_data['seconds_till_reset'] = station_profile.reset_port_extra_data[ 'seconds_till_reset'] - 1 - if self.debug: logg.info( - "radio: {} countdown seconds_till_reset {}".format(station_profile.add_sta_data['radio'], - station_profile.reset_port_extra_data[ - 'seconds_till_reset'])) + if self.debug: + logg.info( + "radio: {} countdown seconds_till_reset {}".format(station_profile.add_sta_data['radio'], + station_profile.reset_port_extra_data[ + 'seconds_till_reset'])) if station_profile.reset_port_extra_data['seconds_till_reset'] <= 0: station_profile.reset_port_extra_data['reset_port_timer_started'] = False port_to_reset = random.randint(0, len(station_profile.station_names) - 1) @@ -1332,7 +1341,6 @@ class L3VariableTime(Realm): def pre_cleanup(self): self.cx_profile.cleanup_prefix() self.multicast_profile.cleanup_prefix() - self.total_stas = 0 for station_list in self.station_lists: for sta in station_list: self.rm_port(sta, check_exists=True) @@ -1388,8 +1396,7 @@ class L3VariableTime(Realm): self.admin_up(sta) client_density += 1 - temp_stations_list = [] - temp_stations_list.append(self.side_b) + temp_stations_list = [self.side_b] for station_profile in self.station_profiles: temp_stations_list.extend(station_profile.station_names.copy()) # need algorithm for setting time default @@ -1424,19 +1431,15 @@ class L3VariableTime(Realm): except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) logg.info("controller_show_ap_summary::: pss {}".format(pss)) if self.series == "9800": searchap = False - cc_mac = "" cc_ch = "" - cc_bw = "" - cc_power = "" - cc_dbm = "" for line in pss.splitlines(): if line.startswith("---------"): searchap = True @@ -1444,9 +1447,9 @@ class L3VariableTime(Realm): # if the pattern changes save the output of the advanced command and re parse https://regex101.com if searchap: pat = "%s\s+(\S+)\s+(%s)\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+(\S+)\s+dBm\)+\s+(\S+)+\s" % ( - self.ap, self.ap_slot) + self.ap, self.ap_slot) m = re.search(pat, line) - if m != None: + if m: if m.group(2) == self.ap_slot: cc_mac = m.group(1) cc_slot = m.group(2) @@ -1470,12 +1473,7 @@ class L3VariableTime(Realm): break else: searchap = False - cc_mac = "" cc_ch = "" - cc_bw = "" - cc_power = "" - cc_dbm = "" - ch_count = "" for line in pss.splitlines(): if line.startswith("---------"): searchap = True @@ -1484,7 +1482,7 @@ class L3VariableTime(Realm): if searchap: pat = "%s\s+(\S+)\s+\S+\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+\(\s*(\S+)\s+dBm" % self.ap m = re.search(pat, line) - if m != None: + if m: cc_mac = m.group(1) cc_ch = m.group(2) # (132,136,140,144) cc_power = m.group(3) @@ -1525,21 +1523,22 @@ class L3VariableTime(Realm): except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) blacklist_time = "" for line in pss.splitlines(): pat = 'Channel\s+%s\S+\s+(\S+)\s+\S+\s+remaining' % self.chan_5ghz m = re.search(pat, line) - if m != None: + if m: blacklist_time = m.group(1) logg.info("dfs_channel: {} blacklist_time: {}".format(self.chan_5ghz, blacklist_time)) return blacklist_time - def dfs_waveforms(self, waveform): + @staticmethod + def dfs_waveforms(waveform): # 1, 2, 3, 4, 5, 11, 12, 13, 14, 15, 16 # "FCCO" , "FCC1" , "FCC2" , "FCC3", "FCC4", "FCC5", "ETSI1", "ETSI2", "ETSI3", "ETSI4", "ETSI5", "ETSI6" if waveform == "FCCO": @@ -1593,7 +1592,8 @@ class L3VariableTime(Realm): return width, interval, count - def dfs_get_frequency(self, channel): + @staticmethod + def dfs_get_frequency(channel): # possibly have a dictionary if channel == "36": @@ -1667,8 +1667,6 @@ class L3VariableTime(Realm): width_ = "1" interval_ = "1428" count_ = "18" - frequency_ = "5260000" # channel 52 - # sweep_time_ = "1000" sweep_time_ = "0" if_gain_ = "40" bb_gain_ = "20" @@ -1797,10 +1795,8 @@ class L3VariableTime(Realm): "--user", self.ap_dict['ap_user'], "--passwd", self.ap_dict['ap_pw'], "--tty", self.ap_dict['ap_tty'], "--baud", self.ap_dict['ap_baud'], "--action", "show_log"], capture_output=True, check=True) - try: + if ap_info: pss = ap_info.stdout.decode('utf-8', 'ignore') - except: - logg.info("ap_info was of type NoneType will set pss empty") except subprocess.CalledProcessError as process_error: logg.info("###################################################") @@ -1815,7 +1811,7 @@ class L3VariableTime(Realm): logg.info("ap: CAC_EXPIRY_EVT {}".format(line)) pat = 'changed to DFS channel\s+(\S+),\s+\S+\s+\S+\s+\S+\s+(\S+)' m = re.search(pat, line) - if m != None: + if m: dfs_channel = m.group(1) cac_time = m.group(2) logg.info("dfs_channel: {} cac_time: {}".format(dfs_channel, cac_time)) @@ -1828,7 +1824,7 @@ class L3VariableTime(Realm): logg.info("ap: CAC_EXPIRY_EVT {}".format(line)) pat = 'CAC_EXPIRY_EVT:\s+\S+\s+\S+\s+\S+\s\S+\s\S+\s(\S+)' m = re.search(pat, line) - if m != None: + if m: dfs_channel = m.group(1) logg.info("dfs_channel: {}".format(dfs_channel)) logg.info("dfs_channel line: {}".format(line)) @@ -1839,9 +1835,6 @@ class L3VariableTime(Realm): def start(self, print_pass=False, print_fail=False): best_max_tp_mbps = 0 best_csv_rx_row_data = " " - max_tp_mbps = 0 - csv_rx_row_data = " " - Result = False # verify the AP CAC timer and experation self.ap_cac_verify() @@ -2009,12 +2002,14 @@ class L3VariableTime(Realm): self.csv_results_writer.writerow(headers) self.csv_results.flush() - def csv_validate_list(self, csv_list, length): + @staticmethod + def csv_validate_list(csv_list, length): if len(csv_list) < length: csv_list = csv_list + [('no data', 'no data')] * (length - len(csv_list)) return csv_list - def csv_add_row(self, row, writer, csv_file): # can make two calls eventually + @staticmethod + def csv_add_row(row, writer, csv_file): # can make two calls eventually if csv_file is not None: writer.writerow(row) csv_file.flush() @@ -2046,8 +2041,6 @@ def main(): global logg lfjson_host = "localhost" lfjson_port = 8080 - endp_types = "lf_udp" - debug_on = False parser = argparse.ArgumentParser( prog='lf_dfs_test.py', @@ -2322,8 +2315,7 @@ Sample script 2/11/2021 parser.add_argument('-ctp', '--controller_tx_power', help='--controller_tx_power <1 | 2 | 3 | 4 | 5 | 6 | 7 | 8> 1 is highest power default NA NA means no change', - default="NA" - , choices=["1", "2", "3", "4", "5", "6", "7", "8", "NA"]) + default="NA", choices=["1", "2", "3", "4", "5", "6", "7", "8", "NA"]) parser.add_argument('-dfs', '--controller_dfs', help='--controller_dfs, switch to enable dfs testing', action='store_true') parser.add_argument('-dft', '--controller_dfs_time', @@ -2360,8 +2352,8 @@ Sample script 2/11/2021 # to do add wifimode parser.add_argument('-r', '--radio', action='append', nargs=1, help='--radio \ - \"radio== ssid== ssid_pw== security== wifimode==\" ' - , required=False) + \"radio== ssid== ssid_pw== security== wifimode==\" ', + required=False) parser.add_argument('-amr', '--side_a_min_bps', help='--side_a_min_bps, station min tx bits per second default 9600', default=9600) parser.add_argument('-amp', '--side_a_min_pdu', help='--side_a_min_pdu , station ipdu size default 1518', @@ -2393,7 +2385,6 @@ Sample script 2/11/2021 controller_args = args - # logg.info("args: {}".format(args)) debug_on = args.debug ################################################################## @@ -2406,9 +2397,6 @@ Sample script 2/11/2021 if args.polling_interval: polling_interval = args.polling_interval - if args.endp_type: - endp_types = args.endp_type - if args.mgr: lfjson_host = args.mgr @@ -2418,7 +2406,7 @@ Sample script 2/11/2021 if args.radio: radios = args.radio - if args.csv_outfile != None: + if args.csv_outfile: current_time = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime()) csv_outfile = "{}_{}.csv".format(args.csv_outfile, current_time) csv_results = "results_{}_{}.csv".format(args.csv_outfile, current_time) @@ -2492,7 +2480,6 @@ Sample script 2/11/2021 formatter = logging.Formatter(FORMAT) logg = logging.getLogger(__name__) logg.setLevel(logging.DEBUG) - file_handler = None if args.log: file_handler = logging.FileHandler(outfile_log, "w") @@ -2652,8 +2639,7 @@ Sample script 2/11/2021 controller_ap_mode != __ap_mode_set or controller_tx_power != __tx_power_set or controller_chan_5ghz != __chan_5ghz_set or - controller_chan_24ghz != __chan_24ghz_set - ): + controller_chan_24ghz != __chan_24ghz_set): logg.info( "###############################################") logg.info("# NEW CONTROLLER CONFIG") @@ -2740,12 +2726,10 @@ Sample script 2/11/2021 ap_dict['ap_baud'], "--action", "clear_log"], capture_output=True, check=True) # stdout=subprocess.PIPE) - try: + if ap_info: pss = ap_info.stdout.decode('utf-8', 'ignore') - except: - logg.info( - "ap_info was of type NoneType will set pss empty") + else: pss = "empty" except subprocess.CalledProcessError as process_error: logg.info( @@ -2780,10 +2764,10 @@ Sample script 2/11/2021 ap_dict['ap_baud'], "--action", "show_log"], capture_output=True, check=True) # stdout=subprocess.PIPE - try: + if ap_info: pss = ap_info.stdout.decode('utf-8', 'ignore') - except: + else: logg.info( "ap_info was of type NoneType will set pss empty") pss = "empty" @@ -2866,10 +2850,10 @@ Sample script 2/11/2021 "--action", "show_log"], capture_output=True, check=True) - try: + if ap_info: pss = ap_info.stdout.decode('utf-8', 'ignore') - except: + else: logg.info( "ap_info was of type NoneType will set pss empty") pss = "empty" @@ -2897,7 +2881,7 @@ Sample script 2/11/2021 logg.info("ap: {}".format(line)) pat = 'CAC_EXPIRY_EVT:\s+\S+\s+\S+\s+\S+\s\S+\s\S+\s(\S+)' m = re.search(pat, line) - if m != None: + if m: __dfs_channel = m.group(1) logg.info( "__dfs_channel: {}".format( @@ -2922,17 +2906,19 @@ Sample script 2/11/2021 logg.info( "###############################################") logg.info( - "controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}" - .format(controller_ap, controller_band, - controller_chan_width, - controller_ap_mode, controller_tx_power, - controller_chan_5ghz, - controller_chan_24ghz)) + "controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}".format( + controller_ap, controller_band, + controller_chan_width, + controller_ap_mode, + controller_tx_power, + controller_chan_5ghz, + controller_chan_24ghz)) logg.info( - "__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}" - .format(__ap_set, __band_set, __chan_width_set, - __ap_mode_set, __tx_power_set, - __chan_5ghz_set, __chan_24ghz_set)) + "__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}".format( + __ap_set, __band_set, + __chan_width_set, + __ap_mode_set, __tx_power_set, + __chan_5ghz_set, __chan_24ghz_set)) logg.info("controller_wifi_mode {}".format( controller_wifimode)) pss = controller.controller_show_ap_summary() @@ -2940,11 +2926,7 @@ Sample script 2/11/2021 "controller_show_ap_summary::: pss {}".format(pss)) if args.controller_series == "9800": searchap = False - cc_mac = "" cc_ch = "" - cc_bw = "" - cc_power = "" - cc_dbm = "" for line in pss.splitlines(): if line.startswith("---------"): searchap = True @@ -2952,9 +2934,9 @@ Sample script 2/11/2021 # if the pattern changes save the output of the advanced command and re parse https://regex101.com if searchap: pat = "%s\s+(\S+)\s+(%s)\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+(\S+)\s+dBm\)+\s+(\S+)+\s" % ( - __ap_set, __ap_slot) + __ap_set, __ap_slot) m = re.search(pat, line) - if m != None: + if m: if m.group(2) == __ap_slot: cc_mac = m.group(1) cc_slot = m.group(2) @@ -2998,12 +2980,7 @@ Sample script 2/11/2021 break else: searchap = False - cc_mac = "" cc_ch = "" - cc_bw = "" - cc_power = "" - cc_dbm = "" - ch_count = "" for line in pss.splitlines(): if line.startswith("---------"): searchap = True @@ -3013,7 +2990,7 @@ Sample script 2/11/2021 pat = "%s\s+(\S+)\s+\S+\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+\(\s*(\S+)\s+dBm" % ( __ap_set) m = re.search(pat, line) - if m != None: + if m: cc_mac = m.group(1) cc_ch = m.group(2) # (132,136,140,144) cc_power = m.group(3) @@ -3184,11 +3161,9 @@ Sample script 2/11/2021 reset_port_time_max_list=reset_port_time_max_list, csv_started=__csv_started, side_a_min_bps=side_a_min_bps, - side_a_max_bps=0, side_a_min_pdu=controller_packet_size, side_a_max_pdu=0, side_b_min_bps=side_b_min_bps, - side_b_max_bps=0, side_b_min_pdu=controller_packet_size, side_b_max_pdu=0, number_template="00", @@ -3203,7 +3178,7 @@ Sample script 2/11/2021 logg.info("build step failed.") logg.info(ip_var_test.get_fail_message()) exit(1) - client_density = ip_var_test.station_bringup() + ip_var_test.station_bringup() # controller.verify_controller(client_density) ip_var_test.start(False, False) ip_var_test.stop() From 6a1064c67be27d1cc394f7f70f639b5ae0d466a1 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 15:45:28 -0800 Subject: [PATCH 471/731] lf_dfs_test: Undefined variable for class Signed-off-by: Matthew Stidham --- py-scripts/lf_dfs_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py-scripts/lf_dfs_test.py b/py-scripts/lf_dfs_test.py index bcd2eeb6..5c7f9082 100755 --- a/py-scripts/lf_dfs_test.py +++ b/py-scripts/lf_dfs_test.py @@ -83,6 +83,9 @@ class CreateCtlr: self.tx_power = _tx_power self.cap_ctl_out = _cap_ctl_out self.client_density = 0 + self.wlan = None + self.wlanID = None + self.wlanSSID = None def verify_controller(self, client_density): self.client_density = client_density From 929aaf406eb3d27f710139ecb8072e9110dfbbb8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 15:49:11 -0800 Subject: [PATCH 472/731] lf_dataplane_test: mixed spaces and tabs Signed-off-by: Matthew Stidham --- py-scripts/lf_dataplane_test.py | 60 ++++++++++++++++----------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/py-scripts/lf_dataplane_test.py b/py-scripts/lf_dataplane_test.py index fa8761e6..48f654e7 100755 --- a/py-scripts/lf_dataplane_test.py +++ b/py-scripts/lf_dataplane_test.py @@ -105,7 +105,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) cv_test_manager = importlib.import_module("py-json.cv_test_manager") @@ -255,37 +254,37 @@ def main(): Sample .json between using eth1 and eth2 { - "mgr":"192.168.0.101", - "port":"8080", - "lf_user":"lanforge", - "lf_password":"lanforge", - "instance_name":"dataplane-instance", - "config_name":"test_con", - "upstream":"1.1.eth1", - "dut":"asus_5g", - "duration":"15s", - "station":"1.1.eth2", - "download_speed":"85%", - "upload_speed":"0", - "raw_line": ["pkts: Custom;60;MTU", "cust_pkt_sz: 88 1200", "directions: DUT Transmit", "traffic_types: UDP", "bandw_options: 20", "spatial_streams: 1"] + "mgr":"192.168.0.101", + "port":"8080", + "lf_user":"lanforge", + "lf_password":"lanforge", + "instance_name":"dataplane-instance", + "config_name":"test_con", + "upstream":"1.1.eth1", + "dut":"asus_5g", + "duration":"15s", + "station":"1.1.eth2", + "download_speed":"85%", + "upload_speed":"0", + "raw_line": ["pkts: Custom;60;MTU", "cust_pkt_sz: 88 1200", "directions: DUT Transmit", "traffic_types: UDP", "bandw_options: 20", "spatial_streams: 1"] } - + Sample .json between using eth1 and station 1.1.sta0002 { - "mgr":"192.168.0.101", - "port":"8080", - "lf_user":"lanforge", - "lf_password":"lanforge", - "instance_name":"dataplane-instance", - "config_name":"test_con", - "upstream":"1.1.eth1", - "dut":"asus_5g", - "duration":"15s", - "station":"1.1.sta0002", - "download_speed":"85%", - "upload_speed":"0", - "raw_line": ["pkts: Custom;60;MTU", "cust_pkt_sz: 88 1200", "directions: DUT Transmit", "traffic_types: UDP", "bandw_options: 20", "spatial_streams: 1"] - } + "mgr":"192.168.0.101", + "port":"8080", + "lf_user":"lanforge", + "lf_password":"lanforge", + "instance_name":"dataplane-instance", + "config_name":"test_con", + "upstream":"1.1.eth1", + "dut":"asus_5g", + "duration":"15s", + "station":"1.1.sta0002", + "download_speed":"85%", + "upload_speed":"0", + "raw_line": ["pkts: Custom;60;MTU", "cust_pkt_sz: 88 1200", "directions: DUT Transmit", "traffic_types: UDP", "bandw_options: 20", "spatial_streams: 1"] +} """ ) @@ -312,7 +311,8 @@ def main(): parser.add_argument( "--graph_groups", help="File to save graph_groups to", default=None) parser.add_argument("--local_lf_report_dir", - help="--local_lf_report_dir default '' put where dataplane script run from", default="") + help="--local_lf_report_dir default '' put where dataplane script run from", + default="") args = parser.parse_args() From d245f9faac6379f6a4162405bace793b81ad86dc Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 15:51:55 -0800 Subject: [PATCH 473/731] lf_dataplane_test: Fix bare except clauses Signed-off-by: Matthew Stidham --- py-scripts/lf_dataplane_test.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/py-scripts/lf_dataplane_test.py b/py-scripts/lf_dataplane_test.py index 48f654e7..80b5afae 100755 --- a/py-scripts/lf_dataplane_test.py +++ b/py-scripts/lf_dataplane_test.py @@ -317,12 +317,12 @@ def main(): args = parser.parse_args() # use json config file - if args.json != "": - try: + if args.json: + if os.path.exists(args.json): with open(args.json, 'r') as json_config: json_data = json.load(json_config) - except: - print("Error reading {}".format(args.json)) + else: + return FileNotFoundError("Error reading {}".format(args.json)) # json configuation takes presidence to command line if "mgr" in json_data: args.mgr = json_data["mgr"] @@ -357,12 +357,12 @@ def main(): args.raw_line = json_data_tmp # use influx json config file - if args.influx_json != "": - try: - with open(args.influx_json, 'r') as influx_json_config: - influx_json_data = json.load(influx_json_config) - except: - print("Error reading {}".format(args.influx_json)) + if args.influx_json: + if os.path.exists(args.influx_json): + with open(args.influx_json, 'r') as json_config: + influx_json_data = json.load(json_config) + else: + return FileNotFoundError("Error reading {}".format(args.influx_json)) # json configuation takes presidence to command line # influx DB configuration if "influx_host" in influx_json_data: From 86d5d7f21bf4e5f93582cb4e3470f1f2ca6cbea3 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 15:52:33 -0800 Subject: [PATCH 474/731] lf_dataplane_test: Fix mutable default arguments Signed-off-by: Matthew Stidham --- py-scripts/lf_dataplane_test.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/py-scripts/lf_dataplane_test.py b/py-scripts/lf_dataplane_test.py index 80b5afae..2362a8c3 100755 --- a/py-scripts/lf_dataplane_test.py +++ b/py-scripts/lf_dataplane_test.py @@ -131,16 +131,24 @@ class DataplaneTest(cv_test): duration="15s", station="1.1.sta01500", dut="NA", - enables=[], - disables=[], - raw_lines=[], + enables=None, + disables=None, + raw_lines=None, raw_lines_file="", - sets=[], + sets=None, graph_groups=None, test_rig="" ): super().__init__(lfclient_host=lf_host, lfclient_port=lf_port) + if enables is None: + enables = [] + if disables is None: + disables = [] + if raw_lines is None: + raw_lines = [] + if sets is None: + sets = [] self.lf_host = lf_host self.lf_port = lf_port self.lf_user = lf_user From f9b9970c20cf11a8ad78b24983a83e29fc913055 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 15:59:23 -0800 Subject: [PATCH 475/731] lf_dut_sta_vap_test: Fix argparser Signed-off-by: Matthew Stidham --- py-scripts/lf_dut_sta_vap_test.py | 124 ++++++------------------------ 1 file changed, 23 insertions(+), 101 deletions(-) diff --git a/py-scripts/lf_dut_sta_vap_test.py b/py-scripts/lf_dut_sta_vap_test.py index 3b56a9a1..d5bd01da 100755 --- a/py-scripts/lf_dut_sta_vap_test.py +++ b/py-scripts/lf_dut_sta_vap_test.py @@ -27,7 +27,6 @@ import os import importlib import argparse import time -import logging import paramiko as pm from paramiko.ssh_exception import NoValidConnectionsError as exception import xlsxwriter @@ -81,7 +80,7 @@ class Login_DUT: self.CLIENT.connect(self.host, username=self.USERNAME, password=self.PASSWORD,timeout=10) return None except exception as error: - self.CLIENT = 0; + self.CLIENT = 0 return None @@ -313,107 +312,30 @@ def main(): formatter_class=argparse.RawTextHelpFormatter, description="Test Scenario of DUT Temperature measurement along with simultaneous throughput on VAP as well as stations") - parser.add_argument("-m", "--manager", type=str, help="Enter the address of Lanforge Manager (By default localhost)") + parser.add_argument("-m", "--manager", type=str, help="Enter the address of Lanforge Manager (By default localhost)", default="localhost") parser.add_argument("-sc", "--scenario", type=str, help="Enter the Name of the Scenario you want to load (by Default DFLT)") parser.add_argument("-r", "--radio", type=str, help="Enter the radio on which you want to create a station/s on ") - parser.add_argument("-n", "--num_sta", type=int, help="Enter the Number of Stations You want to create") - parser.add_argument("-i", "--sta_id", type=int, help="Enter Station id [for sta001, enter 1]") + parser.add_argument("-n", "--num_sta", type=int, help="Enter the Number of Stations You want to create", default=0) + parser.add_argument("-i", "--sta_id", type=int, help="Enter Station id [for sta001, enter 1]", default=0) parser.add_argument("-ss", "--ssid", type=str, help="Enter the ssid, with which you want to associate your stations (Enter the SSID of DUT AP)") - parser.add_argument("-up", "--upstream", type=str, help="Enter the upstream ethernet port") - parser.add_argument("-sec", "--security", type=str, help="Enter the security type [open, wep, wpa, wpa2]") - parser.add_argument("-p", "--password", type=str, help="Enter the password if security is not open") - parser.add_argument("-pr", "--protocol", type=str, help="Enter the protocol on which you want to run your connections [lf_udp, lf_tcp]") - parser.add_argument("-mn", "--min_mbps", type=str, help="Enter the Minimum Rate") - parser.add_argument("-mx", "--max_mbps", type=str, help="Enter the Maximum Rate") - parser.add_argument("-t", "--duration", type=int, help="Enter the Time for which you want to run test (In Minutes)") - parser.add_argument("-o", "--report_name", type=str, help="Enter the Name of the Output file ('Report.xlsx')") - args = None + parser.add_argument("-up", "--upstream", type=str, help="Enter the upstream ethernet port", default='br0000') + parser.add_argument("-sec", "--security", type=str, help="Enter the security type [open, wep, wpa, wpa2]", default='open') + parser.add_argument("-p", "--password", type=str, help="Enter the password if security is not open", default='[Blank]') + parser.add_argument("-pr", "--protocol", type=str, help="Enter the protocol on which you want to run your connections [lf_udp, lf_tcp]", default='lf_udp') + parser.add_argument("-mn", "--min_mbps", type=int, help="Enter the Minimum Rate", default=1000) + parser.add_argument("-mx", "--max_mbps", type=int, help="Enter the Maximum Rate") + parser.add_argument("-t", "--duration", type=int, help="Enter the Time for which you want to run test (In Minutes)", default=15) + parser.add_argument("-o", "--report_name", type=str, help="Enter the Name of the Output file ('Report.xlsx')", default='report.xlsx') - try: - args = parser.parse_args() - # Lanforge Manager IP Address - if (args.manager is None): - manager = "localhost" - if (args.manager is not None): - manager = args.manager + args = parser.parse_args() - # Scenario Name - if (args.scenario is not None): - scenario = args.scenario - # Radio Name - if (args.radio is not None): - radio = args.radio - - # Number of Stations - if (args.num_sta is None): - num_sta = 0 - if (args.num_sta is not None): - num_sta = args.num_sta - - # Station ID - if (args.sta_id is None): - sta_id = '0' - if (args.sta_id is not None): - sta_id = args.sta_id - - # SSID - if (args.ssid is not None): - ssid = args.ssid - if (args.ssid is not None): - ssid = args.ssid + min_bps = args.min_mbps*1000000 - # Security (Open by Default) - if (args.security is None): - security = 'open' - if (args.security is not None): - security = args.security - - # Password (if Security is not Open) - if (args.password is not None): - password = args.password - if (args.password == 'open'): - password = "[Blank]" - if (args.password is None): - password = "[Blank]" - - # Upstream Port (By default br0000) - if (args.upstream is None): - upstream = 'br0000' - if (args.upstream is not None): - upstream = args.upstream - - # Protocol (By Default lf_udp) - if (args.protocol is not None): - protocol = args.protocol - if (args.protocol is None): - protocol = 'lf_udp' - - #Min BPS - if (args.min_mbps is not None): - min_bps = int(args.min_mbps)*1000000 - if (args.min_mbps is None): - min_bps = int(1000)*1000000 - if (args.max_mbps is None ): - max_bps = int(1000)*1000000 - - if (args.min_mbps is not None): - min_bps = int(args.min_mbps)*1000000 - if (args.max_mbps is not None and args.max_mbps != "same"): + if (args.max_mbps is not None and args.max_mbps != "same"): max_bps = int(args.max_mbps)*1000000 - if (args.max_mbps is not None and args.max_mbps == "same"): + if (args.max_mbps is not None and args.max_mbps == "same"): max_bps = args.min_mbps - if (args.duration is not None): - duration = (args.duration * 60)/5 - if (args.report_name is not None): - report_name = args.report_name - if (args.duration is None): - duration = (1 * 60)/5 - if (args.report_name is None): - report_name = "report.xlsx" - except Exception as e: - logging.exception(e) - - exit(2) + @@ -423,7 +345,7 @@ def main(): #Loading the Scenario on Lanforge_1 (Here Considered as DUT) [Created VAP With SSID 'lexusap' on wiphy0 with eth1 as backhaul] Scenario_1 = LoadScenario("192.168.200.18", 8080, "Lexus_DUT") - dut_traffic_profile = CreateSTA_CX("192.168.200.18", 8080, "wiphy1", 1, 0, 'lanforge_ap', 'open', password, 'br0000', 'lf_udp', min_bps, max_bps) + dut_traffic_profile = CreateSTA_CX("192.168.200.18", 8080, "wiphy1", 1, 0, 'lanforge_ap', 'open', args.password, 'br0000', 'lf_udp', args.min_bps, args.max_bps) dut_traffic_profile.build() print("DUT All Set... Lets setup Lanforge") @@ -432,10 +354,10 @@ def main(): #Loading the Scenario on Lanforge_2 (Here Considered as LANFORGE Test) [Created VAP With SSID 'lanforge_ap' on wiphy0 with eth2 as backhaul] DB_Lanforge_2 = "LANforge_TEST" - Scenario_2 = LoadScenario(manager, 8080, scenario) + Scenario_2 = LoadScenario(args.manager, 8080, args.scenario) - lf_traffic_profile = CreateSTA_CX(manager, 8080, radio, num_sta, sta_id, ssid, security, password, upstream, protocol, min_bps, max_bps) + lf_traffic_profile = CreateSTA_CX(args.manager, 8080, args.radio, args.num_sta, args.sta_id, args.ssid, args.security, args.password, args.upstream, args.protocol, args.min_bps, args.max_bps) lf_traffic_profile.build() print("Lanforge System is All set... Lets start and Measure") @@ -448,7 +370,7 @@ def main(): print("Collecting Throughput Values...") # Object to Measure Throughput at VAP Side - vap_measure_obj = VAP_Measure(manager, 8080) + vap_measure_obj = VAP_Measure(args.manager, 8080) # dut_temp_obj = Login_DUT(1, "Thread-1", "192.168.200.18") @@ -458,7 +380,7 @@ def main(): throughput_vap =[] # This loop will get the Data from All the endpoints and sum up to give total Throughput over time - for i in range(0,int(duration)): + for i in range(0,int(args.duration)): temp=0 for j in lf_traffic_profile.endp: y=lf_traffic_profile.local_realm.json_get("/endp/"+j).get('endpoint').get('rx rate') @@ -472,7 +394,7 @@ def main(): print(throughput_sta) dut_traffic_profile.cleanup() lf_traffic_profile.cleanup() - GenerateReport(throughput_sta, throughput_vap, dut_temp_obj.data_core1, dut_temp_obj.data_core2, duration, report_name) + GenerateReport(throughput_sta, throughput_vap, dut_temp_obj.data_core1, dut_temp_obj.data_core2, args.duration, args.report_name) From d5d05c8082e0350c21773162037867e03b550b07 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:01:31 -0800 Subject: [PATCH 476/731] lf_dut_sta_vap_test: fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/lf_dut_sta_vap_test.py | 288 +++++++++++++++--------------- 1 file changed, 145 insertions(+), 143 deletions(-) diff --git a/py-scripts/lf_dut_sta_vap_test.py b/py-scripts/lf_dut_sta_vap_test.py index d5bd01da..dbde81c3 100755 --- a/py-scripts/lf_dut_sta_vap_test.py +++ b/py-scripts/lf_dut_sta_vap_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -''' +""" This Script has two classes : 1. LoadScenario : It will load the existing saved scenario to the Lanforge (Here used for Loading Bridged VAP) 2. CreateSTA_CX : It will create stations and L3 Cross connects and start them @@ -7,11 +7,11 @@ In this example, Another Lanforge is used as DUT It also have a function : GenerateReport that generates the report in xlsx format as well as it plots the Graph of throughput over time with temperature It also have Plot function that generates a html page that contains the plot - - - Prerequisite + + + Prerequisite Start the Lanforge Manager both Sides - + Installation pip install paramiko pip install bokeh @@ -21,7 +21,7 @@ .\Lexus_Final.py --lf_host 192.168.200.15 --dut_host 192.168.200.18 --dut_radio wiphy1 --lf_radio wiphy1 --num_sta 1 --sta_id 1 --lf_ssid lanforge_ap --dut_ssid lexusap --security open --dut_upstream eth2 --lf_upstream eth1 --protocol lf_udp --min_bps 1000 --max_bps 10000 --time 1 This Script is intended to automate the testing of DUT that has stations as well as AP. To automate the simultaenous testing and check the DUT Temperature -''' +""" import sys import os import importlib @@ -38,7 +38,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -52,33 +51,33 @@ Realm = realm.Realm class Login_DUT: def __init__(self, threadID, name, HOST): - self.threadID = threadID - self.name = name - self.host=HOST - self.USERNAME = "lanforge" - self.PASSWORD = "lanforge" - self.CLIENT= pm.SSHClient() - self.LF1= self.Connect() - self.data_core1=[] - self.data_core2=[] - if self.CLIENT == 0: - exit() - print("Connected to " +HOST+" DUT to Measure the Core Temperature") + self.threadID = threadID + self.name = name + self.host = HOST + self.USERNAME = "lanforge" + self.PASSWORD = "lanforge" + self.CLIENT = pm.SSHClient() + self.LF1 = self.Connect() + self.data_core1 = [] + self.data_core2 = [] + if self.CLIENT == 0: + exit() + print("Connected to " + HOST + " DUT to Measure the Core Temperature") + def run(self): - stdin, stdout, stderr= self.CLIENT.exec_command("sensors") + stdin, stdout, stderr = self.CLIENT.exec_command("sensors") out_lines = stdout.readlines() err_lines = stderr.readlines() - print(out_lines[len(out_lines)-3], out_lines[len(out_lines)-2]) - self.data_core1.append(out_lines[len(out_lines)-3]) - self.data_core2.append(out_lines[len(out_lines)-2]) - + print(out_lines[len(out_lines) - 3], out_lines[len(out_lines) - 2]) + self.data_core1.append(out_lines[len(out_lines) - 3]) + self.data_core2.append(out_lines[len(out_lines) - 2]) def Connect(self): self.CLIENT.load_system_host_keys() self.CLIENT.set_missing_host_key_policy(pm.AutoAddPolicy()) try: - self.CLIENT.connect(self.host, username=self.USERNAME, password=self.PASSWORD,timeout=10) - return None + self.CLIENT.connect(self.host, username=self.USERNAME, password=self.PASSWORD, timeout=10) + return None except exception as error: self.CLIENT = 0 return None @@ -86,24 +85,26 @@ class Login_DUT: # Class to Load a Scenario that has been Created in Chamber View saved under DB/[Database_Name] class LoadScenario(LFCliBase): - def __init__(self, host, port, db_name, security_debug_on=False, _exit_on_error=False,_exit_on_fail=False): + def __init__(self, host, port, db_name, security_debug_on=False, _exit_on_error=False, _exit_on_fail=False): super().__init__(host, port, _debug=security_debug_on, _exit_on_fail=_exit_on_fail) self.host = host self.port = port - self.json_post("/cli-json/load", { "name": db_name, "action": 'overwrite' }) - print(host+ " : Scenario Loaded...") + self.json_post("/cli-json/load", {"name": db_name, "action": 'overwrite'}) + print(host + " : Scenario Loaded...") time.sleep(2) + # Class to create stations and run L3 Cross connects and run them for given time. It also stores the endpoint names for measuring throughput class CreateSTA_CX(LFCliBase): - - def __init__(self, host, port, radio, num_sta, sta_id, ssid, security, password, upstream, protocol, min_bps, max_bps, security_debug_on=True, _exit_on_error=True, _exit_on_fail=True): + + def __init__(self, host, port, radio, num_sta, sta_id, ssid, security, password, upstream, protocol, min_bps, + max_bps, security_debug_on=True, _exit_on_error=True, _exit_on_fail=True): super().__init__(host, port, _debug=security_debug_on, _exit_on_fail=_exit_on_fail) - + self.host = host self.port = port self.radio = radio - + self.num_sta = num_sta self.sta_id = sta_id @@ -115,25 +116,25 @@ class CreateSTA_CX(LFCliBase): self.upstream = upstream self.protocol = protocol - self.min_bps =min_bps - self.max_bps =max_bps + self.min_bps = min_bps + self.max_bps = max_bps - #Creating a Realm Object + # Creating a Realm Object self.local_realm = Realm(lfclient_host=host, lfclient_port=port) - #Creating Profile Objects + # Creating Profile Objects self.station_profile = self.local_realm.new_station_profile() self.cx_profile = self.local_realm.new_l3_cx_profile() - #Setting CX Name - self.cx_profile.name_prefix_="Connection" + # Setting CX Name + self.cx_profile.name_prefix_ = "Connection" self.cx_names = [] self.sta_list = [] - self.endp=[] - for i in range(sta_id,sta_id+num_sta): + self.endp = [] + for i in range(sta_id, sta_id + num_sta): self.sta_list.append("sta00") - - #portDhcpUpRequest + + # portDhcpUpRequest ''' upstream_dhcp = LFRequest.LFRequest("http://"+str(host)+":"+str(port)+"/"+"/cli-form/set_port") upstream_dhcp.addPostData( LFUtils.portSetDhcpDownRequest(1, upstream)) @@ -146,42 +147,42 @@ class CreateSTA_CX(LFCliBase): def build(self): - #Creating Stations of Given Profile Settings + # Creating Stations of Given Profile Settings self.station_profile.use_security(self.security, self.ssid, passwd=self.password) self.station_profile.create(self.radio, num_stations=self.num_sta, sta_names_=self.sta_list) self.station_profile.admin_up() - #Wait for a while + # Wait for a while time.sleep(15) - - #Setting up the Parameters for CX + + # Setting up the Parameters for CX self.cx_profile.side_a_min_bps = self.min_bps self.cx_profile.side_b_min_bps = self.min_bps self.cx_profile.side_a_max_bps = self.max_bps self.cx_profile.side_b_max_bps = self.max_bps - + self.cx_profile.side_a_min_pdu = 'Auto' self.cx_profile.side_b_min_pdu = 'Auto' self.cx_profile.report_timer = 1000 - self.cx_profile.side_a_min_pkt='Same' - self.cx_profile.side_a_max_pkt='Same' - - #Create Connections of Given Parameters - self.cx_profile.create(self.protocol, side_a="1.1."+self.upstream, side_b=list(self.local_realm.find_ports_like("sta0+"))) + self.cx_profile.side_a_min_pkt = 'Same' + self.cx_profile.side_a_max_pkt = 'Same' + + # Create Connections of Given Parameters + self.cx_profile.create(self.protocol, side_a="1.1." + self.upstream, + side_b=list(self.local_realm.find_ports_like("sta0+"))) time.sleep(15) - + # Getting all the Endpoint Names for measuring Throughput Later for i in self.cx_profile.get_cx_names(): - self.cx_names.append(i) + self.cx_names.append(i) for j in self.cx_names: - x=self.local_realm.json_get("/cx/"+j) + x = self.local_realm.json_get("/cx/" + j) self.endp.append(x.get(j).get('endpoints')[1]) - #print(self.endp) + # print(self.endp) return 0 - def start(self): - #self.station_profile.admin_up() - + # self.station_profile.admin_up() + self.cx_profile.start_cx() time.sleep(5) return 0 @@ -196,26 +197,26 @@ class CreateSTA_CX(LFCliBase): def cleanup(self): # Removing Connections self.local_realm.cleanup_cxe_prefix(self.cx_profile.name_prefix) - + vap = self.local_realm.find_ports_like("vap+") bridges = self.local_realm.find_ports_like("br+") station_map = self.local_realm.find_ports_like("sta+") - #Removing Bridges - for eid,record in bridges.items(): + # Removing Bridges + for eid, record in bridges.items(): self.local_realm.remove_vlan_by_eid(eid) time.sleep(0.03) - #Removing VAP - for eid,record in vap.items(): + # Removing VAP + for eid, record in vap.items(): self.local_realm.remove_vlan_by_eid(eid) time.sleep(0.03) - - #Removing stations - for eid,record in station_map.items(): + + # Removing stations + for eid, record in station_map.items(): self.local_realm.remove_vlan_by_eid(eid) time.sleep(0.03) del_sta_names = [] try: - for eid,value in station_map.items(): + for eid, value in station_map.items(): tname = eid[eid.rfind('.'):] del_sta_names.append(tname) except Exception as x: @@ -224,47 +225,47 @@ class CreateSTA_CX(LFCliBase): LFUtils.waitUntilPortsDisappear(base_url=self.local_realm.lfclient_url, port_list=del_sta_names, debug=True) print("Ports Successfully Cleaned up") return 0 - except: + except: print("Ports Successfully Cleaned up") time.sleep(5) return 0 # Generates XLSX Report -def GenerateReport(throughput_sta, throughput_vap, core1_temp, core2_temp, duration,name): +def GenerateReport(throughput_sta, throughput_vap, core1_temp, core2_temp, duration, name): workbook = xlsxwriter.Workbook(name) worksheet = workbook.add_worksheet() worksheet.write('A1', 'THROUGHPUT OVER TIME STA CX ') worksheet.write('B1', 'THROUGHPUT OVER TIME VAP ') worksheet.write('C1', 'CORE 0 TEMP') worksheet.write('D1', 'CORE 1 TEMP') - core1=[] - core2=[] - sta_throu=[] - vap_throu=[] - j=2 + core1 = [] + core2 = [] + sta_throu = [] + vap_throu = [] + j = 2 for i in throughput_sta: - sta_throu.append(i/1000000) - worksheet.write('A'+str(j), str(i/1000000)+" Mbps") - j=j+1 - j=2 + sta_throu.append(i / 1000000) + worksheet.write('A' + str(j), str(i / 1000000) + " Mbps") + j = j + 1 + j = 2 for i in throughput_vap: - vap_throu.append(i/1000000) - worksheet.write('B'+str(j), str(i/1000000)+" Mbps") - j=j+1 - j=2 + vap_throu.append(i / 1000000) + worksheet.write('B' + str(j), str(i / 1000000) + " Mbps") + j = j + 1 + j = 2 for i in core1_temp: core1.append(int(str(i).split(':')[1].split('(')[0].split('.')[0].split('+')[1])) - worksheet.write('C'+str(j),str(i).split(':')[1].split('(')[0] ) - j=j+1 - j=2 + worksheet.write('C' + str(j), str(i).split(':')[1].split('(')[0]) + j = j + 1 + j = 2 for i in core2_temp: core2.append(int(str(i).split(':')[1].split('(')[0].split('.')[0].split('+')[1])) - worksheet.write('D'+str(j), str(i).split(':')[1].split('(')[0]) - j=j+1 + worksheet.write('D' + str(j), str(i).split(':')[1].split('(')[0]) + j = j + 1 - Time =[] - for i in range(0,int(duration)*5): + Time = [] + for i in range(0, int(duration) * 5): Time.append(i) plot(sta_throu, vap_throu, core1, core2, Time) workbook.close() @@ -272,92 +273,94 @@ def GenerateReport(throughput_sta, throughput_vap, core1_temp, core2_temp, durat # Plotting Function for Parameters def plot(throughput_sta, throughput_vap, core1_temp, core2_temp, Time): - - s1 = figure() s1.title.text = "WIFI Throughput vs Temperature Plot" s1.xaxis.axis_label = "Time in Seconds" s1.yaxis.axis_label = "Throughput in Mbps" - s1.line( Time, throughput_sta, color='black') - #s1.circle(Time, throughput_sta, color='red') + s1.line(Time, throughput_sta, color='black') + # s1.circle(Time, throughput_sta, color='red') + + s1.line(Time, throughput_vap, color='blue') + # s1.circle(Time, throughput_vap, color='blue') - s1.line( Time, throughput_vap, color='blue') - #s1.circle(Time, throughput_vap, color='blue') - s1.extra_y_ranges = {"Temperature": Range1d(start=0, end=150)} s1.add_layout(LinearAxis(y_range_name="Temperature", axis_label="Temperature in Degree Celsius"), 'right') - + s1.line(Time, core1_temp, y_range_name='Temperature', color='red') - #s1.circle(Time, core1_temp, y_range_name='Temperature', color='red') + # s1.circle(Time, core1_temp, y_range_name='Temperature', color='red') s1.line(Time, core2_temp, y_range_name='Temperature', color='green') - #s1.circle(Time, core2_temp, y_range_name='Temperature', color='blue') + # s1.circle(Time, core2_temp, y_range_name='Temperature', color='blue') show(s1) - + # Creates the Instance for LFCliBase class VAP_Measure(LFCliBase): def __init__(self, lfclient_host, lfclient_port): super().__init__(lfclient_host, lfclient_port) - # main method def main(): - parser = argparse.ArgumentParser( prog='lf_dut_sta_vap_test.py', formatter_class=argparse.RawTextHelpFormatter, description="Test Scenario of DUT Temperature measurement along with simultaneous throughput on VAP as well as stations") - - parser.add_argument("-m", "--manager", type=str, help="Enter the address of Lanforge Manager (By default localhost)", default="localhost") - parser.add_argument("-sc", "--scenario", type=str, help="Enter the Name of the Scenario you want to load (by Default DFLT)") + + parser.add_argument("-m", "--manager", type=str, + help="Enter the address of Lanforge Manager (By default localhost)", default="localhost") + parser.add_argument("-sc", "--scenario", type=str, + help="Enter the Name of the Scenario you want to load (by Default DFLT)") parser.add_argument("-r", "--radio", type=str, help="Enter the radio on which you want to create a station/s on ") parser.add_argument("-n", "--num_sta", type=int, help="Enter the Number of Stations You want to create", default=0) parser.add_argument("-i", "--sta_id", type=int, help="Enter Station id [for sta001, enter 1]", default=0) - parser.add_argument("-ss", "--ssid", type=str, help="Enter the ssid, with which you want to associate your stations (Enter the SSID of DUT AP)") + parser.add_argument("-ss", "--ssid", type=str, + help="Enter the ssid, with which you want to associate your stations (Enter the SSID of DUT AP)") parser.add_argument("-up", "--upstream", type=str, help="Enter the upstream ethernet port", default='br0000') - parser.add_argument("-sec", "--security", type=str, help="Enter the security type [open, wep, wpa, wpa2]", default='open') - parser.add_argument("-p", "--password", type=str, help="Enter the password if security is not open", default='[Blank]') - parser.add_argument("-pr", "--protocol", type=str, help="Enter the protocol on which you want to run your connections [lf_udp, lf_tcp]", default='lf_udp') + parser.add_argument("-sec", "--security", type=str, help="Enter the security type [open, wep, wpa, wpa2]", + default='open') + parser.add_argument("-p", "--password", type=str, help="Enter the password if security is not open", + default='[Blank]') + parser.add_argument("-pr", "--protocol", type=str, + help="Enter the protocol on which you want to run your connections [lf_udp, lf_tcp]", + default='lf_udp') parser.add_argument("-mn", "--min_mbps", type=int, help="Enter the Minimum Rate", default=1000) parser.add_argument("-mx", "--max_mbps", type=int, help="Enter the Maximum Rate") - parser.add_argument("-t", "--duration", type=int, help="Enter the Time for which you want to run test (In Minutes)", default=15) - parser.add_argument("-o", "--report_name", type=str, help="Enter the Name of the Output file ('Report.xlsx')", default='report.xlsx') - + parser.add_argument("-t", "--duration", type=int, help="Enter the Time for which you want to run test (In Minutes)", + default=15) + parser.add_argument("-o", "--report_name", type=str, help="Enter the Name of the Output file ('Report.xlsx')", + default='report.xlsx') + args = parser.parse_args() - - min_bps = args.min_mbps*1000000 - if (args.max_mbps is not None and args.max_mbps != "same"): - max_bps = int(args.max_mbps)*1000000 - if (args.max_mbps is not None and args.max_mbps == "same"): - max_bps = args.min_mbps + min_bps = args.min_mbps * 1000000 - + if args.max_mbps and args.max_mbps != "same": + max_bps = int(args.max_mbps) * 1000000 + if args.max_mbps and args.max_mbps == "same": + max_bps = args.min_mbps - # Start DUT - - #Loading the Scenario on Lanforge_1 (Here Considered as DUT) [Created VAP With SSID 'lexusap' on wiphy0 with eth1 as backhaul] + # Loading the Scenario on Lanforge_1 (Here Considered as DUT) [Created VAP With SSID 'lexusap' on wiphy0 with eth1 as backhaul] Scenario_1 = LoadScenario("192.168.200.18", 8080, "Lexus_DUT") - - dut_traffic_profile = CreateSTA_CX("192.168.200.18", 8080, "wiphy1", 1, 0, 'lanforge_ap', 'open', args.password, 'br0000', 'lf_udp', args.min_bps, args.max_bps) + + dut_traffic_profile = CreateSTA_CX("192.168.200.18", 8080, "wiphy1", 1, 0, 'lanforge_ap', 'open', args.password, + 'br0000', 'lf_udp', min_bps, max_bps) dut_traffic_profile.build() print("DUT All Set... Lets setup Lanforge") - - #Loading the Scenario on Lanforge_2 (Here Considered as LANFORGE Test) [Created VAP With SSID 'lanforge_ap' on wiphy0 with eth2 as backhaul] - + # Loading the Scenario on Lanforge_2 (Here Considered as LANFORGE Test) [Created VAP With SSID 'lanforge_ap' on wiphy0 with eth2 as backhaul] + DB_Lanforge_2 = "LANforge_TEST" Scenario_2 = LoadScenario(args.manager, 8080, args.scenario) - - lf_traffic_profile = CreateSTA_CX(args.manager, 8080, args.radio, args.num_sta, args.sta_id, args.ssid, args.security, args.password, args.upstream, args.protocol, args.min_bps, args.max_bps) + lf_traffic_profile = CreateSTA_CX(args.manager, 8080, args.radio, args.num_sta, args.sta_id, args.ssid, + args.security, args.password, args.upstream, args.protocol, min_bps, + max_bps) lf_traffic_profile.build() print("Lanforge System is All set... Lets start and Measure") @@ -375,16 +378,16 @@ def main(): # dut_temp_obj = Login_DUT(1, "Thread-1", "192.168.200.18") - #List for Storing the Total Throughput - throughput_sta =[] - throughput_vap =[] - + # List for Storing the Total Throughput + throughput_sta = [] + throughput_vap = [] + # This loop will get the Data from All the endpoints and sum up to give total Throughput over time - for i in range(0,int(args.duration)): - temp=0 + for i in range(0, int(args.duration)): + temp = 0 for j in lf_traffic_profile.endp: - y=lf_traffic_profile.local_realm.json_get("/endp/"+j).get('endpoint').get('rx rate') - temp=temp+y + y = lf_traffic_profile.local_realm.json_get("/endp/" + j).get('endpoint').get('rx rate') + temp = temp + y throughput_sta.append(temp) throughput_vap.append(vap_measure_obj.json_get("/port/1/1/vap0000/").get('interface').get('bps rx')) dut_temp_obj.run() @@ -394,10 +397,9 @@ def main(): print(throughput_sta) dut_traffic_profile.cleanup() lf_traffic_profile.cleanup() - GenerateReport(throughput_sta, throughput_vap, dut_temp_obj.data_core1, dut_temp_obj.data_core2, args.duration, args.report_name) - + GenerateReport(throughput_sta, throughput_vap, dut_temp_obj.data_core1, dut_temp_obj.data_core2, args.duration, + args.report_name) + - if __name__ == '__main__': main() - From de7bce7b1627edad0df5b80b91d40f4cd178761f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:02:23 -0800 Subject: [PATCH 477/731] lf_dut_sta_vap_test: Remove bare except clause Signed-off-by: Matthew Stidham --- py-scripts/lf_dut_sta_vap_test.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/py-scripts/lf_dut_sta_vap_test.py b/py-scripts/lf_dut_sta_vap_test.py index dbde81c3..9ebbb771 100755 --- a/py-scripts/lf_dut_sta_vap_test.py +++ b/py-scripts/lf_dut_sta_vap_test.py @@ -221,12 +221,8 @@ class CreateSTA_CX(LFCliBase): del_sta_names.append(tname) except Exception as x: self.local_realm.error(x) - try: - LFUtils.waitUntilPortsDisappear(base_url=self.local_realm.lfclient_url, port_list=del_sta_names, debug=True) - print("Ports Successfully Cleaned up") - return 0 - except: - print("Ports Successfully Cleaned up") + LFUtils.waitUntilPortsDisappear(base_url=self.local_realm.lfclient_url, port_list=del_sta_names, debug=True) + print("Ports Successfully Cleaned up") time.sleep(5) return 0 From af4f7a5ebbafae16b21a323fe0e7a6efca45573b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:03:31 -0800 Subject: [PATCH 478/731] lf_dfs_test: Fix undefined variables Signed-off-by: Matthew Stidham --- py-scripts/lf_dfs_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/lf_dfs_test.py b/py-scripts/lf_dfs_test.py index 5c7f9082..35289eb7 100755 --- a/py-scripts/lf_dfs_test.py +++ b/py-scripts/lf_dfs_test.py @@ -3156,7 +3156,7 @@ Sample script 2/11/2021 debug_on=debug_on, wait_timeout=wait_timeout, outfile=csv_outfile, - results=csv_results, + results=args.csv_results, test_keys=test_keys, test_config=test_config, reset_port_enable_list=reset_port_enable_list, @@ -3170,8 +3170,8 @@ Sample script 2/11/2021 side_b_min_pdu=controller_packet_size, side_b_max_pdu=0, number_template="00", - test_duration=test_duration, - polling_interval=polling_interval, + test_duration=args.test_duration, + polling_interval=args.polling_interval, lfclient_host=lfjson_host, lfclient_port=lfjson_port) __csv_started = True From 4b47f1c1565f5132036f466a9cd20f565d42217e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:04:15 -0800 Subject: [PATCH 479/731] sta_connect2: Cleanup whitespace Signed-off-by: Matthew Stidham --- py-scripts/sta_connect2.py | 87 ++++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index 2d3d033c..da3b1d3b 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -15,7 +15,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -68,11 +67,11 @@ class StaConnect2(LFCliBase): self.upstream_url = None # defer construction self.station_names = [] if _sta_name is not None: - self.station_names = [ _sta_name ] + self.station_names = [_sta_name] self.sta_prefix = _sta_prefix self.bringup_time_sec = _bringup_time_sec # self.localrealm :Realm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 - self.localrealm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 + self.localrealm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 self.resulting_stations = {} self.resulting_endpoints = {} self.station_profile = None @@ -117,23 +116,23 @@ class StaConnect2(LFCliBase): counter = 0 # print("there are %d results" % len(self.station_results)) fields = "_links,port,alias,ip,ap,port+type" - self.station_results = self.localrealm.find_ports_like("%s*"%self.sta_prefix, fields, debug_=False) + self.station_results = self.localrealm.find_ports_like("%s*" % self.sta_prefix, fields, debug_=False) if (self.station_results is None) or (len(self.station_results) < 1): self.get_failed_result_list() - for eid,record in self.station_results.items(): - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - #pprint(eid) - #pprint(record) + for eid, record in self.station_results.items(): + # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + # pprint(eid) + # pprint(record) if record["ap"] == bssid: counter += 1 - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") return counter def clear_test_results(self): self.resulting_stations = {} self.resulting_endpoints = {} super().clear_test_results() - #super(StaConnect, self).clear_test_results().test_results.clear() + # super(StaConnect, self).clear_test_results().test_results.clear() def setup(self, extra_securities=[]): self.clear_test_results() @@ -181,7 +180,8 @@ class StaConnect2(LFCliBase): for security in extra_securities: self.station_profile.add_security_extra(security=security) print("Adding new stations ", end="") - self.station_profile.create(radio=self.radio, sta_names_=self.station_names, up_=False, debug=self.debug, suppress_related_commands_=True) + self.station_profile.create(radio=self.radio, sta_names_=self.station_names, up_=False, debug=self.debug, + suppress_related_commands_=True) LFUtils.wait_until_ports_appear(self.lfclient_url, self.station_names, debug=self.debug) # Create UDP endpoints @@ -192,13 +192,13 @@ class StaConnect2(LFCliBase): self.l3_udp_profile.side_b_min_pdu = 1500 self.l3_udp_profile.report_timer = 1000 self.l3_udp_profile.name_prefix = "udp" - port_list = list(self.localrealm.find_ports_like("%s+"%self.sta_prefix)) + port_list = list(self.localrealm.find_ports_like("%s+" % self.sta_prefix)) if (port_list is None) or (len(port_list) < 1): - raise ValueError("Unable to find ports named '%s'+"%self.sta_prefix) + raise ValueError("Unable to find ports named '%s'+" % self.sta_prefix) self.l3_udp_profile.create(endp_type="lf_udp", - side_a=port_list, - side_b="%d.%s" % (self.resource, self.upstream_port), - suppress_related_commands=True) + side_a=port_list, + side_b="%d.%s" % (self.resource, self.upstream_port), + suppress_related_commands=True) # Create TCP endpoints self.l3_tcp_profile = self.localrealm.new_l3_cx_profile() @@ -207,9 +207,9 @@ class StaConnect2(LFCliBase): self.l3_tcp_profile.name_prefix = "tcp" self.l3_tcp_profile.report_timer = 1000 self.l3_tcp_profile.create(endp_type="lf_tcp", - side_a=list(self.localrealm.find_ports_like("%s+"%self.sta_prefix)), - side_b="%d.%s" % (self.resource, self.upstream_port), - suppress_related_commands=True) + side_a=list(self.localrealm.find_ports_like("%s+" % self.sta_prefix)), + side_b="%d.%s" % (self.resource, self.upstream_port), + suppress_related_commands=True) def start(self): if self.station_profile is None: @@ -220,9 +220,9 @@ class StaConnect2(LFCliBase): if not self.station_profile.up: print("\nBringing ports up...") data = {"shelf": 1, - "resource": self.resource, - "port": "ALL", - "probe_flags": 1} + "resource": self.resource, + "port": "ALL", + "probe_flags": 1} self.json_post("/cli-json/nc_show_ports", data) self.station_profile.admin_up() LFUtils.waitUntilPortsAdminUp(self.resource, self.lfclient_url, self.station_names) @@ -269,7 +269,7 @@ class StaConnect2(LFCliBase): else: connected_stations[sta_name] = sta_url data = { - "shelf":1, + "shelf": 1, "resource": self.resource, "port": "ALL", "probe_flags": 1 @@ -281,7 +281,7 @@ class StaConnect2(LFCliBase): for sta_name in self.station_names: sta_url = self.get_station_url(sta_name) - station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") + station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") if station_info is None: print("unable to query %s" % sta_url) self.resulting_stations[sta_url] = station_info @@ -295,13 +295,14 @@ class StaConnect2(LFCliBase): print(" %s +AP %s, " % (sta_name, ap), end="") if self.dut_bssid != "": if self.dut_bssid.lower() == ap.lower(): - self._pass(sta_name+" connected to BSSID: " + ap) + self._pass(sta_name + " connected to BSSID: " + ap) # self.test_results.append("PASSED: ) # print("PASSED: Connected to BSSID: "+ap) else: - self._fail("%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap)) + self._fail( + "%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap)) else: - self._fail(sta_name+" did not connect to AP") + self._fail(sta_name + " did not connect to AP") return False if ip == "0.0.0.0": @@ -326,7 +327,7 @@ class StaConnect2(LFCliBase): def collect_endp_stats(self, endp_map): print("Collecting Data") - fields="/all" + fields = "/all" for (cx_name, endps) in endp_map.items(): try: endp_url = "/endp/%s%s" % (endps[0], fields) @@ -335,7 +336,7 @@ class StaConnect2(LFCliBase): ptest_a_tx = endp_json['endpoint']['tx bytes'] ptest_a_rx = endp_json['endpoint']['rx bytes'] - #ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % cx_names[cx_name]["b"]) + # ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % cx_names[cx_name]["b"]) endp_url = "/endp/%s%s" % (endps[1], fields) endp_json = self.json_get(endp_url) self.resulting_endpoints[endp_url] = endp_json @@ -352,7 +353,6 @@ class StaConnect2(LFCliBase): except Exception as e: self.error(e) - def stop(self): # stop cx traffic print("Stopping CX Traffic") @@ -385,8 +385,9 @@ class StaConnect2(LFCliBase): curr_endp_names.append(endp_names[1]) for (cx_name, endp_names) in self.l3_tcp_profile.created_cx.items(): curr_endp_names.append(endp_names[0]) - curr_endp_names.append(endp_names[1]) - removeEndps(self.lfclient_url, curr_endp_names, debug= self.debug) + curr_endp_names.append(endp_names[1]) + removeEndps(self.lfclient_url, curr_endp_names, debug=self.debug) + # ~class @@ -420,11 +421,14 @@ Example: parser.add_argument("--dut_bssid", type=str, help="DUT BSSID to which we expect to connect.") parser.add_argument("--debug", type=str, help="enable debugging") parser.add_argument("--prefix", type=str, help="Station prefix. Default: 'sta'", default='sta') - parser.add_argument("--bringup_time", type=int, help="Seconds to wait for stations to associate and aquire IP. Default: 300", default=300) + parser.add_argument("--bringup_time", type=int, + help="Seconds to wait for stations to associate and aquire IP. Default: 300", default=300) parser.add_argument('--influx_user', help='Username for your Influx database', default=None) parser.add_argument('--influx_passwd', help='Password for your Influx database', default=None) parser.add_argument('--influx_db', help='Name of your Influx database', default=None) - parser.add_argument('--influx_host', help='Host of your influx database if different from the system you are running on', default='localhost') + parser.add_argument('--influx_host', + help='Host of your influx database if different from the system you are running on', + default='localhost') parser.add_argument('--monitor_interval', help='How frequently you want to append to your database', default='5s') args = parser.parse_args() @@ -433,7 +437,7 @@ Example: if args.port is not None: lfjson_port = args.port - on_flags = [ 1, "1", "on", "yes", "true" ] + on_flags = [1, "1", "on", "yes", "true"] debug_v = False if args.debug is not None: if args.debug in on_flags: @@ -441,10 +445,10 @@ Example: staConnect = StaConnect2(lfjson_host, lfjson_port, debug_=True, - _influx_db = args.influx_db, - _influx_passwd = args.influx_passwd, - _influx_user = args.influx_user, - _influx_host = args.influx_host, + _influx_db=args.influx_db, + _influx_passwd=args.influx_passwd, + _influx_user=args.influx_user, + _influx_host=args.influx_host, _exit_on_fail=True, _exit_on_error=False) @@ -472,10 +476,10 @@ Example: staConnect.dut_security = args.dut_security if (args.prefix is not None) or (args.prefix != "sta"): staConnect.sta_prefix = args.prefix - staConnect.station_names = [ "%s0000"%args.prefix ] + staConnect.station_names = ["%s0000" % args.prefix] staConnect.bringup_time_sec = args.bringup_time - # staConnect.cleanup() + # staConnect.cleanup() staConnect.setup() staConnect.start() print("napping %f sec" % staConnect.runtime_secs) @@ -492,6 +496,7 @@ Example: staConnect.cleanup() + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 4037c4e53c6f8115a786649a76ca0bb2fedb6663 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:05:01 -0800 Subject: [PATCH 480/731] sta_connect2: Rename shadow variables Signed-off-by: Matthew Stidham --- py-scripts/sta_connect2.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index da3b1d3b..e9fec541 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -159,8 +159,8 @@ class StaConnect2(LFCliBase): sta_url = self.get_station_url(sta_name) response = self.json_get(sta_url) if (response is not None) and (response["interface"] is not None): - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) + for station in self.station_names: + LFUtils.removePort(self.resource, station, self.lfclient_url) LFUtils.wait_until_ports_disappear(self.lfclient_url, self.station_names) # Create stations and turn dhcp on @@ -437,12 +437,6 @@ Example: if args.port is not None: lfjson_port = args.port - on_flags = [1, "1", "on", "yes", "true"] - debug_v = False - if args.debug is not None: - if args.debug in on_flags: - debug_v = True - staConnect = StaConnect2(lfjson_host, lfjson_port, debug_=True, _influx_db=args.influx_db, @@ -486,7 +480,7 @@ Example: time.sleep(staConnect.runtime_secs) staConnect.stop() - run_results = staConnect.get_result_list() + staConnect.get_result_list() is_passing = staConnect.passes() if not is_passing: print("FAIL: Some tests failed") From 212f3c45ca1c96f11cf1982b84950349bf700f18 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:06:43 -0800 Subject: [PATCH 481/731] sta_connect2: Remove redundant and repetitive code Signed-off-by: Matthew Stidham --- py-scripts/sta_connect2.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index e9fec541..e98d2ba1 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -134,7 +134,9 @@ class StaConnect2(LFCliBase): super().clear_test_results() # super(StaConnect, self).clear_test_results().test_results.clear() - def setup(self, extra_securities=[]): + def setup(self, extra_securities=None): + if extra_securities is None: + extra_securities = [] self.clear_test_results() self.check_connect() upstream_json = self.json_get("%s?fields=alias,phantom,down,port,ip" % self.get_upstream_url(), debug_=False) @@ -227,7 +229,7 @@ class StaConnect2(LFCliBase): self.station_profile.admin_up() LFUtils.waitUntilPortsAdminUp(self.resource, self.lfclient_url, self.station_names) - if self.influx_db is not None: + if self.influx_db: grapher = RecordInflux(_influx_host=self.influx_host, _influx_db=self.influx_db, _influx_user=self.influx_user, @@ -275,7 +277,7 @@ class StaConnect2(LFCliBase): "probe_flags": 1 } self.json_post("/cli-json/nc_show_ports", data) - if self.influx_db is not None: + if self.influx_db: grapher.getdata() LFUtils.wait_until_ports_appear() From 69e9ac829eca6ab2ca7885615c51a18611c888ad Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:08:51 -0800 Subject: [PATCH 482/731] sta_connect_bssid_mac: Fix whitespace errors Signed-off-by: Matthew Stidham --- py-scripts/sta_connect_bssid_mac.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/py-scripts/sta_connect_bssid_mac.py b/py-scripts/sta_connect_bssid_mac.py index e0da58c1..1824fb04 100644 --- a/py-scripts/sta_connect_bssid_mac.py +++ b/py-scripts/sta_connect_bssid_mac.py @@ -23,7 +23,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -60,14 +59,13 @@ class client_connect(Realm): self.station_profile.desired_add_sta_flags_mask = ["use-bss-transition"] for station_name in range(len(station_)): - stat_list = [] + stat_list = [station_[station_name]] - stat_list.append(station_[station_name]) print(station_name) self.station_profile.cleanup(stat_list) try: - if self.bssid[station_name] is not None or self.bssid[station_name] != "": + if self.bssid[station_name] is not None or self.bssid[station_name] != "": self.station_profile.set_command_param("add_sta", "ap", bssid_list[station_name]) except: self.station_profile.set_command_param("add_sta", "ap", "DEFAULT") @@ -91,8 +89,7 @@ class client_connect(Realm): def main(): # This has --mgr, --mgr_port and --debug parser = LFCliBase.create_bare_argparse(prog="sta_connect_bssid_mac.py", - description= - """ + description=""" --mgr localhost --mgr_port 8080 --ssid "TestAP-Jitendra" --radio wiphy0 From 54b59c814a4f300d895bcb2e932de781e6d0da22 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:10:29 -0800 Subject: [PATCH 483/731] sta_connect_bssid_mac: Fix bare except clauses Signed-off-by: Matthew Stidham --- py-scripts/sta_connect_bssid_mac.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/py-scripts/sta_connect_bssid_mac.py b/py-scripts/sta_connect_bssid_mac.py index 1824fb04..6c6459c9 100644 --- a/py-scripts/sta_connect_bssid_mac.py +++ b/py-scripts/sta_connect_bssid_mac.py @@ -64,17 +64,14 @@ class client_connect(Realm): print(station_name) self.station_profile.cleanup(stat_list) - try: - if self.bssid[station_name] is not None or self.bssid[station_name] != "": - self.station_profile.set_command_param("add_sta", "ap", bssid_list[station_name]) - except: + if self.bssid[station_name]: + self.station_profile.set_command_param("add_sta", "ap", bssid_list[station_name]) + else: self.station_profile.set_command_param("add_sta", "ap", "DEFAULT") - try: - if self.mac[station_name] is not None or self.mac[station_name] != "": - self.station_profile.add_sta_data["mac"] = mac_list[station_name] - print(self.mac[station_name]) - except: + if self.mac[station_name]: + self.station_profile.add_sta_data["mac"] = mac_list[station_name] + else: self.station_profile.add_sta_data["mac"] = "xx:xx:xx:xx:*:*" print(stat_list) From dfd3d137ce7c66647e9bd7455e534b28bdb6bb19 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:11:49 -0800 Subject: [PATCH 484/731] station_layer3: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/station_layer3.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/py-scripts/station_layer3.py b/py-scripts/station_layer3.py index 7563d34f..0fab8a91 100644 --- a/py-scripts/station_layer3.py +++ b/py-scripts/station_layer3.py @@ -1,15 +1,14 @@ #!/usr/bin/env python3 -''' +""" this script creates 1 station on given arguments how to run - [lanforge@LF4-Node2 py-scripts]$ python3 station_banao.py -hst localhost -s TestAP22 -pwd [BLANK] -sec open -rad wiphy0 -''' +""" import sys import os import importlib import argparse import time - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -20,7 +19,8 @@ Realm = realm.Realm class STATION(LFCliBase): - def __init__(self, lfclient_host, lfclient_port, ssid, paswd, security, radio, sta_list=None, name_prefix="L3Test", upstream="eth2"): + def __init__(self, lfclient_host, lfclient_port, ssid, paswd, security, radio, sta_list=None, name_prefix="L3Test", + upstream="eth2"): super().__init__(lfclient_host, lfclient_port) self.host = lfclient_host self.port = lfclient_port @@ -46,7 +46,6 @@ class STATION(LFCliBase): self.cx_profile.side_b_min_bps = 1000000 self.cx_profile.side_b_max_bps = 1000000 - def precleanup(self, sta_list): self.cx_profile.cleanup_prefix() for sta in self.sta_list: @@ -62,7 +61,7 @@ class STATION(LFCliBase): self.cx_profile.create(endp_type="lf_udp", side_a=self.station_profile.station_names, side_b=self.upstream, sleep_time=0) - def start(self, sta_list): + def start(self): self.station_profile.admin_up() temp_stas = self.station_profile.station_names.copy() if self.local_realm.wait_for_ip(temp_stas): @@ -72,16 +71,12 @@ class STATION(LFCliBase): self.exit_fail() self.cx_profile.start_cx() - def stop(self): # Bring stations down self.station_profile.admin_down() self.cx_profile.stop_cx() - - - def main(): parser = argparse.ArgumentParser( prog='station_layer3.py', @@ -92,7 +87,7 @@ def main(): parser.add_argument('-pwd', '--passwd', type=str, help='password to connect to ssid') parser.add_argument('-sec', '--security', type=str, help='security') parser.add_argument('-rad', '--radio', type=str, help='radio at which client will be connected') - #parser.add_argument() + # parser.add_argument() args = parser.parse_args() num_sta = 1 station_list = LFUtils.port_name_series(prefix="sta", @@ -100,10 +95,12 @@ def main(): end_id=num_sta - 1, padding_number=10000, radio=args.radio) - obj = STATION(lfclient_host= args.host, lfclient_port=8080, ssid=args.ssid , paswd=args.passwd, security=args.security, radio=args.radio, sta_list=station_list) + obj = STATION(lfclient_host=args.host, lfclient_port=8080, ssid=args.ssid, paswd=args.passwd, + security=args.security, radio=args.radio, sta_list=station_list) obj.precleanup(station_list) obj.build() - obj.start(station_list) + obj.start() + if __name__ == '__main__': main() From f75820438b8341fc19f32cb90cd65091c2e10b67 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:12:15 -0800 Subject: [PATCH 485/731] stations_connected: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/stations_connected.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/py-scripts/stations_connected.py b/py-scripts/stations_connected.py index 0ce91c89..0436156c 100755 --- a/py-scripts/stations_connected.py +++ b/py-scripts/stations_connected.py @@ -9,7 +9,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -28,7 +27,7 @@ class StationsConnected(LFCliBase): self.clear_test_results() fields = "_links,port,alias,ip,ap,port+type" self.station_results = self.localrealm.find_ports_like("sta*", fields, debug_=False) - #pprint(self.station_results) + # pprint(self.station_results) if (self.station_results is None) or (len(self.station_results) < 1): self.get_failed_result_list() return False @@ -37,15 +36,16 @@ class StationsConnected(LFCliBase): def num_associated(self, bssid): counter = 0 # print("there are %d results" % len(self.station_results)) - for eid,record in self.station_results.items(): - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - #pprint(eid) - #pprint(record) + for eid, record in self.station_results.items(): + # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + # pprint(eid) + # pprint(record) if record["ap"] == bssid: counter += 1 - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") return counter + def main(): parser = argparse.ArgumentParser( prog='stations_connected.py', @@ -60,7 +60,6 @@ Contains examples of using realm to query stations and get specific information # if args are added args=parser.parse_args() swap out next line parser.parse_args() - qstationsx = StationsConnected("localhost", 8080) bssid = "00:0E:8E:7B:DF:9B" if qstationsx.run(): @@ -69,5 +68,6 @@ Contains examples of using realm to query stations and get specific information else: print("problem querying for stations for %s" % bssid) + if __name__ == "__main__": main() From fc8a8fcc9c7992720758488358b208e66c2fb46b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:13:03 -0800 Subject: [PATCH 486/731] stations_connected: Instance attributed defined outside __init__ Signed-off-by: Matthew Stidham --- py-scripts/stations_connected.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/stations_connected.py b/py-scripts/stations_connected.py index 0436156c..5dfa11d7 100755 --- a/py-scripts/stations_connected.py +++ b/py-scripts/stations_connected.py @@ -22,13 +22,13 @@ class StationsConnected(LFCliBase): super().__init__(_lfjson_host=lfjson_host, _lfjson_port=lfjson_port) self.localrealm = Realm(lfclient_host=lfjson_host, lfclient_port=lfjson_port) self.check_connect() + fields = "_links,port,alias,ip,ap,port+type" + self.station_results = self.localrealm.find_ports_like("sta*", fields, debug_=False) def run(self): self.clear_test_results() - fields = "_links,port,alias,ip,ap,port+type" - self.station_results = self.localrealm.find_ports_like("sta*", fields, debug_=False) # pprint(self.station_results) - if (self.station_results is None) or (len(self.station_results) < 1): + if not self.station_results or (len(self.station_results) < 1): self.get_failed_result_list() return False return True From 077383e0395ddf7cc0e59bcdb5390c35bd8b5655 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:14:27 -0800 Subject: [PATCH 487/731] test_1k_clients_jedtest: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/test_1k_clients_jedtest.py | 143 ++++++++++++++------------ 1 file changed, 76 insertions(+), 67 deletions(-) diff --git a/py-scripts/test_1k_clients_jedtest.py b/py-scripts/test_1k_clients_jedtest.py index cde6597c..987fc925 100755 --- a/py-scripts/test_1k_clients_jedtest.py +++ b/py-scripts/test_1k_clients_jedtest.py @@ -10,7 +10,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -22,45 +21,51 @@ Realm = realm.Realm class Test1KClients(LFCliBase): def __init__(self, - upstream, - host="localhost", - port=8080, - side_a_min_rate= 0,side_a_max_rate= 56000, - side_b_min_rate= 0,side_b_max_rate= 56000, - num_sta_=200, - test_duration="2d", - _debug_on=True, - _exit_on_error=False, - _exit_on_fail=False): + upstream, + host="localhost", + port=8080, + side_a_min_rate=0, side_a_max_rate=56000, + side_b_min_rate=0, side_b_max_rate=56000, + num_sta_=200, + test_duration="2d", + _debug_on=True, + _exit_on_error=False, + _exit_on_fail=False): super().__init__(host, port, _debug=_debug_on, _local_realm=Realm(lfclient_host=host, lfclient_port=port), _exit_on_fail=_exit_on_fail) self.ssid_radio_map = { - '1.1.wiphy0' : ("wpa2", "jedway-wpa2-x2048-4-4", "jedway-wpa2-x2048-4-4"), - '1.1.wiphy1' : ("wpa2", "jedway-wpa2-x2048-5-1", "jedway-wpa2-x2048-5-1"), - '1.1.wiphy2' : ("wpa2", "jedway-wpa2-x2048-4-1", "jedway-wpa2-x2048-4-1"), + '1.1.wiphy0': ("wpa2", "jedway-wpa2-x2048-4-4", "jedway-wpa2-x2048-4-4"), + '1.1.wiphy1': ("wpa2", "jedway-wpa2-x2048-5-1", "jedway-wpa2-x2048-5-1"), + '1.1.wiphy2': ("wpa2", "jedway-wpa2-x2048-4-1", "jedway-wpa2-x2048-4-1"), - '1.2.wiphy0' : ("wpa2", "jedway-wpa2-x2048-5-3", "jedway-wpa2-x2048-5-3"), - '1.2.wiphy1' : ("wpa2", "jedway-wpa2-x2048-4-4", "jedway-wpa2-x2048-4-4"), - '1.2.wiphy2' : ("wpa2", "jedway-wpa2-x2048-4-1", "jedway-wpa2-x2048-4-1"), + '1.2.wiphy0': ("wpa2", "jedway-wpa2-x2048-5-3", "jedway-wpa2-x2048-5-3"), + '1.2.wiphy1': ("wpa2", "jedway-wpa2-x2048-4-4", "jedway-wpa2-x2048-4-4"), + '1.2.wiphy2': ("wpa2", "jedway-wpa2-x2048-4-1", "jedway-wpa2-x2048-4-1"), } if num_sta_ is None: raise ValueError("need a number of stations per radio") self.num_sta = int(num_sta_) self.station_radio_map = { # port_name_series(prefix=prefix_, start_id=start_id_, end_id=end_id_, padding_number=padding_number_, radio=radio) - "1.1.wiphy0" : LFUtils.port_name_series(start_id=0, end_id=self.num_sta-1, padding_number=10000, radio="1.1.wiphy0"), - "1.1.wiphy1" : LFUtils.port_name_series(start_id=1000, end_id=1000+self.num_sta-1, padding_number=10000, radio="1.1.wiphy1"), - "1.1.wiphy2" : LFUtils.port_name_series(start_id=2000, end_id=2000+self.num_sta-1, padding_number=10000, radio="1.1.wiphy2"), + "1.1.wiphy0": LFUtils.port_name_series(start_id=0, end_id=self.num_sta - 1, padding_number=10000, + radio="1.1.wiphy0"), + "1.1.wiphy1": LFUtils.port_name_series(start_id=1000, end_id=1000 + self.num_sta - 1, padding_number=10000, + radio="1.1.wiphy1"), + "1.1.wiphy2": LFUtils.port_name_series(start_id=2000, end_id=2000 + self.num_sta - 1, padding_number=10000, + radio="1.1.wiphy2"), - "1.2.wiphy0" : LFUtils.port_name_series(start_id=3000, end_id=3000+self.num_sta-1, padding_number=10000, radio="1.2.wiphy0"), - "1.2.wiphy1" : LFUtils.port_name_series(start_id=4000, end_id=4000+self.num_sta-1, padding_number=10000, radio="1.2.wiphy1"), - "1.2.wiphy2" : LFUtils.port_name_series(start_id=5000, end_id=5000+self.num_sta-1, padding_number=10000, radio="1.2.wiphy2") + "1.2.wiphy0": LFUtils.port_name_series(start_id=3000, end_id=3000 + self.num_sta - 1, padding_number=10000, + radio="1.2.wiphy0"), + "1.2.wiphy1": LFUtils.port_name_series(start_id=4000, end_id=4000 + self.num_sta - 1, padding_number=10000, + radio="1.2.wiphy1"), + "1.2.wiphy2": LFUtils.port_name_series(start_id=5000, end_id=5000 + self.num_sta - 1, padding_number=10000, + radio="1.2.wiphy2") } - self.test_duration=test_duration - self.upstream=upstream + self.test_duration = test_duration + self.upstream = upstream self.name_prefix = "1k" self.cx_profile = self.local_realm.new_l3_cx_profile() self.cx_profile.name_prefix = self.name_prefix @@ -70,28 +75,27 @@ class Test1KClients(LFCliBase): self.cx_profile.side_b_max_bps = side_b_max_rate self.station_profile_map = {} - #change resource admin_up rate + # change resource admin_up rate self.local_realm.json_post("/cli-json/set_resource", { - "shelf":1, - "resource":all, + "shelf": 1, + "resource": all, "max_staged_bringup": 30, "max_trying_ifup": 15, "max_station_bringup": 6 }) - def build(self): for (radio, name_series) in self.station_radio_map.items(): - print("building stations for %s"%radio) + print("building stations for %s" % radio) if (name_series is None) or len(name_series) < 1: - print("No name series for %s"%radio) + print("No name series for %s" % radio) continue station_profile = self.local_realm.new_station_profile() station_profile.use_security(self.ssid_radio_map[radio][0], self.ssid_radio_map[radio][1], self.ssid_radio_map[radio][2]) self.station_profile_map[radio] = station_profile - + self._pass("defined %s station profiles" % len(self.station_radio_map)) for (radio, station_profile) in self.station_profile_map.items(): station_profile.create(radio=radio, @@ -105,7 +109,8 @@ class Test1KClients(LFCliBase): sleep_time=.02) station_profile.set_command_param("set_port", "report_timer", 1500) station_profile.set_command_flag("set_port", "rpt_timer", 1) - self.cx_profile.create(endp_type="lf_udp", side_a=station_profile.station_names, side_b=self.upstream, sleep_time=0) + self.cx_profile.create(endp_type="lf_udp", side_a=station_profile.station_names, side_b=self.upstream, + sleep_time=0) self._pass("built stations on %s radios" % len(self.station_radio_map)) @@ -118,8 +123,8 @@ class Test1KClients(LFCliBase): if cx_name != 'uri' and cx_name != 'handler': for item, value in cx_name.items(): for value_name, value_rx in value.items(): - if value_name == 'rx bytes' and item in self.cx_profile.created_cx.values(): - cx_rx_map[item] = value_rx + if value_name == 'rx bytes' and item in self.cx_profile.created_cx.values(): + cx_rx_map[item] = value_rx return cx_rx_map def __compare_vals(self, old_list, new_list): @@ -135,28 +140,32 @@ class Test1KClients(LFCliBase): else: return False else: - return False + return False def start(self): print("Bringing stations up...") - prev_ip_num=0 + prev_ip_num = 0 for (radio, station_profile) in self.station_profile_map.items(): station_profile.admin_up() - total_num_sta=6*self.num_sta + total_num_sta = 6 * self.num_sta self.local_realm.wait_for_ip(station_list=self.station_radio_map[radio], debug=self.debug, timeout_sec=30) - curr_ip_num = self.local_realm.get_curr_num_ips(num_sta_with_ips=prev_ip_num,station_list=self.station_radio_map[radio], debug=self.debug) - while ((prev_ip_num < curr_ip_num) and (curr_ip_num < total_num_sta)): - self.local_realm.wait_for_ip(station_list=self.station_radio_map[radio], debug=self.debug, timeout_sec=90) + curr_ip_num = self.local_realm.get_curr_num_ips(num_sta_with_ips=prev_ip_num, + station_list=self.station_radio_map[radio], + debug=self.debug) + while (prev_ip_num < curr_ip_num) and (curr_ip_num < total_num_sta): + self.local_realm.wait_for_ip(station_list=self.station_radio_map[radio], debug=self.debug, + timeout_sec=90) prev_ip_num = curr_ip_num - curr_ip_num = self.local_realm.get_curr_num_ips(num_sta_with_ips=prev_ip_num,station_list=self.station_radio_map[radio], debug=self.debug) + curr_ip_num = self.local_realm.get_curr_num_ips(num_sta_with_ips=prev_ip_num, + station_list=self.station_radio_map[radio], + debug=self.debug) if curr_ip_num == total_num_sta: self._pass("stations on radio %s up" % radio) - else: + else: self._fail("FAIL: Not all stations on radio %s up" % radio) self.exit_fail() - - - old_cx_rx_values = self.__get_rx_values() + + old_cx_rx_values = self.__get_rx_values() self.cx_profile.start_cx() passes = 0 @@ -188,34 +197,31 @@ class Test1KClients(LFCliBase): if passes == expected_passes: self._pass("PASS: All tests passed") - def stop(self): self.cx_profile.stop_cx() def pre_cleanup(self): self.cx_profile.cleanup_prefix() for (radio, name_series) in self.station_radio_map.items(): - sta_list= self.station_radio_map[radio] + sta_list = self.station_radio_map[radio] for sta in sta_list: self.local_realm.rm_port(sta, check_exists=True) def post_cleanup(self): self.cx_profile.cleanup() for (radio, name_series) in self.station_radio_map.items(): - sta_list= self.station_radio_map[radio] + sta_list = self.station_radio_map[radio] for sta in sta_list: self.local_realm.rm_port(sta, check_exists=True) def main(): - - parser = LFCliBase.create_bare_argparse(prog=__file__, - formatter_class=argparse.RawTextHelpFormatter, - epilog='''\ + formatter_class=argparse.RawTextHelpFormatter, + epilog='''\ creates lots of stations across multiple radios. ''', - description='''\ + description='''\ test_1k_clients_jedtest.py: -------------------- Generic command layout: @@ -228,31 +234,33 @@ def main(): --b_min 1000 --a_max 0 --b_max 0 - --debug ''' - ) - - required_args=None + --debug ''' + ) + + required_args = None for group in parser._action_groups: if group.title == "required arguments": - required_args=group + required_args = group break if required_args is not None: - required_args.add_argument("--sta_per_radio",type=int,help="number of stations per radio") - - optional_args=None + required_args.add_argument("--sta_per_radio", type=int, help="number of stations per radio") + + optional_args = None for group in parser._action_groups: if group.title == "optional arguments": - optional_args=group + optional_args = group break if optional_args is not None: optional_args.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=0) optional_args.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=0) optional_args.add_argument('--a_max', help='--a_min bps rate minimum for side_a', default=256000) optional_args.add_argument('--b_max', help='--b_min bps rate minimum for side_b', default=256000) - optional_args.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m") - optional_args.add_argument('-u', '--upstream_port',help='non-station port that generates traffic: ., e.g: 1.eth1',default='1.eth1') - + optional_args.add_argument('--test_duration', help='--test_duration sets the duration of the test', + default="2m") + optional_args.add_argument('-u', '--upstream_port', + help='non-station port that generates traffic: ., e.g: 1.eth1', + default='1.eth1') args = parser.parse_args() @@ -275,10 +283,11 @@ def main(): kilo_test.exit_failed() kilo_test.stop() if not kilo_test.passes(): - kilo_test.exit_failed() + kilo_test.exit_failed() time.sleep(60) kilo_test.post_cleanup() kilo_test.exit_success() + if __name__ == "__main__": main() From 22bda435dfe8c32af4a96a37462e3759042088e1 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:16:19 -0800 Subject: [PATCH 488/731] test_fileio: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/test_fileio.py | 92 ++++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/py-scripts/test_fileio.py b/py-scripts/test_fileio.py index 6148a78c..b4297702 100755 --- a/py-scripts/test_fileio.py +++ b/py-scripts/test_fileio.py @@ -37,7 +37,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -54,14 +53,14 @@ class FileIOTest(LFCliBase): number_template="00000", radio="wiphy0", fs_type=fe_fstype.EP_FE_NFS4.name, - min_rw_size=64*1024, - max_rw_size=64*1024, - min_file_size=25*1024*1024, - max_file_size=25*1024*1024, - min_read_rate_bps=1000*1000, - max_read_rate_bps=1000*1000, + min_rw_size=64 * 1024, + max_rw_size=64 * 1024, + min_file_size=25 * 1024 * 1024, + max_file_size=25 * 1024 * 1024, + min_read_rate_bps=1000 * 1000, + max_read_rate_bps=1000 * 1000, min_write_rate_bps="1G", - max_write_rate_bps=1000*1000, + max_write_rate_bps=1000 * 1000, directory="AUTO", test_duration="5m", upstream_port="eth1", @@ -128,14 +127,14 @@ class FileIOTest(LFCliBase): raise ValueError("--write_only_test_group and --read_only_test_group " "must be used to set test group names") - #self.min_rw_size = self.parse_size(min_rw_size) - #self.max_rw_size = self.parse_size(max_rw_size) - #self.min_file_size = self.parse_size(min_file_size) - #self.min_file_size = self.parse_size(min_file_size) - #self.min_read_rate_bps = self.parse_size_bps(min_read_rate_bps) + # self.min_rw_size = self.parse_size(min_rw_size) + # self.max_rw_size = self.parse_size(max_rw_size) + # self.min_file_size = self.parse_size(min_file_size) + # self.min_file_size = self.parse_size(min_file_size) + # self.min_read_rate_bps = self.parse_size_bps(min_read_rate_bps) # self.max_read_rate_bps = self.sisize_bps(max_read_rate_bps) # self.min_write_rate_bps = self.parse_size_bps(min_write_rate_bps) - #self.max_write_rate_bps = self.parse_size_bps(max_write_rate_bps) + # self.max_write_rate_bps = self.parse_size_bps(max_write_rate_bps) self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port) self.wo_profile = self.local_realm.new_fio_endp_profile() @@ -271,14 +270,14 @@ class FileIOTest(LFCliBase): time.sleep(3) if self.mode == "write": cx_list = self.json_get("fileio/%s?fields=write-bps,read-bps" % ( - ','.join(self.wo_profile.created_cx.keys())), debug_=self.debug) + ','.join(self.wo_profile.created_cx.keys())), debug_=self.debug) elif self.mode == "read": cx_list = self.json_get("fileio/%s?fields=write-bps,read-bps" % ( - ','.join(self.ro_profile.created_cx.keys())), debug_=self.debug) + ','.join(self.ro_profile.created_cx.keys())), debug_=self.debug) else: cx_list = self.json_get("fileio/%s,%s?fields=write-bps,read-bps" % ( - ','.join(self.wo_profile.created_cx.keys()), - ','.join(self.ro_profile.created_cx.keys())), debug_=self.debug) + ','.join(self.wo_profile.created_cx.keys()), + ','.join(self.ro_profile.created_cx.keys())), debug_=self.debug) # print(cx_list) # print("==============\n", cx_list, "\n==============") cx_map = {} @@ -288,7 +287,8 @@ class FileIOTest(LFCliBase): for i in cx_list: for item, value in i.items(): # print(item, value) - cx_map[self.local_realm.name_to_eid(item)[2]] = {"read-bps": value['read-bps'], "write-bps": value['write-bps']} + cx_map[self.local_realm.name_to_eid(item)[2]] = {"read-bps": value['read-bps'], + "write-bps": value['write-bps']} # print(cx_map) return cx_map @@ -342,7 +342,8 @@ class FileIOTest(LFCliBase): if self.wo_tg_exists: if not self.wo_tg_cx_exists: print("Creating Write Only CXs") - self.wo_profile.create(ports=self.created_ports, connections_per_port=self.connections_per_port, + self.wo_profile.create(ports=self.created_ports, + connections_per_port=self.connections_per_port, sleep_time=.5, debug_=self.debug, suppress_related_commands_=None) time.sleep(1) @@ -364,7 +365,8 @@ class FileIOTest(LFCliBase): if self.ro_tg_exists: if not self.ro_tg_cx_exists: print("Creating Read Only CXs") - self.ro_profile.create(ports=self.created_ports, connections_per_port=self.connections_per_port, + self.ro_profile.create(ports=self.created_ports, + connections_per_port=self.connections_per_port, sleep_time=.5, debug_=self.debug, suppress_related_commands_=None) time.sleep(1) @@ -386,7 +388,8 @@ class FileIOTest(LFCliBase): if self.wo_tg_exists: if not self.wo_tg_cx_exists: print("Creating Write Only CXs") - self.wo_profile.create(ports=self.created_ports, connections_per_port=self.connections_per_port, + self.wo_profile.create(ports=self.created_ports, + connections_per_port=self.connections_per_port, sleep_time=.5, debug_=self.debug, suppress_related_commands_=None) time.sleep(1) @@ -407,7 +410,8 @@ class FileIOTest(LFCliBase): if self.ro_tg_exists: if not self.ro_tg_cx_exists: print("Creating Read Only CXs") - self.ro_profile.create(ports=self.created_ports, connections_per_port=self.connections_per_port, + self.ro_profile.create(ports=self.created_ports, + connections_per_port=self.connections_per_port, sleep_time=.5, debug_=self.debug, suppress_related_commands_=None) time.sleep(1) @@ -454,7 +458,7 @@ class FileIOTest(LFCliBase): def start(self, print_pass=False, print_fail=False): temp_ports = self.created_ports.copy() - #temp_stas.append(self.local_realm.name_to_eid(self.upstream_port)[2]) + # temp_stas.append(self.local_realm.name_to_eid(self.upstream_port)[2]) if not self.use_macvlans: self.station_profile.admin_up() else: @@ -617,14 +621,14 @@ Generic command layout: parser.add_argument('--passwd', '--password', '--key', help='WiFi passphrase/password/key') parser.add_argument('--security', help='security type to use for ssid { wep | wpa | wpa2 | wpa3 | open }') parser.add_argument('-u', '--upstream_port', - help='non-station port that generates traffic: ., e.g: 1.eth1', - default='1.eth1') + help='non-station port that generates traffic: ., e.g: 1.eth1', + default='1.eth1') parser.add_argument('--test_duration', help='sets the duration of the test', default="5m") parser.add_argument('--fs_type', help='endpoint type', default="fe_nfs4") - parser.add_argument('--min_rw_size', help='minimum read/write size', default=64*1024) - parser.add_argument('--max_rw_size', help='maximum read/write size', default=64*1024) - parser.add_argument('--min_file_size', help='minimum file size', default=50*1024*1024) - parser.add_argument('--max_file_size', help='maximum file size', default=50*1024*1024) + parser.add_argument('--min_rw_size', help='minimum read/write size', default=64 * 1024) + parser.add_argument('--max_rw_size', help='maximum read/write size', default=64 * 1024) + parser.add_argument('--min_file_size', help='minimum file size', default=50 * 1024 * 1024) + parser.add_argument('--max_file_size', help='maximum file size', default=50 * 1024 * 1024) parser.add_argument('--min_read_rate_bps', help='minimum bps read rate', default=10e9) parser.add_argument('--max_read_rate_bps', help='maximum bps read rate', default=10e9) parser.add_argument('--min_write_rate_bps', help='minimum bps write rate', default=10e9) @@ -662,7 +666,7 @@ Generic command layout: "name": None, "action": None, "cxs": None - } + } if args.add_to_group is not None and args.cxs is not None: update_group_args['name'] = args.add_to_group update_group_args['action'] = "add" @@ -679,17 +683,17 @@ Generic command layout: if (args.num_ports is not None) and (int(args.num_ports) > 0): start_num = int(args.first_port[3:]) num_ports = int(args.num_ports) - port_list = LFUtils.port_name_series(prefix="sta", start_id=start_num, end_id=start_num+num_ports-1, - padding_number=10000, - radio=args.radio) + port_list = LFUtils.port_name_series(prefix="sta", start_id=start_num, end_id=start_num + num_ports - 1, + padding_number=10000, + radio=args.radio) else: if (args.num_ports is not None) and args.macvlan_parent is not None and (int(args.num_ports) > 0) \ - and args.macvlan_parent in args.first_port: - start_num = int(args.first_port[args.first_port.index('#')+1:]) + and args.macvlan_parent in args.first_port: + start_num = int(args.first_port[args.first_port.index('#') + 1:]) num_ports = int(args.num_ports) - port_list = LFUtils.port_name_series(prefix=args.macvlan_parent+"#", start_id=start_num, - end_id=start_num+num_ports-1, padding_number=100000, - radio=args.radio) + port_list = LFUtils.port_name_series(prefix=args.macvlan_parent + "#", start_id=start_num, + end_id=start_num + num_ports - 1, padding_number=100000, + radio=args.radio) else: raise ValueError("Invalid values for num_ports [%s], macvlan_parent [%s], and/or first_port [%s].\n" "first_port must contain parent port and num_ports must be greater than 0" @@ -699,12 +703,12 @@ Generic command layout: num_ports = int(args.num_ports) if not args.use_macvlans: port_list = LFUtils.port_name_series(prefix="sta", start_id=0, end_id=num_ports - 1, - padding_number=10000, - radio=args.radio) + padding_number=10000, + radio=args.radio) else: port_list = LFUtils.port_name_series(prefix=args.macvlan_parent + "#", start_id=0, - end_id=num_ports - 1, padding_number=100000, - radio=args.radio) + end_id=num_ports - 1, padding_number=100000, + radio=args.radio) else: temp_list = args.use_ports.split(',') for port in temp_list: @@ -763,7 +767,7 @@ Generic command layout: use_test_groups=args.use_test_groups, write_only_test_group=args.write_only_test_group, read_only_test_group=args.read_only_test_group, - update_group_args = update_group_args, + update_group_args=update_group_args, connections_per_port=args.connections_per_port, mode=args.mode # want a mount options param From 1567bfa97a6750c759623a32150742037e755ff0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:16:54 -0800 Subject: [PATCH 489/731] test_fileio: Fix mutable default arguments Signed-off-by: Matthew Stidham --- py-scripts/test_fileio.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/py-scripts/test_fileio.py b/py-scripts/test_fileio.py index b4297702..df754a8b 100755 --- a/py-scripts/test_fileio.py +++ b/py-scripts/test_fileio.py @@ -75,15 +75,19 @@ class FileIOTest(LFCliBase): use_test_groups=False, write_only_test_group=None, read_only_test_group=None, - port_list=[], + port_list=None, ip_list=None, connections_per_port=1, mode="both", - update_group_args={"name": None, "action": None, "cxs": None}, + update_group_args=None, _debug_on=False, _exit_on_error=False, _exit_on_fail=False): super().__init__(host, port, _debug=_debug_on, _exit_on_fail=_exit_on_fail) + if port_list is None: + port_list = [] + if update_group_args is None: + update_group_args = {"name": None, "action": None, "cxs": None} self.host = host self.port = port self.radio = radio @@ -658,8 +662,7 @@ Generic command layout: tg_group = parser.add_mutually_exclusive_group() tg_group.add_argument('--add_to_group', help='name of test group to add cxs to', default=None) tg_group.add_argument('--del_from_group', help='name of test group to delete cxs from', default=None) - parser.add_argument('--cxs', help='list of cxs to add/remove depending on use of --add_to_group or --del_from_group' - , default=None) + parser.add_argument('--cxs', help='list of cxs to add/remove depending on use of --add_to_group or --del_from_group', default=None) args = parser.parse_args() update_group_args = { From d096890df01eb37b97af00f166ebc739e21080de Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:20:59 -0800 Subject: [PATCH 490/731] test_generic: type shadows default argument Signed-off-by: Matthew Stidham --- py-scripts/test_generic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/test_generic.py b/py-scripts/test_generic.py index 6ce023f5..0cc7f8b0 100755 --- a/py-scripts/test_generic.py +++ b/py-scripts/test_generic.py @@ -55,7 +55,7 @@ Realm = realm.Realm class GenTest(LFCliBase): def __init__(self, ssid, security, passwd, sta_list, client, name_prefix, upstream, host="localhost", port=8080, - number_template="000", test_duration="5m", type="lfping", dest=None, cmd =None, + number_template="000", test_duration="5m", test_type="lfping", dest=None, cmd =None, interval=1, radio=None, speedtest_min_up=None, speedtest_min_dl=None, speedtest_max_ping=None, file_output=None, loop_count=None, @@ -86,7 +86,7 @@ class GenTest(LFCliBase): self.station_profile.mode = 0 self.generic_endps_profile.name = name_prefix - self.generic_endps_profile.type = type + self.generic_endps_profile.type = test_type self.generic_endps_profile.dest = dest self.generic_endps_profile.cmd = cmd self.generic_endps_profile.interval = interval @@ -281,7 +281,7 @@ python3 ./test_generic.py radio=args.radio, sta_list=station_list, name_prefix="GT", - type=args.type, + test_type=args.type, dest=args.dest, cmd=args.cmd, interval=1, From 0a3363f51b988691f1be728b0f3769f673650a4a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:21:49 -0800 Subject: [PATCH 491/731] test_generic: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/test_generic.py | 65 ++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/py-scripts/test_generic.py b/py-scripts/test_generic.py index 0cc7f8b0..7d6b639d 100755 --- a/py-scripts/test_generic.py +++ b/py-scripts/test_generic.py @@ -43,7 +43,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -55,14 +54,14 @@ Realm = realm.Realm class GenTest(LFCliBase): def __init__(self, ssid, security, passwd, sta_list, client, name_prefix, upstream, host="localhost", port=8080, - number_template="000", test_duration="5m", test_type="lfping", dest=None, cmd =None, + number_template="000", test_duration="5m", test_type="lfping", dest=None, cmd=None, interval=1, radio=None, speedtest_min_up=None, speedtest_min_dl=None, speedtest_max_ping=None, file_output=None, loop_count=None, _debug_on=False, _exit_on_error=False, _exit_on_fail=False): - super().__init__(host, port, _local_realm=Realm(host,port), _debug=_debug_on, _exit_on_fail=_exit_on_fail) + super().__init__(host, port, _local_realm=Realm(host, port), _debug=_debug_on, _exit_on_fail=_exit_on_fail) self.ssid = ssid self.radio = radio self.upstream = upstream @@ -73,7 +72,7 @@ class GenTest(LFCliBase): self.name_prefix = name_prefix self.test_duration = test_duration self.debug = _debug_on - if (client is not None): + if client: self.client_name = client self.station_profile = self.local_realm.new_station_profile() self.generic_endps_profile = self.local_realm.new_generic_endp_profile() @@ -90,13 +89,13 @@ class GenTest(LFCliBase): self.generic_endps_profile.dest = dest self.generic_endps_profile.cmd = cmd self.generic_endps_profile.interval = interval - self.generic_endps_profile.file_output= file_output + self.generic_endps_profile.file_output = file_output self.generic_endps_profile.loop_count = loop_count - if (speedtest_min_up is not None): + if speedtest_min_up is not None: self.generic_endps_profile.speedtest_min_up = float(speedtest_min_up) - if (speedtest_min_dl is not None): + if speedtest_min_dl is not None: self.generic_endps_profile.speedtest_min_dl = float(speedtest_min_dl) - if (speedtest_max_ping is not None): + if speedtest_max_ping is not None: self.generic_endps_profile.speedtest_max_ping = float(speedtest_max_ping) def check_tab_exists(self): @@ -202,18 +201,23 @@ python3 ./test_generic.py 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 ''', - more_optional=optional) + more_optional=optional) - parser.add_argument('--type', help='type of command to run: generic, lfping, iperf3-client, iperf3-server, lfcurl', default="lfping") + parser.add_argument('--type', help='type of command to run: generic, lfping, iperf3-client, iperf3-server, lfcurl', + default="lfping") parser.add_argument('--cmd', help='specifies command to be run by generic type endp', default='') parser.add_argument('--dest', help='destination IP for command', default="10.40.0.1") parser.add_argument('--test_duration', help='duration of the test eg: 30s, 2m, 4h', default="2m") parser.add_argument('--interval', help='interval to use when running lfping (1s, 1m)', default=1) - parser.add_argument('--speedtest_min_up', help='sets the minimum upload threshold for the speedtest type', default=None) - parser.add_argument('--speedtest_min_dl', help='sets the minimum download threshold for the speedtest type', default=None) - parser.add_argument('--speedtest_max_ping', help='sets the minimum ping threshold for the speedtest type', default=None) + parser.add_argument('--speedtest_min_up', help='sets the minimum upload threshold for the speedtest type', + default=None) + parser.add_argument('--speedtest_min_dl', help='sets the minimum download threshold for the speedtest type', + default=None) + parser.add_argument('--speedtest_max_ping', help='sets the minimum ping threshold for the speedtest type', + default=None) parser.add_argument('--client', help='client to the iperf3 server', default=None) - parser.add_argument('--file_output', help='location to output results of lf_curl, absolute path preferred', default=None) + parser.add_argument('--file_output', help='location to output results of lf_curl, absolute path preferred', + default=None) parser.add_argument('--loop_count', help='determines the number of loops to use in lf_curl', default=None) args = parser.parse_args() @@ -273,7 +277,7 @@ python3 ./test_generic.py station_list = LFUtils.portNameSeries(radio=args.radio, prefix_="sta", start_id_=0, - end_id_=num_sta-1, + end_id_=num_sta - 1, padding_number_=100) generic_test = GenTest(host=args.mgr, port=args.mgr_port, @@ -313,7 +317,8 @@ python3 ./test_generic.py try: genconnections = ','.join([[*x.keys()][0] for x in generic_test.json_get('generic')['endpoints']]) except: - raise ValueError('1. Enable the generic tab in LANforge GUI , if still fails 2. Try setting the upstream port flag if your device does not have an eth1 port') + raise ValueError( + '1. Enable the generic tab in LANforge GUI , if still fails 2. Try setting the upstream port flag if your device does not have an eth1 port') if type(args.gen_cols) is not list: generic_cols = list(args.gen_cols.split(",")) @@ -335,22 +340,23 @@ python3 ./test_generic.py try: monitor_interval = Realm.parse_time(args.monitor_interval).total_seconds() except ValueError as error: - print(ValueError("The time string provided for monitor_interval argument is invalid. Please see supported time stamp increments and inputs for monitor_interval in --help. ")) + print(ValueError( + "The time string provided for monitor_interval argument is invalid. Please see supported time stamp increments and inputs for monitor_interval in --help. ")) exit(1) generic_test.start(False, False) generic_test.generic_endps_profile.monitor(generic_cols=generic_cols, - sta_list=station_list, - #port_mgr_cols=port_mgr_cols, - report_file=report_f, - systeminfopath=systeminfopath, - duration_sec=Realm.parse_time(args.test_duration).total_seconds(), - monitor_interval_ms=monitor_interval, - created_cx=genconnections, - output_format=output, - compared_report=compared_rept, - script_name='test_generic', - arguments=args, - debug=args.debug) + sta_list=station_list, + # port_mgr_cols=port_mgr_cols, + report_file=report_f, + systeminfopath=systeminfopath, + duration_sec=Realm.parse_time(args.test_duration).total_seconds(), + monitor_interval_ms=monitor_interval, + created_cx=genconnections, + output_format=output, + compared_report=compared_rept, + script_name='test_generic', + arguments=args, + debug=args.debug) generic_test.stop() time.sleep(30) @@ -359,6 +365,5 @@ python3 ./test_generic.py generic_test.exit_success() - if __name__ == "__main__": main() From 98f69c80ce0ffbc1c1d4435fa99ba0873ace4f21 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:24:28 -0800 Subject: [PATCH 492/731] test_generic: Fix bare except clauses Signed-off-by: Matthew Stidham --- py-scripts/test_generic.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/py-scripts/test_generic.py b/py-scripts/test_generic.py index 7d6b639d..54a1dea9 100755 --- a/py-scripts/test_generic.py +++ b/py-scripts/test_generic.py @@ -105,7 +105,7 @@ class GenTest(LFCliBase): else: return True - def start(self, print_pass=False, print_fail=False): + def start(self): self.station_profile.admin_up() temp_stas = [] for station in self.sta_list.copy(): @@ -235,10 +235,10 @@ python3 ./test_generic.py if args.report_file is None: new_file_path = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':', '-') + '-test_generic' # create path name - try: + if not os.path.exists('/home/lanforge/report-data/'): path = os.path.join('/home/lanforge/report-data/', new_file_path) os.mkdir(path) - except: + else: curr_dir_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) path = os.path.join(curr_dir_path, new_file_path) os.mkdir(path) @@ -316,9 +316,10 @@ python3 ./test_generic.py try: genconnections = ','.join([[*x.keys()][0] for x in generic_test.json_get('generic')['endpoints']]) - except: + except ValueError as error: raise ValueError( - '1. Enable the generic tab in LANforge GUI , if still fails 2. Try setting the upstream port flag if your device does not have an eth1 port') + '1. Enable the generic tab in LANforge GUI , if still fails 2. Try setting the upstream port flag if your device does not have an eth1 port \n' + '%s' % error) if type(args.gen_cols) is not list: generic_cols = list(args.gen_cols.split(",")) @@ -341,9 +342,10 @@ python3 ./test_generic.py monitor_interval = Realm.parse_time(args.monitor_interval).total_seconds() except ValueError as error: print(ValueError( - "The time string provided for monitor_interval argument is invalid. Please see supported time stamp increments and inputs for monitor_interval in --help. ")) + "The time string provided for monitor_interval argument is invalid. Please see supported time stamp increments and inputs for monitor_interval in --help. \n" + "%s" % error)) exit(1) - generic_test.start(False, False) + generic_test.start() generic_test.generic_endps_profile.monitor(generic_cols=generic_cols, sta_list=station_list, # port_mgr_cols=port_mgr_cols, From 4ddbcad1f7eaa1aa571eefec0680b5201f2a3cb9 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:25:45 -0800 Subject: [PATCH 493/731] test_ipv4_ps: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/test_ipv4_ps.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/py-scripts/test_ipv4_ps.py b/py-scripts/test_ipv4_ps.py index 5c7f9009..ab2facbe 100755 --- a/py-scripts/test_ipv4_ps.py +++ b/py-scripts/test_ipv4_ps.py @@ -10,7 +10,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -22,7 +21,7 @@ Realm = realm.Realm class IPV4VariableTime(LFCliBase): def __init__(self, ssid, security, password, sta_list, name_prefix, upstream, radio, - host="localhost", port=8080, + host="localhost", port=8080, side_a_min_rate=56, side_a_max_rate=0, side_b_min_rate=56, side_b_max_rate=0, number_template="00000", test_duration="5m", use_ht160=False, @@ -78,7 +77,8 @@ class IPV4VariableTime(LFCliBase): cx_rx_map[item] = value_rx return cx_rx_map - def __compare_vals(self, old_list, new_list): + @staticmethod + def __compare_vals(old_list, new_list): passes = 0 expected_passes = 0 if len(old_list) == len(new_list): @@ -172,7 +172,6 @@ class IPV4VariableTime(LFCliBase): def main(): - parser = LFCliBase.create_basic_argparse( prog='test_ipv4_variable_time.py', # formatter_class=argparse.RawDescriptionHelpFormatter, @@ -194,17 +193,11 @@ Generic command layout: --test_duration 2m --debug ''') - required = None - for agroup in parser._action_groups: - if agroup.title == "required arguments": - required = agroup - #if required is not None: - optional = None for agroup in parser._action_groups: if agroup.title == "optional arguments": optional = agroup - if optional is not None: + if optional is not None: optional.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) optional.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000) optional.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="5m") @@ -215,8 +208,7 @@ Generic command layout: num_stations_converted = int(args.num_stations) num_sta = num_stations_converted - - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta-1, padding_number_=10000, + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, radio=args.radio) ip_var_test = IPV4VariableTime(host=args.mgr, port=args.mgr_port, From 41df29a51f745dfb18e4fca53dc8eb6a428d662d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:26:27 -0800 Subject: [PATCH 494/731] test_l3_powersave_traffic: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/test_l3_powersave_traffic.py | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/py-scripts/test_l3_powersave_traffic.py b/py-scripts/test_l3_powersave_traffic.py index 554cdb56..9aeebd75 100755 --- a/py-scripts/test_l3_powersave_traffic.py +++ b/py-scripts/test_l3_powersave_traffic.py @@ -6,12 +6,10 @@ import time import datetime import argparse - if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -41,17 +39,17 @@ class L3PowersaveTraffic(LFCliBase): self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=False) # upload self.cx_prof_upload = l3_cxprofile.L3CXProfile(self.host, self.port, self.local_realm, - side_a_min_bps=side_a_min_rate, side_b_min_bps=0, - side_a_max_bps=side_a_max_rate, side_b_max_bps=0, - side_a_min_pdu=pdu_size, side_a_max_pdu=pdu_size, - side_b_min_pdu=0, side_b_max_pdu=0, debug_=False) + side_a_min_bps=side_a_min_rate, side_b_min_bps=0, + side_a_max_bps=side_a_max_rate, side_b_max_bps=0, + side_a_min_pdu=pdu_size, side_a_max_pdu=pdu_size, + side_b_min_pdu=0, side_b_max_pdu=0, debug_=False) # download self.cx_prof_download = l3_cxprofile.L3CXProfile(self.host, self.port, self.local_realm, - side_a_min_bps=0, side_b_min_bps=side_b_min_rate, - side_a_max_bps=0, side_b_max_bps=side_b_max_rate, - side_a_min_pdu=0, side_a_max_pdu=0, - side_b_min_pdu=pdu_size, side_b_max_pdu=pdu_size, debug_=False) + side_a_min_bps=0, side_b_min_bps=side_b_min_rate, + side_a_max_bps=0, side_b_max_bps=side_b_max_rate, + side_a_min_pdu=0, side_a_max_pdu=0, + side_b_min_pdu=pdu_size, side_b_max_pdu=pdu_size, debug_=False) self.test_duration = test_duration self.station_profile = realm.StationProfile(self.lfclient_url, self.local_realm, ssid=self.ssid, ssid_pass=self.password, @@ -80,9 +78,11 @@ class L3PowersaveTraffic(LFCliBase): self.cx_prof_upload.name_prefix = "UDP_up" self.cx_prof_download.name_prefix = "UDP_down" print("Creating upload cx profile ") - self.cx_prof_upload.create(endp_type="lf_udp", side_a=self.station_profile.station_names, side_b="1.eth1", sleep_time=.05) + self.cx_prof_upload.create(endp_type="lf_udp", side_a=self.station_profile.station_names, side_b="1.eth1", + sleep_time=.05) print("Creating download cx profile") - self.cx_prof_download.create(endp_type="lf_udp", side_a=self.station_profile.station_names, side_b="1.eth1", sleep_time=.05) + self.cx_prof_download.create(endp_type="lf_udp", side_a=self.station_profile.station_names, side_b="1.eth1", + sleep_time=.05) def __get_rx_values(self): cx_list = self.json_get("/endp/list?fields=name,rx+bytes", debug_=False) @@ -113,7 +113,7 @@ class L3PowersaveTraffic(LFCliBase): self.station_profile.admin_up() # self.new_monitor.set_flag() # print(self.station_profile.station_names) - if self.local_realm.wait_for_ip(self.station_profile.station_names): + if self.local_realm.wait_for_ip(self.station_profile.station_names): self._pass("All stations got IPs") else: self._fail("Stations failed to get IPs") From 5abac844e06cf2efecbad5fe1c074a49fbf9cdfc Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:27:05 -0800 Subject: [PATCH 495/731] test_l3_powersave_traffic: Remove unused arguments Signed-off-by: Matthew Stidham --- py-scripts/test_l3_powersave_traffic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/test_l3_powersave_traffic.py b/py-scripts/test_l3_powersave_traffic.py index 9aeebd75..88b87f27 100755 --- a/py-scripts/test_l3_powersave_traffic.py +++ b/py-scripts/test_l3_powersave_traffic.py @@ -96,7 +96,7 @@ class L3PowersaveTraffic(LFCliBase): cx_rx_map[item] = value_rx return cx_rx_map - def start(self, print_pass=False, print_fail=False): + def start(self): # start one test, measure # start second test, measure cur_time = datetime.datetime.now() From d92d6f8e843cb90959f737609c784526da08dc22 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:27:51 -0800 Subject: [PATCH 496/731] test_l3_WAN_LAN: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/test_l3_WAN_LAN.py | 56 ++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/py-scripts/test_l3_WAN_LAN.py b/py-scripts/test_l3_WAN_LAN.py index c66b1663..0e22ea85 100755 --- a/py-scripts/test_l3_WAN_LAN.py +++ b/py-scripts/test_l3_WAN_LAN.py @@ -10,7 +10,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -168,10 +167,10 @@ class VRTest(LFCliBase): upstream_temp = self.local_realm.name_to_eid(self.upstream) print("Creating Virtual Router and connections") self.vr_profile.create(resource=upstream_temp[1], upstream_port=upstream_temp[2], debug=self.debug, - upstream_subnets=self.upstream_subnets, upstream_nexthop=self.upstream_nexthop, - local_subnets=self.local_subnets, local_nexthop=self.local_nexthop, - rdd_ip=self.rdd_ip, rdd_gateway=self.rdd_gateway, rdd_netmask=self.rdd_netmask, - suppress_related_commands_=True) + upstream_subnets=self.upstream_subnets, upstream_nexthop=self.upstream_nexthop, + local_subnets=self.local_subnets, local_nexthop=self.local_nexthop, + rdd_ip=self.rdd_ip, rdd_gateway=self.rdd_gateway, rdd_netmask=self.rdd_netmask, + suppress_related_commands_=True) print("Creating stations") self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug) self.cx_profile.create(endp_type="lf_udp", side_a=self.station_profile.station_names, side_b=self.upstream, @@ -179,6 +178,7 @@ class VRTest(LFCliBase): self._pass("PASS: Station build finished") exit(1) + def main(): lfjson_port = 8080 @@ -200,36 +200,44 @@ TBD parser.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) parser.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000) parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="5m") - parser.add_argument('--upstream_subnets', help='--upstream_subnets sets the subnets used by the upstream vrcx', default="20.20.20.0/24") - parser.add_argument('--upstream_nexthop', help='--upstream_nexthop sets the nexthop used by the upstream vrcx, should be rdd gateway', default="20.20.20.1") - parser.add_argument('--local_subnets', help='--local_subnets sets the subnets used by the rdd vrcx', default="10.40.0.0/24") - parser.add_argument('--local_nexthop', help='--local_nexthop sets the nexthop used by the upstream vrcx, should be upstream ip', default="10.40.3.198") + parser.add_argument('--upstream_subnets', help='--upstream_subnets sets the subnets used by the upstream vrcx', + default="20.20.20.0/24") + parser.add_argument('--upstream_nexthop', + help='--upstream_nexthop sets the nexthop used by the upstream vrcx, should be rdd gateway', + default="20.20.20.1") + parser.add_argument('--local_subnets', help='--local_subnets sets the subnets used by the rdd vrcx', + default="10.40.0.0/24") + parser.add_argument('--local_nexthop', + help='--local_nexthop sets the nexthop used by the upstream vrcx, should be upstream ip', + default="10.40.3.198") parser.add_argument('--rdd_ip', help='--rdd_ip sets the ip to be used by the rdd', default="20.20.20.20") - parser.add_argument('--rdd_gateway', help='--rdd_gateway sets the gateway to be used by the rdd', default="20.20.20.1") - parser.add_argument('--rdd_netmask', help='--rdd_netmask sets the netmask to be used by the rdd', default="255.255.255.0") + parser.add_argument('--rdd_gateway', help='--rdd_gateway sets the gateway to be used by the rdd', + default="20.20.20.1") + parser.add_argument('--rdd_netmask', help='--rdd_netmask sets the netmask to be used by the rdd', + default="255.255.255.0") parser.add_argument('--vr_name', help='--vr_name sets the name to be used by the virtual router', default="vr_test") args = parser.parse_args() - num_sta=2 + num_sta = 2 if (args.num_stations is not None) and (int(args.num_stations) > 0): num_stations_converted = int(args.num_stations) num_sta = num_stations_converted - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta-1, padding_number_=10000, + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, radio=args.radio) ip_var_test = VRTest(args.mgr, lfjson_port, number_template="00", sta_list=station_list, - name_prefix="VRT", - upstream=args.upstream_port, - ssid=args.ssid, - password=args.passwd, - radio=args.radio, - security=args.security, test_duration=args.test_duration, use_ht160=False, - side_a_min_rate=args.a_min, side_b_min_rate=args.b_min, _debug_on=args.debug, - upstream_subnets=args.upstream_subnets, upstream_nexthop=args.upstream_nexthop, - local_subnets=args.local_subnets, local_nexthop=args.local_nexthop, - rdd_ip=args.rdd_ip, rdd_gateway=args.rdd_gateway, - rdd_netmask = args.rdd_netmask ,vr_name=args.vr_name) + name_prefix="VRT", + upstream=args.upstream_port, + ssid=args.ssid, + password=args.passwd, + radio=args.radio, + security=args.security, test_duration=args.test_duration, use_ht160=False, + side_a_min_rate=args.a_min, side_b_min_rate=args.b_min, _debug_on=args.debug, + upstream_subnets=args.upstream_subnets, upstream_nexthop=args.upstream_nexthop, + local_subnets=args.local_subnets, local_nexthop=args.local_nexthop, + rdd_ip=args.rdd_ip, rdd_gateway=args.rdd_gateway, + rdd_netmask=args.rdd_netmask, vr_name=args.vr_name) ip_var_test.pre_cleanup() ip_var_test.build() From ed7d7164629cf699d660a7697a312622b85a65b3 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:28:13 -0800 Subject: [PATCH 497/731] test_l3_WAN_LAN: static method was not static Signed-off-by: Matthew Stidham --- py-scripts/test_l3_WAN_LAN.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-scripts/test_l3_WAN_LAN.py b/py-scripts/test_l3_WAN_LAN.py index 0e22ea85..424897f5 100755 --- a/py-scripts/test_l3_WAN_LAN.py +++ b/py-scripts/test_l3_WAN_LAN.py @@ -88,7 +88,8 @@ class VRTest(LFCliBase): cx_rx_map[item] = value_rx return cx_rx_map - def __compare_vals(self, old_list, new_list): + @staticmethod + def __compare_vals(old_list, new_list): passes = 0 expected_passes = 0 if len(old_list) == len(new_list): From 2aba065fe21ede9275d7e76e1a83ddb9984124da Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:30:57 -0800 Subject: [PATCH 498/731] test_l4: Make parser more explicit Signed-off-by: Matthew Stidham --- py-scripts/test_l4.py | 74 +++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 49 deletions(-) diff --git a/py-scripts/test_l4.py b/py-scripts/test_l4.py index 943c3ec7..15fc3455 100755 --- a/py-scripts/test_l4.py +++ b/py-scripts/test_l4.py @@ -61,7 +61,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -257,43 +256,31 @@ python3 ./test_l4.py --test_duration 2m \\ --debug ''') - required = None - for agroup in parser._action_groups: - if agroup.title == "required arguments": - required = agroup - # if required is not None: - - optional = None - for agroup in parser._action_groups: - if agroup.title == "optional arguments": - optional = agroup - - if optional is not None: - optional.add_argument('--requests_per_ten', help='--requests_per_ten number of request per ten minutes', - default=600) - optional.add_argument('--num_tests', help='--num_tests number of tests to run. Each test runs 10 minutes', - default=1) - optional.add_argument('--url', help='--url specifies upload/download, address, and dest', - default="dl http://10.40.0.1 /dev/null") - optional.add_argument('--test_duration', help='duration of test', default="2m") - optional.add_argument('--target_per_ten', - help='--target_per_ten target number of request per ten minutes. test will check for 90 percent this value', - default=600) - optional.add_argument('--mode', help='Used to force mode of stations') - optional.add_argument('--ap', help='Used to force a connection to a particular AP') - optional.add_argument('--report_file', help='where you want to store results') - optional.add_argument('--output_format', help='choose csv or xlsx') # update once other forms are completed - optional.add_argument('--ftp', help='Use ftp for the test', action='store_true') - optional.add_argument('--test_type', help='Choose type of test to run {urls, bytes-rd, bytes-wr}', - default='bytes-rd') - optional.add_argument('--ftp_user', help='--ftp_user sets the username to be used for ftp', default=None) - optional.add_argument('--ftp_passwd', help='--ftp_user sets the password to be used for ftp', default=None) - optional.add_argument('--dest', - help='--dest specifies the destination for the file, should be used when downloading', - default="/dev/null") - optional.add_argument('--source', - help='--source specifies the source of the file, should be used when uploading', - default="/var/www/html/data_slug_4K.bin") + parser.add_argument('--requests_per_ten', help='--requests_per_ten number of request per ten minutes', + default=600) + parser.add_argument('--num_tests', help='--num_tests number of tests to run. Each test runs 10 minutes', + default=1) + parser.add_argument('--url', help='--url specifies upload/download, address, and dest', + default="dl http://10.40.0.1 /dev/null") + parser.add_argument('--test_duration', help='duration of test', default="2m") + parser.add_argument('--target_per_ten', + help='--target_per_ten target number of request per ten minutes. test will check for 90 percent this value', + default=600) + parser.add_argument('--mode', help='Used to force mode of stations') + parser.add_argument('--ap', help='Used to force a connection to a particular AP') + parser.add_argument('--report_file', help='where you want to store results') + parser.add_argument('--output_format', help='choose csv or xlsx') # update once other forms are completed + parser.add_argument('--ftp', help='Use ftp for the test', action='store_true') + parser.add_argument('--test_type', help='Choose type of test to run {urls, bytes-rd, bytes-wr}', + default='bytes-rd') + parser.add_argument('--ftp_user', help='--ftp_user sets the username to be used for ftp', default=None) + parser.add_argument('--ftp_passwd', help='--ftp_user sets the password to be used for ftp', default=None) + parser.add_argument('--dest', + help='--dest specifies the destination for the file, should be used when downloading', + default="/dev/null") + parser.add_argument('--source', + help='--source specifies the source of the file, should be used when uploading', + default="/var/www/html/data_slug_4K.bin") args = parser.parse_args() @@ -305,15 +292,11 @@ python3 ./test_l4.py if args.output_format in ['csv', 'json', 'html', 'hdf', 'stata', 'pickle', 'pdf', 'parquet', 'png', 'df', 'xlsx']: output_form = args.output_format.lower() - print("Defaulting file output placement to /home/lanforge.") - rpt_file = '/home/data.' + output_form else: print("Defaulting data file output type to Excel") - rpt_file = '/home/lanforge/data.xlsx' output_form = 'xlsx' else: - rpt_file = args.report_file if args.output_format is None: output_form = str(args.report_file).split('.')[-1] else: @@ -336,18 +319,11 @@ python3 ./test_l4.py if args.output_format in ['csv', 'json', 'html', 'hdf', 'stata', 'pickle', 'pdf', 'png', 'df', 'parquet', 'xlsx']: rpt_file = path + '/data.' + args.output_format - output = args.output_format else: print('Defaulting data file output type to Excel') rpt_file = path + '/data.xlsx' - output = 'xlsx' else: rpt_file = args.report_file - if args.output_format is None: - output = str(args.report_file).split('.')[-1] - else: - output = args.output_format - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, radio=args.radio) From 3213c14d326a5401acbc3f53c060a0ba23a41f4d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 16:33:16 -0800 Subject: [PATCH 499/731] test_l4: Merge identical if clauses Signed-off-by: Matthew Stidham --- py-scripts/test_l4.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/py-scripts/test_l4.py b/py-scripts/test_l4.py index 15fc3455..094a7132 100755 --- a/py-scripts/test_l4.py +++ b/py-scripts/test_l4.py @@ -312,10 +312,6 @@ python3 ./test_l4.py except: path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) print('Saving file to local directory') - else: - pass - - if args.report_file is None: if args.output_format in ['csv', 'json', 'html', 'hdf', 'stata', 'pickle', 'pdf', 'png', 'df', 'parquet', 'xlsx']: rpt_file = path + '/data.' + args.output_format @@ -324,6 +320,7 @@ python3 ./test_l4.py rpt_file = path + '/data.xlsx' else: rpt_file = args.report_file + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, radio=args.radio) From 74875c1f88201fc4d907e1d3d8ec3a729f0f9c7a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 17:15:30 -0800 Subject: [PATCH 500/731] measure_station_time_up: Fix regressions. args.num_stations now works. Signed-off-by: Matthew Stidham --- py-scripts/measure_station_time_up.py | 54 +++++++++++++-------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/py-scripts/measure_station_time_up.py b/py-scripts/measure_station_time_up.py index 7a9f0d9f..cb472ce4 100755 --- a/py-scripts/measure_station_time_up.py +++ b/py-scripts/measure_station_time_up.py @@ -103,7 +103,7 @@ class MeasureTimeUp(Realm): self._pass("PASS: Station build finished") def scenario(self): - if self.load is not None: + if self.load: data = { "name": self.load, "action": self.action, @@ -117,13 +117,13 @@ class MeasureTimeUp(Realm): print("Loading database %s" % self.load) self.json_post("/cli-json/load", data) - elif self.start is not None: + elif self.start: print("Starting test group %s..." % self.start) self.json_post("/cli-json/start_group", {"name": self.start}) - elif self.stop is not None: + elif self.stop: print("Stopping test group %s..." % self.stop) self.json_post("/cli-json/stop_group", {"name": self.stop}) - elif self.quiesce is not None: + elif self.quiesce: print("Quiescing test group %s..." % self.quiesce) self.json_post("/cli-json/quiesce_group", {"name": self.quiesce}) @@ -151,35 +151,33 @@ Command example: ''') required = parser.add_argument_group('required arguments') required.add_argument('--report_file', help='where you want to store results', required=True) + parser.add_argument('--database', help='Which database to load', default='FACTORY_DFLT') args = parser.parse_args() dictionary = dict() - for num_sta in list(filter(lambda x: (x % 2 == 0), [*range(0, 200)])): + for num_sta in list(filter(lambda x: (x % 2 == 0), [*range(0, args.num_stations)])): print(num_sta) - try: - create_station = MeasureTimeUp(_host=args.mgr, - _port=args.mgr_port, - _ssid=args.ssid, - _password=args.passwd, - _security=args.security, - _num_sta=num_sta, - _radio=["wiphy0", "wiphy1"], - _proxy_str=args.proxy, - _debug_on=args.debug, - _load='FACTORY_DFLT') - create_station.scenario() - time.sleep(5.0 + num_sta / 10) - start = datetime.datetime.now() - create_station.build() - built = datetime.datetime.now() - create_station.station_up() - stationsup = datetime.datetime.now() - dictionary[num_sta] = [start, built, stationsup] - create_station.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=station_list) - time.sleep(5.0 + num_sta / 20) - except: - pass + create_station = MeasureTimeUp(_host=args.mgr, + _port=args.mgr_port, + _ssid=args.ssid, + _password=args.passwd, + _security=args.security, + _num_sta=num_sta, + _radio=["wiphy0", "wiphy7"], + _proxy_str=args.proxy, + _debug_on=args.debug, + _load=args.database) + create_station.scenario() + time.sleep(5.0 + num_sta / 10) + start = datetime.datetime.now() + create_station.build() + built = datetime.datetime.now() + create_station.station_up() + stationsup = datetime.datetime.now() + dictionary[num_sta] = [start, built, stationsup] + create_station.wait_until_ports_disappear() + time.sleep(5.0 + num_sta / 20) df = pd.DataFrame.from_dict(dictionary).transpose() df.columns = ['Start', 'Built', 'Stations Up'] df['built duration'] = df['Built'] - df['Start'] From dce4488777d0c60c2bf537ffda0b9f9c85099eec Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 17:19:50 -0800 Subject: [PATCH 501/731] measure_station_time_up: Support csv, xlsx, and pickle for file outputs Signed-off-by: Matthew Stidham --- py-scripts/measure_station_time_up.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/py-scripts/measure_station_time_up.py b/py-scripts/measure_station_time_up.py index cb472ce4..109b4ea7 100755 --- a/py-scripts/measure_station_time_up.py +++ b/py-scripts/measure_station_time_up.py @@ -155,6 +155,9 @@ Command example: args = parser.parse_args() + if args.report_file.split('.')[-1] not in ['pkl','csv','xlsx']: + raise NameError('Please make sure your file name ends with either pkl, csv, or xlsx') + dictionary = dict() for num_sta in list(filter(lambda x: (x % 2 == 0), [*range(0, args.num_stations)])): print(num_sta) @@ -185,7 +188,14 @@ Command example: df['duration'] = df['Stations Up'] - df['Start'] for variable in ['built duration', 'duration']: df[variable] = [x.total_seconds() for x in df[variable]] - df.to_pickle(args.report_file) + if 'pkl' in args.report_file: + df.to_pickle(args.report_file) + if 'csv' in args.report_file: + df.to_csv(args.report_file) + if 'xlsx' in args.report_file: + df.to_excel(args.report_file) + else: + if __name__ == "__main__": From a952c392fb2f86178c2dbcb8cdfaa53e4c09f07c Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 17:20:37 -0800 Subject: [PATCH 502/731] measure_station_time_up: Remove empty else clause Signed-off-by: Matthew Stidham --- py-scripts/measure_station_time_up.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/py-scripts/measure_station_time_up.py b/py-scripts/measure_station_time_up.py index 109b4ea7..38b02a44 100755 --- a/py-scripts/measure_station_time_up.py +++ b/py-scripts/measure_station_time_up.py @@ -193,9 +193,7 @@ Command example: if 'csv' in args.report_file: df.to_csv(args.report_file) if 'xlsx' in args.report_file: - df.to_excel(args.report_file) - else: - + df.to_excel(args.report_file) if __name__ == "__main__": From a08afea0f4060a3b5f60794cf4aa007894f6583f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 17:22:27 -0800 Subject: [PATCH 503/731] measure_station_time_up: Fix whitespace errors Signed-off-by: Matthew Stidham --- py-scripts/measure_station_time_up.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/py-scripts/measure_station_time_up.py b/py-scripts/measure_station_time_up.py index 38b02a44..31665198 100755 --- a/py-scripts/measure_station_time_up.py +++ b/py-scripts/measure_station_time_up.py @@ -15,7 +15,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -34,7 +33,7 @@ class MeasureTimeUp(Realm): _port=None, _num_sta=None, _number_template="00000", - _radio=["wiphy0", "wiphy1"], + _radio=None, _proxy_str=None, _debug_on=False, _up=True, @@ -49,6 +48,8 @@ class MeasureTimeUp(Realm): _clean_dut="no"): super().__init__(_host, _port) + if _radio is None: + _radio = ["wiphy0", "wiphy1"] self.host = _host self.port = _port self.ssid = _ssid @@ -155,7 +156,7 @@ Command example: args = parser.parse_args() - if args.report_file.split('.')[-1] not in ['pkl','csv','xlsx']: + if args.report_file.split('.')[-1] not in ['pkl', 'csv', 'xlsx']: raise NameError('Please make sure your file name ends with either pkl, csv, or xlsx') dictionary = dict() @@ -193,7 +194,7 @@ Command example: if 'csv' in args.report_file: df.to_csv(args.report_file) if 'xlsx' in args.report_file: - df.to_excel(args.report_file) + df.to_excel(args.report_file) if __name__ == "__main__": From 6c7aff23df12daabbbacf1dbb4c1fe5739312181 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 17:23:25 -0800 Subject: [PATCH 504/731] run_cv_scenario: Remove trailing semicolons Signed-off-by: Matthew Stidham --- py-scripts/run_cv_scenario.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/run_cv_scenario.py b/py-scripts/run_cv_scenario.py index e16b2195..d5b3ad2c 100755 --- a/py-scripts/run_cv_scenario.py +++ b/py-scripts/run_cv_scenario.py @@ -54,7 +54,7 @@ class RunCvScenario(LFCliBase): self.json_post("/cli-json/load", data) self.wait_for_db_load_and_sync() - port_counter = 0; + port_counter = 0 attempts = 6 while (attempts > 0) and (port_counter > 0): sleep(1) @@ -72,7 +72,7 @@ class RunCvScenario(LFCliBase): if (port_counter != 0) and (attempts == 0): print("There appears to be a vAP in this database, quitting.") - pprint(alias_map); + pprint(alias_map) exit(1) data = { From d7efd606c902d9239e24b7758771941bf393c5fa Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 17:23:51 -0800 Subject: [PATCH 505/731] run_cv_scenario: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/run_cv_scenario.py | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/py-scripts/run_cv_scenario.py b/py-scripts/run_cv_scenario.py index d5b3ad2c..2cb6e02d 100755 --- a/py-scripts/run_cv_scenario.py +++ b/py-scripts/run_cv_scenario.py @@ -13,7 +13,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -30,9 +29,12 @@ Realm = realm.Realm cvScenario.test_scenario = args.test_scenario """ + class RunCvScenario(LFCliBase): - def __init__(self, lfhost="localhost", lfport=8080, debug_=False, lanforge_db_=None, cv_scenario_=None, cv_test_=None, test_scenario_=None): - super().__init__( _lfjson_host=lfhost, _lfjson_port=lfport, _debug=debug_, _exit_on_error=True, _exit_on_fail=True) + def __init__(self, lfhost="localhost", lfport=8080, debug_=False, lanforge_db_=None, cv_scenario_=None, + cv_test_=None, test_scenario_=None): + super().__init__(_lfjson_host=lfhost, _lfjson_port=lfport, _debug=debug_, _exit_on_error=True, + _exit_on_fail=True) self.lanforge_db = lanforge_db_ self.cv_scenario = cv_scenario_ self.cv_test = cv_test_ @@ -47,8 +49,8 @@ class RunCvScenario(LFCliBase): def build(self): data = { "name": "BLANK", - "action":"overwrite", - "clean_dut":"yes", + "action": "overwrite", + "clean_dut": "yes", "clean_chambers": "yes" } self.json_post("/cli-json/load", data) @@ -77,8 +79,8 @@ class RunCvScenario(LFCliBase): data = { "name": self.lanforge_db, - "action":"overwrite", - "clean_dut":"yes", + "action": "overwrite", + "clean_dut": "yes", "clean_chambers": "yes" } self.json_post("/cli-json/load", data) @@ -130,7 +132,7 @@ class RunCvScenario(LFCliBase): status_response = self.json_get("/") if "text_records_last_updated_ms" in status_response: blobs_last_updated = int(status_response["text_records_last_updated_ms"]) - #print("*** blobs updated at %d" % blobs_last_updated) + # print("*** blobs updated at %d" % blobs_last_updated) else: begin_time = round(time.time() * 1000) print("no text_records_last_updated_ms, using %d " % begin_time) @@ -169,7 +171,6 @@ class RunCvScenario(LFCliBase): self.json_post("/cli-json/show_traffic_profile", {"name": "ALL"}) sleep(5) - def start(self, debug_=False): # /gui_cli takes commands keyed on 'cmd', so we create an array of commands commands = [ @@ -193,7 +194,7 @@ class RunCvScenario(LFCliBase): "sleep 60", "cv get test_ref 'Report Location:'", "sleep 5", - #"cv click test_ref 'Save HTML'", + # "cv click test_ref 'Save HTML'", "cv click test_ref 'Close'", "sleep 1", "cv click test_ref Cancel", @@ -208,7 +209,7 @@ class RunCvScenario(LFCliBase): try: debug_par = "" if debug_: - debug_par="?_debug=1" + debug_par = "?_debug=1" if command.endswith("is_built"): print("Waiting for scenario to build...", end='') self.localrealm.wait_while_building(debug_=False) @@ -230,7 +231,8 @@ class RunCvScenario(LFCliBase): else: response_json = [] print("running %s..." % command, end='') - response = self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, response_json_list_=response_json) + response = self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, + response_json_list_=response_json) if debug_: LFUtils.debug_printer.pprint(response_json) print("...proceeding") @@ -239,7 +241,6 @@ class RunCvScenario(LFCliBase): self._pass("report finished", print_=True) - def stop(self): pass @@ -260,7 +261,8 @@ Example: parser.add_argument("-m", "--lfmgr", type=str, help="address of the LANforge GUI machine (localhost is default)") parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") parser.add_argument("-d", "--lanforge_db", type=str, help="Name of test scenario database (see Status Tab)") - parser.add_argument("-c", "--cv_scenario", type=str, help="Name of Chamber View test scenario (see CV Manage Scenarios)") + parser.add_argument("-c", "--cv_scenario", type=str, + help="Name of Chamber View test scenario (see CV Manage Scenarios)") parser.add_argument("-n", "--cv_test", type=str, help="Chamber View test") parser.add_argument("-s", "--test_profile", type=str, help="Name of the saved CV test profile") parser.add_argument("--debug", help='Enable debugging', default=False, action="store_true") @@ -308,7 +310,9 @@ Example: exit(1) report_file = run_cv_scenario.get_report_file_name() - print("Report file saved to "+report_file) + print("Report file saved to " + report_file) + + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 5d95f276238a215bf6bcf670dd411c8e29db96a8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 19:56:01 -0800 Subject: [PATCH 506/731] regression_test: test stalls on test_l3_scenario_throughput Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 4d22d71e..52356cb5 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -348,7 +348,7 @@ else "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_udp lf_tcp' --upstream_port 1.1.$UPSTREAM --radio 'radio==1.1.wiphy0 stations==10 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --radio 'radio==1.1.wiphy1 stations==1 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --test_duration 5s --influx_host c7-graphana --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --influx_tag testbed regression_test --influx_tag DUT ROG -o longevity.csv" "./test_l3_powersave_traffic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - "./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput -m $MGR" + #"./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput -m $MGR" #./test_l3_unicast_traffic_gen #./test_l3_unicast_traffic_gen #./test_l3_WAN_LAN From 4a97a90f282ecc0fbbfffa6c8d9a201c0f345e63 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 24 Nov 2021 22:29:06 -0800 Subject: [PATCH 507/731] ws_generic_monitor_test: Will run forever. It needs to be fixed. Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 52356cb5..85fc2c5f 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -361,7 +361,7 @@ else "./wlan_capacity_calculator.py -sta 11abg -t Voice -p 48 -m 106 -e WEP -q Yes -b 1 2 5.5 11 -pre Long -s N/A -co G.711 -r Yes -c Yes" "./wlan_capacity_calculator.py -sta 11n -t Voice -d 17 -ch 40 -gu 800 -high 9 -e WEP -q Yes -ip 5 -mc 42 -b 6 9 12 24 -m 1538 -co G.729 -pl Greenfield -cw 15 -r Yes -c Yes" "./wlan_capacity_calculator.py -sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes" - "./ws_generic_monitor_test.py --mgr $MGR" + #"./ws_generic_monitor_test.py --mgr $MGR" "python3 -c 'import lanforge_scripts'" ) fi From 6fab304140b755718acfd1399f7abf7fa5c146c1 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Mon, 29 Nov 2021 10:14:28 -0800 Subject: [PATCH 508/731] whitespace changes after autopep8 --- py-scripts/lf_webpage.py | 124 ++++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 59 deletions(-) diff --git a/py-scripts/lf_webpage.py b/py-scripts/lf_webpage.py index 4ff65452..be2c5820 100755 --- a/py-scripts/lf_webpage.py +++ b/py-scripts/lf_webpage.py @@ -17,7 +17,7 @@ import paramiko from datetime import datetime import pandas as pd - + sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -57,8 +57,6 @@ class HttpDownload(Realm): self.http_profile.debug = _debug_on self.created_cx = {} - - def set_values(self): # This method will set values according user input if self.bands == "5G": @@ -67,7 +65,7 @@ class HttpDownload(Realm): self.radio = [self.twog_radio] elif self.bands == "Both": self.radio = [self.fiveg_radio, self.twog_radio] - print( self.radio) + print(self.radio) self.num_sta = self.num_sta // 2 def precleanup(self): @@ -121,7 +119,7 @@ class HttpDownload(Realm): self.station_profile.create(radio=rad, sta_names_=self.station_list, debug=self.local_realm.debug) self.local_realm.wait_until_ports_appear(sta_list=self.station_list) self.station_profile.admin_up() - if self.local_realm.wait_for_ip(self.station_list,timeout_sec=60): + if self.local_realm.wait_for_ip(self.station_list, timeout_sec=60): self.local_realm._pass("All stations got IPs") else: self.local_realm._fail("Stations failed to get IPs") @@ -181,7 +179,7 @@ class HttpDownload(Realm): LFUtils.wait_until_ports_disappear(base_url=self.local_realm.lfclient_url, port_list=self.station_profile.station_names, debug=self.debug) - def file_create(self,ssh_port): + def file_create(self, ssh_port): ip = self.host user = "root" pswd = "lanforge" @@ -211,13 +209,13 @@ class HttpDownload(Realm): time.sleep(1) return output - def download_time_in_sec(self,result_data): + def download_time_in_sec(self, result_data): self.resullt_data = result_data download_time = dict.fromkeys(result_data.keys()) for i in download_time: try: download_time[i] = result_data[i]['dl_time'] - except: + except BaseException: download_time[i] = [] print(download_time) lst = [] @@ -253,13 +251,13 @@ class HttpDownload(Realm): dataset.append(dwnld_time["Both"]) return dataset - def speed_in_Mbps(self,result_data): + def speed_in_Mbps(self, result_data): self.resullt_data = result_data speed = dict.fromkeys(result_data.keys()) for i in speed: try: speed[i] = result_data[i]['speed'] - except: + except BaseException: speed[i] = [] print(speed) lst = [] @@ -341,7 +339,7 @@ class HttpDownload(Realm): pass_fail_list.append("PASS") sumry2.append("PASS") # BOTH - if float(z11[2]) == 0.0 or float(z11[2]) > float(threshold_both) : + if float(z11[2]) == 0.0 or float(z11[2]) > float(threshold_both): var = "FAIL" pass_fail_list.append(var) sumryB.append("FAIL") @@ -446,35 +444,36 @@ class HttpDownload(Realm): def generate_graph(self, dataset, lis, bands): graph = lf_graph.lf_bar_graph(_data_set=dataset, _xaxis_name="Stations", _yaxis_name="Time in Seconds", - _xaxis_categories=lis, _label=bands, _xticks_font=8, - _graph_image_name="webpage download time graph", - _color=['forestgreen', 'darkorange', 'blueviolet'], _color_edge='black', _figsize=(14, 5), - _grp_title="Download time taken by each client", _xaxis_step=1, _show_bar_value=True, - _text_font=6, _text_rotation=60, - _legend_loc="upper right", - _legend_box=(1, 1.15), - _enable_csv=True - ) + _xaxis_categories=lis, _label=bands, _xticks_font=8, + _graph_image_name="webpage download time graph", + _color=['forestgreen', 'darkorange', 'blueviolet'], _color_edge='black', _figsize=(14, 5), + _grp_title="Download time taken by each client", _xaxis_step=1, _show_bar_value=True, + _text_font=6, _text_rotation=60, + _legend_loc="upper right", + _legend_box=(1, 1.15), + _enable_csv=True + ) graph_png = graph.build_bar_graph() print("graph name {}".format(graph_png)) return graph_png - def graph_2(self,dataset2, lis, bands): + def graph_2(self, dataset2, lis, bands): graph_2 = lf_graph.lf_bar_graph(_data_set=dataset2, _xaxis_name="Stations", _yaxis_name="Download Rate in Mbps", - _xaxis_categories=lis, _label=bands, _xticks_font=8, - _graph_image_name="webpage_speed_graph", - _color=['forestgreen', 'darkorange', 'blueviolet'], _color_edge='black', - _figsize=(14, 5), - _grp_title="Download rate for each client (Mbps)", _xaxis_step=1, _show_bar_value=True, - _text_font=6, _text_rotation=60, - _legend_loc="upper right", - _legend_box=(1, 1.15), - _enable_csv=True - ) + _xaxis_categories=lis, _label=bands, _xticks_font=8, + _graph_image_name="webpage_speed_graph", + _color=['forestgreen', 'darkorange', 'blueviolet'], _color_edge='black', + _figsize=(14, 5), + _grp_title="Download rate for each client (Mbps)", _xaxis_step=1, _show_bar_value=True, + _text_font=6, _text_rotation=60, + _legend_loc="upper right", + _legend_box=(1, 1.15), + _enable_csv=True + ) graph_png = graph_2.build_bar_graph() return graph_png - def generate_report(self,date, num_stations,duration, test_setup_info,dataset,lis,bands,threshold_2g,threshold_5g,threshold_both,dataset2,summary_table_value,result_data,test_input_infor): + def generate_report(self, date, num_stations, duration, test_setup_info, dataset, lis, bands, threshold_2g, + threshold_5g, threshold_both, dataset2, summary_table_value, result_data, test_input_infor): report = lf_report.lf_report(_results_dir_name="webpage_test", _output_html="Webpage.html", _output_pdf="Webpage.pdf") report.set_title("WEBPAGE DOWNLOAD TEST") report.set_date(date) @@ -594,7 +593,8 @@ class HttpDownload(Realm): html_file = report.write_html() print("returned file {}".format(html_file)) print(html_file) - report.write_pdf() + report.write_pdf_with_timestamp(_page_size='A4', _orientation='Landscape') + def main(): parser = argparse.ArgumentParser( @@ -614,11 +614,11 @@ def main(): parser.add_argument('--file_size', type=str, help='specify the size of file you want to download', default='5MB') parser.add_argument('--bands', nargs="+", help='specify which band testing you want to run eg 5G OR 2.4G OR Both', default=["5G", "2.4G", "Both"]) parser.add_argument('--duration', type=int, help='time to run traffic') - parser.add_argument('--threshold_5g',help="Enter the threshold value for 5G Pass/Fail criteria", default="60") - parser.add_argument('--threshold_2g',help="Enter the threshold value for 2.4G Pass/Fail criteria",default="90") - parser.add_argument('--threshold_both',help="Enter the threshold value for Both Pass/Fail criteria" , default="50") + parser.add_argument('--threshold_5g', help="Enter the threshold value for 5G Pass/Fail criteria", default="60") + parser.add_argument('--threshold_2g', help="Enter the threshold value for 2.4G Pass/Fail criteria", default="90") + parser.add_argument('--threshold_both', help="Enter the threshold value for Both Pass/Fail criteria", default="50") parser.add_argument('--ap_name', help="specify the ap model ", default="TestAP") - parser.add_argument('--ssh_port', type=int, help="specify the shh port eg 22",default=22) + parser.add_argument('--ssh_port', type=int, help="specify the ssh port eg 22", default=22) args = parser.parse_args() test_time = datetime.now() @@ -631,14 +631,14 @@ def main(): list2G_bytes = [] list2G_speed = [] Both = [] - Both_bytes =[] - Both_speed =[] + Both_bytes = [] + Both_speed = [] dict_keys = [] dict_keys.extend(args.bands) # print(dict_keys) final_dict = dict.fromkeys(dict_keys) # print(final_dict) - dict1_keys = ['dl_time', 'min', 'max', 'avg','bytes_rd', 'speed'] + dict1_keys = ['dl_time', 'min', 'max', 'avg', 'bytes_rd', 'speed'] for i in final_dict: final_dict[i] = dict.fromkeys(dict1_keys) print(final_dict) @@ -720,7 +720,7 @@ def main(): final_dict['Both']['min'] = min_both max_both.append(max(Both)) final_dict['Both']['max'] = max_both - avg_both.append((sum(Both) /args.num_stations)) + avg_both.append((sum(Both) / args.num_stations)) final_dict['Both']['avg'] = avg_both final_dict['Both']['bytes_rd'] = Both_bytes final_dict['Both']['speed'] = Both_speed @@ -739,36 +739,41 @@ def main(): print("total test duration ", test_duration) date = str(datetime.now()).split(",")[0].replace(" ", "-").split(".")[0] test_setup_info = { - "DUT Name": args.ap_name, - "SSID": args.ssid, - "Test Duration": test_duration, + "DUT Name": args.ap_name, + "SSID": args.ssid, + "Test Duration": test_duration, } - test_input_infor={ - "LANforge ip":args.mgr, - "File Size" : args.file_size, - "Bands" : args.bands, + test_input_infor = { + "LANforge ip": args.mgr, + "File Size": args.file_size, + "Bands": args.bands, "Upstream": args.upstream_port, "Stations": args.num_stations, - "SSID" :args.ssid, + "SSID": args.ssid, "Security": args.security, - "Duration" : args.duration, + "Duration": args.duration, "Contact": "support@candelatech.com" } http1 = HttpDownload(lfclient_host=args.mgr, lfclient_port=args.mgr_port, - upstream=args.upstream_port, num_sta=args.num_stations, - security=args.security, - ssid=args.ssid, password=args.passwd, - target_per_ten=args.target_per_ten, - file_size=args.file_size, bands=args.bands, - twog_radio=args.twog_radio, - fiveg_radio=args.fiveg_radio) + upstream=args.upstream_port, num_sta=args.num_stations, + security=args.security, + ssid=args.ssid, password=args.passwd, + target_per_ten=args.target_per_ten, + file_size=args.file_size, bands=args.bands, + twog_radio=args.twog_radio, + fiveg_radio=args.fiveg_radio) dataset = http1.download_time_in_sec(result_data=result_data) lis = [] for i in range(1, args.num_stations + 1): lis.append(i) - dataset2= http1.speed_in_Mbps(result_data=result_data) - data = http1.summary_calculation(result_data=result_data, bands=args.bands, threshold_5g=args.threshold_5g , threshold_2g= args.threshold_2g, threshold_both=args.threshold_both) + dataset2 = http1.speed_in_Mbps(result_data=result_data) + data = http1.summary_calculation( + result_data=result_data, + bands=args.bands, + threshold_5g=args.threshold_5g, + threshold_2g=args.threshold_2g, + threshold_both=args.threshold_both) summary_table_value = { "": args.bands, @@ -780,5 +785,6 @@ def main(): threshold_both=args.threshold_both, dataset2=dataset2, summary_table_value=summary_table_value, result_data=result_data, test_input_infor=test_input_infor) + if __name__ == '__main__': main() From 72363432d3a40c9b3979303e471491b286ba3716 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 12:47:33 -0800 Subject: [PATCH 509/731] regression_test: improve measure_station_time_up call Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 85fc2c5f..4e89787d 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -300,7 +300,7 @@ else #--influx_host c7-graphana --influx_port 8086 --influx_org Candela \ #--influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ #--influx_bucket ben \ - "./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --debug --report_file measure_station_time_up.txt" + "./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --debug --report_file measure_station_time_up.pkl" "./create_station.py --mgr $MGR --radio $RADIO_USED --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED && ./modify_station.py \ --mgr $MGR \ --radio $RADIO_USED \ From cc305b8422b1e3e4a97cd20c0b62b3f758253b32 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 12:50:47 -0800 Subject: [PATCH 510/731] measure_station_time_up: Don't hardcode radio names Signed-off-by: Matthew Stidham --- py-scripts/measure_station_time_up.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-scripts/measure_station_time_up.py b/py-scripts/measure_station_time_up.py index 31665198..b4b8086c 100755 --- a/py-scripts/measure_station_time_up.py +++ b/py-scripts/measure_station_time_up.py @@ -153,6 +153,7 @@ Command example: required = parser.add_argument_group('required arguments') required.add_argument('--report_file', help='where you want to store results', required=True) parser.add_argument('--database', help='Which database to load', default='FACTORY_DFLT') + parser.add_argument('--radio2', help='second radio to create stations on', default='wiphy7') args = parser.parse_args() @@ -168,7 +169,7 @@ Command example: _password=args.passwd, _security=args.security, _num_sta=num_sta, - _radio=["wiphy0", "wiphy7"], + _radio=[args.radio, args.radio2], _proxy_str=args.proxy, _debug_on=args.debug, _load=args.database) From 3423dd0d737a34406d835c5f9447e8763658dde4 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 12:51:59 -0800 Subject: [PATCH 511/731] regression_test: Improve measure_station_time_up args Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 4e89787d..26c73107 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -300,7 +300,8 @@ else #--influx_host c7-graphana --influx_port 8086 --influx_org Candela \ #--influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ #--influx_bucket ben \ - "./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --debug --report_file measure_station_time_up.pkl" + "./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED \ + --debug --report_file measure_station_time_up.pkl --radio2 wiphy1" "./create_station.py --mgr $MGR --radio $RADIO_USED --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED && ./modify_station.py \ --mgr $MGR \ --radio $RADIO_USED \ From b3d9447c7ed0b705aab381eb31b98cfaa7a0d8f5 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 12:56:11 -0800 Subject: [PATCH 512/731] sta_connect2: Make the mgr argument on sta_connect2 more robust Signed-off-by: Matthew Stidham --- py-scripts/sta_connect2.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index e98d2ba1..5e815480 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -398,8 +398,6 @@ class StaConnect2(LFCliBase): def main(): - lfjson_host = "localhost" - lfjson_port = 8080 parser = argparse.ArgumentParser( prog="sta_connect2.py", formatter_class=argparse.RawTextHelpFormatter, @@ -407,8 +405,8 @@ def main(): Example: ./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C """) - parser.add_argument("-d", "--dest", type=str, help="address of the LANforge GUI machine (localhost is default)") - parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") + parser.add_argument("-d", "--dest", "--mgr", type=str, help="address of the LANforge GUI machine (localhost is default)", default='localhost') + parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)", default=8080) parser.add_argument("-u", "--user", type=str, help="TBD: credential login/username") parser.add_argument("-p", "--passwd", type=str, help="TBD: credential password") parser.add_argument("--resource", type=str, help="LANforge Station resource ID to use, default is 1") @@ -434,12 +432,8 @@ Example: parser.add_argument('--monitor_interval', help='How frequently you want to append to your database', default='5s') args = parser.parse_args() - if args.dest is not None: - lfjson_host = args.dest - if args.port is not None: - lfjson_port = args.port - staConnect = StaConnect2(lfjson_host, lfjson_port, + staConnect = StaConnect2(args.dest, args.port, debug_=True, _influx_db=args.influx_db, _influx_passwd=args.influx_passwd, From e98e7c71c99734f097a29bdba70637ef941f22a0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 12:57:49 -0800 Subject: [PATCH 513/731] regression_test: Improve measure_station_time_up args Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 26c73107..2d2ac5b2 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -315,7 +315,7 @@ else #recordinflux.py "./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test Dataplane --test_profile http --cv_scenario ct-us-001" #scenario.py - "./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C" + "./sta_connect2.py --dut_ssid $SSID_USED --dut_bssid $BSSID --dut_passwd $PASSWD_USED" #./sta_connect_bssid_mac.py "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" "./sta_connect.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" From 356dbcf15a97ddbb04d33aac48b39875a52c08b0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 13:00:32 -0800 Subject: [PATCH 514/731] Revert "sta_connect2: Make the mgr argument on sta_connect2 more robust" This reverts commit b3d9447c7ed0b705aab381eb31b98cfaa7a0d8f5. --- py-scripts/sta_connect2.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/py-scripts/sta_connect2.py b/py-scripts/sta_connect2.py index 5e815480..e98d2ba1 100755 --- a/py-scripts/sta_connect2.py +++ b/py-scripts/sta_connect2.py @@ -398,6 +398,8 @@ class StaConnect2(LFCliBase): def main(): + lfjson_host = "localhost" + lfjson_port = 8080 parser = argparse.ArgumentParser( prog="sta_connect2.py", formatter_class=argparse.RawTextHelpFormatter, @@ -405,8 +407,8 @@ def main(): Example: ./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C """) - parser.add_argument("-d", "--dest", "--mgr", type=str, help="address of the LANforge GUI machine (localhost is default)", default='localhost') - parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)", default=8080) + parser.add_argument("-d", "--dest", type=str, help="address of the LANforge GUI machine (localhost is default)") + parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") parser.add_argument("-u", "--user", type=str, help="TBD: credential login/username") parser.add_argument("-p", "--passwd", type=str, help="TBD: credential password") parser.add_argument("--resource", type=str, help="LANforge Station resource ID to use, default is 1") @@ -432,8 +434,12 @@ Example: parser.add_argument('--monitor_interval', help='How frequently you want to append to your database', default='5s') args = parser.parse_args() + if args.dest is not None: + lfjson_host = args.dest + if args.port is not None: + lfjson_port = args.port - staConnect = StaConnect2(args.dest, args.port, + staConnect = StaConnect2(lfjson_host, lfjson_port, debug_=True, _influx_db=args.influx_db, _influx_passwd=args.influx_passwd, From 8fccdf3111f49dfa237c7232ef3b3b1869441c12 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 13:03:05 -0800 Subject: [PATCH 515/731] regression_test: Remove TIP scripts, enable more of our scripts Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 2d2ac5b2..c718d002 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -217,8 +217,6 @@ else --passwd $PASSWD_USED --radio 1.1.$RADIO_USED --security wpa2 --debug --mgr $MGR" #./ftp_html.py #./grafana_profile - # "./layer3_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED" - # "./layer4_test.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY" "./lf_ap_auto_test.py \ --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth1 \ @@ -263,7 +261,7 @@ else --protocol lf_udp --min_mbps 1000 --max_mbps 10000 --duration 1" "./lf_graph.py --mgr $MGR" "./lf_mesh_test.py --mgr $MGR --upstream $UPSTREAM --raw_line 'selected_dut2 RootAP wactest $BSSID'" - #"./lf_multipsk.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --debug" + "./lf_multipsk.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --debug" "./lf_report.py" "./lf_report_test.py" # "./lf_rvr_test.py" @@ -315,7 +313,6 @@ else #recordinflux.py "./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test Dataplane --test_profile http --cv_scenario ct-us-001" #scenario.py - "./sta_connect2.py --dut_ssid $SSID_USED --dut_bssid $BSSID --dut_passwd $PASSWD_USED" #./sta_connect_bssid_mac.py "./sta_connect_example.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" "./sta_connect.py --mgr $MGR --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --upstream_port $UPSTREAM --test_duration 15s" @@ -335,9 +332,9 @@ else #test_client_admission.py "./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 --test_duration 30s --mgr $MGR" # Better tested on Kelly, where VRF is turned off "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug --mgr $MGR" - #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security $SECURITY --debug --mgr $MGR" - #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type iperf3 --debug --mgr $MGR" - #"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfcurl --dest $TEST_HTTP_IP --file_output ${HOMEPATH}/Documents/lfcurl_output.txt --debug --mgr $MGR" + "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security $SECURITY --debug --mgr $MGR" + "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type iperf3 --debug --mgr $MGR" + "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfcurl --dest $TEST_HTTP_IP --file_output ${HOMEPATH}/Documents/lfcurl_output.txt --debug --mgr $MGR" "./testgroup.py --group_name group1 --add_group --list_groups --debug --mgr $MGR" "./testgroup2.py --num_stations 4 --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --radio $RADIO_USED --group_name group0 --add_group --mgr $MGR" "./test_ip_connection.py --radio $RADIO_USED --num_stations $NUM_STA --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" From 10bbe522dedfb4da697bdba6bbd4409c583ed575 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 29 Nov 2021 13:04:37 -0800 Subject: [PATCH 516/731] logg.py: adds comments about protocol logging levels Signed-off-by: Jed Reynolds --- lanforge_client/logg.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lanforge_client/logg.py b/lanforge_client/logg.py index ed165089..d05341d9 100644 --- a/lanforge_client/logg.py +++ b/lanforge_client/logg.py @@ -37,6 +37,16 @@ class Logg: These reserved words may not be used as tags: debug, debugging, debug_log, digest, file, gui, http, json, log, method, tag + Protocol logging levels: + * always: X-Errors( stops script on halt_on_errors) + * timeouts: can be configured as halt level errors + - digest (POST set_port / GET /ports ) + - url (POST /cli-json/set_port / GET /port/1/2/3/?fields) + - json (POST /cli-json/set_port { a:b } ; GET /port/1/2/3?fields {results interfaces[]} + - http that plus X-Warnings and ALL headers + - gui Xtra debugging messages generated by LANforgeGUI + + Please also consider how log messages can be formatted: https://stackoverflow.com/a/20112491/11014343: logging.basicConfig(format="[%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s") From 418db00d4d2bc6e1c875cffd6bad8a4dc7c0ae84 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 13:09:42 -0800 Subject: [PATCH 517/731] test_wanlink: main() takes only 1 argument Signed-off-by: Matthew Stidham --- py-scripts/test_wanlink.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/py-scripts/test_wanlink.py b/py-scripts/test_wanlink.py index 41656f50..4a51dee6 100755 --- a/py-scripts/test_wanlink.py +++ b/py-scripts/test_wanlink.py @@ -34,9 +34,9 @@ class LANtoWAN(Realm): self._exit_on_error = False self._exit_on_fail = False - def create_wanlinks(self, shelf=1, resource=1, max_rate=1544000): + def create_wanlinks(self): print("Creating wanlinks") - create_wanlink.main('http://'+self.args['host']+':8080', self.args) + create_wanlink.main(self.args) def cleanup(self): pass @@ -45,10 +45,6 @@ def main(): parser = LFCliBase.create_basic_argparse( prog='test_wanlink.py', formatter_class=argparse.RawTextHelpFormatter) - for group in parser._action_groups: - if group.title == "required arguments": - required_args = group - break optional_args = None for group in parser._action_groups: @@ -76,10 +72,6 @@ def main(): optional_args.add_argument('--drop_B', help='The drop frequency of port B (%%)', default=None) # todo: packet loss A and B # todo: jitter A and B - for group in parser._action_groups: - if group.title == "optional arguments": - optional_args = group - break parseargs = parser.parse_args() args = { "host": parseargs.mgr, @@ -90,16 +82,16 @@ def main(): "latency": parseargs.latency, "latency_A": (parseargs.latency_A if parseargs.latency_A is not None else parseargs.latency), "latency_B": (parseargs.latency_B if parseargs.latency_B is not None else parseargs.latency), - "rate": (parseargs.rate), + "rate": parseargs.rate, "rate_A": (parseargs.rate_A if parseargs.rate_A is not None else parseargs.rate), "rate_B": (parseargs.rate_B if parseargs.rate_B is not None else parseargs.rate), - "jitter": (parseargs.jitter), + "jitter": parseargs.jitter, "jitter_A": (parseargs.jitter_A if parseargs.jitter_A is not None else parseargs.jitter), "jitter_B": (parseargs.jitter_B if parseargs.jitter_B is not None else parseargs.jitter), - "jitter_freq": (parseargs.jitter), + "jitter_freq": parseargs.jitter, "jitter_freq_A": (parseargs.jitter_freq_A if parseargs.jitter_freq_A is not None else parseargs.jitter_freq), "jitter_freq_B": (parseargs.jitter_freq_B if parseargs.jitter_freq_B is not None else parseargs.jitter_freq), - "drop": (parseargs.drop), + "drop": parseargs.drop, "drop_A": (parseargs.drop_A if parseargs.drop_A is not None else parseargs.drop), "drop_B": (parseargs.drop_B if parseargs.drop_B is not None else parseargs.drop), } From 82d20e68fc07992f03f273226ac625869490bf6b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 13:46:21 -0800 Subject: [PATCH 518/731] regression_test: Fix lf_dut_sta_vap_test call Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index c718d002..5cee500f 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -256,7 +256,7 @@ else --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ --influx_bucket ben \ --influx_tag testbed Ferndale-01" - "./lf_dut_sta_vap_test.py --mgr $MGR --radio $RADIO_USED \ + "./lf_dut_sta_vap_test.py --manager $MGR --radio $RADIO_USED \ --num_sta 1 --sta_id 1 --ssid $SSID_USED --security $SECURITY --upstream $UPSTREAM \ --protocol lf_udp --min_mbps 1000 --max_mbps 10000 --duration 1" "./lf_graph.py --mgr $MGR" From 3b15113d3056de4d7245ccfded38d53dced2e04b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:02:47 -0800 Subject: [PATCH 519/731] lf_snp_test: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/lf_snp_test.py | 2416 +++++++++++++++++++++---------------- 1 file changed, 1376 insertions(+), 1040 deletions(-) diff --git a/py-scripts/lf_snp_test.py b/py-scripts/lf_snp_test.py index 3ea810a5..16fdd26a 100755 --- a/py-scripts/lf_snp_test.py +++ b/py-scripts/lf_snp_test.py @@ -1,41 +1,41 @@ #!/usr/bin/env python3 -''' +""" NAME: lf_snp_test.py snp == Scaling and Performance -PURPOSE: +PURPOSE: -This program is to test an AP connected to a controller. +This program is to test an AP connected to a controller. The AP name is configurable. - The controler - with with a specific ap mode, wifi mode (2.4 Ghz or 5 Ghz), Bandwidth (20,40,80,160) and TX power. -The controller will configure the AP. -The Lanforge radios are configured for a specific client dencity, Packet type (TCP, UDP), Direction (download, upload) and Packet-size. + The controler + with with a specific ap mode, wifi mode (2.4 Ghz or 5 Ghz), Bandwidth (20,40,80,160) and TX power. +The controller will configure the AP. +The Lanforge radios are configured for a specific client dencity, Packet type (TCP, UDP), Direction (download, upload) and Packet-size. The transmission rate will be recorded and compared against the expected rate to determine pass or fail. The results will be recorded in CSV file with the following data AP, Band, wifi_mode, Bandwidth, encryption, ap mode, number of clients, packet type, direction, packet size, measured rx bytes, upload bits per second, -download bits per second. +download bits per second. unique test id, pass / fail, epoch time, and time. TECHNICAL UNDERSTANDING: LANForge Monitored Values Per Polling Interval 'rx bytes' - bytes transmitted - 'rx rate' - bits per second + 'rx rate' - bits per second - in DL direction: -B tx -> -A rx, (side_b_tx_min_bps) LANforge Eth endpoint transmits bytes (AP/DUT), + in DL direction: -B tx -> -A rx, (side_b_tx_min_bps) LANforge Eth endpoint transmits bytes (AP/DUT), station endpoint (Wifi) LANForge receives them. station-end-rx-bps (bits per second) is download rx-bps (bits per second) - in UL direction: -A tx -> -B rx, (side_a_tx_min_bps) LANforge Eth endpoint receives bytes (AP/DUT), + in UL direction: -A tx -> -B rx, (side_a_tx_min_bps) LANforge Eth endpoint receives bytes (AP/DUT), station endpoint (Wifi) LANForge transmits them. ethernet-end-rx-bps (bits per second) is upload load rx-bps (bits per second) configured bps (side_a_tx_min_bps and side_b_tx_min_bps) if lists not same lenght shorter list padded out with 256000 if upload and download selected. NOTES: 1. The controller_client_densities are indpendent of the number of stations on a radio - 2. The --side_a_tx_min_bps (download) and --side_b_tx_min_bps (upload) is used to set the rate - a. default 256000 + 2. The --side_a_tx_min_bps (download) and --side_b_tx_min_bps (upload) is used to set the rate + a. default 256000 The script is devided into parts: -1. Controller Class : CreateCtlr controller interface. +1. Controller Class : CreateCtlr controller interface. Configurable by script: a. Band : a (5ghz) b (2.4ghz) b. wifi_mode : supported modes based on radio @@ -47,13 +47,13 @@ The script is devided into parts: g. packet_type: lf_udp lf_tcp h. traffic direction: upload / download i. pdu: --side_a_min_pdu, --side_b_min_pdu Note: LANforge configuration - + 2. Traffic Generation Class : L3VariableTime a. Creates and brings up stations/clients on radios b. Measures connections c. reports results -3. Scaling And Performance Main +3. Scaling And Performance Main a. Command parcing b. Fixed Configuration Coded Into The Script c. Script Controller Configurations @@ -66,51 +66,51 @@ OUTPUT: html results , default .html pdf results , default .pdf csv results_snp_.csv , results reflected in html and pdf files - csv details_snp_.csv raw data + csv details_snp_.csv raw data * radios and con -EXAMPLE: +EXAMPLE: Use --print_test_config at end of command to see test configuration Test configurations take presidence to command line parameters Using Coded Test Configuration --controller_test_1 - ./lf_snp_test.py --controller_ip 10.195.197.234 --controller_user admin --controller_passwd Milpitas@123 + ./lf_snp_test.py --controller_ip 10.195.197.234 --controller_user admin --controller_passwd Milpitas@123 --controller_aps 'Vanc-e' --controller_series "9800" --endp_types 'lf_udp' --upstream_port eth2 --controller_prompt "Can-SnP-9120" --controller_test_1 --print_test_config Using Coded Test Configuration --controller_test_1 - ./lf_snp_test.py --controller_ip 10.195.197.234 --controller_user admin --controller_passwd Milpitas@123 + ./lf_snp_test.py --controller_ip 10.195.197.234 --controller_user admin --controller_passwd Milpitas@123 --controller_aps 'Vanc-e' --controller_series "9800" --endp_types 'lf_udp' --upstream_port eth2 --controller_prompt "Can-SnP-9120" --controller_test_1 --print_test_config Using Coded Test Configuration: - ./lf_snp_test.py -cc 192.168.100.112 -cu admin -cpw Cisco123 -cca APA453.0E7B.CF9C -cs "3504" --endp_types 'lf_udp' --upstream_port eth2 --controller_test_3 - --controller_prompt "(Cisco Controller)" + ./lf_snp_test.py -cc 192.168.100.112 -cu admin -cpw Cisco123 -cca APA453.0E7B.CF9C -cs "3504" --endp_types 'lf_udp' --upstream_port eth2 --controller_test_3 + --controller_prompt "(Cisco Controller)" --print_test_config Using Commandline with defaults: - ./lf_snp_test.py --controller_ip 192.168.100.112 --controller_user admin --controller_passwd Cisco123 --controller_aps APA453.0E7B.CF9C --controller_series "3504" - --controller_prompt "(Cisco Controller)" --radio "radio==1.wiphy0 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto" + ./lf_snp_test.py --controller_ip 192.168.100.112 --controller_user admin --controller_passwd Cisco123 --controller_aps APA453.0E7B.CF9C --controller_series "3504" + --controller_prompt "(Cisco Controller)" --radio "radio==1.wiphy0 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto" --print_test_config Using Commandline: - ./lf_snp_test.py --controller_ip 192.168.100.112 --controller_user admin --controller_passwd Cisco123 --controller_aps APA453.0E7B.CF9C - --controller_series "3504" --upstream_port eth2 --controller_prompt "(Cisco Controller)" --controller_wifimode "a" --controller_chan_5ghz "36" - --radio "radio==1.wiphy0 stations==10 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==ac" --controller_client_densities "10" + ./lf_snp_test.py --controller_ip 192.168.100.112 --controller_user admin --controller_passwd Cisco123 --controller_aps APA453.0E7B.CF9C + --controller_series "3504" --upstream_port eth2 --controller_prompt "(Cisco Controller)" --controller_wifimode "a" --controller_chan_5ghz "36" + --radio "radio==1.wiphy0 stations==10 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==ac" --controller_client_densities "10" --print_test_config Using Commandline: Setting --test_duration "20s" --polling_interval to 5s -ccd "2" (--controller_client_densities) - ./lf_snp_test.py --controller_ip 192.168.100.112 --controller_user admin --controller_passwd Cisco123 --controller_aps APA453.0E7B.CF9C - --controller_series "3504" --upstream_port eth2 --controller_prompt "(Cisco Controller)" --controller_wifimode "auto" --controller_chan_5ghz "36" - --radio "radio==1.wiphy0 stations==2 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==an" --controller_client_densities "2" + ./lf_snp_test.py --controller_ip 192.168.100.112 --controller_user admin --controller_passwd Cisco123 --controller_aps APA453.0E7B.CF9C + --controller_series "3504" --upstream_port eth2 --controller_prompt "(Cisco Controller)" --controller_wifimode "auto" --controller_chan_5ghz "36" + --radio "radio==1.wiphy0 stations==2 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==an" --controller_client_densities "2" --print_test_config SAMPLE TEST CONFIG: --controller_test_1 output from --print_test_config option 2021-04-21 05:43:25,040 __main__ INFO: USING: controller_test_1 -2021-04-21 05:43:25,040 __main__ INFO: TEST CONFIG: +2021-04-21 05:43:25,040 __main__ INFO: TEST CONFIG: 2021-04-21 05:43:25,040 __main__ INFO: controller_aps ('-cca' ,'--controller_aps'): ['vanc-e'] 2021-04-21 05:43:25,040 __main__ INFO: controller_bands ('-ccf' ,'--controller_bands'): ['a', 'b'] 2021-04-21 05:43:25,040 __main__ INFO: controller_wifimodes ('-cwm' ,'--controller_wifimodes'): ['an', 'anAX', 'anAC', 'abgn', 'bg'] @@ -136,7 +136,7 @@ COPYWRITE Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. -''' +""" import sys import os import importlib @@ -155,6 +155,7 @@ if sys.version_info[0] != 3: exit(1) from lf_report import lf_report + sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -164,46 +165,51 @@ Realm = realm.Realm # lf_bar_graph = lf_graph.lf_bar_graph FORMAT = '%(asctime)s %(name)s %(levelname)s: %(message)s' + + # see https://stackoverflow.com/a/13306095/11014343 class FileAdapter(object): def __init__(self, logger): self.logger = logger + def write(self, data): # NOTE: data can be a partial line, multiple lines - data = data.strip() # ignore leading/trailing whitespace - if data: # non-blank - self.logger.info(data) + data = data.strip() # ignore leading/trailing whitespace + if data: # non-blank + self.logger.info(data) + def flush(self): pass # leave it to logging to flush properly + ################################################################################ # # Controller Class : CrateCtlr controller interface # ################################################################################ -class CreateCtlr(): +class CreateCtlr: def __init__(self, - _scheme, - _port, - _series, - _ctlr, - _prompt, - _user, - _passwd, - _ap, - _band, - _chan_5ghz, - _chan_24ghz, - _chan_width, - _ap_mode, - _tx_power, - _wlan, - _cap_ctl_out): + _scheme, + _port, + _series, + _ctlr, + _prompt, + _user, + _passwd, + _ap, + _band, + _chan_5ghz, + _chan_24ghz, + _chan_width, + _ap_mode, + _tx_power, + _wlan, + _cap_ctl_out): self.scheme = _scheme - self.port = _port + self.port = _port self.series = _series self.ctlr = _ctlr self.prompt = _prompt @@ -220,8 +226,8 @@ class CreateCtlr(): self.cap_ctl_out = _cap_ctl_out self.client_density = 0 - #show summary (to get AP) (3400/9800) - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 --action summary --series 9800 --log stdout + # show summary (to get AP) (3400/9800) + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 --action summary --series 9800 --log stdout def controller_show_summary(self): pss = "" try: @@ -236,553 +242,670 @@ class CreateCtlr(): series: {} \ band: {} \ action: {}".format( - self.scheme, - self.ctlr, - self.port, - self.prompt, - self.user, - self.passwd, - self.ap, - self.series, - self.band, - "summary")) + self.scheme, + self.ctlr, + self.port, + self.prompt, + self.user, + self.passwd, + self.ap, + self.series, + self.band, + "summary")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", - "--scheme", self.scheme, - "--prompt", self.prompt, - "--port", self.port, - "-d", self.ctlr, - "-u", self.user, - "-p", self.passwd, - "-a", self.ap, - "--series", self.series, - "--band", self.band, - "--action", "summary"], - capture_output=self.cap_ctl_out, + ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", + "--scheme", self.scheme, + "--prompt", self.prompt, + "--port", self.port, + "-d", self.ctlr, + "-u", self.user, + "-p", self.passwd, + "-a", self.ap, + "--series", self.series, + "--band", self.band, + "--action", "summary"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}" - .format(process_error.returncode, process_error.output)) - time.sleep(1) - exit(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) + time.sleep(1) + exit(1) return pss - #show ap dot11 5ghz summary (band defaults to 5ghz) --band a - #show ap dot11 24ghz summary use --band b for 2.4 ghz - #action advanced (3400/9800) - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 --action advanced --series 9800 --log stdout + # show ap dot11 5ghz summary (band defaults to 5ghz) --band a + # show ap dot11 24ghz summary use --band b for 2.4 ghz + # action advanced (3400/9800) + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 --action advanced --series 9800 --log stdout def controller_show_ap_summary(self): pss = "" try: logg.info("\ - scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"advanced")) + scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "advanced")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "advanced"], - capture_output=True, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "advanced"], + capture_output=True, check=True) pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) + time.sleep(1) exit(1) return pss - #show wlan summary + # show wlan summary def controller_show_wlan_summary(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"show wlan summary")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "show wlan summary")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "show_wlan_summary"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "show_wlan_summary"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #disable AP - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable --series 9800 + # disable AP + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable --series 9800 def controller_disable_ap(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"disable")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "disable")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", - self.ctlr, "-u",self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "disable"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", + self.ctlr, "-u", self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "disable"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #disable wlan - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_wlan --series 9800 + # disable wlan + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_wlan --series 9800 def controller_disable_wlan(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} wlan: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,self.wlan,"disable_wlan")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} wlan: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, self.wlan, "disable_wlan")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band,"--wlan", self.wlan, "--action", "disable_wlan"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--wlan", self.wlan, "--action", + "disable_wlan"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #disable network 5ghz - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_network_5ghz --series 9800 + # disable network 5ghz + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_network_5ghz --series 9800 def controller_disable_network_5ghz(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"disable_network_5ghz")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "disable_network_5ghz")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "disable_network_5ghz"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "disable_network_5ghz"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) + time.sleep(1) exit(1) else: try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"cmd","config 802.11a disable network")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "cmd", "config 802.11a disable network")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "cmd", "--value", "config 802.11a disable network"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "cmd", "--value", + "config 802.11a disable network"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #disable network 24ghz - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_network_24ghz --series 9800 + # disable network 24ghz + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action disable_network_24ghz --series 9800 def controller_disable_network_24ghz(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"disable_network_24ghz")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "disable_network_24ghz")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "disable_network_24ghz"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "disable_network_24ghz"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) + time.sleep(1) exit(1) else: try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"cmd","config 802.11b disable network")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "cmd", "config 802.11b disable network")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "cmd", "--value", "config 802.11b disable network"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "cmd", "--value", + "config 802.11b disable network"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #set manual mode - Series 9800 must be set to manual mode - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action manual --series 9800 + # set manual mode - Series 9800 must be set to manual mode + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action manual --series 9800 # ap name dot11 5ghz radio role manual client-serving def controller_role_manual(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"manual")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "manual")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "manual"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "manual"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) + time.sleep(1) exit(1) else: - logg.info("Check the controller scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) + logg.info( + "Check the controller scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) - #set manual mode - Series 9800 must be set to auto mode - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action auto --series 9800 + # set manual mode - Series 9800 must be set to auto mode + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action auto --series 9800 # ap name dot11 5ghz radio role manual client-serving def controller_role_auto(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user, - self.passwd,self.ap,self.series,self.band,"auto")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, + self.passwd, self.ap, self.series, self.band, "auto")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "auto"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "auto"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) + time.sleep(1) exit(1) else: - logg.info("Check the controller scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) + logg.info( + "Check the controller scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) - #test parameters summary (txPower 1-8) - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action txPower --value 5 --series 9800 + # test parameters summary (txPower 1-8) + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action txPower --value 5 --series 9800 def controller_set_tx_power(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"txPower", self.tx_power )) # TODO fix txPower to tx_power in wifi_ctl_9800_3504.py - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "txPower","--value", self.tx_power], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "txPower", self.tx_power)) # TODO fix txPower to tx_power in wifi_ctl_9800_3504.py + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "txPower", "--value", self.tx_power], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #set channel [36, 64, 100] - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action channel --value 36 --series 9800 + # set channel [36, 64, 100] + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action channel --value 36 --series 9800 # 9800 : ap name dot11 [5ghz | 24ghz] channel # 3504 : (controller Controller) >config 802.11a channel ap APA453.0E7B.CF9C 52 def controller_set_channel(self): try: - if (self.band == "a"): + if self.band == "a": controller_channel = self.chan_5ghz else: controller_channel = self.chan_24ghz - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"channel", controller_channel )) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "channel","--value", controller_channel], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "channel", controller_channel)) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "channel", "--value", controller_channel], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #set bandwidth [20 40 80 160] - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action bandwidth --value 40 --series 9800 + # set bandwidth [20 40 80 160] + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action bandwidth --value 40 --series 9800 def controller_set_bandwidth(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"channel", self.chan_width )) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "channel","--value", self.chan_width], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "channel", self.chan_width)) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "channel", "--value", self.chan_width], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) - + except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #create wlan - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action create_wlan --wlan "open-wlan" --wlanID 1 --series 9800 + # create wlan + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action create_wlan --wlan "open-wlan" --wlanID 1 --series 9800 def controller_create_wlan(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} wlan {} wlanID {} wlanSSID {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"create_wlan", self.wlan, self.wlanID, self.wlanSSID )) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "create_wlan","--wlan", self.wlan, "--wlanID", self.wlanID, "--wlanSSID", self.wlanSSID], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} wlan {} wlanID {} wlanSSID {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "create_wlan", self.wlan, self.wlanID, self.wlanSSID)) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "create_wlan", "--wlan", self.wlan, "--wlanID", self.wlanID, "--wlanSSID", + self.wlanSSID], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) - + except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) exit(1) else: - logg.info("Check the controller_scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) + logg.info( + "Check the controller_scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) - #create wireless tag policy --9800 series needs to have wireless tag policy set - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action wireless_tag_policy --series 9800 + # create wireless tag policy --9800 series needs to have wireless tag policy set + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action wireless_tag_policy --series 9800 def controller_set_wireless_tag_policy(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"wireless_tag_policy" )) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "wireless_tag_policy"], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "wireless_tag_policy")) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "wireless_tag_policy"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) exit(1) else: - logg.info("Check the controller_scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) + logg.info( + "Check the controller_scheme used attemping 9800 series on 3504 controller: {}".format(self.scheme)) - #enable wlan - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_wlan --series 9800 + # enable wlan + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_wlan --series 9800 def controller_enable_wlan(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} wlan: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band, self.wlan,"enable_wlan")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--wlan", self.wlan, - "--action", "enable_wlan"], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} wlan: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, self.wlan, "enable_wlan")) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--wlan", self.wlan, + "--action", "enable_wlan"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) - + except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #enable 5ghz - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_network_5ghz --series 9800 + # enable 5ghz + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_network_5ghz --series 9800 def controller_enable_network_5ghz(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"enable_network_5ghz")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "enable_network_5ghz"], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "enable_network_5ghz")) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "enable_network_5ghz"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) - + except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) exit(1) else: try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"cmd","config 802.11a enable network")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "cmd", "config 802.11a enable network")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "cmd", "--value", "config 802.11a enable network"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "cmd", "--value", + "config 802.11a enable network"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #enable 24ghz - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_network_24ghz --series 9800 + # enable 24ghz + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable_network_24ghz --series 9800 def controller_enable_network_24ghz(self): if self.series == "9800": try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"enable_network_24ghz")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "enable_network_24ghz"], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "enable_network_24ghz")) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "enable_network_24ghz"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) exit(1) else: try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"cmd","config 802.11b enable network")) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "cmd", "config 802.11b enable network")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "cmd", "--value", "config 802.11b enable network"], - capture_output=self.cap_ctl_out, check=True) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, "--action", "cmd", "--value", + "config 802.11b enable network"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #enable (band a) - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable --series 9800 + # enable (band a) + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action enable --series 9800 def controller_enable_ap(self): try: - logg.info("scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, - self.ctlr,self.port,self.prompt,self.user,self.passwd, self.ap, self.series, - self.band,"enable")) - ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--band", self.band, - "--action", "enable"], - capture_output=self.cap_ctl_out, check=True) + logg.info( + "scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format( + self.scheme, + self.ctlr, self.port, self.prompt, self.user, self.passwd, self.ap, self.series, + self.band, "enable")) + ctl_output = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, + "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--band", self.band, + "--action", "enable"], + capture_output=self.cap_ctl_out, check=True) if self.cap_ctl_out: pss = ctl_output.stdout.decode('utf-8', 'ignore') logg.info(pss) except subprocess.CalledProcessError as process_error: - logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) - time.sleep(1) + logg.info( + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) exit(1) - #advanced (showes summary) - #./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action advanced --series 9800 + # advanced (showes summary) + # ./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p --port 23 -a "9120-Chamber-1" --band a --action advanced --series 9800 def controller_show_ap_channel(self): - advanced = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", - self.user, "-p", self.passwd, - "-a", self.ap,"--series", self.series, "--action", "ap_channel"], capture_output=True) + advanced = subprocess.run( + ["../wifi_ctl_9800_3504.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", + self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap, "--series", self.series, "--action", "ap_channel"], capture_output=True) pss = advanced.stdout.decode('utf-8', 'ignore') logg.info(pss) if self.series == "9800": - if (self.band == "a"): + if self.band == "a": controller_channel = self.chan_5ghz else: controller_channel = self.chan_24ghz @@ -792,44 +915,52 @@ class CreateCtlr(): logg.info("line {}".format(line)) element_list = line.lstrip().split() logg.info("element_list {}".format(element_list)) - if (line.lstrip().startswith(search_str)): + if line.lstrip().startswith(search_str): logg.info("line {}".format(line)) element_list = line.lstrip().split() logg.info("element_list {}".format(element_list)) # AP Name (0) mac (1) slot (2) Admin State [enable/disable] (3) Oper State [Up/Down] (4) Width (5) Txpwr (6,7) channel (8) mode (9) - logg.info("ap: {} slof {} channel {} chan_width {}".format(element_list[0],element_list[2],element_list[8],element_list[5])) - if (str(controller_channel) in str(element_list[8])) and (str(self.chan_width) in str(element_list[5])): - logg.info("ap {} configuration successful: channel {} in expected {} chan_width {} in expected {}" - .format(element_list[0],controller_channel,element_list[8],self.chan_width,element_list[5])) + logg.info("ap: {} slof {} channel {} chan_width {}".format(element_list[0], element_list[2], + element_list[8], element_list[5])) + if (str(controller_channel) in str(element_list[8])) and ( + str(self.chan_width) in str(element_list[5])): + logg.info( + "ap {} configuration successful: channel {} in expected {} chan_width {} in expected {}" + .format(element_list[0], controller_channel, element_list[8], self.chan_width, + element_list[5])) else: logg.info("WARNING ap {} configuration: channel {} in expected {} chan_width {} in expected {}" - .format(element_list[0],controller_channel,element_list[8],self.chan_width,element_list[5])) + .format(element_list[0], controller_channel, element_list[8], self.chan_width, + element_list[5])) break else: logg.info("checking for 802.11{}".format(self.band)) - if (self.band == "a"): + if self.band == "a": controller_channel = self.chan_5ghz else: controller_channel = self.chan_24ghz for line in pss.splitlines(): - #logg.info("line {}".format(line)) + # logg.info("line {}".format(line)) search_str = "802.11{}".format(self.band) - if (line.lstrip().startswith(search_str)): + if line.lstrip().startswith(search_str): logg.info("line {}".format(line)) element_list = line.lstrip().split() logg.info("element_list {}".format(element_list)) - logg.info("ap: {} channel {} chan_width {}".format(self.ap,element_list[4],element_list[5])) - if (str(controller_channel) in str(element_list[4])) and (str(self.chan_width) in str(element_list[5])): + logg.info("ap: {} channel {} chan_width {}".format(self.ap, element_list[4], element_list[5])) + if (str(controller_channel) in str(element_list[4])) and ( + str(self.chan_width) in str(element_list[5])): logg.info("ap configuration successful: channel {} in expected {} chan_width {} in expected {}" - .format(controller_channel,element_list[4],self.chan_width,element_list[5])) + .format(controller_channel, element_list[4], self.chan_width, element_list[5])) else: logg.info("AP WARNING: channel {} expected {} chan_width {} expected {}" - .format(element_list[4],controller_channel,element_list[5],self.chan_width)) + .format(element_list[4], controller_channel, element_list[5], self.chan_width)) break - - logg.info("configure ap {} channel {} chan_width {}".format(self.ap,self.channel,self.chan_width)) + + logg.info("configure ap {} channel {} chan_width {}".format(self.ap, self.channel, self.chan_width)) # Verify channel and channel width. + + ################################################################################ # # End of Controller Class : controller interface @@ -842,64 +973,64 @@ class CreateCtlr(): # ################################################################################ class L3VariableTime(Realm): - def __init__(self, - args, - _scheme, - _port, - _series, - _ctlr, - _prompt, - _user, - _passwd, - _ap, - _ap_slot, - _band, - _chan_5ghz, - _chan_24ghz, - _chan_width, - _ap_mode, - _tx_power, - _client_density, - _cap_ctl_out, - _ap_dict, - endp_type, - 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, - results, - test_keys, - test_config, - reset_port_enable_list, - reset_port_time_min_list, - reset_port_time_max_list, - csv_started=False, - side_a_tx_min_bps=560000, - side_a_tx_max_bps=0, # setting to 0 will match min - side_a_min_pdu=1518, - side_a_max_pdu=0, - side_b_tx_min_bps=560000, - side_b_tx_max_bps=0, # setting to 0 will match min - side_b_min_pdu=1518, - side_b_max_pdu=0, - number_template="00", - test_duration="256s", - polling_interval="60s", - lfclient_host="localhost", - lfclient_port=8080, - debug=False, - wait_timeout=120, - _exit_on_error=False, - _exit_on_fail=False, - _proxy_str=None, + def __init__(self, + args, + _scheme, + _port, + _series, + _ctlr, + _prompt, + _user, + _passwd, + _ap, + _ap_slot, + _band, + _chan_5ghz, + _chan_24ghz, + _chan_width, + _ap_mode, + _tx_power, + _client_density, + _cap_ctl_out, + _ap_dict, + endp_type, + 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, + results, + test_keys, + test_config, + reset_port_enable_list, + reset_port_time_min_list, + reset_port_time_max_list, + csv_started=False, + side_a_tx_min_bps=560000, + side_a_tx_max_bps=0, # setting to 0 will match min + side_a_min_pdu=1518, + side_a_max_pdu=0, + side_b_tx_min_bps=560000, + side_b_tx_max_bps=0, # setting to 0 will match min + side_b_min_pdu=1518, + side_b_max_pdu=0, + number_template="00", + test_duration="256s", + polling_interval="60s", + lfclient_host="localhost", + lfclient_port=8080, + debug=False, + wait_timeout=120, + _exit_on_error=False, + _exit_on_fail=False, + _proxy_str=None, _capture_signal_list=None): super().__init__(lfclient_host=lfclient_host, lfclient_port=lfclient_port, @@ -911,16 +1042,16 @@ class L3VariableTime(Realm): if _capture_signal_list is None: _capture_signal_list = [] self.scheme = _scheme - self.port = _port + self.port = _port self.series = _series - self.ctlr = _ctlr + self.ctlr = _ctlr self.prompt = _prompt - self.user = _user + self.user = _user self.passwd = _passwd - self.ap = _ap + self.ap = _ap self.ap_slot = _ap_slot - self.band = _band - self.chan_5ghz = _chan_5ghz + self.band = _band + self.chan_5ghz = _chan_5ghz self.chan_24ghz = _chan_24ghz self.chan_width = _chan_width self.ap_mode = _ap_mode @@ -933,7 +1064,7 @@ class L3VariableTime(Realm): self.side_b = side_b self.ssid_list = ssid_list self.ssid_password_list = ssid_password_list - self.station_lists = station_lists + self.station_lists = station_lists self.ssid_security_list = ssid_security_list self.wifimode_list = wifimode_list self.reset_port_enable_list = reset_port_enable_list @@ -943,8 +1074,8 @@ class L3VariableTime(Realm): self.name_prefix = name_prefix self.test_duration = test_duration self.radio_name_list = radio_name_list - self.number_of_stations_per_radio_list = number_of_stations_per_radio_list - #self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=debug_on) + self.number_of_stations_per_radio_list = number_of_stations_per_radio_list + # self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port, debug_=debug_on) self.polling_interval_seconds = self.duration_time_to_seconds(polling_interval) self.cx_profile = self.new_l3_cx_profile() self.multicast_profile = self.new_multicast_profile() @@ -971,44 +1102,48 @@ class L3VariableTime(Realm): self.test_keys = test_keys self.test_config = test_config - self.test_config_dict = dict(map(lambda x: x.split('=='), str(self.test_config).replace('[','').replace(']','').replace("'","").split())) + self.test_config_dict = dict(map(lambda x: x.split('=='), + str(self.test_config).replace('[', '').replace(']', '').replace("'", + "").split())) # Full spread-sheet data if self.outfile is not None: - self.csv_file_details = open(self.outfile, "a+") + self.csv_file_details = open(self.outfile, "a+") self.csv_writer = csv.writer(self.csv_file_details, delimiter=",") - + if self.results is not None: - self.csv_results = open(self.results, "a+") + self.csv_results = open(self.results, "a+") self.csv_results_writer = csv.writer(self.csv_results, delimiter=",") - for (radio_, ssid_, ssid_password_, ssid_security_, wifimode_,\ - reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ - in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, wifimode_list,\ - reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): + for (radio_, ssid_, ssid_password_, ssid_security_, wifimode_, + reset_port_enable_, reset_port_time_min_, reset_port_time_max_) \ + in zip(radio_name_list, ssid_list, ssid_password_list, ssid_security_list, wifimode_list, + reset_port_enable_list, reset_port_time_min_list, reset_port_time_max_list): self.station_profile = self.new_station_profile() self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = ssid_ self.station_profile.ssid_pass = ssid_password_ self.station_profile.security = ssid_security_ - self.station_profile.mode = wifimode_ + self.station_profile.mode = wifimode_ self.station_profile.number_template = self.number_template - self.station_profile.mode = wifimode_ - self.station_profile.set_reset_extra(reset_port_enable=reset_port_enable_,\ - test_duration=self.duration_time_to_seconds(self.test_duration),\ - reset_port_min_time=self.duration_time_to_seconds(reset_port_time_min_),\ - reset_port_max_time=self.duration_time_to_seconds(reset_port_time_max_)) + self.station_profile.mode = wifimode_ + self.station_profile.set_reset_extra(reset_port_enable=reset_port_enable_, + test_duration=self.duration_time_to_seconds(self.test_duration), + reset_port_min_time=self.duration_time_to_seconds( + reset_port_time_min_), + reset_port_max_time=self.duration_time_to_seconds( + reset_port_time_max_)) self.station_profiles.append(self.station_profile) - + self.multicast_profile.host = self.lfclient_host self.cx_profile.host = self.lfclient_host self.cx_profile.port = self.lfclient_port self.cx_profile.name_prefix = self.name_prefix - self.cx_profile.side_a_min_bps = self.side_a_tx_min_bps # Note: side_a_tx_min_bps is side_a_min_bps in py-json profiles - self.cx_profile.side_a_max_bps = self.side_a_tx_min_bps + self.cx_profile.side_a_min_bps = self.side_a_tx_min_bps # Note: side_a_tx_min_bps is side_a_min_bps in py-json profiles + self.cx_profile.side_a_max_bps = self.side_a_tx_min_bps self.cx_profile.side_a_min_pdu = self.side_a_min_pdu self.cx_profile.side_a_max_pdu = self.side_a_max_pdu - self.cx_profile.side_b_min_bps = self.side_b_tx_min_bps # Note: side_b_tx_min_bps is side_b_min_bps in py-json profiles + self.cx_profile.side_b_min_bps = self.side_b_tx_min_bps # Note: side_b_tx_min_bps is side_b_min_bps in py-json profiles self.cx_profile.side_b_max_bps = self.side_b_tx_min_bps self.cx_profile.side_b_min_pdu = self.side_b_min_pdu self.cx_profile.side_b_max_pdu = self.side_b_max_pdu @@ -1030,26 +1165,26 @@ class L3VariableTime(Realm): 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(): + for item, endp_value in endp_name.items(): if item in our_endps: - endps.append(value) + endps.append(endp_value) print("endpoint: ", item, " value:\n") - pprint(value) - - for value_name, value in value.items(): + pprint(endp_value) + + for value_name, value in endp_value.items(): if value_name == 'rx bytes': endp_rx_map[item] = value if value_name == 'rx drop %': endp_rx_drop_map[item] = value if value_name == 'rx rate': # This hack breaks for mcast or if someone names endpoints weirdly. - #print("item: ", item, " rx-bps: ", value_rx_bps) + # print("item: ", item, " rx-bps: ", value_rx_bps) if item.endswith("-A"): total_dl += int(value) else: total_ul += int(value) - #print("total-dl: ", total_dl, " total-ul: ", total_ul, "\n") + # print("total-dl: ", total_dl, " total-ul: ", total_ul, "\n") return endp_rx_map, endp_rx_drop_map, endps, total_dl, total_ul def time_stamp(self): @@ -1065,13 +1200,15 @@ class L3VariableTime(Realm): csv_rx_delta_dict = {} test_id = "" - for key in [key for key in old_list if "mtx" in key]: del old_list[key] - for key in [key for key in new_list if "mtx" in key]: del new_list[key] + for key in [key for key in old_list if "mtx" in key]: + del old_list[key] + for key in [key for key in new_list if "mtx" in key]: + del new_list[key] - filtered_values = [v for _, v in new_list.items() if v !=0] + filtered_values = [v for _, v in new_list.items() if v != 0] # Evaluate upload or download new_evaluate_list = new_list.copy() - print("new_evaluate_list before",new_evaluate_list) + print("new_evaluate_list before", new_evaluate_list) # look at ul and dl old_evaluate_list = old_list.copy() @@ -1079,40 +1216,41 @@ class L3VariableTime(Realm): for item, value in old_evaluate_list.items(): # check only upload or download - expected passes corresponds to traffic only in observed direction if "upload" in self.test_config_dict.values() and item.endswith("-B") \ - or "download" in self.test_config_dict.values() and item.endswith("-A"): - expected_passes +=1 + or "download" in self.test_config_dict.values() and item.endswith("-A"): + expected_passes += 1 print("ITEM: {} VALUE: {}".format(item, value)) if new_evaluate_list[item] > old_evaluate_list[item]: passes += 1 - #if self.debug: logg.info(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", new_evaluate_list[item] - old_evaluate_list[item]) - print(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", new_evaluate_list[item] - old_evaluate_list[item]) + # if self.debug: logg.info(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", new_evaluate_list[item] - old_evaluate_list[item]) + print(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", + new_evaluate_list[item] - old_evaluate_list[item]) else: if "upload" in self.test_config_dict.values() and item.endswith("-B") \ - or "download" in self.test_config_dict.values() and item.endswith("-A"): + or "download" in self.test_config_dict.values() and item.endswith("-A"): # only a failure if expecting traffic in that direction print("Failed to increase rx bytes: ", item, new_evaluate_list[item], old_evaluate_list[item]) if not self.csv_started: # stations that end in -A are dl (download, download), stations that end in -B are ul (upload, upload) if item.endswith("-A"): - csv_rx_headers.append(item+'-dl-rx-bytes') + csv_rx_headers.append(item + '-dl-rx-bytes') else: - csv_rx_headers.append(item+'-ul-rx-bytes') - csv_rx_delta_dict.update({item:(new_evaluate_list[item] - old_evaluate_list[item])}) - + csv_rx_headers.append(item + '-ul-rx-bytes') + csv_rx_delta_dict.update({item: (new_evaluate_list[item] - old_evaluate_list[item])}) + if not self.csv_started: csv_header = self.csv_generate_column_details_headers() csv_header += csv_rx_headers logg.info(csv_header) self.csv_add_column_headers(csv_header) csv_results = self.csv_generate_column_results_headers() - #csv_results += csv_rx_headers + # csv_results += csv_rx_headers self.csv_add_column_headers_results(csv_results) self.csv_started = True # need to generate list of all the values - filtered_values = [v for _, v in csv_rx_delta_dict.items() if v !=0] + filtered_values = [v for _, v in csv_rx_delta_dict.items() if v != 0] # if need the average use average_rx_delta - #average_rx_delta= sum(filtered_values) / len(filtered_values) if len(filtered_values) != 0 else 0 + # average_rx_delta= sum(filtered_values) / len(filtered_values) if len(filtered_values) != 0 else 0 # write out the configuraiton for the test for key in self.test_keys: @@ -1123,7 +1261,7 @@ class L3VariableTime(Realm): csv_rx_row_data.extend([self.epoch_time, self.time_stamp()]) csv_result_row_data.extend([self.epoch_time, self.time_stamp()]) - #Generate TestID + # Generate TestID for key in self.test_keys: test_id = test_id + "_" + self.test_config_dict[key] @@ -1138,22 +1276,23 @@ class L3VariableTime(Realm): csv_rx_row_data.append(self.side_b_tx_min_bps) # Recorde the Total Transmit rate for all stations - rx_bytes = sum(filtered_values) #total + rx_bytes = sum(filtered_values) # total csv_rx_row_data.append(rx_bytes) # The total_dl_bps and total_up_bps is for the interval csv_rx_row_data.append(total_dl_bps) csv_rx_row_data.append(total_ul_bps) - #csv_result_row_data.append(rx_bytes) + # csv_result_row_data.append(rx_bytes) print("csv_rx_row_data {}".format(csv_rx_row_data)) - #TODO: may want to pass in the information that needs to be in the csv file into the class - + # TODO: may want to pass in the information that needs to be in the csv file into the class + for item, value in old_evaluate_list.items(): - expected_passes +=1 + expected_passes += 1 if new_evaluate_list[item] > old_evaluate_list[item]: passes += 1 - print(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", new_evaluate_list[item] - old_evaluate_list[item]) + print(item, new_evaluate_list[item], old_evaluate_list[item], " Difference: ", + new_evaluate_list[item] - old_evaluate_list[item]) else: print("Failed to increase rx data: ", item, new_evaluate_list[item], old_evaluate_list[item]) if not self.csv_started: @@ -1162,36 +1301,46 @@ class L3VariableTime(Realm): csv_rx_row_data.append(new_list[item] - old_list[item]) # data from each station for each iteration - self.csv_add_row(csv_rx_row_data,self.csv_writer,self.csv_file_details) + self.csv_add_row(csv_rx_row_data, self.csv_writer, self.csv_file_details) if passes == expected_passes: return True, rx_bytes, csv_result_row_data else: return False, rx_bytes, csv_result_row_data else: - print("Old-list length: %i new: %i does not match in compare-vals."%(len(old_list), len(new_list))) - print("old-list:",old_list) - print("new-list:",new_list) - return False, None, None + print("Old-list length: %i new: %i does not match in compare-vals." % (len(old_list), len(new_list))) + print("old-list:", old_list) + print("new-list:", new_list) + return False, None, None def reset_port_check(self): for station_profile in self.station_profiles: if station_profile.reset_port_extra_data['reset_port_enable']: if not station_profile.reset_port_extra_data['reset_port_timer_started']: - logg.info("reset_port_time_min: {}".format(station_profile.reset_port_extra_data['reset_port_time_min'])) - logg.info("reset_port_time_max: {}".format(station_profile.reset_port_extra_data['reset_port_time_max'])) + logg.info( + "reset_port_time_min: {}".format(station_profile.reset_port_extra_data['reset_port_time_min'])) + logg.info( + "reset_port_time_max: {}".format(station_profile.reset_port_extra_data['reset_port_time_max'])) station_profile.reset_port_extra_data['seconds_till_reset'] = \ - random.randint(station_profile.reset_port_extra_data['reset_port_time_min'],\ - station_profile.reset_port_extra_data['reset_port_time_max']) + random.randint(station_profile.reset_port_extra_data['reset_port_time_min'], + station_profile.reset_port_extra_data['reset_port_time_max']) station_profile.reset_port_extra_data['reset_port_timer_started'] = True - logg.info("on radio {} seconds_till_reset {}".format(station_profile.add_sta_data['radio'],station_profile.reset_port_extra_data['seconds_till_reset'])) + logg.info("on radio {} seconds_till_reset {}".format(station_profile.add_sta_data['radio'], + station_profile.reset_port_extra_data[ + 'seconds_till_reset'])) else: - station_profile.reset_port_extra_data['seconds_till_reset'] = station_profile.reset_port_extra_data['seconds_till_reset'] - 1 - if self.debug: logg.info("radio: {} countdown seconds_till_reset {}".format(station_profile.add_sta_data['radio'] ,station_profile.reset_port_extra_data['seconds_till_reset'])) - if ((station_profile.reset_port_extra_data['seconds_till_reset'] <= 0)): + station_profile.reset_port_extra_data['seconds_till_reset'] = station_profile.reset_port_extra_data[ + 'seconds_till_reset'] - 1 + if self.debug: + logg.info( + "radio: {} countdown seconds_till_reset {}".format(station_profile.add_sta_data['radio'], + station_profile.reset_port_extra_data[ + 'seconds_till_reset'])) + if station_profile.reset_port_extra_data['seconds_till_reset'] <= 0: station_profile.reset_port_extra_data['reset_port_timer_started'] = False - port_to_reset = random.randint(0,len(station_profile.station_names)-1) - logg.info("reset on radio {} station: {}".format(station_profile.add_sta_data['radio'],station_profile.station_names[port_to_reset])) + port_to_reset = random.randint(0, len(station_profile.station_names) - 1) + logg.info("reset on radio {} station: {}".format(station_profile.add_sta_data['radio'], + station_profile.station_names[port_to_reset])) self.reset_port(station_profile.station_names[port_to_reset]) def pre_cleanup(self): @@ -1205,12 +1354,12 @@ class L3VariableTime(Realm): # Verify Stations are Gone count = 0 - while (count < 10): + while count < 10: more = False for station_list in self.station_lists: for sta in station_list: rv = self.rm_port(sta, check_exists=True) - if (rv): + if rv: more = True if not more: break @@ -1224,24 +1373,28 @@ class L3VariableTime(Realm): station_profile.set_number_template(station_profile.number_template) logg.info("Creating stations") - station_profile.create(radio=self.radio_name_list[index], sta_names_=self.station_lists[index], debug=self.debug, sleep_time=0) + station_profile.create(radio=self.radio_name_list[index], sta_names_=self.station_lists[index], + debug=self.debug, sleep_time=0) index += 1 for _tos in self.tos: - logg.info("Creating connections for endpoint type: {} TOS: {} stations_names {}".format(self.endp_type, _tos, station_profile.station_names)) - self.cx_profile.create(endp_type=self.endp_type, side_a=station_profile.station_names, side_b=self.side_b, sleep_time=0, tos=_tos) - self._pass("PASS: Stations build finished") - + logg.info( + "Creating connections for endpoint type: {} TOS: {} stations_names {}".format(self.endp_type, _tos, + station_profile.station_names)) + self.cx_profile.create(endp_type=self.endp_type, side_a=station_profile.station_names, + side_b=self.side_b, sleep_time=0, tos=_tos) + self._pass("PASS: Stations build finished") + def start(self, print_pass=False, print_fail=False): best_rx_bytes = 0 rx_bytes = 0 csv_rx_row_data = " " Result = False logg.info("Bringing up stations") - self.admin_up(self.side_b) + self.admin_up(self.side_b) for station_profile in self.station_profiles: for sta in station_profile.station_names: - logg.info("Bringing up station %s"%(sta)) + logg.info("Bringing up station %s" % sta) self.admin_up(sta) temp_stations_list = [] @@ -1252,7 +1405,7 @@ class L3VariableTime(Realm): logg.info("ip's acquired") else: logg.info("Stations Failed to get IP's , consider increasing -wto','--wait_timeout' from the command line ") - exit(1) # Exit if cannot receive IP's + exit(1) # Exit if cannot receive IP's time.sleep(30) logg.info("Starting layer-3 traffic (if any configured)") self.cx_profile.start_cx() @@ -1265,7 +1418,7 @@ class L3VariableTime(Realm): end_time = self.parse_time(self.test_duration) + cur_time - logg.info("Monitoring throughput for duration: %s"%(self.test_duration)) + logg.info("Monitoring throughput for duration: %s" % self.test_duration) passes = 0 expected_passes = 0 @@ -1277,17 +1430,18 @@ class L3VariableTime(Realm): cur_time = datetime.datetime.now() self.reset_port_check() time.sleep(1) - + self.epoch_time = int(time.time()) # the total_dl_bps and total_up_bps is for all stations - new_rx_values, rx_drop_percent, endps, total_dl_bps, total_ul_bps = self.__get_rx_values() + new_rx_values, rx_drop_percent, endps, total_dl_bps, total_ul_bps = self.__get_rx_values() print("main loop, total-dl: ", total_dl_bps, " total-ul: ", total_ul_bps) expected_passes += 1 # __compare_vals - does the calculations - Result, rx_bytes, csv_rx_row_data = self.__compare_vals(old_rx_values, new_rx_values, total_dl_bps, total_ul_bps) + Result, rx_bytes, csv_rx_row_data = self.__compare_vals(old_rx_values, new_rx_values, total_dl_bps, + total_ul_bps) # save the best rate for the interval if rx_bytes > best_rx_bytes: best_rx_bytes = rx_bytes @@ -1295,7 +1449,8 @@ class L3VariableTime(Realm): if Result: passes += 1 else: - fail_msg = "FAIL: TIME: {} EPOCH: {} Not all stations increased traffic".format(cur_time, self.epoch_time) + fail_msg = "FAIL: TIME: {} EPOCH: {} Not all stations increased traffic".format(cur_time, + self.epoch_time) self._fail(fail_msg, print_fail) old_rx_values = new_rx_values @@ -1307,7 +1462,7 @@ class L3VariableTime(Realm): csv_rx_row_data.append(best_rx_bytes) csv_rx_row_data.append(total_dl_bps) csv_rx_row_data.append(total_ul_bps) - self.csv_add_row(csv_rx_row_data,self.csv_results_writer,self.csv_results) + self.csv_add_row(csv_rx_row_data, self.csv_results_writer, self.csv_results) if passes == expected_passes: self._pass("PASS: All tests passed", print_pass) @@ -1323,52 +1478,59 @@ class L3VariableTime(Realm): self.multicast_profile.cleanup() for station_profile in self.station_profiles: station_profile.cleanup() - + # for details csv file def csv_generate_column_details_headers(self): # test_keys used to generate the test_id - csv_rx_headers = self.test_keys.copy() - csv_rx_headers.extend + csv_rx_headers = self.test_keys.copy() # test_keys are the controller configuration - csv_rx_headers.extend(['epoch_time','time','test_id','test_duration','intv_sec','A_to_B_tx_bps_ul','B_to_A_tx_bps_dl','rx_bytes_intv_best','all_sta_dl_bps','all_sta_ul_bps']) + csv_rx_headers.extend( + ['epoch_time', 'time', 'test_id', 'test_duration', 'intv_sec', 'A_to_B_tx_bps_ul', 'B_to_A_tx_bps_dl', + 'rx_bytes_intv_best', 'all_sta_dl_bps', 'all_sta_ul_bps']) return csv_rx_headers def csv_generate_column_results_headers(self): # test_keys used to generate test_id - csv_rx_headers = self.test_keys.copy() - csv_rx_headers.extend - #test_keys are the controller configuration - csv_rx_headers.extend(['epoch_time','time','test_id','test_duration','intv_sec','A_to_B_tx_bps_ul','B_to_A_tx_bps_dl','rx_bytes_intv_best','all_sta_dl_bps','all_sta_ul_bps']) + csv_rx_headers = self.test_keys.copy() + # test_keys are the controller configuration + csv_rx_headers.extend( + ['epoch_time', 'time', 'test_id', 'test_duration', 'intv_sec', 'A_to_B_tx_bps_ul', 'B_to_A_tx_bps_dl', + 'rx_bytes_intv_best', 'all_sta_dl_bps', 'all_sta_ul_bps']) return csv_rx_headers - def csv_add_column_headers(self,headers): + def csv_add_column_headers(self, headers): if self.csv_file_details is not None: self.csv_writer.writerow(headers) self.csv_file_details.flush() - def csv_add_column_headers_results(self,headers): + def csv_add_column_headers_results(self, headers): if self.csv_results is not None: self.csv_results_writer.writerow(headers) - self.csv_results.flush() + self.csv_results.flush() - def csv_validate_list(self, csv_list, length): + @staticmethod + def csv_validate_list(csv_list, length): if len(csv_list) < length: - csv_list = csv_list + [('no data','no data')] * (length - len(csv_list)) + csv_list = csv_list + [('no data', 'no data')] * (length - len(csv_list)) return csv_list - def csv_add_row(self,row,writer,csv_file_details): # can make two calls eventually + @staticmethod + def csv_add_row(row, writer, csv_file_details): # can make two calls eventually if csv_file_details is not None: writer.writerow(row) csv_file_details.flush() + def valid_endp_types(_endp_type): etypes = _endp_type.split() for endp_type in etypes: - valid_endp_type=['lf_udp','lf_udp6','lf_tcp','lf_tcp6','mc_udp','mc_udp6'] + valid_endp_type = ['lf_udp', 'lf_udp6', 'lf_tcp', 'lf_tcp6', 'mc_udp', 'mc_udp6'] if not (str(endp_type) in valid_endp_type): print('invalid endp_type: %s. Valid types lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6' % endp_type) exit(1) return _endp_type + + ################################################################################ # # End of Traffic Generation Class @@ -1388,12 +1550,12 @@ def main(): parser = argparse.ArgumentParser( prog='lf_controller_snp.py', - #formatter_class=argparse.RawDescriptionHelpFormatter, + # formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawTextHelpFormatter, epilog='''\ Scaling and Performance ''', - + description='''\ lf_controller_snp.py: -------------------- @@ -1623,76 +1785,117 @@ LANforge GUI what is displayed in the Column and how to access the value with cl ############################################# # Fixed Configurations Coded Into Script ############################################# - parser.add_argument('-ct1' ,'--controller_test_1', help='--controller_test_1 LANforge static radio configuration',action="store_true") - parser.add_argument('-ct2' ,'--controller_test_2', help='--controller_test_2 LANforge static radio configuration',action="store_true") - parser.add_argument('-ct3' ,'--controller_test_3', help='--controller_test_3 LANforge static radio configuration',action="store_true") + parser.add_argument('-ct1', '--controller_test_1', help='--controller_test_1 LANforge static radio configuration', + action="store_true") + parser.add_argument('-ct2', '--controller_test_2', help='--controller_test_2 LANforge static radio configuration', + action="store_true") + parser.add_argument('-ct3', '--controller_test_3', help='--controller_test_3 LANforge static radio configuration', + action="store_true") ############################################# # Script Controller Configurations ############################################# - parser.add_argument('-cca' ,'--controller_aps', help='--controller_aps List of APs to test default: APA453.0E7B.CF9C',default="APA453.0E7B.CF9C") - parser.add_argument('-ccf' ,'--controller_bands', help='--controller_bands default: a',default="a") - parser.add_argument('-cwm' ,'--controller_wifimodes', help='List of of wifi mode to test default: auto',default="auto") + parser.add_argument('-cca', '--controller_aps', + help='--controller_aps List of APs to test default: APA453.0E7B.CF9C', + default="APA453.0E7B.CF9C") + parser.add_argument('-ccf', '--controller_bands', help='--controller_bands default: a', default="a") + parser.add_argument('-cwm', '--controller_wifimodes', help='List of of wifi mode to test default: auto', + default="auto") - parser.add_argument('-cc5','--controller_chan_5ghzs', help='--controller_chan_5ghzs <36 40 ...> default 36',default="36") - parser.add_argument('-cc2','--controller_chan_24ghzs', help='--controller_chan_24ghzs <1 2 ...> default 1',default="1") - parser.add_argument('-ccw','--controller_chan_widths', help='--controller_chan_widths <20 40 80 160> default: \"20\"',default="20") - parser.add_argument('-cam','--controller_ap_modes', help='--controller_ap_modes default local',default="local") - parser.add_argument('-pdu','--controller_pdus', help='--controller_pdus List of packet sizes \"88 512 1370 1518\" default 1580',default="1518" ) - - parser.add_argument('-cde','--controller_data_encryptions', help='--controller_data_encryptions \"enable disable\"',default="disable" ) - parser.add_argument('-cs' ,'--controller_series', help='--controller_series <9800 | 3504>',default="9800",choices=["9800","3504"]) - parser.add_argument('-ccp','--controller_prompt', type=str,help="controller prompt default WLC",default="WLC") - parser.add_argument('-cas','--controller_ap_slot', type=str,help="AP slot, default 1",default="1") - parser.add_argument('-cwl','--controller_wlan', type=str,help="--controller_wlan , default wlan",default="wlan") + parser.add_argument('-cc5', '--controller_chan_5ghzs', help='--controller_chan_5ghzs <36 40 ...> default 36', + default="36") + parser.add_argument('-cc2', '--controller_chan_24ghzs', help='--controller_chan_24ghzs <1 2 ...> default 1', + default="1") + parser.add_argument('-ccw', '--controller_chan_widths', + help='--controller_chan_widths <20 40 80 160> default: \"20\"', default="20") + parser.add_argument('-cam', '--controller_ap_modes', help='--controller_ap_modes default local', + default="local") + parser.add_argument('-pdu', '--controller_pdus', + help='--controller_pdus List of packet sizes \"88 512 1370 1518\" default 1580', default="1518") - parser.add_argument('-cc' ,'--controller_ip', help='--controller_ip default 192.168.100.178',default="192.168.100.178") - parser.add_argument('-cp' ,'--controller_port', help='--controller_port ssh default 22',default="22") - parser.add_argument('-cu' ,'--controller_user', help='--controller_user ',default="admin") - parser.add_argument('-cpw','--controller_passwd', help='--controller_passwd ',default="controller123") - parser.add_argument('-ccs','--controller_scheme', help='--controller_scheme (serial|telnet|ssh): connect via serial, ssh or telnet',default="ssh",choices=["serial","telnet","ssh"]) - parser.add_argument('-ccd','--controller_client_densities', help='--controller_client_densities List of client densities defaults 1', default="1" ) + parser.add_argument('-cde', '--controller_data_encryptions', + help='--controller_data_encryptions \"enable disable\"', default="disable") + parser.add_argument('-cs', '--controller_series', help='--controller_series <9800 | 3504>', default="9800", + choices=["9800", "3504"]) + parser.add_argument('-ccp', '--controller_prompt', type=str, help="controller prompt default WLC", default="WLC") + parser.add_argument('-cas', '--controller_ap_slot', type=str, help="AP slot, default 1", default="1") + parser.add_argument('-cwl', '--controller_wlan', type=str, help="--controller_wlan , default wlan", + default="wlan") - parser.add_argument('-ctp','--controller_tx_powers', help='--controller_tx_powers <1 | 2 | 3 | 4 | 5 | 6 | 7 | 8> 1 is highest power default 3',default="3" - ,choices=["1","2","3","4","5","6","7","8"]) - parser.add_argument('-cco','--cap_ctl_out', help='--cap_ctl_out , switch the controller controller output will be captured', action='store_true') + parser.add_argument('-cc', '--controller_ip', + help='--controller_ip default 192.168.100.178', + default="192.168.100.178") + parser.add_argument('-cp', '--controller_port', + help='--controller_port ssh default 22', default="22") + parser.add_argument('-cu', '--controller_user', help='--controller_user ', + default="admin") + parser.add_argument('-cpw', '--controller_passwd', help='--controller_passwd ', + default="controller123") + parser.add_argument('-ccs', '--controller_scheme', + help='--controller_scheme (serial|telnet|ssh): connect via serial, ssh or telnet', + default="ssh", choices=["serial", "telnet", "ssh"]) + parser.add_argument('-ccd', '--controller_client_densities', + help='--controller_client_densities List of client densities defaults 1', default="1") + + parser.add_argument('-ctp', '--controller_tx_powers', + help='--controller_tx_powers <1 | 2 | 3 | 4 | 5 | 6 | 7 | 8> 1 is highest power default 3', + default="3", choices=["1", "2", "3", "4", "5", "6", "7", "8"]) + parser.add_argument('-cco', '--cap_ctl_out', + help='--cap_ctl_out , switch the controller controller output will be captured', + action='store_true') ################################################################# # Script AP parameters for reading AP, - not used in this script ################################################################# - parser.add_argument('-api','--ap_info', action='append', nargs=1, type=str, \ - help='(enter 0 if does not apply) --ap_info \"ap_scheme== ap_prompt== ap_ip== ap_port== ap_user== ap_pw== ap_tty==\" ') - #--ap_info "ap_scheme==serial ap_prompt==APA53.0E7B.CF9C ap_ip==0 ap_port==0 ap_user==admin ap_pw==Admin123 ap_tty==/dev/ttyUSB2" + parser.add_argument('-api', '--ap_info', action='append', nargs=1, type=str, + help='(enter 0 if does not apply) --ap_info \"ap_scheme== ap_prompt== ap_ip== ap_port== ap_user== ap_pw== ap_tty==\" ') + # --ap_info "ap_scheme==serial ap_prompt==APA53.0E7B.CF9C ap_ip==0 ap_port==0 ap_user==admin ap_pw==Admin123 ap_tty==/dev/ttyUSB2" ############################################# # Script LANforge Configurations ############################################# - parser.add_argument('-lm','--mgr', help='--mgr ',default='localhost') - parser.add_argument('-d','--test_duration', help='--test_duration example --time 5d (5 days) default: 2m options: number followed by d, h, m or s',default='20s') - parser.add_argument('-pi','--polling_interval', help="--polling_interval ", default='5s') - parser.add_argument('--tos', help='--tos: Support different ToS settings: BK | BE | VI | VO | numeric',default="BE") - parser.add_argument('-db','--debug', help='--debug: Enable debugging',action='store_true') - parser.add_argument('-t', '--endp_types', help='--endp_types example --endp_types \"lf_udp lf_tcp\" Default: lf_udp lf_tcp, options: lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6', + parser.add_argument('-lm', '--mgr', help='--mgr ', default='localhost') + parser.add_argument('-d', '--test_duration', + help='--test_duration example --time 5d (5 days) default: 2m options: number followed by d, h, m or s', + default='20s') + parser.add_argument('-pi', '--polling_interval', help="--polling_interval ", default='5s') + parser.add_argument('--tos', help='--tos: Support different ToS settings: BK | BE | VI | VO | numeric', + default="BE") + parser.add_argument('-db', '--debug', help='--debug: Enable debugging', action='store_true') + parser.add_argument('-t', '--endp_types', + help='--endp_types example --endp_types \"lf_udp lf_tcp\" Default: lf_udp lf_tcp, options: lf_udp, lf_udp6, lf_tcp, lf_tcp6, mc_udp, mc_udp6', default='lf_udp lf_tcp', type=valid_endp_types) - parser.add_argument('-cd', '--controller_directions', help='--controller_directions example --controller_directions \"upload download\" Default: upload download', default='upload download') - parser.add_argument('-u', '--upstream_port', help='--upstream_port example: --upstream_port eth1',default='eth1') - parser.add_argument('-o','--csv_outfile', help="--csv_outfile ", default='snp') - parser.add_argument("-l", "--log", action='store_true', help="create logfile for messages, default stdout") - parser.add_argument('-c','--csv_output', help="Generate csv output", default=True) + parser.add_argument('-cd', '--controller_directions', + help='--controller_directions example --controller_directions \"upload download\" Default: upload download', + default='upload download') + parser.add_argument('-u', '--upstream_port', + help='--upstream_port example: --upstream_port eth1', + default='eth1') + parser.add_argument('-o', '--csv_outfile', help="--csv_outfile ", default='snp') + parser.add_argument("-l", "--log", action='store_true', help="create logfile for messages, default stdout") + parser.add_argument('-c', '--csv_output', help="Generate csv output", default=True) - parser.add_argument('-r','--radio', action='append', nargs=1, help='--radio \ - \"radio== ssid== ssid_pw== security== wifimode==\" '\ + parser.add_argument('-r', '--radio', action='append', nargs=1, help='--radio \ + \"radio== ssid== ssid_pw== security== wifimode==\" ' , required=False) - parser.add_argument('-ul_bps','--side_a_tx_min_bps', help='--side_a_tx_min_bps , upload (A side tx) min tx rate bps default 256000 500000000', default="256000 1000000000") - parser.add_argument('-dl_bps','--side_b_tx_min_bps', help='--side_b_tx_min_bps , download(B side tx) min tx rate bps default 1000000000', default="1000000000") + parser.add_argument('-ul_bps', '--side_a_tx_min_bps', + help='--side_a_tx_min_bps , upload (A side tx) min tx rate bps default 256000 500000000', + default="256000 1000000000") + parser.add_argument('-dl_bps', '--side_b_tx_min_bps', + help='--side_b_tx_min_bps , download(B side tx) min tx rate bps default 1000000000', + default="1000000000") ############################################## # Parameters Used For Testing ############################################## - parser.add_argument('-noc','--no_controller', help='-noc / --no_controller no configuration of the controller', action='store_true') - parser.add_argument('-nos','--no_stations', help='-nos / --no_stations , no stations', action='store_true') - parser.add_argument('-wto','--wait_timeout', help='-wto / --wait_timeout , time to wait for stations to get IP ', default="360") - parser.add_argument('-ptc','--print_test_config', help='-ptc / --print_test_config , print out the test configuration and exit', action='store_true') + parser.add_argument('-noc', '--no_controller', help='-noc / --no_controller no configuration of the controller', + action='store_true') + parser.add_argument('-nos', '--no_stations', help='-nos / --no_stations , no stations', action='store_true') + parser.add_argument('-wto', '--wait_timeout', help='-wto / --wait_timeout , time to wait for stations to get IP ', + default="360") + parser.add_argument('-ptc', '--print_test_config', + help='-ptc / --print_test_config , print out the test configuration and exit', + action='store_true') ############################################################## # @@ -1701,7 +1904,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl ############################################################## args = parser.parse_args() controller_args = args # use args. - #logg.info("args: {}".format(args)) + # logg.info("args: {}".format(args)) debug_on = args.debug ############################################################### @@ -1723,7 +1926,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl radios = args.radio if args.wait_timeout: - wait_timeout = int(args.wait_timeout) + wait_timeout = int(args.wait_timeout) if args.controller_scheme: __scheme = args.controller_scheme @@ -1738,7 +1941,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl __prompt = args.controller_prompt if args.controller_series: - __series = args.controller_series + __series = args.controller_series if args.controller_user: __user = args.controller_user @@ -1750,7 +1953,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl __cap_ctl_out = args.cap_ctl_out else: __cap_ctl_out = False - + if args.controller_ap_slot: __ap_slot = args.controller_ap_slot @@ -1762,11 +1965,12 @@ LANforge GUI what is displayed in the Column and how to access the value with cl ap_info = args.ap_info for _ap_info in ap_info: print("ap_info {}".format(_ap_info)) - ap_keys = ['ap_scheme','ap_prompt','ap_ip','ap_port','ap_user','ap_pw', 'ap_tty', 'ap_baud'] - ap_dict = dict(map(lambda x: x.split('=='), str(_ap_info).replace('[','').replace(']','').replace("'","").split())) + ap_keys = ['ap_scheme', 'ap_prompt', 'ap_ip', 'ap_port', 'ap_user', 'ap_pw', 'ap_tty', 'ap_baud'] + ap_dict = dict( + map(lambda x: x.split('=='), str(_ap_info).replace('[', '').replace(']', '').replace("'", "").split())) for key in ap_keys: if key not in ap_dict: - print("missing ap config, for the {}, all these need to be set {} ".format(key,ap_keys)) + print("missing ap config, for the {}, all these need to be set {} ".format(key, ap_keys)) exit(1) print("ap_dict: {}".format(ap_dict)) @@ -1775,39 +1979,39 @@ LANforge GUI what is displayed in the Column and how to access the value with cl # Create a report instanciate a reporting class # ############################################### - report = lf_report(_results_dir_name = "Scaling_and_Performance", _output_html="snp.html", _output_pdf="snp.pdf") + report = lf_report(_results_dir_name="Scaling_and_Performance", _output_html="snp.html", _output_pdf="snp.pdf") if args.csv_outfile != None: current_time = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime()) - csv_outfile = "details_{}_{}.csv".format(args.csv_outfile,current_time) + csv_outfile = "details_{}_{}.csv".format(args.csv_outfile, current_time) csv_outfile = report.file_add_path(csv_outfile) - csv_results = "results_{}_{}.csv".format(args.csv_outfile,current_time) + csv_results = "results_{}_{}.csv".format(args.csv_outfile, current_time) csv_results = report.file_add_path(csv_results) print("csv output file : {}".format(csv_outfile)) print("csv results file : {}".format(csv_results)) - + if args.log: - outfile_log = "{}_{}_output_log.log".format(args.outfile,current_time) + outfile_log = "{}_{}_output_log.log".format(args.outfile, current_time) outfile_log = report.file_add_path(outfile_log) print("output file log: {}".format(outfile_log)) else: outfile_log = "stdout" - print("output file log: {}".format(outfile_log)) + print("output file log: {}".format(outfile_log)) - # Set up the log file + # Set up the log file console_handler = logging.StreamHandler() formatter = logging.Formatter(FORMAT) logg = logging.getLogger(__name__) logg.setLevel(logging.DEBUG) file_handler = None - if (args.log): + if args.log: file_handler = logging.FileHandler(outfile_log, "w") file_handler.setLevel(logging.DEBUG) file_handler.setFormatter(formatter) logg.addHandler(file_handler) - logg.addHandler(logging.StreamHandler(sys.stdout)) # allows to logging to file and stderr + logg.addHandler(logging.StreamHandler(sys.stdout)) # allows to logging to file and stderr # if loggin.basicConfig is called this will result in duplicating log entries # logging.basicConfig(format=FORMAT, handlers=[file_handler]) else: @@ -1820,31 +2024,38 @@ LANforge GUI what is displayed in the Column and how to access the value with cl # Configuration used by command switch --controller_test_1 # ############################################################# - 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_001_one = [ + ['radio==1.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] - radio_AX200_abgn_ax_list_008_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_list_008_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_008_one} + radio_AX200_abgn_ax_dict_one = {'1': radio_AX200_abgn_ax_list_001_one, + '8': radio_AX200_abgn_ax_list_008_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_list_050_one = [['radio==1.wiphy8 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_050_one = [['radio==1.wiphy8 stations==64 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] + 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_list_050_one = [ + ['radio==1.wiphy8 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_050_one = [ + ['radio==1.wiphy8 stations==64 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, - '50' : radio_ath10K_9984_an_AC_list_020_one, - '65' : radio_ath10K_9984_an_AC_list_020_one} + 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, + '50': radio_ath10K_9984_an_AC_list_020_one, + '65': radio_ath10K_9984_an_AC_list_020_one} #################################################################### # @@ -1858,85 +2069,94 @@ LANforge GUI what is displayed in the Column and how to access the value with cl # Configuration used by command switch --controller_test_2 # ############################################################ - radio_AX200_abgn_ax_list_001 = [['radio==1.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] + radio_AX200_abgn_ax_list_001 = [ + ['radio==1.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] - radio_AX200_abgn_ax_list_010 = [['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==2.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==2.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] + radio_AX200_abgn_ax_list_010 = [ + ['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==2.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==2.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] + radio_AX200_abgn_ax_list_020 = [ + ['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==2.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==2.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==3.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==3.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==4.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==4.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==5.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==5.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy2 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy3 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ] - radio_AX200_abgn_ax_list_020 = [['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==2.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==2.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==3.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==3.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==4.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==4.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==5.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==5.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy2 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy3 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ] + radio_AX200_abgn_ax_list_024 = [ + ['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==2.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==2.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==3.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==3.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==4.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==4.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==5.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==5.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy2 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy3 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy4 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy5 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy6 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy7 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ] - radio_AX200_abgn_ax_list_024 = [['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==2.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==2.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==3.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==3.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==4.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==4.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==5.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==5.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy0 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy1 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy2 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy3 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy4 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy5 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy6 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy7 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ] + radio_AX200_abgn_ax_dict = {'1': radio_AX200_abgn_ax_list_001, + '10': radio_AX200_abgn_ax_list_010, + '24': radio_AX200_abgn_ax_list_024} - radio_AX200_abgn_ax_dict = {'1' : radio_AX200_abgn_ax_list_001, - '10' : radio_AX200_abgn_ax_list_010, - '24' : radio_AX200_abgn_ax_list_024} + radio_ath10K_9984_an_AC_list_001 = [ + ['radio==1.wiphy8 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_010 = [ + ['radio==1.wiphy8 stations==10 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_020 = [ + ['radio==1.wiphy8 stations==20 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_050 = [ + ['radio==1.wiphy8 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_100 = [ + ['radio==1.wiphy8 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==1.wiphy9 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_200 = [ + ['radio==1.wiphy8 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==1.wiphy9 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy8 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==6.wiphy9 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_001 = [['radio==1.wiphy8 stations==1 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_010 = [['radio==1.wiphy8 stations==10 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_020 = [['radio==1.wiphy8 stations==20 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_050 = [['radio==1.wiphy8 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_100 = [['radio==1.wiphy8 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==1.wiphy9 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_200 = [['radio==1.wiphy8 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==1.wiphy9 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy8 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==6.wiphy9 stations==50 ssid==test-can ssid_pw==[BLANK] security==open wifimode==auto']] - - radio_ath10K_9984_an_AC_dict = {'1' : radio_ath10K_9984_an_AC_list_001, - '50' : radio_ath10K_9984_an_AC_list_050, + radio_ath10K_9984_an_AC_dict = {'1': radio_ath10K_9984_an_AC_list_001, + '50': radio_ath10K_9984_an_AC_list_050, '200': radio_ath10K_9984_an_AC_list_200} #################################################################### @@ -1952,50 +2172,64 @@ LANforge GUI what is displayed in the Column and how to access the value with cl # Configuration used by command switch --controller_test_3 # ############################################################# - #iwlwifi(AX200) 521 - radio_AX200_abgn_ax_list_001_wiphy2 = [['radio==1.wiphy2 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + # iwlwifi(AX200) 521 + radio_AX200_abgn_ax_list_001_wiphy2 = [ + ['radio==1.wiphy2 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_AX200_abgn_ax_list_001 = [['radio==1.wiphy2 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_AX200_abgn_ax_list_004 = [['radio==1.wiphy2 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==1.wiphy3 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==1.wiphy4 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto'], - ['radio==1.wiphy5 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_AX200_abgn_ax_list_001 = [ + ['radio==1.wiphy2 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_AX200_abgn_ax_list_004 = [ + ['radio==1.wiphy2 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==1.wiphy3 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==1.wiphy4 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto'], + ['radio==1.wiphy5 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_AX200_abgn_ax_dict_test = {'1' : radio_AX200_abgn_ax_list_001, - '4': radio_AX200_abgn_ax_list_004} + radio_AX200_abgn_ax_dict_test = {'1': radio_AX200_abgn_ax_list_001, + '4': radio_AX200_abgn_ax_list_004} - radio_AX200_abgn_ax_dict_test_wiphy2 = {'1' : radio_AX200_abgn_ax_list_001_wiphy2} + radio_AX200_abgn_ax_dict_test_wiphy2 = {'1': radio_AX200_abgn_ax_list_001_wiphy2} - radio_ath10K_9984_an_AC_list_001 = [['radio==1.wiphy0 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_010 = [['radio==1.wiphy0 stations==10 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_020 = [['radio==1.wiphy0 stations==20 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_050 = [['radio==1.wiphy0 stations==50 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_001 = [ + ['radio==1.wiphy0 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_010 = [ + ['radio==1.wiphy0 stations==10 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_020 = [ + ['radio==1.wiphy0 stations==20 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_050 = [ + ['radio==1.wiphy0 stations==50 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_001_wiphy0 = [['radio==1.wiphy0 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_list_010_wiphy0 = [['radio==1.wiphy0 stations==10 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_001_wiphy0 = [ + ['radio==1.wiphy0 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath10K_9984_an_AC_list_010_wiphy0 = [ + ['radio==1.wiphy0 stations==10 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath10K_9984_an_AC_dict_test_wiphy0 = {'1' : radio_ath10K_9984_an_AC_list_001_wiphy0, - '10' : radio_ath10K_9984_an_AC_list_010_wiphy0} + radio_ath10K_9984_an_AC_dict_test_wiphy0 = {'1': radio_ath10K_9984_an_AC_list_001_wiphy0, + '10': radio_ath10K_9984_an_AC_list_010_wiphy0} + + radio_ath10K_9984_an_AC_dict_test = {'1': radio_ath10K_9984_an_AC_list_001, + '10': radio_ath10K_9984_an_AC_list_010, + '50': radio_ath10K_9984_an_AC_list_050} - radio_ath10K_9984_an_AC_dict_test = {'1' : radio_ath10K_9984_an_AC_list_001, - '10' : radio_ath10K_9984_an_AC_list_010, - '50' : radio_ath10K_9984_an_AC_list_050} - #################################################################### # Test to use ath9K #################################################################### - radio_ath9K_9984_abgn_list_001 = [['radio==1.wiphy1 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath9K_9984_abgn_list_010 = [['radio==1.wiphy1 stations==10 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath9K_9984_abgn_list_020 = [['radio==1.wiphy1 stations==20 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath9K_9984_abgn_list_050 = [['radio==1.wiphy1 stations==50 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath9K_9984_abgn_list_200 = [['radio==1.wiphy1 stations==200 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath9K_9984_abgn_list_001 = [ + ['radio==1.wiphy1 stations==1 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath9K_9984_abgn_list_010 = [ + ['radio==1.wiphy1 stations==10 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath9K_9984_abgn_list_020 = [ + ['radio==1.wiphy1 stations==20 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath9K_9984_abgn_list_050 = [ + ['radio==1.wiphy1 stations==50 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] + radio_ath9K_9984_abgn_list_200 = [ + ['radio==1.wiphy1 stations==200 ssid==test_candela ssid_pw==[BLANK] security==open wifimode==auto']] - radio_ath9K_9984_abgn_dict_test = {'1' : radio_ath9K_9984_abgn_list_001, - '10' : radio_ath9K_9984_abgn_list_010, - '20' : radio_ath9K_9984_abgn_list_020, - '50' : radio_ath9K_9984_abgn_list_050, - '200': radio_ath9K_9984_abgn_list_200 } + radio_ath9K_9984_abgn_dict_test = {'1': radio_ath9K_9984_abgn_list_001, + '10': radio_ath9K_9984_abgn_list_010, + '20': radio_ath9K_9984_abgn_list_020, + '50': radio_ath9K_9984_abgn_list_050, + '200': radio_ath9K_9984_abgn_list_200} #################################################################### # Test to only use teh ath9K #################################################################### @@ -2004,7 +2238,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl # #################################################################### MAX_NUMBER_OF_STATIONS = 200 - + radio_name_list = [] number_of_stations_per_radio_list = [] ssid_list = [] @@ -2012,150 +2246,152 @@ LANforge GUI what is displayed in the Column and how to access the value with cl ssid_security_list = [] wifimode_list = [] - #optional radio configuration + # optional radio configuration reset_port_enable_list = [] reset_port_time_min_list = [] reset_port_time_max_list = [] wifi_mode_dict = { - "auto" : "0", - "a" : "1", - "b" : "2", - "g" : "3", - "abg" : "4", - "abgn" : "5", - "bgn" : "6", - "bg" : "7", - "abgnAC" : "8", - "anAC" : "9", - "an" : "10", - "bgnAC" : "11", - "abgnAX" : "12", - "bgnAX" : "13", - "anAX" : "14" - } + "auto": "0", + "a": "1", + "b": "2", + "g": "3", + "abg": "4", + "abgn": "5", + "bgn": "6", + "bg": "7", + "abgnAC": "8", + "anAC": "9", + "an": "10", + "bgnAC": "11", + "abgnAX": "12", + "bgnAX": "13", + "anAX": "14" + } -########################################################################################### -# Test Configurations: Take presidence over command line arguments -# GOAL: help with command line configurations -########################################################################################### + ########################################################################################### + # Test Configurations: Take presidence over command line arguments + # GOAL: help with command line configurations + ########################################################################################### -########################################################################################### -# -# controller_test_1 -# -########################################################################################### + ########################################################################################### + # + # controller_test_1 + # + ########################################################################################### # Test configuration that may be read in , in conjunction with command line arguments if args.controller_test_1: logg.info("USING: controller_test_1") - controller_aps = "vanc-e".split() - controller_bands = "a b".split() - controller_wifimodes = "an anAX anAC abgn bg".split() - controller_tx_powers = "3".split() - controller_chan_5ghzs = "36".split() - controller_chan_24ghzs = "1".split() - controller_chan_widths = "20 40 80".split() - controller_ap_modes = "local".split() + controller_aps = "vanc-e".split() + controller_bands = "a b".split() + controller_wifimodes = "an anAX anAC abgn bg".split() + controller_tx_powers = "3".split() + controller_chan_5ghzs = "36".split() + controller_chan_24ghzs = "1".split() + controller_chan_widths = "20 40 80".split() + controller_ap_modes = "local".split() controller_data_encryptions = "disable".split() - controller_packet_types = "lf_udp lf_tcp".split() - controller_directions = "upload download".split() - controller_pdus = "88 512 1370 1518".split() + controller_packet_types = "lf_udp lf_tcp".split() + controller_directions = "upload download".split() + controller_pdus = "88 512 1370 1518".split() controller_client_densities = "1 10 50 200".split() - controller_side_a_tx_min_bps = "256000".split() - controller_side_b_tx_min_bps = "256000".split() - radio_AX200_abgn_ax_dict = radio_AX200_abgn_ax_dict_one + controller_side_a_tx_min_bps = "256000".split() + controller_side_b_tx_min_bps = "256000".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 -########################################################################################### -# -# controller_test_2 -# -########################################################################################### + ########################################################################################### + # + # controller_test_2 + # + ########################################################################################### elif args.controller_test_2: logg.info("USING: controller_test_2") # Note the local system only supports 802.11-abgn , 802.11a - controller_aps = "APA453.0E7B.CF9C".split() - controller_bands = "a".split() - #controller_wifimodes = "an anAX anAC abgn bg".split() - controller_wifimodes = "an".split() - controller_tx_powers = "3".split() - controller_chan_5ghzs = "36".split() - controller_chan_24ghzs = "1".split() - controller_chan_widths = "20".split() - controller_ap_modes = "local".split() + controller_aps = "APA453.0E7B.CF9C".split() + controller_bands = "a".split() + # controller_wifimodes = "an anAX anAC abgn bg".split() + controller_wifimodes = "an".split() + controller_tx_powers = "3".split() + controller_chan_5ghzs = "36".split() + controller_chan_24ghzs = "1".split() + controller_chan_widths = "20".split() + controller_ap_modes = "local".split() controller_data_encryptions = "disable".split() - #controller_packet_types = "lf_udp lf_tcp".split() - controller_packet_types = "lf_udp".split() - #controller_directions = "upload download".split() - controller_directions = "upload download".split() - #controller_pdus = "88 512 1370 1518".split() - controller_pdus = "1518".split() + # controller_packet_types = "lf_udp lf_tcp".split() + controller_packet_types = "lf_udp".split() + # controller_directions = "upload download".split() + controller_directions = "upload download".split() + # controller_pdus = "88 512 1370 1518".split() + controller_pdus = "1518".split() controller_client_densities = "10".split() controller_data_encryptions = "disable".split() - controller_side_a_tx_min_bps = "256000".split() - controller_side_b_tx_min_bps = "256000".split() - radio_AX200_abgn_ax_dict = radio_AX200_abgn_ax_dict_test + controller_side_a_tx_min_bps = "256000".split() + controller_side_b_tx_min_bps = "256000".split() + radio_AX200_abgn_ax_dict = radio_AX200_abgn_ax_dict_test radio_ath10K_9984_an_AC_dict = radio_ath10K_9984_an_AC_dict_test -########################################################################################### -# -# controller_test_3 -# -########################################################################################### - elif args.controller_test_3: #CMR_test_3 + ########################################################################################### + # + # controller_test_3 + # + ########################################################################################### + elif args.controller_test_3: # CMR_test_3 logg.info("USING: controller_test_3") # Note the local system only supports 802.11-abgn , 802.11a - controller_aps = "APA453.0E7B.CF9C".split() - controller_bands = "a".split() - #controller_wifimodes = "an anAX anAC abgn bg".split() - controller_wifimodes = "an".split() - controller_tx_powers = "3".split() - controller_chan_5ghzs = "36".split() - controller_chan_24ghzs = "1".split() - controller_chan_widths = "20".split() - controller_ap_modes = "local".split() + controller_aps = "APA453.0E7B.CF9C".split() + controller_bands = "a".split() + # controller_wifimodes = "an anAX anAC abgn bg".split() + controller_wifimodes = "an".split() + controller_tx_powers = "3".split() + controller_chan_5ghzs = "36".split() + controller_chan_24ghzs = "1".split() + controller_chan_widths = "20".split() + controller_ap_modes = "local".split() controller_data_encryptions = "disable".split() - #controller_packet_types = "lf_udp lf_tcp".split() - controller_packet_types = "lf_udp".split() - #controller_directions = "upload download".split() - controller_directions = "upload download".split() - #controller_pdus = "88 512 1370 1518".split() - controller_pdus = "1518".split() + # controller_packet_types = "lf_udp lf_tcp".split() + controller_packet_types = "lf_udp".split() + # controller_directions = "upload download".split() + controller_directions = "upload download".split() + # controller_pdus = "88 512 1370 1518".split() + controller_pdus = "1518".split() controller_client_densities = "1".split() controller_data_encryptions = "disable".split() - controller_side_a_tx_min_bps = "256000".split() - controller_side_b_tx_min_bps = "256000".split() - radio_AX200_abgn_ax_dict = radio_AX200_abgn_ax_dict_test_wiphy2 + controller_side_a_tx_min_bps = "256000".split() + controller_side_b_tx_min_bps = "256000".split() + radio_AX200_abgn_ax_dict = radio_AX200_abgn_ax_dict_test_wiphy2 radio_ath10K_9984_an_AC_dict = radio_ath10K_9984_an_AC_dict_test - #radio_ath10K_9984_an_AC_dict = radio_ath9K_9984_abgn_dict_test + # radio_ath10K_9984_an_AC_dict = radio_ath9K_9984_abgn_dict_test ########################################################################################### # Use Command line arguments ########################################################################################### - else: + else: - controller_aps = args.controller_aps.split() - controller_bands = args.controller_bands.split() - controller_wifimodes = args.controller_wifimodes.split() + controller_aps = args.controller_aps.split() + controller_bands = args.controller_bands.split() + controller_wifimodes = args.controller_wifimodes.split() for mode in controller_wifimodes: if mode in wifi_mode_dict.keys(): pass else: - logg.info("wifimode [{}] not recognised. Please use: auto, a, b, g, abg, abgn, bgn, bg, abgnAC, anAC, an, bgnAC, abgnAX, bgnAX, anAX".format(mode)) + logg.info( + "wifimode [{}] not recognised. Please use: auto, a, b, g, abg, abgn, bgn, bg, abgnAC, anAC, an, bgnAC, abgnAX, bgnAX, anAX".format( + mode)) exit(1) - controller_tx_powers = args.controller_tx_powers.split() - controller_chan_5ghzs = args.controller_chan_5ghzs.split() - controller_chan_24ghzs = args.controller_chan_24ghzs.split() - controller_chan_widths = args.controller_chan_widths.split() - controller_ap_modes = args.controller_ap_modes.split() - controller_client_densities = args.controller_client_densities.split() - controller_packet_types = args.endp_types.split() - controller_pdus = args.controller_pdus.split() - controller_directions = args.controller_directions.split() - controller_data_encryptions = args.controller_data_encryptions.split() + controller_tx_powers = args.controller_tx_powers.split() + controller_chan_5ghzs = args.controller_chan_5ghzs.split() + controller_chan_24ghzs = args.controller_chan_24ghzs.split() + controller_chan_widths = args.controller_chan_widths.split() + controller_ap_modes = args.controller_ap_modes.split() + controller_client_densities = args.controller_client_densities.split() + controller_packet_types = args.endp_types.split() + controller_pdus = args.controller_pdus.split() + controller_directions = args.controller_directions.split() + controller_data_encryptions = args.controller_data_encryptions.split() - controller_side_a_tx_min_bps = args.side_a_tx_min_bps.split() - controller_side_b_tx_min_bps = args.side_b_tx_min_bps.split() + controller_side_a_tx_min_bps = args.side_a_tx_min_bps.split() + controller_side_b_tx_min_bps = args.side_b_tx_min_bps.split() logg.info("TEST CONFIG: ") logg.info("controller_aps ('-cca' ,'--controller_aps'): {}".format(controller_aps)) logg.info("controller_bands ('-ccf' ,'--controller_bands'): {}".format(controller_bands)) @@ -2165,11 +2401,13 @@ LANforge GUI what is displayed in the Column and how to access the value with cl logg.info("controller_chan_widths ('-ccw','--controller_chan_widths'): {}".format(controller_chan_widths)) logg.info("controller_tx_powers ('-ctp','--controller_tx_powers'): {}".format(controller_tx_powers)) logg.info("controller_ap_modes ('-cam','--controller_ap_modes'): {}".format(controller_ap_modes)) - logg.info("controller_client_densities ('-ccd','--controller_client_densities'): {}".format(controller_client_densities)) + logg.info( + "controller_client_densities ('-ccd','--controller_client_densities'): {}".format(controller_client_densities)) logg.info("controller_packet_types ('-t', '--endp_types'): {}".format(controller_packet_types)) logg.info("controller_pdus ('-cps','--controller_pdus'): {}".format(controller_pdus)) logg.info("controller_directions ('-cd', '--controller_directions'): {}".format(controller_directions)) - logg.info("controller_data_encryptions ('-cde','--controller_data_encryptions') {}".format(controller_data_encryptions)) + logg.info( + "controller_data_encryptions ('-cde','--controller_data_encryptions') {}".format(controller_data_encryptions)) logg.info("controller_side_a_tx_min_bps ('-amr','--side_a_tx_min_bps'): {}".format(controller_side_a_tx_min_bps)) logg.info("controller_side_b_tx_min_bps ('-bmr','--side_b_tx_min_bps'): {}".format(controller_side_b_tx_min_bps)) logg.info("test duration ('-d','--test_duration'): {}".format(test_duration)) @@ -2185,7 +2423,8 @@ LANforge GUI what is displayed in the Column and how to access the value with cl logg.info('##### ATH10K_9984 RADIOS ####') logg.info(radio_ath10K_9984_an_AC_dict) else: - logg.info("No radios endered EXITING, use --radio or --controller_test_1, --controller_test_2 or --controller_test_3") + logg.info( + "No radios endered EXITING, use --radio or --controller_test_1, --controller_test_2 or --controller_test_3") exit(1) if args.print_test_config: @@ -2197,30 +2436,32 @@ LANforge GUI what is displayed in the Column and how to access the value with cl logg.info("Reports Directory Created") exit(1) - __ap_set = None - __band_set = None - __chan_width_set = None - __ap_mode_set = None - __tx_power_set = None - __chan_5ghz_set = None - __chan_24ghz_set = None - __csv_started = False + __ap_set = None + __band_set = None + __chan_width_set = None + __ap_mode_set = None + __tx_power_set = None + __chan_5ghz_set = None + __chan_24ghz_set = None + __csv_started = False for controller_ap in controller_aps: for controller_band in controller_bands: # frequency for controller_wifimode in controller_wifimodes: # check for valid frequency and wifi_mode combination put here to simplify logic since all radios do not support all modes # "an anAX anAC abgn bg" - if((controller_band == "a" and controller_wifimode == "bg") or (controller_band == "b" and controller_wifimode == "anAC")): + if ((controller_band == "a" and controller_wifimode == "bg") or ( + controller_band == "b" and controller_wifimode == "anAC")): logg.info("#######################################################################") - logg.info("# Skipping combination controller_band {} controller_wifimode {}".format(controller_band,controller_wifimode)) + logg.info("# Skipping combination controller_band {} controller_wifimode {}".format(controller_band, + controller_wifimode)) logg.info("#######################################################################") - pass # invalid combination continue + pass # invalid combination continue else: for controller_tx_power in controller_tx_powers: for controller_chan_5ghz in controller_chan_5ghzs: for controller_chan_24ghz in controller_chan_24ghzs: - for controller_chan_width in controller_chan_widths: #bandwidth + for controller_chan_width in controller_chan_widths: # bandwidth for controller_data_encryption in controller_data_encryptions: for controller_ap_mode in controller_ap_modes: for controller_client_density in controller_client_densities: @@ -2235,144 +2476,191 @@ LANforge GUI what is displayed in the Column and how to access the value with cl ############################################### if args.radio: radios = args.radio - logg.info("########################################################") + logg.info( + "########################################################") logg.info("# radios configured from command line {}".format(radios)) logg.info("# controller_band: {}".format(controller_band)) logg.info("# controller_wifimode: {}".format(controller_wifimode)) - logg.info("########################################################") - + logg.info( + "########################################################") + ################################################################# # USE radio dictionaies in this file to configure LANforge radios ################################################################# elif controller_band == "a": if controller_wifimode == "anAX" or controller_wifimode == "abgn": - #AX200 dual band + # AX200 dual band try: radios = radio_AX200_abgn_ax_dict[controller_client_density] - logg.info("controller_client_density:{} radios: {}".format(controller_client_density,radios)) + logg.info("controller_client_density:{} radios: {}".format( + controller_client_density, radios)) except: - logg.info("CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: controller_client_density: {} not supported for configuration".format(controller_client_density)) - logg.info("CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: current dictionary radio_AX200_abgn_ax_dict {}".format(radio_AX200_abgn_ax_dict)) - logg.info("CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: MOVE TO NEXT DENSITY CONTINUING TESTING") + logg.info( + "CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: controller_client_density: {} not supported for configuration".format( + controller_client_density)) + logg.info( + "CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: current dictionary radio_AX200_abgn_ax_dict {}".format( + radio_AX200_abgn_ax_dict)) + logg.info( + "CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: MOVE TO NEXT DENSITY CONTINUING TESTING") continue - elif controller_wifimode == "an" or controller_wifimode == "anAC" or controller_wifimode =="auto": - #ath10K only supports 5Ghz + elif controller_wifimode == "an" or controller_wifimode == "anAC" or controller_wifimode == "auto": + # ath10K only supports 5Ghz try: - radios = radio_ath10K_9984_an_AC_dict[controller_client_density] + radios = radio_ath10K_9984_an_AC_dict[ + controller_client_density] logg.info("radios: {}".format(radios)) except: - logg.info("CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: controller_client_density: {} not supported for configuration".format(controller_client_density)) - logg.info("CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: current dictionary radio_AX200_abgn_ax_dict {}".format(radio_ath10K_9984_an_AC_dict)) - logg.info("CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: MOVE TO NEXT DENSITY CONTINUING TESTING") + logg.info( + "CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: controller_client_density: {} not supported for configuration".format( + controller_client_density)) + logg.info( + "CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: current dictionary radio_AX200_abgn_ax_dict {}".format( + radio_ath10K_9984_an_AC_dict)) + logg.info( + "CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: MOVE TO NEXT DENSITY CONTINUING TESTING") continue else: logg.info("##################################") logg.info("# INVALID COMBINATION 5ghz") - #logg.info("# controller run settings: {}".format(test_config)) + # logg.info("# controller run settings: {}".format(test_config)) logg.info("##################################") exit(1) - else: # controller_band == "b" - if controller_wifimode == "an" or controller_wifimode == "anAX" or controller_wifimode == "abgn" or controller_wifimode == "bg" or controller_wifimode == "auto": - #AX200 dual band + else: # controller_band == "b" + if controller_wifimode == "an" or controller_wifimode == "anAX" or controller_wifimode == "abgn" or controller_wifimode == "bg" or controller_wifimode == "auto": + # AX200 dual band try: radios = radio_AX200_abgn_ax_dict[controller_client_density] logg.info("radios: {}".format(radios)) except: - logg.info("CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: controller_client_density: {} not supported for configuration".format(controller_client_density)) - logg.info("CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: current dictionary radio_AX200_abgn_ax_dict {}".format(radio_AX200_abgn_ax_dict)) - logg.info("CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: MOVE TO NEXT DENSITY CONTINUING TESTING") + logg.info( + "CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: controller_client_density: {} not supported for configuration".format( + controller_client_density)) + logg.info( + "CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: current dictionary radio_AX200_abgn_ax_dict {}".format( + radio_AX200_abgn_ax_dict)) + logg.info( + "CONTROLLER DENSITY INVALID FOR RADIO DICTIONARY: MOVE TO NEXT DENSITY CONTINUING TESTING") continue else: logg.info("##################################") logg.info("# INVALID COMBINATION 24 ghz") - #logg.info("# controller run settings: {}".format(test_config)) + # logg.info("# controller run settings: {}".format(test_config)) logg.info("##################################") exit(1) for controller_packet_type in controller_packet_types: for controller_direction in controller_directions: # looping though both A and B together, upload direction will select A, download direction will select B - for side_a_tx_min_bps_ul, side_b_tx_min_bps_dl in itertools.zip_longest(controller_side_a_tx_min_bps, controller_side_b_tx_min_bps, fillvalue = 256000): + for side_a_tx_min_bps_ul, side_b_tx_min_bps_dl in itertools.zip_longest( + controller_side_a_tx_min_bps, + controller_side_b_tx_min_bps, fillvalue=256000): for controller_pdu in controller_pdus: - logg.info("###################################################################") - logg.info("# TEST RUNNING direction:{} ul: {} , TEST RUNNING dl: {}" - .format(controller_direction, side_a_tx_min_bps_ul, side_b_tx_min_bps_dl)) - logg.info("####################################################################") + logg.info( + "###################################################################") + logg.info( + "# TEST RUNNING direction:{} ul: {} , TEST RUNNING dl: {}" + .format(controller_direction, + side_a_tx_min_bps_ul, + side_b_tx_min_bps_dl)) + logg.info( + "####################################################################") test_config = "AP=={} Band=={} chan_5ghz=={} chan_24ghz=={} wifi_mode=={} BW=={} encryption=={} ap_mode=={} clients=={} packet_type=={} direction=={} pdu=={}".format( - controller_ap,controller_band,controller_chan_5ghz,controller_chan_24ghz,controller_wifimode,controller_chan_width,controller_data_encryption,controller_ap_mode,controller_client_density, - controller_packet_type,controller_direction,controller_pdu) - test_keys = ['AP','Band','wifi_mode','chan_5ghz','chan_24ghz','BW','encryption','ap_mode','clients','packet_type','direction','pdu'] - logg.info("# controller run settings: {}".format(test_config)) - if(args.no_controller): - logg.info("################################################") - logg.info("# TEST MODE : NO CONTROLLER SET : TEST MODE") - logg.info("################################################") - if( controller_ap != __ap_set or - controller_band != __band_set or - controller_chan_width != __chan_width_set or - controller_ap_mode != __ap_mode_set or - controller_tx_power != __tx_power_set or - controller_chan_5ghz != __chan_5ghz_set or - controller_chan_24ghz != __chan_24ghz_set - ): - logg.info("###############################################") - logg.info("# TEST MODE : NEW CONTROLLER CONFIG : TEST MODE") - logg.info("###############################################") - __ap_set = controller_ap - __band_set = controller_band - __chan_width_set = controller_chan_width - __ap_mode_set = controller_ap_mode - __tx_power_set = controller_tx_power - __chan_5ghz_set = controller_chan_5ghz - __chan_24ghz_set = controller_chan_24ghz - __client_density = controller_client_density + controller_ap, controller_band, + controller_chan_5ghz, controller_chan_24ghz, + controller_wifimode, controller_chan_width, + controller_data_encryption, controller_ap_mode, + controller_client_density, + controller_packet_type, controller_direction, + controller_pdu) + test_keys = ['AP', 'Band', 'wifi_mode', 'chan_5ghz', + 'chan_24ghz', 'BW', 'encryption', + 'ap_mode', 'clients', 'packet_type', + 'direction', 'pdu'] + logg.info( + "# controller run settings: {}".format(test_config)) + if args.no_controller: + logg.info( + "################################################") + logg.info( + "# TEST MODE : NO CONTROLLER SET : TEST MODE") + logg.info( + "################################################") + if (controller_ap != __ap_set or + controller_band != __band_set or + controller_chan_width != __chan_width_set or + controller_ap_mode != __ap_mode_set or + controller_tx_power != __tx_power_set or + controller_chan_5ghz != __chan_5ghz_set or + controller_chan_24ghz != __chan_24ghz_set + ): + logg.info( + "###############################################") + logg.info( + "# TEST MODE : NEW CONTROLLER CONFIG : TEST MODE") + logg.info( + "###############################################") + __ap_set = controller_ap + __band_set = controller_band + __chan_width_set = controller_chan_width + __ap_mode_set = controller_ap_mode + __tx_power_set = controller_tx_power + __chan_5ghz_set = controller_chan_5ghz + __chan_24ghz_set = controller_chan_24ghz + __client_density = controller_client_density else: - logg.info("################################################") - logg.info("# SETUP MODE : SETUP CONTROLLER : SETUP MODE") - logg.info("################################################") - - if( controller_ap != __ap_set or - controller_band != __band_set or - controller_chan_width != __chan_width_set or - controller_ap_mode != __ap_mode_set or - controller_tx_power != __tx_power_set or - controller_chan_5ghz != __chan_5ghz_set or - controller_chan_24ghz != __chan_24ghz_set - ): - logg.info("###############################################") - logg.info("# SETUP MODE : NEW CONTROLLER CONFIG") - logg.info("###############################################") - __ap_set = controller_ap - __band_set = controller_band - __chan_width_set = controller_chan_width - __ap_mode_set = controller_ap_mode - __tx_power_set = controller_tx_power - __chan_5ghz_set = controller_chan_5ghz - __chan_24ghz_set = controller_chan_24ghz - __client_density = controller_client_density + logg.info( + "################################################") + logg.info( + "# SETUP MODE : SETUP CONTROLLER : SETUP MODE") + logg.info( + "################################################") + + if (controller_ap != __ap_set or + controller_band != __band_set or + controller_chan_width != __chan_width_set or + controller_ap_mode != __ap_mode_set or + controller_tx_power != __tx_power_set or + controller_chan_5ghz != __chan_5ghz_set or + controller_chan_24ghz != __chan_24ghz_set + ): + logg.info( + "###############################################") + logg.info( + "# SETUP MODE : NEW CONTROLLER CONFIG") + logg.info( + "###############################################") + __ap_set = controller_ap + __band_set = controller_band + __chan_width_set = controller_chan_width + __ap_mode_set = controller_ap_mode + __tx_power_set = controller_tx_power + __chan_5ghz_set = controller_chan_5ghz + __chan_24ghz_set = controller_chan_24ghz + __client_density = controller_client_density controller = CreateCtlr( - _scheme=__scheme, - _port=__port, - _series=__series, - _ctlr=__ctlr, - _prompt=__prompt, - _user=__user, - _passwd=__passwd, - _ap=__ap_set, - _band=__band_set, - _chan_5ghz=__chan_5ghz_set, - _chan_24ghz=__chan_24ghz_set, - _chan_width=__chan_width_set, - _ap_mode=__ap_mode_set, - _tx_power=__tx_power_set, - _wlan = __wlan, - _cap_ctl_out=__cap_ctl_out - ) - #Disable AP + _scheme=__scheme, + _port=__port, + _series=__series, + _ctlr=__ctlr, + _prompt=__prompt, + _user=__user, + _passwd=__passwd, + _ap=__ap_set, + _band=__band_set, + _chan_5ghz=__chan_5ghz_set, + _chan_24ghz=__chan_24ghz_set, + _chan_width=__chan_width_set, + _ap_mode=__ap_mode_set, + _tx_power=__tx_power_set, + _wlan=__wlan, + _cap_ctl_out=__cap_ctl_out + ) + # Disable AP # # Controller Configuration # - #if controller_args.controller_series == "9800": + # if controller_args.controller_series == "9800": # controller_controller_no_loggin_console() pss = controller.controller_show_ap_summary() logg.info("pss {}".format(pss)) @@ -2388,13 +2676,13 @@ LANforge GUI what is displayed in the Column and how to access the value with cl controller.controller_set_tx_power() controller.controller_set_channel() controller.controller_set_bandwidth() - #if controller_args.controller_series == "9800": - # CANDELA TODO, not needed controller.controller_create_wlan() - # CANDELA TODO set the policy tag, controller.controller_set_wireless_tag_policy() - # CANDELA controller.controller_enable_wlan() - if controller_band == "a": + # if controller_args.controller_series == "9800": + # CANDELA TODO, not needed controller.controller_create_wlan() + # CANDELA TODO set the policy tag, controller.controller_set_wireless_tag_policy() + # CANDELA controller.controller_enable_wlan() + if controller_band == "a": controller.controller_enable_network_5ghz() - else: + else: controller.controller_enable_network_24ghz() controller.controller_enable_ap() # need to actually check the CAC timer @@ -2403,140 +2691,186 @@ LANforge GUI what is displayed in the Column and how to access the value with cl # end of controller controller code #################################### else: - logg.info("###############################################") - logg.info("# SETUP MODE : NO CHANGE TO CONTROLLER CONFIG") - logg.info("###############################################") - logg.info("controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}" - .format(controller_ap,controller_band, controller_chan_width, controller_ap_mode, controller_tx_power, controller_chan_5ghz, controller_chan_24ghz)) - logg.info("__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}" - .format(__ap_set,__band_set, __chan_width_set, __ap_mode_set, __tx_power_set, __chan_5ghz_set, __chan_24ghz_set)) - logg.info("controller_wifi_mode {}".format(controller_wifimode)) + logg.info( + "###############################################") + logg.info( + "# SETUP MODE : NO CHANGE TO CONTROLLER CONFIG") + logg.info( + "###############################################") + logg.info( + "controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}" + .format(controller_ap, controller_band, + controller_chan_width, + controller_ap_mode, + controller_tx_power, + controller_chan_5ghz, + controller_chan_24ghz)) + logg.info( + "__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}" + .format(__ap_set, __band_set, + __chan_width_set, __ap_mode_set, + __tx_power_set, __chan_5ghz_set, + __chan_24ghz_set)) + logg.info("controller_wifi_mode {}".format( + controller_wifimode)) logg.info("radios {}".format(radios)) for radio_ in radios: - radio_keys = ['radio','stations','ssid','ssid_pw','security','wifimode'] - radio_info_dict = dict(map(lambda x: x.split('=='), str(radio_).replace('[','').replace(']','').replace("'","").split())) - logg.info("radio_dict {}".format(radio_info_dict)) + radio_keys = ['radio', 'stations', 'ssid', + 'ssid_pw', 'security', 'wifimode'] + radio_info_dict = dict( + map(lambda x: x.split('=='), + str(radio_).replace('[', '').replace( + ']', '').replace("'", "").split())) + logg.info( + "radio_dict {}".format(radio_info_dict)) for key in radio_keys: if key not in radio_info_dict: - logg.info("missing config, for the {}, all of the following need to be present {} ".format(key,radio_keys)) + logg.info( + "missing config, for the {}, all of the following need to be present {} ".format( + key, radio_keys)) exit(1) radio_name_list.append(radio_info_dict['radio']) ssid_list.append(radio_info_dict['ssid']) - ssid_password_list.append(radio_info_dict['ssid_pw']) - ssid_security_list.append(radio_info_dict['security']) + ssid_password_list.append( + radio_info_dict['ssid_pw']) + ssid_security_list.append( + radio_info_dict['security']) if args.radio: - number_of_stations_per_radio_list.append(radio_info_dict['stations']) - wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) - else: - number_of_stations_per_radio_list.append(radio_info_dict['stations']) - wifimode_list.append(int(wifi_mode_dict[radio_info_dict['wifimode']])) - optional_radio_reset_keys = ['reset_port_enable'] + number_of_stations_per_radio_list.append( + radio_info_dict['stations']) + wifimode_list.append(int(wifi_mode_dict[ + radio_info_dict[ + 'wifimode']])) + else: + number_of_stations_per_radio_list.append( + radio_info_dict['stations']) + wifimode_list.append(int(wifi_mode_dict[ + radio_info_dict[ + 'wifimode']])) + optional_radio_reset_keys = [ + 'reset_port_enable'] radio_reset_found = True for key in optional_radio_reset_keys: if key not in radio_info_dict: - #logg.info("port reset test not enabled") + # logg.info("port reset test not enabled") radio_reset_found = False break - + if radio_reset_found: reset_port_enable_list.append(True) - reset_port_time_min_list.append(radio_info_dict['reset_port_time_min']) - reset_port_time_max_list.append(radio_info_dict['reset_port_time_max']) + reset_port_time_min_list.append( + radio_info_dict['reset_port_time_min']) + reset_port_time_max_list.append( + radio_info_dict['reset_port_time_max']) else: reset_port_enable_list.append(False) reset_port_time_min_list.append('0s') reset_port_time_max_list.append('0s') # no stations for testing reconfiguration of the controller - - if(args.no_stations): - logg.info("#################################################") + if args.no_stations: + logg.info( + "#################################################") logg.info("# TEST MODE : NO STATIONS TEST MODE") - logg.info("##################################################") + logg.info( + "##################################################") else: - logg.info("#################################################") - logg.info("# SETUP MODE : CREATING STATIONS SETUP MODE") - logg.info("##################################################") + logg.info( + "#################################################") + logg.info( + "# SETUP MODE : CREATING STATIONS SETUP MODE") + logg.info( + "##################################################") index = 0 station_lists = [] - for (radio_name_, number_of_stations_per_radio_) in zip(radio_name_list,number_of_stations_per_radio_list): - number_of_stations = int(number_of_stations_per_radio_) + for ( + radio_name_, + number_of_stations_per_radio_) in zip( + radio_name_list, + number_of_stations_per_radio_list): + number_of_stations = int( + number_of_stations_per_radio_) if number_of_stations > MAX_NUMBER_OF_STATIONS: - logg.info("number of stations per radio exceeded max of : {}".format(MAX_NUMBER_OF_STATIONS)) + logg.info( + "number of stations per radio exceeded max of : {}".format( + MAX_NUMBER_OF_STATIONS)) quit(1) - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_= 1 + index*1000, end_id_= number_of_stations + index*1000, - padding_number_=10000, radio=radio_name_) + station_list = LFUtils.portNameSeries( + prefix_="sta", start_id_=1 + index * 1000, + end_id_=number_of_stations + index * 1000, + padding_number_=10000, radio=radio_name_) station_lists.append(station_list) index += 1 # Run Traffic upload (STA to AP) - if(controller_direction == "upload"): - side_a_tx_min_bps = side_a_tx_min_bps_ul - side_b_tx_min_bps = 0 - # Run Traffic download (AP to STA) + if controller_direction == "upload": + side_a_tx_min_bps = side_a_tx_min_bps_ul + side_b_tx_min_bps = 0 + # Run Traffic download (AP to STA) else: - side_a_tx_min_bps = 0 - side_b_tx_min_bps = side_b_tx_min_bps_dl - # current default is to have a values + side_a_tx_min_bps = 0 + side_b_tx_min_bps = side_b_tx_min_bps_dl + # current default is to have a values ip_var_test = L3VariableTime( - args=args, - _scheme=__scheme, - _port=__port, - _series=__series, - _ctlr=__ctlr, - _prompt=__prompt, - _user=__user, - _passwd=__passwd, - _ap=__ap_set, - _ap_slot=__ap_slot, - _band=__band_set, - _chan_5ghz=__chan_5ghz_set, - _chan_24ghz=__chan_24ghz_set, - _chan_width=__chan_width_set, - _ap_mode=__ap_mode_set, - _tx_power=__tx_power_set, - _client_density=__client_density, - _cap_ctl_out=__cap_ctl_out, - _ap_dict = ap_dict, - endp_type=controller_packet_type, - tos=args.tos, - side_b=side_b, - radio_name_list=radio_name_list, - number_of_stations_per_radio_list=number_of_stations_per_radio_list, - ssid_list=ssid_list, - ssid_password_list=ssid_password_list, - ssid_security_list=ssid_security_list, - wifimode_list=wifimode_list, - station_lists= station_lists, - name_prefix="LT-", - debug_on=debug_on, - wait_timeout=wait_timeout, - outfile=csv_outfile, - results=csv_results, - test_keys=test_keys, - test_config=test_config, - reset_port_enable_list=reset_port_enable_list, - reset_port_time_min_list=reset_port_time_min_list, - reset_port_time_max_list=reset_port_time_max_list, - csv_started=__csv_started, - side_a_tx_min_bps = side_a_tx_min_bps, - side_a_tx_max_bps =0, - side_a_min_pdu =controller_pdu, - side_a_max_pdu =0, - side_b_tx_min_bps =side_b_tx_min_bps, - side_b_tx_max_bps =0, - side_b_min_pdu =controller_pdu, - side_b_max_pdu = 0, - number_template="00", - test_duration=test_duration, - polling_interval= polling_interval, - lfclient_host=lfjson_host, - lfclient_port=lfjson_port) + args=args, + _scheme=__scheme, + _port=__port, + _series=__series, + _ctlr=__ctlr, + _prompt=__prompt, + _user=__user, + _passwd=__passwd, + _ap=__ap_set, + _ap_slot=__ap_slot, + _band=__band_set, + _chan_5ghz=__chan_5ghz_set, + _chan_24ghz=__chan_24ghz_set, + _chan_width=__chan_width_set, + _ap_mode=__ap_mode_set, + _tx_power=__tx_power_set, + _client_density=__client_density, + _cap_ctl_out=__cap_ctl_out, + _ap_dict=ap_dict, + endp_type=controller_packet_type, + tos=args.tos, + side_b=side_b, + radio_name_list=radio_name_list, + number_of_stations_per_radio_list=number_of_stations_per_radio_list, + ssid_list=ssid_list, + ssid_password_list=ssid_password_list, + ssid_security_list=ssid_security_list, + wifimode_list=wifimode_list, + station_lists=station_lists, + name_prefix="LT-", + debug_on=debug_on, + wait_timeout=wait_timeout, + outfile=csv_outfile, + results=csv_results, + test_keys=test_keys, + test_config=test_config, + reset_port_enable_list=reset_port_enable_list, + reset_port_time_min_list=reset_port_time_min_list, + reset_port_time_max_list=reset_port_time_max_list, + csv_started=__csv_started, + side_a_tx_min_bps=side_a_tx_min_bps, + side_a_tx_max_bps=0, + side_a_min_pdu=controller_pdu, + side_a_max_pdu=0, + side_b_tx_min_bps=side_b_tx_min_bps, + side_b_tx_max_bps=0, + side_b_min_pdu=controller_pdu, + side_b_max_pdu=0, + number_template="00", + test_duration=test_duration, + polling_interval=polling_interval, + lfclient_host=lfjson_host, + lfclient_port=lfjson_port) __csv_started = True ip_var_test.pre_cleanup() ip_var_test.build() if not ip_var_test.passes(): logg.info("build step failed.") logg.info(ip_var_test.get_fail_message()) - exit(1) + exit(1) ip_var_test.start(False, False) ip_var_test.stop() if not ip_var_test.passes(): @@ -2550,11 +2884,12 @@ LANforge GUI what is displayed in the Column and how to access the value with cl ssid_security_list = [] wifimode_list = [] ip_var_test.cleanup() - if ( args.no_stations): + if args.no_stations: pass else: ip_var_test.passes() - logg.info("Full test passed, all connections increased rx rate") + logg.info( + "Full test passed, all connections increased rx rate") ########################################## # # Build Results @@ -2570,10 +2905,11 @@ LANforge GUI what is displayed in the Column and how to access the value with cl report.set_table_dataframe_from_csv(csv_results) report.build_table() report.write_html() - report.write_pdf(_page_size = 'A3', _orientation='Landscape') + report.write_pdf(_page_size='A3', _orientation='Landscape') if args.log: logg.info("output_log: {}".format(outfile_log)) + if __name__ == "__main__": main() From 37e2710bb248217ba9298251e69d0d123a2a9135 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:04:17 -0800 Subject: [PATCH 520/731] lf_snp_test: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/lf_snp_test.py | 44 +++++++++++++++------------------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/py-scripts/lf_snp_test.py b/py-scripts/lf_snp_test.py index 16fdd26a..babccc5c 100755 --- a/py-scripts/lf_snp_test.py +++ b/py-scripts/lf_snp_test.py @@ -593,8 +593,7 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -628,8 +627,7 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -656,8 +654,7 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -686,8 +683,7 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -718,8 +714,7 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -749,8 +744,7 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -778,8 +772,7 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -804,8 +797,7 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -833,8 +825,7 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -859,8 +850,7 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -887,8 +877,7 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". - format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -925,9 +914,11 @@ class CreateCtlr: if (str(controller_channel) in str(element_list[8])) and ( str(self.chan_width) in str(element_list[5])): logg.info( - "ap {} configuration successful: channel {} in expected {} chan_width {} in expected {}" - .format(element_list[0], controller_channel, element_list[8], self.chan_width, - element_list[5])) + "ap {} configuration successful: channel {} in expected {} chan_width {} in expected {}".format(element_list[0], + controller_channel, + element_list[8], + self.chan_width, + element_list[5])) else: logg.info("WARNING ap {} configuration: channel {} in expected {} chan_width {} in expected {}" .format(element_list[0], controller_channel, element_list[8], self.chan_width, @@ -1876,8 +1867,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl parser.add_argument('-c', '--csv_output', help="Generate csv output", default=True) parser.add_argument('-r', '--radio', action='append', nargs=1, help='--radio \ - \"radio== ssid== ssid_pw== security== wifimode==\" ' - , required=False) + \"radio== ssid== ssid_pw== security== wifimode==\" ', required=False) parser.add_argument('-ul_bps', '--side_a_tx_min_bps', help='--side_a_tx_min_bps , upload (A side tx) min tx rate bps default 256000 500000000', default="256000 1000000000") From febb426e3c6fd54b093a0b9d6fa8ed0a8c2b93fd Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:05:46 -0800 Subject: [PATCH 521/731] lf_snp_test: Fix unreliable None comparisons Signed-off-by: Matthew Stidham --- py-scripts/lf_snp_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/lf_snp_test.py b/py-scripts/lf_snp_test.py index babccc5c..7309cfeb 100755 --- a/py-scripts/lf_snp_test.py +++ b/py-scripts/lf_snp_test.py @@ -1971,7 +1971,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl ############################################### report = lf_report(_results_dir_name="Scaling_and_Performance", _output_html="snp.html", _output_pdf="snp.pdf") - if args.csv_outfile != None: + if args.csv_outfile: current_time = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime()) csv_outfile = "details_{}_{}.csv".format(args.csv_outfile, current_time) csv_outfile = report.file_add_path(csv_outfile) @@ -2885,7 +2885,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl # Build Results # ########################################## - if args.csv_outfile != None: + if args.csv_outfile: logg.info("Report CSV Details: {}".format(csv_outfile)) logg.info("Report CSV Results: {}".format(csv_results)) report.set_title("Scaling And Performance") From 72efa0c69c644f99e9cc9b26777f9b69b3943e71 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:14:23 -0800 Subject: [PATCH 522/731] lf_snp_test: Make argparse more verbose Signed-off-by: Matthew Stidham --- py-scripts/lf_snp_test.py | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/py-scripts/lf_snp_test.py b/py-scripts/lf_snp_test.py index 7309cfeb..0ea32b7f 100755 --- a/py-scripts/lf_snp_test.py +++ b/py-scripts/lf_snp_test.py @@ -1535,7 +1535,6 @@ def valid_endp_types(_endp_type): ############################################################ def main(): global logg - lfjson_host = "localhost" lfjson_port = 8080 debug_on = False @@ -1881,7 +1880,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl parser.add_argument('-noc', '--no_controller', help='-noc / --no_controller no configuration of the controller', action='store_true') parser.add_argument('-nos', '--no_stations', help='-nos / --no_stations , no stations', action='store_true') - parser.add_argument('-wto', '--wait_timeout', help='-wto / --wait_timeout , time to wait for stations to get IP ', + parser.add_argument('-wto', '--wait_timeout', type=int, help='-wto / --wait_timeout , time to wait for stations to get IP ', default="360") parser.add_argument('-ptc', '--print_test_config', help='-ptc / --print_test_config , print out the test configuration and exit', @@ -1900,23 +1899,6 @@ LANforge GUI what is displayed in the Column and how to access the value with cl ############################################################### # Gather Test Data ############################################################### - if args.test_duration: - test_duration = args.test_duration - - if args.polling_interval: - polling_interval = args.polling_interval - - if args.mgr: - lfjson_host = args.mgr - - if args.upstream_port: - side_b = args.upstream_port - - if args.radio: - radios = args.radio - - if args.wait_timeout: - wait_timeout = int(args.wait_timeout) if args.controller_scheme: __scheme = args.controller_scheme @@ -2400,8 +2382,8 @@ LANforge GUI what is displayed in the Column and how to access the value with cl "controller_data_encryptions ('-cde','--controller_data_encryptions') {}".format(controller_data_encryptions)) logg.info("controller_side_a_tx_min_bps ('-amr','--side_a_tx_min_bps'): {}".format(controller_side_a_tx_min_bps)) logg.info("controller_side_b_tx_min_bps ('-bmr','--side_b_tx_min_bps'): {}".format(controller_side_b_tx_min_bps)) - logg.info("test duration ('-d','--test_duration'): {}".format(test_duration)) - logg.info("polling_interval ('-pi','--polling_interval'): {}".format(polling_interval)) + logg.info("test duration ('-d','--test_duration'): {}".format(args.test_duration)) + logg.info("polling_interval ('-pi','--polling_interval'): {}".format(args.polling_interval)) if args.radio: logg.info("radios from command line used") @@ -2822,7 +2804,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl _ap_dict=ap_dict, endp_type=controller_packet_type, tos=args.tos, - side_b=side_b, + side_b=args.upstream_port, radio_name_list=radio_name_list, number_of_stations_per_radio_list=number_of_stations_per_radio_list, ssid_list=ssid_list, @@ -2832,7 +2814,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl station_lists=station_lists, name_prefix="LT-", debug_on=debug_on, - wait_timeout=wait_timeout, + wait_timeout=args.wait_timeout, outfile=csv_outfile, results=csv_results, test_keys=test_keys, @@ -2850,9 +2832,9 @@ LANforge GUI what is displayed in the Column and how to access the value with cl side_b_min_pdu=controller_pdu, side_b_max_pdu=0, number_template="00", - test_duration=test_duration, - polling_interval=polling_interval, - lfclient_host=lfjson_host, + test_duration=args.test_duration, + polling_interval=args.polling_interval, + lfclient_host=args.mgr, lfclient_port=lfjson_port) __csv_started = True ip_var_test.pre_cleanup() From 71467c2c237df8353b0606c95a5e90dca06a2a32 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:15:35 -0800 Subject: [PATCH 523/731] lf_snp_test: fix whitespace problems Signed-off-by: Matthew Stidham --- py-scripts/lf_snp_test.py | 92 ++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 41 deletions(-) diff --git a/py-scripts/lf_snp_test.py b/py-scripts/lf_snp_test.py index 0ea32b7f..05c183c1 100755 --- a/py-scripts/lf_snp_test.py +++ b/py-scripts/lf_snp_test.py @@ -593,7 +593,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -627,7 +628,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -654,7 +656,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -683,7 +686,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -714,7 +718,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -744,7 +749,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -772,7 +778,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -797,7 +804,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -825,7 +833,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) else: @@ -850,7 +859,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -877,7 +887,8 @@ class CreateCtlr: except subprocess.CalledProcessError as process_error: logg.info( - "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) + "Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format( + process_error.returncode, process_error.output)) time.sleep(1) exit(1) @@ -914,11 +925,12 @@ class CreateCtlr: if (str(controller_channel) in str(element_list[8])) and ( str(self.chan_width) in str(element_list[5])): logg.info( - "ap {} configuration successful: channel {} in expected {} chan_width {} in expected {}".format(element_list[0], - controller_channel, - element_list[8], - self.chan_width, - element_list[5])) + "ap {} configuration successful: channel {} in expected {} chan_width {} in expected {}".format( + element_list[0], + controller_channel, + element_list[8], + self.chan_width, + element_list[5])) else: logg.info("WARNING ap {} configuration: channel {} in expected {} chan_width {} in expected {}" .format(element_list[0], controller_channel, element_list[8], self.chan_width, @@ -1866,7 +1878,8 @@ LANforge GUI what is displayed in the Column and how to access the value with cl parser.add_argument('-c', '--csv_output', help="Generate csv output", default=True) parser.add_argument('-r', '--radio', action='append', nargs=1, help='--radio \ - \"radio== ssid== ssid_pw== security== wifimode==\" ', required=False) + \"radio== ssid== ssid_pw== security== wifimode==\" ', + required=False) parser.add_argument('-ul_bps', '--side_a_tx_min_bps', help='--side_a_tx_min_bps , upload (A side tx) min tx rate bps default 256000 500000000', default="256000 1000000000") @@ -1880,7 +1893,8 @@ LANforge GUI what is displayed in the Column and how to access the value with cl parser.add_argument('-noc', '--no_controller', help='-noc / --no_controller no configuration of the controller', action='store_true') parser.add_argument('-nos', '--no_stations', help='-nos / --no_stations , no stations', action='store_true') - parser.add_argument('-wto', '--wait_timeout', type=int, help='-wto / --wait_timeout , time to wait for stations to get IP ', + parser.add_argument('-wto', '--wait_timeout', type=int, + help='-wto / --wait_timeout , time to wait for stations to get IP ', default="360") parser.add_argument('-ptc', '--print_test_config', help='-ptc / --print_test_config , print out the test configuration and exit', @@ -2531,10 +2545,10 @@ LANforge GUI what is displayed in the Column and how to access the value with cl logg.info( "###################################################################") logg.info( - "# TEST RUNNING direction:{} ul: {} , TEST RUNNING dl: {}" - .format(controller_direction, - side_a_tx_min_bps_ul, - side_b_tx_min_bps_dl)) + "# TEST RUNNING direction:{} ul: {} , TEST RUNNING dl: {}".format( + controller_direction, + side_a_tx_min_bps_ul, + side_b_tx_min_bps_dl)) logg.info( "####################################################################") test_config = "AP=={} Band=={} chan_5ghz=={} chan_24ghz=={} wifi_mode=={} BW=={} encryption=={} ap_mode=={} clients=={} packet_type=={} direction=={} pdu=={}".format( @@ -2564,8 +2578,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl controller_ap_mode != __ap_mode_set or controller_tx_power != __tx_power_set or controller_chan_5ghz != __chan_5ghz_set or - controller_chan_24ghz != __chan_24ghz_set - ): + controller_chan_24ghz != __chan_24ghz_set): logg.info( "###############################################") logg.info( @@ -2594,8 +2607,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl controller_ap_mode != __ap_mode_set or controller_tx_power != __tx_power_set or controller_chan_5ghz != __chan_5ghz_set or - controller_chan_24ghz != __chan_24ghz_set - ): + controller_chan_24ghz != __chan_24ghz_set): logg.info( "###############################################") logg.info( @@ -2670,19 +2682,19 @@ LANforge GUI what is displayed in the Column and how to access the value with cl logg.info( "###############################################") logg.info( - "controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}" - .format(controller_ap, controller_band, - controller_chan_width, - controller_ap_mode, - controller_tx_power, - controller_chan_5ghz, - controller_chan_24ghz)) + "controller_ap: {} controller_band: {} controller_chan_width: {} controller_ap_mode: {} controller_tx_power: {} controller_chan_5ghz: {} controller_chan_24ghz: {}".format( + controller_ap, controller_band, + controller_chan_width, + controller_ap_mode, + controller_tx_power, + controller_chan_5ghz, + controller_chan_24ghz)) logg.info( - "__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}" - .format(__ap_set, __band_set, - __chan_width_set, __ap_mode_set, - __tx_power_set, __chan_5ghz_set, - __chan_24ghz_set)) + "__ap_set: {} __band_set: {} __chan_width_set: {} __ap_mode_set: {} __tx_power_set: {} __chan_5ghz_set: {} __chan_24ghz_set: {}".format( + __ap_set, __band_set, + __chan_width_set, __ap_mode_set, + __tx_power_set, __chan_5ghz_set, + __chan_24ghz_set)) logg.info("controller_wifi_mode {}".format( controller_wifimode)) logg.info("radios {}".format(radios)) @@ -2757,9 +2769,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl station_lists = [] for ( radio_name_, - number_of_stations_per_radio_) in zip( - radio_name_list, - number_of_stations_per_radio_list): + number_of_stations_per_radio_) in zip(radio_name_list, number_of_stations_per_radio_list): number_of_stations = int( number_of_stations_per_radio_) if number_of_stations > MAX_NUMBER_OF_STATIONS: From 4ce15f8bf361304d38bfa12a0fa92b7923e5bd9e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:17:08 -0800 Subject: [PATCH 524/731] lf_tr398v2_test: fix mutable default arguments Signed-off-by: Matthew Stidham --- py-scripts/lf_tr398v2_test.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/py-scripts/lf_tr398v2_test.py b/py-scripts/lf_tr398v2_test.py index 3be1b939..16864836 100755 --- a/py-scripts/lf_tr398v2_test.py +++ b/py-scripts/lf_tr398v2_test.py @@ -291,13 +291,21 @@ class TR398v2Test(cvtest): raw_lines_file="", dut5="", dut2="", - enables=[], - disables=[], - raw_lines=[], - sets=[], + enables=None, + disables=None, + raw_lines=None, + sets=None, ): super().__init__(lfclient_host=lf_host, lfclient_port=lf_port) + if enables is None: + enables = [] + if disables is None: + disables = [] + if raw_lines is None: + raw_lines = [] + if sets is None: + sets = [] self.lf_host = lf_host self.lf_port = lf_port self.lf_user = lf_user From 06c255314e4a0a8d51e064a509b7af3a01fd07c6 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:17:37 -0800 Subject: [PATCH 525/731] lf_tr398v2_test: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/lf_tr398v2_test.py | 43 ++++++++++++++++------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/py-scripts/lf_tr398v2_test.py b/py-scripts/lf_tr398v2_test.py index 16864836..04896fe0 100755 --- a/py-scripts/lf_tr398v2_test.py +++ b/py-scripts/lf_tr398v2_test.py @@ -266,7 +266,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) cv_test_manager = importlib.import_module("py-json.cv_test_manager") @@ -309,7 +308,7 @@ class TR398v2Test(cvtest): self.lf_host = lf_host self.lf_port = lf_port self.lf_user = lf_user - self.lf_password =lf_password + self.lf_password = lf_password self.instance_name = instance_name self.config_name = config_name self.dut5 = dut5 @@ -330,13 +329,12 @@ class TR398v2Test(cvtest): # Nothing to do at this time. return - def run(self): self.sync_cv() time.sleep(2) self.sync_cv() - blob_test = "TR398v2-"; + blob_test = "TR398v2-" self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name self.show_text_blob(None, None, False) @@ -370,7 +368,6 @@ class TR398v2Test(cvtest): def main(): - parser = argparse.ArgumentParser(""" Open this file in an editor and read the top notes for more details. @@ -427,25 +424,25 @@ def main(): cv_base_adjust_parser(args) - CV_Test = TR398v2Test(lf_host = args.mgr, - lf_port = args.port, - lf_user = args.lf_user, - lf_password = args.lf_password, - instance_name = args.instance_name, - config_name = args.config_name, - upstream = args.upstream, - pull_report = args.pull_report, - local_lf_report_dir = args.local_lf_report_dir, - load_old_cfg = args.load_old_cfg, - dut2 = args.dut2, - dut5 = args.dut5, - raw_lines_file = args.raw_lines_file, - enables = args.enable, - disables = args.disable, - raw_lines = args.raw_line, - sets = args.set, + CV_Test = TR398v2Test(lf_host=args.mgr, + lf_port=args.port, + lf_user=args.lf_user, + lf_password=args.lf_password, + instance_name=args.instance_name, + config_name=args.config_name, + upstream=args.upstream, + pull_report=args.pull_report, + local_lf_report_dir=args.local_lf_report_dir, + load_old_cfg=args.load_old_cfg, + dut2=args.dut2, + dut5=args.dut5, + raw_lines_file=args.raw_lines_file, + enables=args.enable, + disables=args.disable, + raw_lines=args.raw_line, + sets=args.set, test_rig=args.test_rig - ) + ) CV_Test.setup() CV_Test.run() From 3157b938b065df18e92878c710ffd1caf4aa0ed6 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:18:56 -0800 Subject: [PATCH 526/731] lf_wifi_capacity_test: fix mutable default arguments Signed-off-by: Matthew Stidham --- py-scripts/lf_wifi_capacity_test.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/py-scripts/lf_wifi_capacity_test.py b/py-scripts/lf_wifi_capacity_test.py index b457e4a8..bc469e9c 100755 --- a/py-scripts/lf_wifi_capacity_test.py +++ b/py-scripts/lf_wifi_capacity_test.py @@ -347,11 +347,11 @@ class WiFiCapacityTest(cv_test): security="open", paswd="[BLANK]", ssid="", - enables=[], - disables=[], - raw_lines=[], + enables=None, + disables=None, + raw_lines=None, raw_lines_file="", - sets=[], + sets=None, influx_host="localhost", influx_port=8086, report_dir="", @@ -362,6 +362,14 @@ class WiFiCapacityTest(cv_test): ): super().__init__(lfclient_host=lfclient_host, lfclient_port=lf_port) + if enables is None: + enables = [] + if disables is None: + disables = [] + if raw_lines is None: + raw_lines = [] + if sets is None: + sets = [] self.lfclient_host = lfclient_host self.lf_port = lf_port self.lf_user = lf_user @@ -534,7 +542,7 @@ def main(): parser.add_argument("--report_dir", default="") parser.add_argument("--scenario", default="") parser.add_argument("--graph_groups", help="File to save graph groups to", default=None) - parser.add_argument("--local_lf_report_dir", help="--local_lf_report_dir default '' put where dataplane script run from",default="") + parser.add_argument("--local_lf_report_dir", help="--local_lf_report_dir default '' put where dataplane script run from", default="") args = parser.parse_args() From b8a644895ee13a4f6724d2a1b34fdfd78dda22e2 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 24 Nov 2021 08:50:55 -0700 Subject: [PATCH 527/731] test_l3_longevity.py : changed port_data variable from p -> port_data Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 62 ++++++++++++++++----------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 55816ef6..fa87a8f1 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -1155,11 +1155,11 @@ class L3VariableTime(Realm): else: # print("response".format(response)) pprint(response) - p = response['interface'] + port_data = response['interface'] print( - "#### 6g From LANforge: p, response['insterface']:{}".format(p)) - mac = p['mac'] - # print("#### From LANforge: p['mac']: + "#### 6g From LANforge: port_data, response['insterface']:{}".format(p)) + mac = port_data['mac'] + # print("#### From LANforge: port_data['mac']: # {mac}".format(mac=mac)) # Parse the ap stats to find the matching @@ -1260,11 +1260,11 @@ class L3VariableTime(Realm): else: # print("response".format(response)) pprint(response) - p = response['interface'] + port_data = response['interface'] print( - "#### 6g From LANforge: p, response['insterface']:{}".format(p)) - mac = p['mac'] - # print("#### From LANforge: p['mac']: + "#### 6g From LANforge: port_data, response['insterface']:{}".format(p)) + mac = port_data['mac'] + # print("#### From LANforge: port_data['mac']: # {mac}".format(mac=mac)) # Parse the ap stats to find the matching @@ -1314,7 +1314,7 @@ class L3VariableTime(Realm): dl_pdu_str, atten_val, eid_name, - p, + port_data, latency, jitter, total_ul_rate, @@ -1370,11 +1370,11 @@ class L3VariableTime(Realm): else: # print("response".format(response)) pprint(response) - p = response['interface'] + port_data = response['interface'] print( - "#### From LANforge: p, response['insterface']:{}".format(p)) - mac = p['mac'] - # print("#### From LANforge: p['mac']: + "#### From LANforge: port_data, response['insterface']:{}".format(p)) + mac = port_data['mac'] + # print("#### From LANforge: port_data['mac']: # {mac}".format(mac=mac)) # Parse the ap stats to find the matching @@ -1473,7 +1473,7 @@ class L3VariableTime(Realm): dl_pdu_str, atten_val, eid_name, - p, + port_data, latency, jitter, total_ul_rate, @@ -1500,11 +1500,11 @@ class L3VariableTime(Realm): else: # print("response".format(response)) pprint(response) - p = response['interface'] + port_data = response['interface'] print( - "#### 5g From LANforge: p, response['insterface']:{}".format(p)) - mac = p['mac'] - # print("#### From LANforge: p['mac']: + "#### 5g From LANforge: port_data, response['insterface']:{}".format(p)) + mac = port_data['mac'] + # print("#### From LANforge: port_data['mac']: # {mac}".format(mac=mac)) # Parse the ap stats to find the matching @@ -1553,7 +1553,7 @@ class L3VariableTime(Realm): dl_pdu_str, atten_val, eid_name, - p, + port_data, latency, jitter, total_ul_rate, @@ -1609,11 +1609,11 @@ class L3VariableTime(Realm): else: # print("response".format(response)) pprint(response) - p = response['interface'] - # print("#### From LANforge: p, + port_data = response['interface'] + # print("#### From LANforge: port_data, # response['insterface']:{}".format(p)) - mac = p['mac'] - # print("#### From LANforge: p['mac']: + mac = port_data['mac'] + # print("#### From LANforge: port_data['mac']: # {mac}".format(mac=mac)) # Parse the ap stats to find the matching @@ -1712,7 +1712,7 @@ class L3VariableTime(Realm): dl_pdu_str, atten_val, eid_name, - p, + port_data, latency, jitter, total_ul_rate, @@ -1738,11 +1738,11 @@ class L3VariableTime(Realm): else: # print("response".format(response)) pprint(response) - p = response['interface'] + port_data = response['interface'] print( - "#### 2g From LANforge: p, response['insterface']:{}".format(p)) - mac = p['mac'] - # print("#### From LANforge: p['mac']: + "#### 2g From LANforge: port_data, response['insterface']:{}".format(p)) + mac = port_data['mac'] + # print("#### From LANforge: port_data['mac']: # {mac}".format(mac=mac)) # Parse the ap stats to find the matching @@ -1791,7 +1791,7 @@ class L3VariableTime(Realm): dl_pdu_str, atten_val, eid_name, - p, + port_data, latency, jitter, total_ul_rate, @@ -1818,7 +1818,7 @@ class L3VariableTime(Realm): "query-port: %s: incomplete response:" % (url)) pprint(response) else: - p = response['interface'] + port_data = response['interface'] latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( p["port"], endps) @@ -1830,7 +1830,7 @@ class L3VariableTime(Realm): dl_pdu_str, atten_val, eid_name, - p, + port_data, latency, jitter, total_ul_rate, From 9a66e91fde9a74006268d48c89bb837e9ac3b4fa Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 29 Nov 2021 11:59:19 -0700 Subject: [PATCH 528/731] test_l3_longevity.py added comments for the layer3_cols flags lf_qa.py comments updates for sub-tests Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 142 ++++++++++++++++++++++++++++++++ py-scripts/tools/lf_qa.py | 4 + 2 files changed, 146 insertions(+) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index fa87a8f1..b641f4c8 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -2517,6 +2517,148 @@ Setting wifi_settings per radio use-bss-transition | 0x80000000000 # Enable BSS transition. disable-twt | 0x100000000000 # Disable TWT mode +=============================================================================== + ** FURTHER INFORMATION ** + Using the layer3_cols flag: + + Currently the output function does not support inputting the columns in layer3_cols the way they are displayed in the GUI. This quirk is under construction. To output + certain columns in the GUI in your final report, please match the according GUI column display to it's counterpart to have the columns correctly displayed in + your report. + + GUI Column Display Layer3_cols argument to type in (to print in report) + + Name | 'name' + EID | 'eid' + Run | 'run' + Mng | 'mng' + Script | 'script' + Tx Rate | 'tx rate' + Tx Rate (1 min) | 'tx rate (1 min)' + Tx Rate (last) | 'tx rate (last)' + Tx Rate LL | 'tx rate ll' + Rx Rate | 'rx rate' + Rx Rate (1 min) | 'rx rate (1 min)' + Rx Rate (last) | 'rx rate (last)' + Rx Rate LL | 'rx rate ll' + Rx Drop % | 'rx drop %' + Tx PDUs | 'tx pdus' + Tx Pkts LL | 'tx pkts ll' + PDU/s TX | 'pdu/s tx' + Pps TX LL | 'pps tx ll' + Rx PDUs | 'rx pdus' + Rx Pkts LL | 'pps rx ll' + PDU/s RX | 'pdu/s tx' + Pps RX LL | 'pps rx ll' + Delay | 'delay' + Dropped | 'dropped' + Jitter | 'jitter' + Tx Bytes | 'tx bytes' + Rx Bytes | 'rx bytes' + Replays | 'replays' + TCP Rtx | 'tcp rtx' + Dup Pkts | 'dup pkts' + Rx Dup % | 'rx dup %' + OOO Pkts | 'ooo pkts' + Rx OOO % | 'rx ooo %' + RX Wrong Dev | 'rx wrong dev' + CRC Fail | 'crc fail' + RX BER | 'rx ber' + CX Active | 'cx active' + CX Estab/s | 'cx estab/s' + 1st RX | '1st rx' + CX TO | 'cx to' + Pattern | 'pattern' + Min PDU | 'min pdu' + Max PDU | 'max pdu' + Min Rate | 'min rate' + Max Rate | 'max rate' + Send Buf | 'send buf' + Rcv Buf | 'rcv buf' + CWND | 'cwnd' + TCP MSS | 'tcp mss' + Bursty | 'bursty' + A/B | 'a/b' + Elapsed | 'elapsed' + Destination Addr | 'destination addr' + Source Addr | 'source addr' + + Using the port_mgr_cols flag: + '4way time (us)' + 'activity' + 'alias' + 'anqp time (us)' + 'ap' + 'beacon' + 'bps rx' + 'bps rx ll' + 'bps tx' + 'bps tx ll' + 'bytes rx ll' + 'bytes tx ll' + 'channel' + 'collisions' + 'connections' + 'crypt' + 'cx ago' + 'cx time (us)' + 'device' + 'dhcp (ms)' + 'down' + 'entity id' + 'gateway ip' + 'ip' + 'ipv6 address' + 'ipv6 gateway' + 'key/phrase' + 'login-fail' + 'login-ok' + 'logout-fail' + 'logout-ok' + 'mac' + 'mask' + 'misc' + 'mode' + 'mtu' + 'no cx (us)' + 'noise' + 'parent dev' + 'phantom' + 'port' + 'port type' + 'pps rx' + 'pps tx' + 'qlen' + 'reset' + 'retry failed' + 'rx bytes' + 'rx crc' + 'rx drop' + 'rx errors' + 'rx fifo' + 'rx frame' + 'rx length' + 'rx miss' + 'rx over' + 'rx pkts' + 'rx-rate' + 'sec' + 'signal' + 'ssid' + 'status' + 'time-stamp' + 'tx abort' + 'tx bytes' + 'tx crr' + 'tx errors' + 'tx fifo' + 'tx hb' + 'tx pkts' + 'tx wind' + 'tx-failed %' + 'tx-rate' + 'wifi retries' + + Can't decide what columns to use? You can just use 'all' to select all available columns from both tables. ''') diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index b309cad8..1513c069 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -392,6 +392,10 @@ class csv_sql: print("test_rig_list: {}".format(test_rig_list)) # TODO determin the subtest pass and fail graph + # df is sorted by date oldest to newest + # get the test_run for last run + # query the db for all pass and fail or last run + # put in table # create the rest of the graphs for test_rig in test_rig_list: From f6f63f28165d51077d8ca62fb096d0a6e4c325e8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:28:05 -0800 Subject: [PATCH 529/731] test_l3_longevity: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/test_l3_longevity.py | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index b641f4c8..f5b722c6 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -''' +""" NAME: test_l3_longevity.py PURPOSE: @@ -55,7 +55,7 @@ COPYRIGHT: Copyright 2021 Candela Technologies Inc INCLUDE_IN_README -''' +""" import argparse import csv import datetime @@ -319,7 +319,7 @@ class L3VariableTime(Realm): dur = self.duration_time_to_seconds(self.test_duration) - if (self.polling_interval_seconds > dur + 1): + if self.polling_interval_seconds > dur + 1: self.polling_interval_seconds = dur - 1 # Full spread-sheet data @@ -607,12 +607,12 @@ class L3VariableTime(Realm): # Make sure they are gone count = 0 - while (count < 10): + while count < 10: more = False for station_list in self.station_lists: for sta in station_list: rv = self.rm_port(sta, check_exists=True) - if (rv): + if rv: more = True if not more: break @@ -655,9 +655,9 @@ class L3VariableTime(Realm): these_cx, these_endp = self.cx_profile.create( endp_type=etype, side_a=[ self.side_a], side_b=self.side_b, sleep_time=0, tos=_tos) - if (etype == "lf_udp" or etype == "lf_udp6"): + if etype == "lf_udp" or etype == "lf_udp6": self.udp_endps = self.udp_endps + these_endp - elif(etype == "lf"): + elif etype == "lf": self.lf_endps = self.eth_endps + these_endp else: self.tcp_endps = self.tcp_endps + these_endp @@ -689,7 +689,7 @@ class L3VariableTime(Realm): if etype == "mc_udp" or etype == "mc_udp6": print( "Creating Multicast connections for endpoint type: %s" % - (etype)) + etype) self.multicast_profile.create_mc_tx( etype, self.side_b, etype) self.multicast_profile.create_mc_rx( @@ -701,7 +701,7 @@ class L3VariableTime(Realm): (etype, _tos, self.cx_profile.get_cx_count())) these_cx, these_endp = self.cx_profile.create( endp_type=etype, side_a=station_profile.station_names, side_b=self.side_b, sleep_time=0, tos=_tos) - if (etype == "lf_udp" or etype == "lf_udp6"): + if etype == "lf_udp" or etype == "lf_udp6": self.udp_endps = self.udp_endps + these_endp else: self.tcp_endps = self.tcp_endps + these_endp @@ -711,7 +711,7 @@ class L3VariableTime(Realm): if self.dataplane: self._pass( "PASS: CX build finished: created/updated: %s connections." % - (self.cx_count)) + self.cx_count) else: self._pass( "PASS: Stations & CX build finished: created/updated: %s stations and %s connections." % @@ -941,7 +941,7 @@ class L3VariableTime(Realm): self.admin_up(self.side_b) for station_profile in self.station_profiles: for sta in station_profile.station_names: - print("Bringing up station %s" % (sta)) + print("Bringing up station %s" % sta) self.admin_up(sta) temp_stations_list = [] @@ -1002,10 +1002,10 @@ class L3VariableTime(Realm): dl_pdu_str = dl_pdu ul_pdu_str = ul_pdu - if (ul_pdu == "AUTO" or ul_pdu == "MTU"): + if ul_pdu == "AUTO" or ul_pdu == "MTU": ul_pdu = "-1" - if (dl_pdu == "AUTO" or dl_pdu == "MTU"): + if dl_pdu == "AUTO" or dl_pdu == "MTU": dl_pdu = "-1" print( @@ -1051,7 +1051,7 @@ class L3VariableTime(Realm): print( "Monitoring throughput for duration: %s" % - (self.test_duration)) + self.test_duration) # Monitor test for the interval duration. passes = 0 @@ -1150,7 +1150,7 @@ class L3VariableTime(Realm): "interface" not in response): print( "6g query-port: %s: incomplete response:" % - (url)) + url) pprint(response) else: # print("response".format(response)) @@ -1255,7 +1255,7 @@ class L3VariableTime(Realm): "interface" not in response): print( "6g query-port: %s: incomplete response:" % - (url)) + url) pprint(response) else: # print("response".format(response)) @@ -1365,7 +1365,7 @@ class L3VariableTime(Realm): "interface" not in response): print( "query-port 5g: %s: incomplete response:" % - (url)) + url) pprint(response) else: # print("response".format(response)) @@ -1495,7 +1495,7 @@ class L3VariableTime(Realm): "interface" not in response): print( "5g query-port: %s: incomplete response:" % - (url)) + url) pprint(response) else: # print("response".format(response)) @@ -1604,7 +1604,7 @@ class L3VariableTime(Realm): "interface" not in response): print( "2g query-port: %s: incomplete response:" % - (url)) + url) pprint(response) else: # print("response".format(response)) @@ -1733,7 +1733,7 @@ class L3VariableTime(Realm): "interface" not in response): print( "5g query-port: %s: incomplete response:" % - (url)) + url) pprint(response) else: # print("response".format(response)) @@ -1815,7 +1815,7 @@ class L3VariableTime(Realm): if (response is None) or ( "interface" not in response): print( - "query-port: %s: incomplete response:" % (url)) + "query-port: %s: incomplete response:" % url) pprint(response) else: port_data = response['interface'] @@ -3170,16 +3170,16 @@ Setting wifi_settings per radio attenuators = [] else: attenuators = args.attenuators.split(",") - if (args.atten_vals == ""): + if args.atten_vals == "": atten_vals = [-1] else: atten_vals = args.atten_vals.split(",") - if (len(ul_rates) != len(dl_rates)): + if len(ul_rates) != len(dl_rates): print( "ERROR: ul_rates %s and dl_rates %s arrays must be same length\n" % (len(ul_rates), len(dl_rates))) - if (len(ul_pdus) != len(dl_pdus)): + if len(ul_pdus) != len(dl_pdus): print( "ERROR: ul_pdus %s and dl_pdus %s arrays must be same length\n" % (len(ul_rates), len(dl_rates))) From eaaed43f1e8ae98cf81ac8881d2c9c44d84245a0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:29:53 -0800 Subject: [PATCH 530/731] test_l3_longevity: Use the staticmethod class where relevant Signed-off-by: Matthew Stidham --- py-scripts/test_l3_longevity.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index f5b722c6..bcb62b8c 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -901,7 +901,8 @@ class L3VariableTime(Realm): # provide fake bs_data for testing without AP wl2 is the 6E interface, wl1 # 5G, wl0 2G - def read_ap_rx_report_test_mode(self): + @staticmethod + def read_ap_rx_report_test_mode(): ap_rx_report_fake = "{}{}{}{}{}".format( "root@Docsis-Gateway:~# wl -i wl1 rx_report\n", "Station Address (rssi) tid ampdu mpdu Data Mbps PHY Mbps bw mcs Nss oow holes dup rtries ofdma tones air\n", @@ -913,7 +914,8 @@ class L3VariableTime(Realm): # -\n" return ap_rx_report_fake - def read_ap_bs_data_test_mode(self): + @staticmethod + def read_ap_bs_data_test_mode(): ap_stats_fake = "{}{}{}{}{}{}".format( "root@Docsis-Gateway:~# wl -i wl2 bs_data\n", "Station Address PHY Mbps Data Mbps Air Use Data Use Retries bw mcs Nss ofdma mu-mimo\n", @@ -925,7 +927,8 @@ class L3VariableTime(Realm): # print("ap_stats_fake {}".format(ap_stats_fake)) return ap_stats_fake - def read_ap_chanim_stats_test_mode(self): + @staticmethod + def read_ap_chanim_stats_test_mode(): # Create the test data as a continuous string ap_chanim_stats_fake = "{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl2 chanim_stats\n", "version: 3\n", @@ -2175,7 +2178,8 @@ class L3VariableTime(Realm): for station_profile in self.station_profiles: station_profile.cleanup() - def csv_generate_column_headers(self): + @staticmethod + def csv_generate_column_headers(): csv_rx_headers = [ 'Time epoch', 'Time', @@ -2321,13 +2325,15 @@ class L3VariableTime(Realm): ul_port_csv_writer.writerow(headers) pfile.flush() - def csv_validate_list(self, csv_list, length): + @staticmethod + def csv_validate_list(csv_list, length): if len(csv_list) < length: csv_list = csv_list + [('no data', 'no data')] * \ (length - len(csv_list)) return csv_list - def csv_add_row(self, row, writer, csv_file): + @staticmethod + def csv_add_row(row, writer, csv_file): if csv_file is not None: writer.writerow(row) csv_file.flush() From 2a12e63914e26e2f6496928fa88744518881f477 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:31:45 -0800 Subject: [PATCH 531/731] test_l3_longevity: Remove unused variables Signed-off-by: Matthew Stidham --- py-scripts/test_l3_longevity.py | 42 +++++++-------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index bcb62b8c..f8a24a71 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -1048,7 +1048,7 @@ class L3VariableTime(Realm): cur_time = datetime.datetime.now() print("Getting initial values.") - old_rx_values, rx_drop_percent, endps, total_dl_bps, total_ul_bps, total_dl_ll_bps, total_ul_ll_bps = self.__get_rx_values() + self.__get_rx_values() end_time = self.parse_time(self.test_duration) + cur_time @@ -1063,7 +1063,6 @@ class L3VariableTime(Realm): total_ul_bps = 0 total_dl_ll_bps = 0 total_ul_ll_bps = 0 - endps = [] ap_row = [] mac_found_ul_6g = False mac_found_ul_5g = False @@ -1072,14 +1071,6 @@ class L3VariableTime(Realm): mac_found_5g = False mac_found_2g = False reset_timer = 0 - latency = 0 - jitter = 0 - total_ul_rate = 0 - total_ul_rate_ll = 0 - total_ul_pkts_ll = 0 - total_dl_rate = 0 - total_dl_rate_ll = 0 - total_dl_pkts_ll = 0 while cur_time < end_time: # interval_time = cur_time + datetime.timedelta(seconds=5) @@ -1197,8 +1188,7 @@ class L3VariableTime(Realm): # Find latency, jitter for connections # using this port. - latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) + self.get_endp_stats_for_port(p["port"], endps) # now report the ap_chanim_stats along # side of the ap_stats_6g @@ -1912,8 +1902,6 @@ class L3VariableTime(Realm): self.cx_profile.stop_cx() self.multicast_profile.stop_mc() - cur_time = datetime.datetime.now() - if passes == expected_passes: self._pass( "PASS: Requested-Rate: %s <-> %s PDU: %s <-> %s All tests passed" % @@ -2180,20 +2168,9 @@ class L3VariableTime(Realm): @staticmethod def csv_generate_column_headers(): - csv_rx_headers = [ - 'Time epoch', - 'Time', - 'Monitor', - 'UL-Min-Requested', - 'UL-Max-Requested', - 'DL-Min-Requested', - 'DL-Max-Requested', - 'UL-Min-PDU', - 'UL-Max-PDU', - 'DL-Min-PDU', - 'DL-Max-PDU', - ] - csv_rx_headers.append("average_rx_data_bytes") + csv_rx_headers = ['Time epoch', 'Time', 'Monitor', 'UL-Min-Requested', 'UL-Max-Requested', 'DL-Min-Requested', + 'DL-Max-Requested', 'UL-Min-PDU', 'UL-Max-PDU', 'DL-Min-PDU', 'DL-Max-PDU', + "average_rx_data_bytes"] return csv_rx_headers def csv_generate_port_column_headers(self): @@ -2294,7 +2271,7 @@ class L3VariableTime(Realm): return csv_rx_headers # Write initial headers to csv file. - def csv_add_column_headers(self, headers): + def csv_add_column_headers(self): if self.csv_kpi_file is not None: self.csv_kpi_writer.writerow( self.csv_generate_kpi_column_headers()) @@ -2367,7 +2344,6 @@ def main(): lfjson_host = "localhost" lfjson_port = 8080 endp_types = "lf_udp" - debug = False parser = argparse.ArgumentParser( prog='test_l3_longevity.py', @@ -3329,21 +3305,21 @@ Setting wifi_settings per radio print("getting ofdma ap data and writing to a file") file_date = report.get_date() - ap_ofdma_6g_data = ip_var_test.get_ap_ofdma_6g() + ip_var_test.get_ap_ofdma_6g() ap_ofdma_6g = "{}-{}".format(file_date, "ap_ofdma_6g_data.txt") ap_ofdma_6g = report.file_add_path(ap_ofdma_6g) ap_ofdma_6g_data = open(ap_ofdma_6g, "w") ap_ofdma_6g_data.write(str(ap_ofdma_6g_data)) ap_ofdma_6g_data.close() - ap_ofdma_5g_data = ip_var_test.get_ap_ofdma_5g() + ip_var_test.get_ap_ofdma_5g() ap_ofdma_5g = "{}-{}".format(file_date, "ap_ofdma_5g_data.txt") ap_ofdma_5g = report.file_add_path(ap_ofdma_5g) ap_ofdma_5g_data = open(ap_ofdma_5g, "w") ap_ofdma_5g_data.write(str(ap_ofdma_5g_data)) ap_ofdma_5g_data.close() - ap_ofdma_24g_data = ip_var_test.get_ap_ofdma_24g() + ip_var_test.get_ap_ofdma_24g() ap_ofdma_24g = "{}-{}".format(file_date, "ap_ofdma_24g_data.txt") ap_ofdma_24g = report.file_add_path(ap_ofdma_24g) ap_ofdma_24g_data = open(ap_ofdma_24g, "w") From a29d582e89cddd4256803b973aa65446113562f9 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:32:51 -0800 Subject: [PATCH 532/731] test_l3_longevity: Use set literal when possible Signed-off-by: Matthew Stidham --- py-scripts/test_l3_longevity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index f8a24a71..45be5a35 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -969,7 +969,7 @@ class L3VariableTime(Realm): csv_header = self.csv_generate_column_headers() # print(csv_header) - self.csv_add_column_headers(csv_header) + self.csv_add_column_headers() # dl - ports port_eids = self.gather_port_eids() @@ -3084,7 +3084,7 @@ Setting wifi_settings per radio if wifi_settings_found: # Check for additional flags - if set(('wifi_mode', 'enable_flags')).issubset( + if {'wifi_mode', 'enable_flags'}.issubset( radio_info_dict.keys()): print("wifi_settings flags set") else: From a45dbf191b79785b86a5f980424a12c0709cec57 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:41:19 -0800 Subject: [PATCH 533/731] regression_test: Fix test_l3_longevity command flags Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 5cee500f..9c1538db 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -344,7 +344,7 @@ else "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_udp lf_tcp' --upstream_port 1.1.$UPSTREAM --radio 'radio==1.1.wiphy0 stations==10 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --radio 'radio==1.1.wiphy1 stations==1 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --test_duration 5s --influx_host c7-graphana --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --influx_tag testbed regression_test --influx_tag DUT ROG -o longevity.csv" + "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_tcp' --upstream_port 1.1.$UPSTREAM --radio 'radio==1.1.wiphy0 stations==10 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --radio 'radio==1.1.wiphy1 stations==1 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --test_duration 5s --influx_host c7-graphana --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --influx_tag testbed regression_test --influx_tag DUT ROG -o longevity.csv" "./test_l3_powersave_traffic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" #"./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput -m $MGR" #./test_l3_unicast_traffic_gen From f622702ff35b25bb3f9886c570380e0bb39c662d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:44:52 -0800 Subject: [PATCH 534/731] regression-test: Use user defined variables for network on test_l3_longevity test Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 9c1538db..0e03c6da 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -344,7 +344,9 @@ else "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_tcp' --upstream_port 1.1.$UPSTREAM --radio 'radio==1.1.wiphy0 stations==10 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --radio 'radio==1.1.wiphy1 stations==1 ssid==ASUS_70 ssid_pw==[BLANK] security==open' --test_duration 5s --influx_host c7-graphana --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --influx_tag testbed regression_test --influx_tag DUT ROG -o longevity.csv" + "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_tcp' --upstream_port 1.1.$UPSTREAM --radio + 'radio==1.1.wiphy0 stations==10 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --radio + 'radio==1.1.wiphy1 stations==1 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --test_duration 5s --influx_host c7-graphana --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --influx_tag testbed regression_test --influx_tag DUT ROG -o longevity.csv" "./test_l3_powersave_traffic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" #"./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput -m $MGR" #./test_l3_unicast_traffic_gen From 5b0f6cfc59815c411f91ba76e6d76ba5b2cebb04 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:50:14 -0800 Subject: [PATCH 535/731] test_l3_longevity: Fix undefined variables Signed-off-by: Matthew Stidham --- py-scripts/test_l3_longevity.py | 36 ++++++++++++++------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 45be5a35..767a0a2e 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -1151,7 +1151,7 @@ class L3VariableTime(Realm): pprint(response) port_data = response['interface'] print( - "#### 6g From LANforge: port_data, response['insterface']:{}".format(p)) + "#### 6g From LANforge: port_data, response['insterface']:{}".format(port_data)) mac = port_data['mac'] # print("#### From LANforge: port_data['mac']: # {mac}".format(mac=mac)) @@ -1188,7 +1188,7 @@ class L3VariableTime(Realm): # Find latency, jitter for connections # using this port. - self.get_endp_stats_for_port(p["port"], endps) + self.get_endp_stats_for_port(port_data["port"], endps) # now report the ap_chanim_stats along # side of the ap_stats_6g @@ -1206,19 +1206,13 @@ class L3VariableTime(Realm): xtop = split_row[7] print( "6g xtop {xtop}".format(xtop=xtop)) + channel_utilization = float( + 100) - float(xtop) + print("6g channel_utilization {utilization}".format(utilization=channel_utilization)) except BaseException: print( "6g detected chanspec with reading chanim_stats, exception reading xtop") - try: - channel_utilization = float( - 100) - float(xtop) - print( - "6g channel_utilization {utilization}".format( - utilization=channel_utilization)) - except BaseException: - print( - "6g detected chanspec with reading chanim_stats, failed calcluating channel_utilization from xtop") # should be only one channel # utilization break @@ -1255,7 +1249,7 @@ class L3VariableTime(Realm): pprint(response) port_data = response['interface'] print( - "#### 6g From LANforge: port_data, response['insterface']:{}".format(p)) + "#### 6g From LANforge: port_data, response['insterface']:{}".format(port_data)) mac = port_data['mac'] # print("#### From LANforge: port_data['mac']: # {mac}".format(mac=mac)) @@ -1293,7 +1287,7 @@ class L3VariableTime(Realm): # Find latency, jitter for connections # using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) + port_data["port"], endps) print( "6g ap_ul_row {ap_ul_row}".format( @@ -1365,7 +1359,7 @@ class L3VariableTime(Realm): pprint(response) port_data = response['interface'] print( - "#### From LANforge: port_data, response['insterface']:{}".format(p)) + "#### From LANforge: port_data, response['insterface']:{}".format(port_data)) mac = port_data['mac'] # print("#### From LANforge: port_data['mac']: # {mac}".format(mac=mac)) @@ -1403,7 +1397,7 @@ class L3VariableTime(Realm): # Find latency, jitter for connections # using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) + port_data["port"], endps) # now report the ap_chanim_stats along # side of the ap_stats_5g @@ -1495,7 +1489,7 @@ class L3VariableTime(Realm): pprint(response) port_data = response['interface'] print( - "#### 5g From LANforge: port_data, response['insterface']:{}".format(p)) + "#### 5g From LANforge: port_data, response['insterface']:{}".format(port_data)) mac = port_data['mac'] # print("#### From LANforge: port_data['mac']: # {mac}".format(mac=mac)) @@ -1533,7 +1527,7 @@ class L3VariableTime(Realm): # Find latency, jitter for connections # using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) + port_data["port"], endps) print( "5g ap_ul_row {ap_ul_row}".format( @@ -1642,7 +1636,7 @@ class L3VariableTime(Realm): # Find latency, jitter for connections # using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) + port_data["port"], endps) # now report the ap_chanim_stats along # side of the ap_stats_2g @@ -1733,7 +1727,7 @@ class L3VariableTime(Realm): pprint(response) port_data = response['interface'] print( - "#### 2g From LANforge: port_data, response['insterface']:{}".format(p)) + "#### 2g From LANforge: port_data, response['insterface']:{}".format(port_data)) mac = port_data['mac'] # print("#### From LANforge: port_data['mac']: # {mac}".format(mac=mac)) @@ -1771,7 +1765,7 @@ class L3VariableTime(Realm): # Find latency, jitter for connections # using this port. latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) + port_data["port"], endps) print( "2g ap_ul_row {ap_ul_row}".format( @@ -1813,7 +1807,7 @@ class L3VariableTime(Realm): else: port_data = response['interface'] latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port( - p["port"], endps) + port_data["port"], endps) self.write_port_csv( len(temp_stations_list), From ea79a485e0dccbfa2f7fa64cefd1d82e383567ae Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:53:18 -0800 Subject: [PATCH 536/731] test_l3_unicast_traffic_gen: Cleanup whitespace Signed-off-by: Matthew Stidham --- py-scripts/test_l3_unicast_traffic_gen.py | 160 ++++++++++++---------- 1 file changed, 84 insertions(+), 76 deletions(-) diff --git a/py-scripts/test_l3_unicast_traffic_gen.py b/py-scripts/test_l3_unicast_traffic_gen.py index 11be83c8..1e2e8dd9 100755 --- a/py-scripts/test_l3_unicast_traffic_gen.py +++ b/py-scripts/test_l3_unicast_traffic_gen.py @@ -10,7 +10,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -36,21 +35,21 @@ class L3VariableTimeLongevity(LFCliBase): self.side_b = side_b self.ssid_list = ssid_list self.ssid_password_list = ssid_password_list - self.station_lists = station_lists + self.station_lists = station_lists self.security = security self.number_template = number_template self.resource = resource - self.debug=_debug_on + self.debug = _debug_on self.name_prefix = name_prefix self.test_duration = test_duration self.cx_stations_lists = station_lists - self.radios = radios # from the command line + self.radios = radios # from the command line self.radio_list = radio_name_list - self.number_of_stations_per_radio_list = number_of_stations_per_radio_list + self.number_of_stations_per_radio_list = number_of_stations_per_radio_list self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port) self.cx_profile = self.local_realm.new_l3_cx_profile() self.station_profiles = [] - + index = 0 for radio in radios: self.station_profile = self.local_realm.new_station_profile() @@ -62,7 +61,7 @@ class L3VariableTimeLongevity(LFCliBase): self.station_profile.mode = 0 self.station_profiles.append(self.station_profile) index += 1 - + self.cx_profile.host = self.host self.cx_profile.port = self.port self.cx_profile.name_prefix = self.name_prefix @@ -78,8 +77,8 @@ class L3VariableTimeLongevity(LFCliBase): if cx_name != 'uri' and cx_name != 'handler': for item, value in cx_name.items(): for value_name, value_rx in value.items(): - if value_name == 'rx bytes': - cx_rx_map[item] = value_rx + if value_name == 'rx bytes': + cx_rx_map[item] = value_rx return cx_rx_map def __compare_vals(self, old_list, new_list): @@ -107,16 +106,14 @@ class L3VariableTimeLongevity(LFCliBase): if self.debug: print("Bringing up station {}".format(station_profile)) station_profile.admin_up(self.resource) - if self.local_realm.wait_for_ip(self.resource, station_list,timeout_sec=10*len(station_list)): + if self.local_realm.wait_for_ip(self.resource, station_list, timeout_sec=10 * len(station_list)): if self.debug: print("ip's aquired {}".format(station_list)) else: print("print failed to get IP's: {}".format(station_list)) - if self.local_realm.wait_for_ip(self.resource, station_list,timeout_sec=120): + if self.local_realm.wait_for_ip(self.resource, station_list, timeout_sec=120): print("tried again: print failed to get IP's: {}".format(station_list)) exit(1) - - self.cx_profile.start_cx() @@ -134,7 +131,7 @@ class L3VariableTimeLongevity(LFCliBase): while cur_time < interval_time: cur_time = datetime.datetime.now() time.sleep(1) - + new_rx_values = self.__get_rx_values() filtered_new_rx_values = [] filtered_new_rx_values = new_rx_values @@ -162,8 +159,8 @@ class L3VariableTimeLongevity(LFCliBase): def cleanup(self, resource): resource = 1 data = { - "name":"BLANK", - "action":"overwrite" + "name": "BLANK", + "action": "overwrite" } url = "cli-json/load" self.json_post(url, data) @@ -171,7 +168,7 @@ class L3VariableTimeLongevity(LFCliBase): timeout = 20 done = False while timeout > 0 and not done: - time.sleep( 1) + time.sleep(1) port_r = self.json_get("/port/1/1/list?fields=alias") if self.debug: print("port interfaces {}".format(port_r["interfaces"])) @@ -181,37 +178,37 @@ class L3VariableTimeLongevity(LFCliBase): print("interface {}".format(interface)) else: done = True - break + break timeout -= 1 if timeout <= 0: print("not all station ports removed {}".format(port_r["interfaces"])) - def build(self): + def build(self): # refactor in LFUtils.port_zero_request() resource = 1 - - data ={ - 'shelf':1, - 'resource':1, - 'port':'eth1', - 'ip_addr':'0.0.0.0', - 'netmask':'0.0.0.0', - 'gateway':'0.0.0.0', - 'current_flags':0, - 'interest':402653212 - } + + data = { + 'shelf': 1, + 'resource': 1, + 'port': 'eth1', + 'ip_addr': '0.0.0.0', + 'netmask': '0.0.0.0', + 'gateway': '0.0.0.0', + 'current_flags': 0, + 'interest': 402653212 + } url = "cli-json/set_port" self.json_post(url, data) # refactor into LFUtils - data ={ - "shelf":1, - "resource": resource, - "port":"br0", - "network_devs":"eth1", - "br_flags":1 + data = { + "shelf": 1, + "resource": resource, + "port": "br0", + "network_devs": "eth1", + "br_flags": 1 } url = "cli-json/add_br" self.json_post(url, data) @@ -221,39 +218,44 @@ class L3VariableTimeLongevity(LFCliBase): self.json_post("/cli-json/set_port", data) except: print("LFUtils.port_dhcp_up_request didn't complete ") - print("or the json_post failed either way {} did not set up dhcp so test may not pass data ".format(self.side_b)) + print("or the json_post failed either way {} did not set up dhcp so test may not pass data ".format( + self.side_b)) resource = 1 - index = 0 + index = 0 for station_profile, station_list in zip(self.station_profiles, self.station_lists): station_profile.use_security(station_profile.security, station_profile.ssid, station_profile.ssid_pass) station_profile.set_number_template(station_profile.number_template) if self.debug: - print("radio: {} station_profile: {} Creating stations: {} ".format(self.radio_list[index],station_profile, station_list)) - + print("radio: {} station_profile: {} Creating stations: {} ".format(self.radio_list[index], + station_profile, station_list)) + temp_station_list = [] for station in range(len(station_list)): temp_station_list.append(str(self.resource) + "." + station_list[station]) - station_profile.create(radio=self.radio_list[index], sta_names_=station_list, debug=False ) + station_profile.create(radio=self.radio_list[index], sta_names_=station_list, debug=False) index += 1 - self.cx_profile.create(endp_type=self.endp_type, side_a=temp_station_list, side_b='1.'+self.side_b, sleep_time=.5) + self.cx_profile.create(endp_type=self.endp_type, side_a=temp_station_list, side_b='1.' + self.side_b, + sleep_time=.5) self._pass("PASS: Stations build finished") + def valid_endp_type(endp_type): - valid_endp_type=['lf_udp','lf_udp6','lf_tcp','lf_tcp6'] + valid_endp_type = ['lf_udp', 'lf_udp6', 'lf_tcp', 'lf_tcp6'] if str(endp_type) in valid_endp_type: return endp_type else: - print('invalid endp_type. Valid types lf_udp, lf_udp6, lf_tcp, lf_tcp6') + print('invalid endp_type. Valid types lf_udp, lf_udp6, lf_tcp, lf_tcp6') exit(1) + def main(): lfjson_host = "localhost" lfjson_port = 8080 parser = argparse.ArgumentParser( prog='test_l3_longevity.py', - #formatter_class=argparse.RawDescriptionHelpFormatter, + # formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawTextHelpFormatter, epilog='''\ Useful Information: @@ -264,7 +266,7 @@ Useful Information: 4. Security is fixed at WPA2 5. Maximum stations per radio is 64 ''', - + description='''\ test_l3_longevity.py: -------------------- @@ -317,36 +319,41 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type lf_tcp --upstream ''') - - parser.add_argument('-d','--test_duration', help='--test_duration example --time 5d (5 days) default: 3m options: number followed by d, h, m or s',default='3m') - parser.add_argument('-t', '--endp_type', help='--endp_type example --endp_type lf_udp, default: lf_udp , options: lf_udp, lf_udp6, lf_tcp, lf_tcp6', - default='lf_udp',type=valid_endp_type) - parser.add_argument('-u', '--upstream_port', help='--upstream_port example: --upstream_port eth1',default='eth1') - parser.add_argument('--debug', help='Enable debugging', default=False, action="store_true") + parser.add_argument('-d', '--test_duration', + help='--test_duration example --time 5d (5 days) default: 3m options: number followed by d, h, m or s', + default='3m') + parser.add_argument('-t', '--endp_type', + help='--endp_type example --endp_type lf_udp, default: lf_udp , options: lf_udp, lf_udp6, lf_tcp, lf_tcp6', + default='lf_udp', type=valid_endp_type) + parser.add_argument('-u', '--upstream_port', help='--upstream_port example: --upstream_port eth1', + default='eth1') + parser.add_argument('--debug', help='Enable debugging', default=False, action="store_true") requiredNamed = parser.add_argument_group('required arguments') - requiredNamed.add_argument('-r','--radio', action='append', nargs=4, metavar=('', '','',''), - help ='--radio ',required=True) + requiredNamed.add_argument('-r', '--radio', action='append', nargs=4, + metavar=('', '', '', ''), + help='--radio ', + required=True) args = parser.parse_args() if args.test_duration: test_duration = args.test_duration if args.endp_type: - endp_type = args.endp_type + endp_type = args.endp_type side_b = args.upstream_port if args.radio: radios = args.radio - + radio_offset = 0 number_of_stations_offset = 1 ssid_offset = 2 ssid_password_offset = 3 MAX_NUMBER_OF_STATIONS = 64 - + radio_name_list = [] number_of_stations_per_radio_list = [] ssid_list = [] @@ -371,36 +378,37 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type lf_tcp --upstream if number_of_stations > MAX_NUMBER_OF_STATIONS: print("number of stations per radio exceeded max of : {}".format(MAX_NUMBER_OF_STATIONS)) quit(1) - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_= 1 + index*1000, end_id_= number_of_stations + index*1000, padding_number_=10000) + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=1 + index * 1000, + end_id_=number_of_stations + index * 1000, padding_number_=10000) station_lists.append(station_list) index += 1 - ip_var_test = L3VariableTimeLongevity(lfjson_host, - lfjson_port, - number_template="00", - station_lists= station_lists, - name_prefix="var_time", - endp_type=endp_type, - side_b=side_b, - radios=radios, - radio_name_list=radio_name_list, - number_of_stations_per_radio_list=number_of_stations_per_radio_list, - ssid_list=ssid_list, - ssid_password_list=ssid_password_list, - resource=1, - security="wpa2", test_duration=test_duration, - side_a_min_rate=256000, side_b_min_rate=256000, - _debug_on=args.debug) + ip_var_test = L3VariableTimeLongevity(lfjson_host, + lfjson_port, + number_template="00", + station_lists=station_lists, + name_prefix="var_time", + endp_type=endp_type, + side_b=side_b, + radios=radios, + radio_name_list=radio_name_list, + number_of_stations_per_radio_list=number_of_stations_per_radio_list, + ssid_list=ssid_list, + ssid_password_list=ssid_password_list, + resource=1, + security="wpa2", test_duration=test_duration, + side_a_min_rate=256000, side_b_min_rate=256000, + _debug_on=args.debug) ip_var_test.cleanup(station_list) ip_var_test.build() if not ip_var_test.passes(): print(ip_var_test.get_fail_message()) - exit(1) + exit(1) ip_var_test.start(False, False) ip_var_test.stop() if not ip_var_test.passes(): print(ip_var_test.get_fail_message()) - exit(1) + exit(1) time.sleep(30) ip_var_test.cleanup(station_list) if ip_var_test.passes(): From 2177dd3575db78ae334c37facc6e08ccfd70d37a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:58:25 -0800 Subject: [PATCH 537/731] test_l4: Fix bare except Signed-off-by: Matthew Stidham --- py-scripts/test_l4.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/py-scripts/test_l4.py b/py-scripts/test_l4.py index 094a7132..06e1b077 100755 --- a/py-scripts/test_l4.py +++ b/py-scripts/test_l4.py @@ -304,12 +304,11 @@ python3 ./test_l4.py # Create directory if args.report_file is None: - try: - homedir = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-%M")).replace(':', - '-') + 'test_l4' + if os.path.isdir('/home/lanforge/report-data'): + homedir = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-%M")).replace(':', '-') + 'test_l4' path = os.path.join('/home/lanforge/report-data/', homedir) os.mkdir(path) - except: + else: path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) print('Saving file to local directory') if args.output_format in ['csv', 'json', 'html', 'hdf', 'stata', 'pickle', 'pdf', 'png', 'df', 'parquet', @@ -349,10 +348,7 @@ python3 ./test_l4.py ip_test.build() ip_test.start() - try: - layer4traffic = ','.join([[*x.keys()][0] for x in ip_test.local_realm.json_get('layer4')['endpoint']]) - except: - pass + layer4traffic = ','.join([[*x.keys()][0] for x in ip_test.local_realm.json_get('layer4')['endpoint']]) ip_test.cx_profile.monitor(col_names=['name', 'bytes-rd', 'urls/s', 'bytes-wr'], report_file=rpt_file, duration_sec=ip_test.local_realm.parse_time(args.test_duration).total_seconds(), From a9928bbc2b90b825b9ee24186ba2cec636e1b87e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 14:58:40 -0800 Subject: [PATCH 538/731] regression_test: test_l4 only needs to run for 15 seconds Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 0e03c6da..ce13a66b 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -352,7 +352,7 @@ else #./test_l3_unicast_traffic_gen #./test_l3_unicast_traffic_gen #./test_l3_WAN_LAN - "./test_l4.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" + "./test_l4.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --test_duration 15s" "./test_status_msg.py --debug --mgr $MGR" #this is all which is needed to run "./test_wanlink.py --name my_wanlink4 --latency_A 20 --latency_B 69 --rate 1000 --jitter_A 53 --jitter_B 73 --jitter_freq 6 --drop_A 12 --drop_B 11 --debug --mgr $MGR" #./test_wpa_passphrases From 93977892e657a14cff1cbd6ecf2939a1a388b2a3 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 16:36:07 -0800 Subject: [PATCH 539/731] lf_multipsk: Fix regressions Signed-off-by: Matthew Stidham --- py-scripts/lf_multipsk.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/lf_multipsk.py b/py-scripts/lf_multipsk.py index accf11c4..f650fe3c 100755 --- a/py-scripts/lf_multipsk.py +++ b/py-scripts/lf_multipsk.py @@ -268,11 +268,10 @@ class MultiPsk(Realm): y = station_ip[j].split('.') if x[0] == y[0] and x[1] == y[1]: print("station got ip from vlan") - x = "Pass" + return "Pass" else: print("station did not got ip from vlan") - x = "Fail" - return x + return "Fail" def compare_nonvlan_ip_nat(self): non_vlan_sta_ip = self.get_non_vlan_sta_ip() @@ -321,6 +320,7 @@ def main(): formatter_class=argparse.RawTextHelpFormatter, description="lanforge webpage download Test Script") parser.add_argument('--n_vlan', help="type number of vlan using in test eg 1 or 2", default=1) + parser.add_argument('--mode', help="Mode for lf_multipsk", default=None) args = parser.parse_args() input_data = [{ From 51d7e632e91c297a798642eaadc77504c95b6492 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 16:38:47 -0800 Subject: [PATCH 540/731] gen_cxprofile: Fix whitespace Signed-off-by: Matthew Stidham --- py-json/gen_cxprofile.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/py-json/gen_cxprofile.py b/py-json/gen_cxprofile.py index f2d870c5..11dceb9f 100644 --- a/py-json/gen_cxprofile.py +++ b/py-json/gen_cxprofile.py @@ -9,7 +9,6 @@ import time import datetime import json - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -396,12 +395,11 @@ class GenCXProfile(LFCliBase): gen_results = self.json_get("generic/list?fields=name,last+results", debug_=self.debug) if gen_results['endpoints'] is not None: pprint(gen_results['endpoints']) - #for name in gen_results['endpoints']: - # pprint(name.items) - #for k,v in name.items(): + # for name in gen_results['endpoints']: + # pprint(name.items) + # for k,v in name.items(): exit(1) - def choose_speedtest_command(self): gen_results = self.json_get("generic/list?fields=name,last+results", debug_=self.debug) if gen_results['endpoints'] is not None: @@ -409,11 +407,12 @@ class GenCXProfile(LFCliBase): for k, v in name.items(): if v['last results'] is not None and v['name'] in self.created_endp and v['last results'] != '': last_results = json.loads(v['last results']) - if last_results['download'] is None and last_results['upload'] is None and last_results['ping'] is None: + if last_results['download'] is None and last_results['upload'] is None and last_results[ + 'ping'] is None: return False, v['name'] elif last_results['download'] >= self.speedtest_min_dl and \ - last_results['upload'] >= self.speedtest_min_up and \ - last_results['ping'] <= self.speedtest_max_ping: + last_results['upload'] >= self.speedtest_min_up and \ + last_results['ping'] <= self.speedtest_max_ping: return True, v['name'] def choose_generic_command(self): @@ -462,7 +461,8 @@ class GenCXProfile(LFCliBase): if output_format is not None: if output_format.lower() != report_file.split('.')[-1]: raise ValueError( - 'Filename %s has an extension that does not match output format %s .' % (report_file, output_format)) + 'Filename %s has an extension that does not match output format %s .' % ( + report_file, output_format)) else: output_format = report_file.split('.')[-1] @@ -602,7 +602,9 @@ class GenCXProfile(LFCliBase): exit(1) # append compared df to created one if output_format.lower() != 'csv': - pandas_extensions.df_to_file(dataframe=pd.read_csv(report_file), output_f=output_format, save_path=report_file) + pandas_extensions.df_to_file(dataframe=pd.read_csv(report_file), output_f=output_format, + save_path=report_file) else: if output_format.lower() != 'csv': - pandas_extensions.df_to_file(dataframe=pd.read_csv(report_file), output_f=output_format, save_path=report_file) + pandas_extensions.df_to_file(dataframe=pd.read_csv(report_file), output_f=output_format, + save_path=report_file) From ce7a88151057c64934ed41136467ed1f7a427adc Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 16:40:46 -0800 Subject: [PATCH 541/731] gen_cxprofile: Fix improper line continuation errors Signed-off-by: Matthew Stidham --- py-json/gen_cxprofile.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/py-json/gen_cxprofile.py b/py-json/gen_cxprofile.py index 11dceb9f..340f2433 100644 --- a/py-json/gen_cxprofile.py +++ b/py-json/gen_cxprofile.py @@ -48,7 +48,7 @@ class GenCXProfile(LFCliBase): if self.cmd == "": raise ValueError("Please ensure cmd has been set correctly") elif self.type == "speedtest": - self.cmd = "vrf_exec.bash %s speedtest-cli --json --share" % (sta_name) + self.cmd = "vrf_exec.bash %s speedtest-cli --json --share" % sta_name elif self.type == "iperf3" and self.dest is not None: self.cmd = "iperf3 --forceflush --format k --precision 4 -c %s -t 60 --tos 0 -b 1K --bind_dev %s -i 1 " \ "--pidfile /tmp/lf_helper_iperf3_%s.pid" % (self.dest, sta_name, gen_name) @@ -131,7 +131,7 @@ class GenCXProfile(LFCliBase): if self.cmd == "": raise ValueError("Please ensure cmd has been set correctly") elif self.type == "speedtest": - self.cmd = "vrf_exec.bash %s speedtest-cli --json --share" % (sta_name) + self.cmd = "vrf_exec.bash %s speedtest-cli --json --share" % sta_name elif self.type == "iperf3" and self.dest is not None: self.cmd = "iperf3 --forceflush --format k --precision 4 -c %s -t 60 --tos 0 -b 1K --bind_dev %s -i 1 " \ "--pidfile /tmp/lf_helper_iperf3_test.pid" % (self.dest, sta_name) @@ -407,8 +407,7 @@ class GenCXProfile(LFCliBase): for k, v in name.items(): if v['last results'] is not None and v['name'] in self.created_endp and v['last results'] != '': last_results = json.loads(v['last results']) - if last_results['download'] is None and last_results['upload'] is None and last_results[ - 'ping'] is None: + if last_results['download'] is None and last_results['upload'] is None and last_results['ping'] is None: return False, v['name'] elif last_results['download'] >= self.speedtest_min_dl and \ last_results['upload'] >= self.speedtest_min_up and \ @@ -417,7 +416,7 @@ class GenCXProfile(LFCliBase): def choose_generic_command(self): gen_results = self.json_get("generic/list?fields=name,last+results", debug_=self.debug) - if (gen_results['endpoints'] is not None): + if gen_results['endpoints'] is not None: for name in gen_results['endpoints']: for k, v in name.items(): if v['name'] in self.created_endp and not v['name'].endswith('1'): @@ -446,7 +445,7 @@ class GenCXProfile(LFCliBase): except: if (duration_sec is None) or (duration_sec <= 1): raise ValueError("GenCXProfile::monitor wants duration_sec > 1 second") - if (duration_sec <= monitor_interval_ms): + if duration_sec <= monitor_interval_ms: raise ValueError("GenCXProfile::monitor wants duration_sec > monitor_interval") if report_file is None: raise ValueError("Monitor requires an output file to be defined") @@ -461,8 +460,7 @@ class GenCXProfile(LFCliBase): if output_format is not None: if output_format.lower() != report_file.split('.')[-1]: raise ValueError( - 'Filename %s has an extension that does not match output format %s .' % ( - report_file, output_format)) + 'Filename %s has an extension that does not match output format %s .' % (report_file, output_format)) else: output_format = report_file.split('.')[-1] From 111fae086690a7af31f94f810b11f67f92cc9b1f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 16:41:33 -0800 Subject: [PATCH 542/731] gen_cxprofile: Fix bare except error Signed-off-by: Matthew Stidham --- py-json/gen_cxprofile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-json/gen_cxprofile.py b/py-json/gen_cxprofile.py index 340f2433..ac92ef11 100644 --- a/py-json/gen_cxprofile.py +++ b/py-json/gen_cxprofile.py @@ -175,7 +175,7 @@ class GenCXProfile(LFCliBase): resource = port_info[1] shelf = port_info[0] name = port_info[2] - except: + except ValueError: raise ValueError("Unexpected name for port_name %s" % port_name) # this naming convention follows what you see when you use @@ -442,7 +442,7 @@ class GenCXProfile(LFCliBase): debug=False): try: duration_sec = self.parse_time(duration_sec).seconds - except: + except ValueError: if (duration_sec is None) or (duration_sec <= 1): raise ValueError("GenCXProfile::monitor wants duration_sec > 1 second") if duration_sec <= monitor_interval_ms: From f56a4347d94aea322ad3c3c1c9725cc5556ecc60 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 16:42:43 -0800 Subject: [PATCH 543/731] gen_cxprofile: Fix mutable default arguments error Signed-off-by: Matthew Stidham --- py-json/gen_cxprofile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py-json/gen_cxprofile.py b/py-json/gen_cxprofile.py index ac92ef11..0612c577 100644 --- a/py-json/gen_cxprofile.py +++ b/py-json/gen_cxprofile.py @@ -277,7 +277,9 @@ class GenCXProfile(LFCliBase): }) time.sleep(sleep_time) - def create(self, ports=[], sleep_time=.5, debug_=False, suppress_related_commands_=None): + def create(self, ports=None, sleep_time=.5, debug_=False, suppress_related_commands_=None): + if ports is None: + ports = [] if self.debug: debug_ = True post_data = [] From 9e2e4a1c73f4f3e9e3fedb51605d18a5b2c2833c Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 29 Nov 2021 16:46:34 -0800 Subject: [PATCH 544/731] test_generic: Fix os.path.exists error Signed-off-by: Matthew Stidham --- py-scripts/test_generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/test_generic.py b/py-scripts/test_generic.py index 54a1dea9..42a04879 100755 --- a/py-scripts/test_generic.py +++ b/py-scripts/test_generic.py @@ -235,7 +235,7 @@ python3 ./test_generic.py if args.report_file is None: new_file_path = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':', '-') + '-test_generic' # create path name - if not os.path.exists('/home/lanforge/report-data/'): + if os.path.exists('/home/lanforge/report-data/'): path = os.path.join('/home/lanforge/report-data/', new_file_path) os.mkdir(path) else: From 43fa8db465dc7d433366ac289a8cd0924a3cf35a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 30 Nov 2021 12:33:57 -0500 Subject: [PATCH 545/731] lf_check.py : add test run, success, timeout, failure summary ct_us_001_scripts.json : fixed typo Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 2 +- py-scripts/tools/lf_check.py | 26 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 63fb63f3..9627d0b6 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -67,7 +67,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[" --mgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", - " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USEDD,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --local_lf_report_dir REPORT_PATH"]} }, "suite_test":{ diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 9d052caa..804494bf 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -156,6 +156,10 @@ class lf_check(): self.outfile = _outfile self.outfile_name = _outfile_name self.test_result = "Failure" + self.tests_run = 0 + self.tests_success = 0 + self.tests_failure = 0 + self.tests_timeout = 0 self.results_col_titles = [ "Test", "Command", "Result", "STDOUT", "STDERR"] self.html_results = "" @@ -250,7 +254,7 @@ class lf_check(): "get_scripts_get_sha exit_code: {exit_code}".format( exit_code=exit_code)) scripts_git_sha = commit_hash.decode('utf-8', 'ignore') - scripts_git_sha = scripts_git_sha.replace('\n','') + scripts_git_sha = scripts_git_sha.replace('\n', '') return scripts_git_sha ''' @@ -1056,6 +1060,16 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.test_result = "Time Out" background = self.background_purple + # Total up test, tests success, tests failure, tests + # timeouts + self.tests_run += 1 + if self.test_result == "Success": + self.tests_success += 1 + elif self.test_result == "Failure": + self.tests_failed += 1 + elif self.test_result == "TIMEOUT": + self.tests_timeout += 1 + if 'lf_qa' in command: line_list = open(stdout_log_txt).readlines() for line in line_list: @@ -1405,6 +1419,12 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # Successfully gathered LANforge information Run Tests check.run_script_test() + lf_test_summary = pd.DataFrame() + lf_test_summary['Tests Run'] = [check.tests_run] + lf_test_summary['Success'] = [check.tests_success] + lf_test_summary['Failure'] = [check.tests_failure] + lf_test_summary['Timeout'] = [check.tests_timeout] + # generate output reports test_rig = check.get_test_rig() report.set_title( @@ -1422,6 +1442,10 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a report.build_table_title() report.set_table_dataframe(lf_radio_df) report.build_table() + report.set_table_title("LF Check Test Summary") + report.build_table_title() + report.set_table_dataframe(lf_test_summary) + report.build_table() report.set_table_title("LF Check Test Results") report.build_table_title() html_results = check.get_html_results() From b2c95bdc33acb80ff3c2c14135e6fa3c4334ffe6 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 30 Nov 2021 12:14:25 -0700 Subject: [PATCH 546/731] lf_check.py : bug fix Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 804494bf..5dbc6d85 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1066,7 +1066,7 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if self.test_result == "Success": self.tests_success += 1 elif self.test_result == "Failure": - self.tests_failed += 1 + self.tests_failure += 1 elif self.test_result == "TIMEOUT": self.tests_timeout += 1 From b4c4eb3b1ef71e1457b4ed7848920baccca24690 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 30 Nov 2021 15:02:08 -0800 Subject: [PATCH 547/731] requirements: Pillow is not used in the library Signed-off-by: Matthew Stidham --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ecf16a2e..16c04ea7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -36,7 +36,6 @@ paramiko>=2.8.0 pdfkit>=0.6.1 pexpect>=4.8.0 pexpect-serial>=0.1.0 -Pillow>=8.4.0 pip-search>=0.0.7 plotly>=5.3.1 ptyprocess>=0.7.0 From c40e16424899d868a071d18aad0f992ecfc37e01 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 30 Nov 2021 18:54:02 -0500 Subject: [PATCH 548/731] lf_check.py : added summary to summary some tests failed ct_us_001_scripts.json : added information about --create_scenario and instance name Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 5 ++++- py-scripts/tools/lf_check.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 9627d0b6..9273fff6 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -6,7 +6,10 @@ "The variables that are all capitalized below are replaced with configuration", "from the json file. so LF_MGR_IP in the test below is replaced by the json lf_mgr_ip", "The replacement is loosely coupled so the upper and lower case convention is used", - "to identify replaced strings in the lf_check.py code." + "to identify replaced strings in the lf_check.py code.", + "When doing a create_chamberview.py --create_scenario ", + "has no correlation to the --instance_name , instance name is used ", + "as a unique identifier for tha chamber-view test run" ] }, "test_suites":{ diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 5dbc6d85..e755810e 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -159,6 +159,7 @@ class lf_check(): self.tests_run = 0 self.tests_success = 0 self.tests_failure = 0 + self.tests_some_failure = 0 self.tests_timeout = 0 self.results_col_titles = [ "Test", "Command", "Result", "STDOUT", "STDERR"] @@ -1067,6 +1068,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.tests_success += 1 elif self.test_result == "Failure": self.tests_failure += 1 + elif self.test_result == "Some Tests Failed": + self.tests_some_failure += 1 elif self.test_result == "TIMEOUT": self.tests_timeout += 1 @@ -1422,6 +1425,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a lf_test_summary = pd.DataFrame() lf_test_summary['Tests Run'] = [check.tests_run] lf_test_summary['Success'] = [check.tests_success] + lf_test_summary['Some Tests Failed'] = [check.tests_some_failure] lf_test_summary['Failure'] = [check.tests_failure] lf_test_summary['Timeout'] = [check.tests_timeout] From f36004fcc5f06c41f503598bcaa601047ff8ad5b Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 30 Nov 2021 19:03:32 -0500 Subject: [PATCH 549/731] lf_check.py : directory name reflects the test suite Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index e755810e..7b9f0656 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1178,7 +1178,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a parser.add_argument( '--dir', help="--dir ", - default="lf_check") + default="") parser.add_argument( '--path', help="--path ", @@ -1253,7 +1253,10 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # select test suite test_suite = args.suite - __dir = args.dir + if args.dir == "": + __dir = "lf_check_{suite}".format(suite=test_suite) + else: + __dir = args.dir __path = args.path server_override = args.server_override @@ -1269,13 +1272,13 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # create report class for reporting report = lf_report.lf_report(_path=__path, _results_dir_name=__dir, - _output_html="lf_check.html", - _output_pdf="lf_check.pdf") + _output_html="{dir}.html".format(dir=__dir), + _output_pdf="{dir}.pdf".format(dir=__dir)) current_time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime()) - csv_results = "lf_check{}-{}.csv".format(args.outfile, current_time) + csv_results = "{dir}-{outfile}-{current_time}.csv".format(dir=__dir,outfile=args.outfile,current_time=current_time) csv_results = report.file_add_path(csv_results) - outfile_name = "lf_check-{}-{}".format(args.outfile, current_time) + outfile_name = "{dir}-{outfile}-{current_time}".format(dir=__dir,outfile=args.outfile,current_time=current_time) outfile = report.file_add_path(outfile_name) report_path = report.get_report_path() log_path = report.get_log_path() From feccfeb68511d2632e9b524caaf4f6fe82e92dc6 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 1 Dec 2021 14:11:32 -0800 Subject: [PATCH 550/731] regression_test: improve update line in case virtualenv exists Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index ce13a66b..38dd1d50 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -20,7 +20,7 @@ Help() echo "If using the help flag, put the H flag at the end of the command after other flags." } -pip3 install --user -r ../requirements.txt --upgrade +if [ -d "/home/lanforge/lanforge_env"] && pip3 install --upgrade lanforge-scripts || pip3 install --user -r ../requirements.txt --upgrade while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:" option; do case "${option}" in From 7aa04ecbc3c4185814c8f7f9e2e2e12bc9987777 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 1 Dec 2021 15:59:42 -0700 Subject: [PATCH 551/731] lf_check.py ct_001_AX88U_dut.json: pass in serial number fix ct_us_001_tests.json test update Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_001_AX88U_dut.json | 3 +++ py-scripts/tools/ct_us_001_tests.json | 3 ++- py-scripts/tools/lf_check.py | 10 +++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/py-scripts/tools/ct_001_AX88U_dut.json b/py-scripts/tools/ct_001_AX88U_dut.json index 28aff673..691d2a4e 100644 --- a/py-scripts/tools/ct_001_AX88U_dut.json +++ b/py-scripts/tools/ct_001_AX88U_dut.json @@ -9,6 +9,9 @@ "test_dut":{ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "USE_DUT_NAME": "ASUSRT-AX88U", + "DUT_SW": "3.0.0.4.386_44266", + "DUT_HW": "1.0", + "DUT_SN": "12345678", "wireless_network_dict":{ "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 10e27ae0..9c36d48d 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -26,7 +26,8 @@ " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port eth2 ", " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", - " --test_rig TEST_RIG --test_tag 'l3_longevity'" + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" ] }, "lf_qa":{ diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 7b9f0656..302e0cea 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -211,7 +211,7 @@ class lf_check(): self.dut_hw = "DUT_HW_NA" self.dut_sw = "DUT_SW_NA" self.dut_model = "DUT_MODEL_NA" - self.dut_serial = "DUT_SERIAL_NA" + self.dut_serial = "DUT_SN_NA" self.dut_wireless_network_dict = {} @@ -664,8 +664,8 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) else: self.logger.info("DUT_MODEL not in test_dut json") - if "DUT_SERIAL" in self.json_dut["test_dut"]: - self.dut_serial = self.json_dut["test_dut"]["DUT_SERIAL"] + if "DUT_SN" in self.json_dut["test_dut"]: + self.dut_serial = self.json_dut["test_dut"]["DUT_SN"] else: self.logger.info("DUT_SERIAL not in test_dut json") @@ -819,9 +819,9 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if 'DUT_MODEL' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( 'DUT_MODEL', self.dut_model) - if 'DUT_SERIAL' in self.test_dict[test]['args']: + if 'DUT_SN' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace( - 'DUT_SERIAL', self.dut_serial) + 'DUT_SN', self.dut_serial) if 'UPSTREAM_PORT' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('UPSTREAM_PORT', From a929e432054710f6598223229490ae8a5a987e2b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 2 Dec 2021 09:49:24 -0800 Subject: [PATCH 552/731] regression_test: Partial failure function in case there is a lanforge failure but Python doesn't fail Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 49 +++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 38dd1d50..3992717d 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -20,7 +20,12 @@ Help() echo "If using the help flag, put the H flag at the end of the command after other flags." } -if [ -d "/home/lanforge/lanforge_env"] && pip3 install --upgrade lanforge-scripts || pip3 install --user -r ../requirements.txt --upgrade +if [ -d "/home/lanforge/lanforge_env" ]; +then + pip3 install --upgrade lanforge-scripts +else + pip3 install --user -r ../requirements.txt --upgrade +fi while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:" option; do case "${option}" in @@ -499,28 +504,38 @@ function test() { start=$(date +%s) # this command saves stdout and stderr to the stdout file, and has a special file for stderr text. # Modified from https://unix.stackexchange.com/a/364176/327076 - { eval "$testcommand" 2>&1 >&3 3>&- | tee "${TEST_DIR}/${NAME}_stderr.txt" 3>&-; } > "${TEST_DIR}/${NAME}.txt" 3>&1 - chmod 664 "${TEST_DIR}/${NAME}.txt" - FILESIZE=$(stat -c%s "${TEST_DIR}/${NAME}_stderr.txt") || 0 + FILENAME="${TEST_DIR}/${NAME}" + { eval "$testcommand" 2>&1 >&3 3>&- | tee "${FILENAME}_stderr.txt" 3>&-; } > "${FILENAME}.txt" 3>&1 + chmod 664 "${FILENAME}.txt" + FILESIZE=$(stat -c%s "${FILENAME}_stderr.txt") || 0 end=$(date +%s) execution="$((end-start))" - if (( FILESIZE > 0)); then + TEXT=$(cat "${FILENAME}".txt) + STDERR="" + if [[ "tests failed" == *"${TEXT}" ]] + then + TEXTCLASS="partial_failure" + TDTEXT="Partial Failure" + else + TEXTCLASS="success" + TDTEXT="Success" + fi + + if (( FILESIZE > 0)) + then echo "Errors detected" - results+=(" - - - - - ") + TEXTCLASS="failure" + TDTEXT="Failure" + STDERR="STDERR" else echo "No errors detected" - results+=(" - - - - - ") fi + results+=(" + + + + + ") } function start_tests() { From 0c68ddd984992822f7ac080673838fe83aa15118 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 2 Dec 2021 09:52:55 -0800 Subject: [PATCH 553/731] regression_test: Add partial_failure css Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 3992717d..33ef1735 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -572,6 +572,9 @@ function html_generator() { .failure { background-color:red; } + .partial_failure { + background-color:yellow; + } table { border: 1px solid gray; } From ab0edd0ea8a11395b6f26f1e92749ed36e98060d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 2 Dec 2021 10:46:48 -0800 Subject: [PATCH 554/731] requirements.txt: Reduce bokeh requirement so we can support python 3.6 until the end of this month Signed-off-by: Matthew Stidham --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 16c04ea7..5c82a91b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ bcrypt>=3.2.0 beautifulsoup4>=4.10.0 -bokeh>=2.4.1 +bokeh>=2.3 Brotli>=1.0.9 bs4>=0.0.1 certifi>=2021.10.8 From ac936583dace762e9698cc53f35e8e5fd438f117 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 2 Dec 2021 14:46:04 -0700 Subject: [PATCH 555/731] update_dependencies.py , requirements.txt : removed bokeh Signed-off-by: Chuck SmileyRekiere --- py-scripts/update_dependencies.py | 2 +- requirements.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/py-scripts/update_dependencies.py b/py-scripts/update_dependencies.py index 15c8741a..95e65268 100755 --- a/py-scripts/update_dependencies.py +++ b/py-scripts/update_dependencies.py @@ -24,7 +24,7 @@ def main(): args = parser.parse_args() print("Installing Script Python3 Dependencies") - packages = ['pandas', 'plotly', 'numpy', 'cryptography', 'paramiko', 'bokeh', 'pyarrow', 'websocket-client', + packages = ['pandas', 'plotly', 'numpy', 'cryptography', 'paramiko', 'pyarrow', 'websocket-client', 'xlsxwriter', 'pyshark', 'influxdb', 'influxdb-client', 'matplotlib', 'pdfkit', 'pip-search', 'pyserial', 'pexpect-serial', 'scp', 'dash', 'kaleido'] if args.pyjwt: diff --git a/requirements.txt b/requirements.txt index 5c82a91b..dcf67b90 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ bcrypt>=3.2.0 beautifulsoup4>=4.10.0 -bokeh>=2.3 Brotli>=1.0.9 bs4>=0.0.1 certifi>=2021.10.8 From cd397ec8838ab4a5e43d7848437ba6087d67baf0 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 29 Nov 2021 14:00:17 -0800 Subject: [PATCH 556/731] regression_test.sh: WIP making html styles more enjoyable Signed-off-by: Jed Reynolds --- py-scripts/regression_test.sh | 112 +++++++++++++++++----------------- 1 file changed, 55 insertions(+), 57 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 33ef1735..51b69d88 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -20,12 +20,7 @@ Help() echo "If using the help flag, put the H flag at the end of the command after other flags." } -if [ -d "/home/lanforge/lanforge_env" ]; -then - pip3 install --upgrade lanforge-scripts -else - pip3 install --user -r ../requirements.txt --upgrade -fi +if [ -d "/home/lanforge/lanforge_env"] && pip3 install --upgrade lanforge-scripts || pip3 install --user -r ../requirements.txt --upgrade while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:" option; do case "${option}" in @@ -529,13 +524,13 @@ function test() { STDERR="STDERR" else echo "No errors detected" + results+=(" + + + + + ") fi - results+=(" - - - - - ") } function start_tests() { @@ -562,51 +557,54 @@ function start_tests() { function html_generator() { LAST_COMMIT=$(git log --pretty=oneline | head -n 1) - header=" - - Regression Test Results $NOW - - - - -

Regression Results

-

$NOW

-

$LAST_COMMIT

-
${CURR_TEST_NAME}${testcommand}Failure${execution}STDOUTSTDERR
${CURR_TEST_NAME}${testcommand}Success${execution}STDOUT
${CURR_TEST_NAME}${testcommand}${TDTEXT}${execution}STDOUT${STDERR}
${CURR_TEST_NAME}${testcommand}Success${execution}STDOUT
${CURR_TEST_NAME}${testcommand}${TDTEXT}${execution}STDOUT${STDERR}
- - - - - - - - " - tail=" - " + header=" + + +Regression Test Results $NOW + + + + +

Regression Results

+

$NOW

+

$LAST_COMMIT

+
Command NameCommandStatusExecution timeSTDOUTSTDERR
+ + + + + + + + + + + " + tail="" fname="${HOMEPATH}/html-reports/regression_file-${NOW}.html" echo "$header" >> "$fname" From 563c7d425847ee2ac58a15a7afd117a0854ad1f6 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 29 Nov 2021 22:37:04 -0800 Subject: [PATCH 557/731] regression_test.sh: updates CSS to reference brand fonts and report.css Signed-off-by: Jed Reynolds --- py-scripts/regression_test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 51b69d88..92825d0f 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -561,7 +561,11 @@ function html_generator() { Regression Test Results $NOW + @@ -615,7 +626,6 @@ h1, h2, h3, h4 { - From 2e16dada6654314263a4b0be46985609fde8ccb5 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 3 Dec 2021 14:10:19 -0500 Subject: [PATCH 610/731] lf_qa.py support for subtest presentation. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_qa.py | 153 ++++++++++++++++++++++++++++---------- 1 file changed, 115 insertions(+), 38 deletions(-) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 1513c069..31c647da 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -53,6 +53,10 @@ class csv_sql: self.dut_hw_version = "NA" self.dut_serial_num_list = "NA" self.dut_serial_num = "NA" + self.subtest_passed = 0 + self.subtest_failed = 0 + self.subtest_total = 0 + self.test_run = "" # Helper methods def get_test_rig_list(self): @@ -139,7 +143,7 @@ class csv_sql: print("exception reading test_run from {_kpi_path}".format( _kpi_path=_kpi_path)) - if test_run is "NA": + if test_run == "NA": try: test_run = _kpi_path.rsplit('/', 2)[0] print("try harder test_run {test_run}".format(test_run=test_run)) @@ -355,6 +359,92 @@ class csv_sql: self.html_results += """
""" self.html_results += """
""" + # TODO determin the subtest pass and fail graph + # df is sorted by date oldest to newest + # get the test_run for last run + # query the db for all pass and fail or last run + # put in table + def sub_test_information(self): + print("generate table and graph from subtest data per run: {}".format( + time.time())) + # https://datacarpentry.org/python-ecology-lesson/09-working-with-sql/index.html- + self.conn = sqlite3.connect(self.database) + # current connection is sqlite3 /TODO move to SQLAlchemy + df3 = pd.read_sql_query( + "SELECT * from {}".format(self.table), self.conn) + # sort by date from oldest to newest. + try: + df3 = df3.sort_values(by='Date') + except BaseException: + print(("Database empty reading subtest: " + "KeyError(key) when sorting by Date for db: {db}," + " check Database name, path to kpi, typo in path, exiting".format(db=self.database))) + exit(1) + self.conn.close() + + # test_run are used for detemining the subtest-pass, subtest-fail + test_run_list = list(df3['test_run']) + print("test_run_list first [0] {}".format(test_run_list[0])) + print("test_run_list last [-1] {}".format(test_run_list[-1])) + test_run_list = list(sorted(set(test_run_list))) + print("test_run_list first [0] {}".format(test_run_list[0])) + print("test_run_list last [-1] {}".format(test_run_list[-1])) + + + self.test_run = test_run_list[-1] + # collect this runs subtest totals + df_tmp = df3.loc[df3['test_run'] == self.test_run ] + subtest_passed_list = list(df_tmp['Subtest-Pass']) + subtest_failed_list = list(df_tmp['Subtest-Fail']) + + try: + self.subtest_passed = int(sum(subtest_passed_list)) + self.subtest_failed = int(sum(subtest_failed_list)) + self.subtest_total = self.subtest_passed + self.subtest_failed + except BaseException: + warning_msg = ("WARNING subtest values need to be filtered or" + " Test is not behaving in filling out subtest values") + print ("{warn}".format(warn=warning_msg),file=sys.stderr) + print ("{warn}".format(warn=warning_msg),file=sys.stdout) + self.subtest_passed = 0 + self.subtest_failed = 0 + self.subtest_total = 0 + + print("{run} subtest Total:{total} Pass:{passed} Fail:{failed}".format( + run=self.test_run, total=self.subtest_total,passed=self.subtest_passed,failed=self.subtest_failed + )) + + # extract the DUT information from last run + self.dut_model_num_list = list(set(list(df_tmp['dut-model-num']))) + self.dut_model_num_list = [x for x in self.dut_model_num_list if x is not None] + if self.dut_model_num_list: + self.dut_model_num = self.dut_model_num_list[-1] + + self.dut_sw_version_list = list(set(list(df_tmp['dut-sw-version']))) + self.dut_sw_version_list = [x for x in self.dut_sw_version_list if x is not None] + if self.dut_sw_version_list: + self.dut_sw_version = self.dut_sw_version_list[-1] + + self.dut_hw_version_list = list(set(list(df_tmp['dut-hw-version']))) + self.dut_hw_version_list = [x for x in self.dut_hw_version_list if x is not None] + if self.dut_hw_version_list: + self.dut_hw_version = self.dut_hw_version_list[-1] + + self.dut_serial_num_list = list(set(list(df_tmp['dut-serial-num']))) + self.dut_serial_num_list = [x for x in self.dut_serial_num_list if x is not None] + if self.dut_serial_num_list[-1]: + self.dut_serial_num = self.dut_serial_num_list[-1] + + print( + "In png DUT: {DUT} SW:{SW} HW:{HW} SN:{SN}" .format( + DUT=self.dut_model_num, + SW=self.dut_sw_version, + HW=self.dut_hw_version, + SN=self.dut_serial_num)) + + + + def generate_graph_png(self): print( "generate png and html to display, generate time: {}".format( @@ -383,19 +473,14 @@ class csv_sql: # print("dataframe df3 {df3}".format(df3=df3)) test_tag_list = list(df3['test-tag']) - test_tag_list = list(set(test_tag_list)) + test_tag_list = list(sorted(set(test_tag_list))) # print("test_tag_list: {}".format(test_tag_list) ) test_rig_list = list(df3['test-rig']) - test_rig_list = list(set(test_rig_list)) + test_rig_list = list(sorted(set(test_rig_list))) self.test_rig_list = test_rig_list print("test_rig_list: {}".format(test_rig_list)) - # TODO determin the subtest pass and fail graph - # df is sorted by date oldest to newest - # get the test_run for last run - # query the db for all pass and fail or last run - # put in table # create the rest of the graphs for test_rig in test_rig_list: @@ -412,34 +497,11 @@ class csv_sql: kpi_path_list = list(df_tmp['kpi_path']) # get Device Under Test Information , - # the set reduces the redundency , list puts it back into a list - # the [0] will get the latest versions for the report - self.dut_model_num_list = list( - set(list(df_tmp['dut-model-num']))) - print( - "in png self.dut_model_num_list {dut_model_num_list}".format( - dut_model_num_list=self.dut_model_num_list)) - if self.dut_model_num_list[0] is not None: - self.dut_model_num = self.dut_model_num_list[0] - self.dut_sw_version_list = list( - set(list(df_tmp['dut-sw-version']))) - if self.dut_sw_version_list[0] is not None: - self.dut_sw_version = self.dut_sw_version_list[0] - self.dut_hw_version_list = list( - set(list(df_tmp['dut-hw-version']))) - if self.dut_hw_version_list[0] is not None: - self.dut_hw_version = self.dut_hw_version_list[0] - self.dut_serial_num_list = list( - set(list(df_tmp['dut-serial-num']))) - if self.dut_serial_num_list[0] is not None: - self.dut_serial_num = self.dut_serial_num_list[0] - - print( - "In png DUT: {DUT} SW:{SW} HW:{HW} SN:{SN}" .format( - DUT=self.dut_model_num_list, - SW=self.dut_sw_version_list, - HW=self.dut_hw_version_list, - SN=self.dut_serial_num_list)) + # the set command uses a hash , sorted puts it back in order + # the set reduces the redundency the filster removes None + # list puts it back into a list + # This code is since the dut is not passed in to lf_qa.py when + # regernation of graphs from db units_list = list(df_tmp['Units']) print( @@ -591,10 +653,11 @@ Usage: lf_qa.py --store --png --path --databas exit(1) elif not args.store: if args.png: - print("if --png set to create png files then --store must also be set, exiting") - exit(1) + print("if --png set to create png files from database") elif not args.png: print("Need to enter an action of --store --png ") + exit(1) + # create report class for reporting report = lf_report(_path=__path, @@ -610,9 +673,12 @@ Usage: lf_qa.py --store --png --path --databas _server=__server, _cut=__cut, _png=__png) + # csv_dash.sub_test_information() + if args.store: csv_dash.store() if args.png: + csv_dash.sub_test_information() csv_dash.generate_graph_png() # generate output reports @@ -654,6 +720,17 @@ Usage: lf_qa.py --store --png --path --databas report.set_custom_html(suite_html) report.build_custom() + # sub test summary + lf_subtest_summary = pd.DataFrame() + lf_subtest_summary['Subtest Total'] = [csv_dash.subtest_total] + lf_subtest_summary['Subtest Passed'] = [csv_dash.subtest_passed] + lf_subtest_summary['Subtest Falied'] = [csv_dash.subtest_failed] + + report.set_table_title("Suite Subtest Summary") + report.build_table_title() + report.set_table_dataframe(lf_subtest_summary) + report.build_table() + # png summary of test report.set_table_title("Suite Summary") report.build_table_title() From 287d3af2f75ba8596e98885fe075f279d2101f5d Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 4 Dec 2021 07:56:07 -0700 Subject: [PATCH 611/731] lf_check.py : update latest at top directory for suite Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 302e0cea..5df5ead4 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -106,6 +106,7 @@ import argparse import json import subprocess import csv +import shutil import shlex import paramiko import pandas as pd @@ -1216,6 +1217,10 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a default="") parser.add_argument('--logfile', help="--logfile logging for output of lf_check.py script", default="lf_check.log") + parser.add_argument( + '--update_latest', + help="--update_latest copy latest results to top dir", + action='store_true') args = parser.parse_args() @@ -1469,7 +1474,54 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a print("lf_check_html_report: " + html_report) check.send_results_email(report_file=html_report) + # + if args.update_latest: + report_path = os.path.dirname(html_report) + parent_report_dir = os.path.dirname(report_path) + # copy results to lastest so someone may see the latest. + # duplicates html_report file up one directory is the destination + html_report_latest = parent_report_dir + "/{dir}_latest.html".format(dir=__dir) + + banner_src_png = report_path + "/banner.png" + banner_dest_png = parent_report_dir + "/banner.png" + CandelaLogo_src_png = report_path + "/CandelaLogo2-90dpi-200x90-trans.png" + CandelaLogo_dest_png = parent_report_dir + "/CandelaLogo2-90dpi-200x90-trans.png" + CandelaLogo_small_src_png = report_path + "/candela_swirl_small-72h.png" + CandelaLogo_small_dest_png = parent_report_dir + "/candela_swirl_small-72h.png" + report_src_css = report_path + "/report.css" + report_dest_css = parent_report_dir + "/report.css" + custom_src_css = report_path + "/custom.css" + custom_dest_css = parent_report_dir + "/custom.css" + font_src_woff = report_path + "/CenturyGothic.woff" + font_dest_woff = parent_report_dir + "/CenturyGothic.woff" + + # pprint.pprint([ + # ('banner_src', banner_src_png), + # ('banner_dest', banner_dest_png), + # ('CandelaLogo_src_png', CandelaLogo_src_png), + # ('CandelaLogo_dest_png', CandelaLogo_dest_png), + # ('report_src_css', report_src_css), + # ('custom_src_css', custom_src_css) + # ]) + + # copy one directory above + try: + shutil.copyfile(html_report, html_report_latest) + except BaseException: + print("unable to copy results from {html} to {html_latest}".format(html=html_report, html_latest=html_report_latest)) + print("check permissions on {html_report_latest}".format(html_report_latest=html_report_latest)) + + # copy banner and logo up one directory, + shutil.copyfile(banner_src_png, banner_dest_png) + shutil.copyfile(CandelaLogo_src_png, CandelaLogo_dest_png) + shutil.copyfile(report_src_css, report_dest_css) + shutil.copyfile(custom_src_css, custom_dest_css) + shutil.copyfile(font_src_woff, font_dest_woff) + shutil.copyfile(CandelaLogo_small_src_png, CandelaLogo_small_dest_png) + + # print out locations of results + print("html_report_latest: {latest}".format(latest=html_report_latest)) if __name__ == '__main__': main() From dafc866b498a0403300f2b89b7c684891e5f3c89 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 4 Dec 2021 08:11:00 -0700 Subject: [PATCH 612/731] lf_qa.py : fixed check for empty list Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_qa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 31c647da..950d6db3 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -432,7 +432,7 @@ class csv_sql: self.dut_serial_num_list = list(set(list(df_tmp['dut-serial-num']))) self.dut_serial_num_list = [x for x in self.dut_serial_num_list if x is not None] - if self.dut_serial_num_list[-1]: + if self.dut_serial_num_list: self.dut_serial_num = self.dut_serial_num_list[-1] print( From e3066eae2c969c3e3adf01df1444e9cc56a87c15 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 4 Dec 2021 09:33:45 -0700 Subject: [PATCH 613/731] lf_check.py : updated json exception to point to the file Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 5df5ead4..26351ee0 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1227,27 +1227,30 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # load test config file information either .json json_rig = "" try: - print("args.json_rig {rig}".format(rig=args.json_rig)) + print("reading json_rig: {rig}".format(rig=args.json_rig)) with open(args.json_rig, 'r') as json_rig_config: json_rig = json.load(json_rig_config) - except BaseException: - print("Error reading {}".format(args.json_rig)) + except json.JSONDecodeError as err: + print("ERROR reading {json}, ERROR: {error} ".format(json=args.json_rig,error=err)) + exit(1) json_dut = "" try: - print("args.json_dut {dut}".format(dut=args.json_dut)) + print("reading json_dut: {dut}".format(dut=args.json_dut)) with open(args.json_dut, 'r') as json_dut_config: json_dut = json.load(json_dut_config) - except BaseException: - print("Error reading {}".format(args.json_dut)) + except json.JSONDecodeError as err: + print("ERROR reading {json}, ERROR: {error} ".format(json=args.json_dut,error=err)) + exit(1) json_test = "" try: - print("args.json_test {}".format(args.json_test)) + print("reading json_test: {}".format(args.json_test)) with open(args.json_test, 'r') as json_test_config: json_test = json.load(json_test_config) - except BaseException: - print("Error reading {}".format(args.json_test)) + except json.JSONDecodeError as err: + print("ERROR reading {json}, ERROR: {error} ".format(json=args.json_test,error=err)) + exit(1) # Test-rig information information lanforge_system_node_version = 'NO_LF_NODE_VER' @@ -1328,21 +1331,21 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a scripts_git_sha = check.get_scripts_git_sha() print("git_sha {sha}".format(sha=scripts_git_sha)) except BaseException: - print("git_sha read exception ") + print("WARNING: git_sha read exception unable to read") try: lanforge_system_node_version = check.get_lanforge_system_node_version() print("lanforge_system_node_version {system_node_ver}".format( system_node_ver=lanforge_system_node_version)) except BaseException: - print("lanforge_system_node_version exception") + print("WARNING: lanforge_system_node_version exception") try: lanforge_fedora_version = check.get_lanforge_fedora_version() print("lanforge_fedora_version {fedora_ver}".format( fedora_ver=lanforge_fedora_version)) except BaseException: - print("lanforge_fedora_version exception, tests aborted check lanforge ip") + print("ERROR: lanforge_fedora_version exception, tests aborted check lanforge ip") exit(1) try: @@ -1350,7 +1353,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a print("lanforge_kernel_version {kernel_ver}".format( kernel_ver=lanforge_kernel_version)) except BaseException: - print("lanforge_kernel_version exception, tests aborted check lanforge ip") + print("ERROR: lanforge_kernel_version exception, tests aborted check lanforge ip") exit(1) try: @@ -1358,7 +1361,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a print("lanforge_server_version_full {lanforge_server_version_full}".format( lanforge_server_version_full=lanforge_server_version_full)) except BaseException: - print("lanforge_server_version exception, tests aborted check lanforge ip") + print("ERROR: lanforge_server_version exception, tests aborted check lanforge ip") exit(1) try: @@ -1366,7 +1369,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a print("lanforge_gui_version_full {lanforge_gui_version_full}".format( lanforge_gui_version_full=lanforge_gui_version_full)) except BaseException: - print("lanforge_gui_version exception, tests aborted check lanforge ip") + print("ERROR: lanforge_gui_version exception, tests aborted check lanforge ip") exit(1) try: @@ -1396,7 +1399,7 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a try: firmware_version = lanforge_radio_json[key]['firmware version'] except BaseException: - print("5.4.3 radio fw version not in /radiostatus/all") + print("5.4.3 radio fw version not in /radiostatus/all ") firmware_version = "5.4.3 N/A" lf_radio_df = lf_radio_df.append( From ab608f1dc2c2ddd632fecce034580901b6961d97 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 4 Dec 2021 10:14:55 -0700 Subject: [PATCH 614/731] lf_check.py : added test suite duration , start and tend time. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 26351ee0..7b19b0f5 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -195,6 +195,9 @@ class lf_check(): # results self.test_server = "" self.database_sqlite = "" + self.suite_start_time = "" + self.suite_end_time = "" + self.suite_duration = "" self.test_start_time = "" self.test_end_time = "" self.duration = "" @@ -712,6 +715,13 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) def run_script_test(self): self.start_html_results() self.start_csv_results() + # Suite start time + suite_start_time = datetime.datetime.now() + self.suite_start_time = str(datetime.datetime.now().strftime( + "%Y-%m-%d-%H-%M-%S")).replace(':', '-') + self.logger.info("Suite Start Time {suite_time}".format( + suite_time=self.suite_start_time)) + # Configure Tests for test in self.test_dict: if self.test_dict[test]['enabled'] == "FALSE": @@ -1151,6 +1161,17 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) else: self.logger.info( "enable value {} for test: {} ".format(self.test_dict[test]['enabled'], test)) + + suite_end_time = datetime.datetime.now() + self.suite_end_time = str(datetime.datetime.now().strftime( + "%Y-%m-%d-%H-%M-%S")).replace(':', '-') + self.logger.info("Suite End Time: {suite_time}".format( + suite_time=self.suite_end_time)) + suite_time_delta = suite_end_time - suite_start_time + self.suite_duration = "{day}d {seconds}s {msec} ms".format( + day=suite_time_delta.days, seconds=suite_time_delta.seconds, msec=suite_time_delta.microseconds) + self.logger.info("Suite Duration: {suite_duration}".format( + suite_duration=self.suite_duration)) self.finish_html_results() @@ -1433,6 +1454,12 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # Successfully gathered LANforge information Run Tests check.run_script_test() + lf_suite_time = pd.DataFrame() + lf_suite_time['Suite Start'] = [check.suite_start_time] + lf_suite_time['Suite End'] = [check.suite_end_time] + lf_suite_time['Suite Duration'] = [check.suite_duration] + + lf_test_summary = pd.DataFrame() lf_test_summary['Tests Run'] = [check.tests_run] lf_test_summary['Success'] = [check.tests_success] @@ -1457,11 +1484,15 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a report.build_table_title() report.set_table_dataframe(lf_radio_df) report.build_table() - report.set_table_title("LF Check Test Summary") + report.set_table_title("LF Check Suite Run") + report.build_table_title() + report.set_table_dataframe(lf_suite_time) + report.build_table() + report.set_table_title("LF Check Suite Summary") report.build_table_title() report.set_table_dataframe(lf_test_summary) report.build_table() - report.set_table_title("LF Check Test Results") + report.set_table_title("LF Check Suite Results") report.build_table_title() html_results = check.get_html_results() report.set_custom_html(html_results) From 5f753e6b514a70fe022a66161d00972ea5eb719f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 4 Dec 2021 10:26:37 -0700 Subject: [PATCH 615/731] lf_check.py : show the copy when hovering Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 7b19b0f5..b085b096 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1126,20 +1126,23 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.html_results += """
""" self.html_results += """""" - # TODO - plase copy button at end and selectable , so + # TODO - place copy button at end and selectable , so # individual sections may be copied if command != short_cmd: - '''self.html_results += f""" - """.format(command=command)''' - self.html_results += f""" """.format(command=command) - - # nocopy + ''' + # nocopy - example ''' self.html_results += f"""' % ( - column_name, duts[column]) + '' % + (column_name, duts[column]) ) dut_table = '
Command NameCommandStatusExecution timeSTDOUTSTDERR
Command NameCommand Status Execution time STDOUT
+ # Hover and copy button snows up + self.html_results += f"""
Copy {command}
+ """.format(command=command) + # TODO - place a point button for not have the copy + # hover, no copy button + '''self.html_results += f"""
{command}
{command} From a563fe9d3e2fa5b67b6d7f1558fd5e96de0e8e60 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 6 Dec 2021 07:09:04 -0700 Subject: [PATCH 616/731] lf_check.py : added lf qa link to output report lf_qa.py : removed None prior to sorting lists to prevent exceptions ct_us_002_tests.json : updated test_l3_longevity.py test report.css , reduced the size of copy button to 10 px to prevent jumping. Signed-off-by: Chuck SmileyRekiere --- py-scripts/artifacts/report.css | 4 ++-- py-scripts/tools/ct_us_002_tests.json | 8 ++++--- py-scripts/tools/lf_check.py | 31 ++++++++++++++++++--------- py-scripts/tools/lf_qa.py | 3 +++ 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/py-scripts/artifacts/report.css b/py-scripts/artifacts/report.css index 542ba429..517d9190 100644 --- a/py-scripts/artifacts/report.css +++ b/py-scripts/artifacts/report.css @@ -368,8 +368,8 @@ td.scriptdetails span.copybtn { } td.scriptdetails:hover span.copybtn { display: inline-block; - padding: 5px; - font-size: 12px; + padding: 2px; + font-size:10px; float: left; color: #050; background: white; diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 94bccda7..45013704 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -12,9 +12,11 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --test_duration 60s --polling_interval 15s --upstream_port eth2 ", - " --radio 'radio==wiphy1,stations==4,ssid==NETGEAR59,ssid_pw==crispynest798,security==wpa2' ", - " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000" + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port eth2 ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" ] }, "lf_qa":{ diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index b085b096..5fc10a9b 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -243,8 +243,8 @@ class lf_check(): self.qa_report_html = "NA" self.database_qa = "" self.table_qa = "" - self.test_run = "" + self.hostname = "" def get_test_rig(self): return self.test_rig @@ -403,7 +403,7 @@ class lf_check(): report_url = report_file.replace('/home/lanforge/', '') if report_url.startswith('/'): report_url = report_url[1:] - qa_url = self.qa_report_html.replace('home/lanforge', '') + qa_url = self.qa_report_html.replace('/home/lanforge', '') if qa_url.startswith('/'): qa_url = qa_url[1:] # following recommendation @@ -411,14 +411,14 @@ class lf_check(): # Mail # command to check if mail running : systemctl status postfix # command = 'echo "$HOSTNAME mail system works!" | mail -s "Test: $HOSTNAME $(date)" chuck.rekiere@candelatech.com' - hostname = socket.getfqdn() - ip = socket.gethostbyname(hostname) + self.hostname = socket.getfqdn() + ip = socket.gethostbyname(self.hostname) # a hostname lacking dots by definition lacks a domain name # this is not useful for hyperlinks outside the known domain, so an IP # address should be preferred - if hostname.find('.') < 1: - hostname = ip + if self.hostname.find('.') < 1: + self.hostname = ip message_txt = "" if (self.email_txt != ""): @@ -427,12 +427,12 @@ Results from {hostname}: Suite: {suite} Database: {db} http://{hostname}/{report} -""".format(email_txt=self.email_txt, lf_mgr_ip=self.lf_mgr_ip, suite=self.test_suite, db=self.database_sqlite, hostname=hostname, report=report_url) +""".format(email_txt=self.email_txt, lf_mgr_ip=self.lf_mgr_ip, suite=self.test_suite, db=self.database_sqlite, hostname=self.hostname, report=report_url) else: message_txt = """Results from {hostname}: Suite: {suite} Database: {db} -http://{hostname}/{report}""".format(hostname=hostname, suite=self.test_suite, db=self.database_sqlite, report=report_url) +http://{hostname}/{report}""".format(hostname=self.hostname, suite=self.test_suite, db=self.database_sqlite, report=report_url) # Put in report information current two methods supported, message_txt += """ @@ -441,10 +441,10 @@ http://{ip_qa}/{qa_url} NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if (self.email_title_txt != ""): - mail_subject = "{email} [{hostname}] {suite} {date}".format(email=self.email_title_txt, hostname=hostname, + mail_subject = "{email} [{hostname}] {suite} {date}".format(email=self.email_title_txt, hostname=self.hostname, suite=self.test_suite, db=self.database_sqlite, date=datetime.datetime.now()) else: - mail_subject = "Regression Test [{hostname}] {suite} {date}".format(hostname=hostname, + mail_subject = "Regression Test [{hostname}] {suite} {date}".format(hostname=self.hostname, suite=self.test_suite, db=self.database_sqlite, date=datetime.datetime.now()) try: if self.production_run: @@ -1457,6 +1457,9 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a # Successfully gathered LANforge information Run Tests check.run_script_test() + # Add the qa_report_html + qa_report_html = check.qa_report_html + lf_suite_time = pd.DataFrame() lf_suite_time['Suite Start'] = [check.suite_start_time] lf_suite_time['Suite End'] = [check.suite_end_time] @@ -1491,6 +1494,14 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a report.build_table_title() report.set_table_dataframe(lf_suite_time) report.build_table() + if "NA" not in qa_report_html: + qa_url = qa_report_html.replace('/home/lanforge', '') + if qa_url.startswith('/'): + qa_url = qa_url[1:] + report.set_table_title("LF Check QA ") + report.build_table_title() + report.build_link("QA Test Results", qa_url) + report.set_table_title("LF Check Suite Summary") report.build_table_title() report.set_table_dataframe(lf_test_summary) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 950d6db3..8617c113 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -466,6 +466,7 @@ class csv_sql: # graph group and test-tag are used for detemining the graphs, can use any columns # the following list manipulation removes the duplicates graph_group_list = list(df3['Graph-Group']) + graph_group_list = [x for x in graph_group_list if x is not None] graph_group_list = list(set(graph_group_list)) print("graph_group_list: {}".format(graph_group_list)) @@ -473,10 +474,12 @@ class csv_sql: # print("dataframe df3 {df3}".format(df3=df3)) test_tag_list = list(df3['test-tag']) + test_tag_list = [x for x in test_tag_list if x is not None] test_tag_list = list(sorted(set(test_tag_list))) # print("test_tag_list: {}".format(test_tag_list) ) test_rig_list = list(df3['test-rig']) + test_rig_list = [x for x in test_rig_list if x is not None] test_rig_list = list(sorted(set(test_rig_list))) self.test_rig_list = test_rig_list print("test_rig_list: {}".format(test_rig_list)) From bd6ce10620ca5c6b75f44e066fc70f4d11af07ec Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 09:18:20 -0800 Subject: [PATCH 617/731] regression_test: lf_snp_test command change Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 14750067..ba1f4452 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -303,7 +303,7 @@ else --duration 20 \ --channel 52 \ --radio_mode AUTO" - "./lf_snp_test.py --mgr $MGR --radio $RADIO_USED" + "./lf_snp_test.py --help" "./lf_tr398_test.py --mgr $MGR --upstream $UPSTREAM" #./lf_webpage "./lf_wifi_capacity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ From 8e3f50a6dcf1ee8a53a68d9f11b2e52d5f851a55 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 09:20:49 -0800 Subject: [PATCH 618/731] regression_test: comment out test_wanlink for now Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index ba1f4452..1fa7b21f 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -369,7 +369,7 @@ else #./test_l3_WAN_LAN "./test_l4.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --test_duration 15s" "./test_status_msg.py --debug --mgr $MGR" #this is all which is needed to run - "./test_wanlink.py --name my_wanlink4 --latency_A 20 --latency_B 69 --rate 1000 --jitter_A 53 --jitter_B 73 --jitter_freq 6 --drop_A 12 --drop_B 11 --debug --mgr $MGR" + #"./test_wanlink.py --name my_wanlink4 --latency_A 20 --latency_B 69 --rate 1000 --jitter_A 53 --jitter_B 73 --jitter_freq 6 --drop_A 12 --drop_B 11 --debug --mgr $MGR" #./test_wpa_passphrases #./tip_station_powersave #./video_rates From 46314d25636a03c2baa400d087cec2a2d7dbdc6a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 09:33:08 -0800 Subject: [PATCH 619/731] kaleido is no longer used anywhere in our library Signed-off-by: Matthew Stidham --- py-scripts/update_dependencies.py | 2 +- python.3.6.requirements.txt | 1 - requirements.txt | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/py-scripts/update_dependencies.py b/py-scripts/update_dependencies.py index 95e65268..b25dad77 100755 --- a/py-scripts/update_dependencies.py +++ b/py-scripts/update_dependencies.py @@ -26,7 +26,7 @@ def main(): print("Installing Script Python3 Dependencies") packages = ['pandas', 'plotly', 'numpy', 'cryptography', 'paramiko', 'pyarrow', 'websocket-client', 'xlsxwriter', 'pyshark', 'influxdb', 'influxdb-client', 'matplotlib', 'pdfkit', 'pip-search', 'pyserial', - 'pexpect-serial', 'scp', 'dash', 'kaleido'] + 'pexpect-serial', 'scp', 'dash'] if args.pyjwt: packages.append('pyjwt') else: diff --git a/python.3.6.requirements.txt b/python.3.6.requirements.txt index 55759883..e38edefe 100644 --- a/python.3.6.requirements.txt +++ b/python.3.6.requirements.txt @@ -24,7 +24,6 @@ iperf3==0.1.10 itsdangerous>=2.0.1 Jinja2>=3.0.2 jwt>=1.3.1 -kaleido>=0.2.1 kiwisolver>=1.3.1 lxml>=4.6.4 MarkupSafe>=2.0.1 diff --git a/requirements.txt b/requirements.txt index dcf67b90..2dc0ad2b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,7 +22,6 @@ influxdb-client>=1.23.0 itsdangerous>=2.0.1 Jinja2>=3.0.2 jwt>=1.3.1 -kaleido>=0.2.1 kiwisolver>=1.3.2 lxml>=4.6.4 MarkupSafe>=2.0.1 From 41fb4fa7caf5310cc2098194043eab060df6f900 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 09:42:43 -0800 Subject: [PATCH 620/731] requirements: jwt is old news. Use pyjwt instead. Signed-off-by: Matthew Stidham --- python.3.6.requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python.3.6.requirements.txt b/python.3.6.requirements.txt index e38edefe..d4de7118 100644 --- a/python.3.6.requirements.txt +++ b/python.3.6.requirements.txt @@ -23,7 +23,7 @@ influxdb-client>=1.23.0 iperf3==0.1.10 itsdangerous>=2.0.1 Jinja2>=3.0.2 -jwt>=1.3.1 +pyjwt>=2.3.0 kiwisolver>=1.3.1 lxml>=4.6.4 MarkupSafe>=2.0.1 From d7784bebdee3bde153d2b218ef2f68472a265ad2 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 09:43:09 -0800 Subject: [PATCH 621/731] requirements: jwt is old news. Use pyjwt instead. Signed-off-by: Matthew Stidham --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2dc0ad2b..a8c83445 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,7 +21,7 @@ influxdb>=5.3.1 influxdb-client>=1.23.0 itsdangerous>=2.0.1 Jinja2>=3.0.2 -jwt>=1.3.1 +pyjwt>=2.3.0 kiwisolver>=1.3.2 lxml>=4.6.4 MarkupSafe>=2.0.1 From 3cba1decabff442e3de5cfff0050621b301dbd2a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 10:16:06 -0800 Subject: [PATCH 622/731] regression_test: test_fileio should use upstream port Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 1fa7b21f..1124ab8a 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -345,7 +345,7 @@ else # --b_max 0 # --debug" #test_client_admission.py - "./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 --test_duration 30s --mgr $MGR" # Better tested on Kelly, where VRF is turned off + "./test_fileio.py --macvlan_parent $UPSTREAM --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 --netmask 255.255.255.0 --gateway 192.168.92.1 --test_duration 30s --mgr $MGR" # Better tested on Kelly, where VRF is turned off "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug --mgr $MGR" "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security $SECURITY --debug --mgr $MGR" "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type iperf3 --debug --mgr $MGR" From 769cfff91213d010152c8560bea48784f9846bd7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 11:11:51 -0800 Subject: [PATCH 623/731] scenario.py: Check for BuildVersion, that will tell you whether the /events/ flag will work Signed-off-by: Matthew Stidham --- py-scripts/scenario.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/py-scripts/scenario.py b/py-scripts/scenario.py index dd5c4ab4..5f6f3105 100755 --- a/py-scripts/scenario.py +++ b/py-scripts/scenario.py @@ -53,7 +53,6 @@ class LoadScenario(Realm): stop=None, quiesce=None, timeout=120, - code=None, debug=False): super().__init__(lfclient_host=mgr, lfclient_port=mgr_port, @@ -67,7 +66,7 @@ class LoadScenario(Realm): self.stop = stop self.quiesce = quiesce self.timeout = timeout - self.code = code + self.BuildVersion = self.json_get('/')['VersionInfo']['BuildVersion'] self.starting_events = None def start_test(self): @@ -159,7 +158,6 @@ def main(): parser.add_argument('--timeout', help='Stop trying to load scenario after this many seconds', default=120) args = parser.parse_args() - code = requests.get('http://%s:8080/events' % args.mgr) scenario = LoadScenario(mgr=args.mgr, scenario=args.load, action=args.action, @@ -169,18 +167,17 @@ def main(): stop=args.stop, quiesce=args.quiesce, timeout=args.timeout, - code=code, debug=args.debug) - if code == 200: + if scenario.BuildVersion == '5.4.4': scenario.start_test() scenario.load_scenario() - if code != 200: + if scenario.BuildVersion != '5.4.4': print('sleeping 30 seconds, please upgrade your LANforge for a better experience, more information at https://www.candelatech.com/downloads.php#releases') time.sleep(30) - if code == 200: + if scenario.BuildVersion == '5.4.4': scenario.check_if_complete() # scenario_loader.load_scenario() From f9b334713839019c658dc0358c3015dee06f5c03 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 11:24:18 -0800 Subject: [PATCH 624/731] LFRequest: Fix whitespace Signed-off-by: Matthew Stidham --- py-json/LANforge/LFRequest.py | 64 +++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/py-json/LANforge/LFRequest.py b/py-json/LANforge/LFRequest.py index 422e650b..368e91a7 100644 --- a/py-json/LANforge/LFRequest.py +++ b/py-json/LANforge/LFRequest.py @@ -15,17 +15,17 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit() - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) debug_printer = PrettyPrinter(indent=2) + class LFRequest: Default_Base_URL = "http://localhost:8080" - No_Data = {'No Data':0} + No_Data = {'No Data': 0} requested_url = "" post_data = No_Data - default_headers = { 'Accept': 'application/json'} + default_headers = {'Accept': 'application/json'} proxies = None logger = logging.getLogger(__name__) @@ -63,7 +63,7 @@ class LFRequest: # pprint.pprint(self.proxies) if not url.startswith("http://") and not url.startswith("https://"): - self.logger.warning("No http:// or https:// found, prepending http:// to "+url) + self.logger.warning("No http:// or https:// found, prepending http:// to " + url) url = "http://" + url if uri is not None: if not url.endswith('/') and not uri.startswith('/'): @@ -77,7 +77,8 @@ class LFRequest: if self.requested_url.find('//'): protopos = self.requested_url.find("://") - self.requested_url = self.requested_url[:protopos + 2] + self.requested_url[protopos + 2:].replace("//", "/") + self.requested_url = self.requested_url[:protopos + 2] + self.requested_url[protopos + 2:].replace("//", + "/") # finding '#' prolly indicates a macvlan (eth1#0) # finding ' ' prolly indicates a field name that should imply %20 @@ -85,7 +86,7 @@ class LFRequest: self.requested_url = self.requested_url.replace('#', '%23') if self.requested_url.find(' ') >= 1: self.requested_url = self.requested_url.replace(' ', '+') - self.logger.debug("new LFRequest[%s]" % self.requested_url ) + self.logger.debug("new LFRequest[%s]" % self.requested_url) # request first url on stack def formPost(self, show_error=True, debug=False, die_on_error_=False): @@ -104,15 +105,14 @@ class LFRequest: opener = request.build_opener(request.ProxyHandler(self.proxies)) request.install_opener(opener) - - self.logger.debug("formPost: url: "+self.requested_url) + self.logger.debug("formPost: url: " + self.requested_url) if (self.post_data is not None) and (self.post_data is not self.No_Data): urlenc_data = urllib.parse.urlencode(self.post_data).encode("utf-8") self.logger.debug("formPost: data looks like:" + str(urlenc_data)) - self.logger.debug("formPost: url: "+self.requested_url) + self.logger.debug("formPost: url: " + self.requested_url) myrequest = request.Request(url=self.requested_url, - data=urlenc_data, - headers=self.default_headers) + data=urlenc_data, + headers=self.default_headers) else: myrequest = request.Request(url=self.requested_url, headers=self.default_headers) self.logger.error("No data for this formPost?") @@ -146,7 +146,8 @@ class LFRequest: return None def jsonPost(self, show_error=True, debug=False, die_on_error_=False, response_json_list_=None): - return self.json_post(show_error=show_error, debug=debug, die_on_error_=die_on_error_, response_json_list_=response_json_list_) + return self.json_post(show_error=show_error, debug=debug, die_on_error_=die_on_error_, + response_json_list_=response_json_list_) def json_post(self, show_error=True, debug=False, die_on_error_=False, response_json_list_=None, method_='POST'): if not debug and self.debug: @@ -160,9 +161,9 @@ class LFRequest: if (self.post_data is not None) and (self.post_data is not self.No_Data): myrequest = request.Request(url=self.requested_url, - method=method_, - data=json.dumps(self.post_data).encode("utf-8"), - headers=self.default_headers) + method=method_, + data=json.dumps(self.post_data).encode("utf-8"), + headers=self.default_headers) else: myrequest = request.Request(url=self.requested_url, headers=self.default_headers) self.logger.error("No data for this jsonPost?") @@ -176,7 +177,7 @@ class LFRequest: resp_data = resp.read().decode('utf-8') if debug and die_on_error_: self.logger.debug("----- LFRequest::json_post:128 debug: --------------------------------------------") - self.logger.debug("URL: <%s> status: %d "% (self.requested_url, resp.status)) + self.logger.debug("URL: <%s> status: %d " % (self.requested_url, resp.status)) if resp.status != 200: self.logger.debug(pformat(resp.getheaders())) self.logger.debug("----- resp_data:128 -------------------------------------------------") @@ -188,7 +189,8 @@ class LFRequest: raise ValueError("reponse_json_list_ needs to be type list") j = json.loads(resp_data) if debug: - self.logger.debug("----- LFRequest::json_post:140 debug: --------------------------------------------") + self.logger.debug( + "----- LFRequest::json_post:140 debug: --------------------------------------------") self.logger.debug(pformat(j)) self.logger.debug("-------------------------------------------------") response_json_list_.append(j) @@ -213,23 +215,23 @@ class LFRequest: return None def json_put(self, show_error=True, debug=False, die_on_error_=False, response_json_list_=None): - return self.json_post(show_error=show_error, - debug=debug, - die_on_error_=die_on_error_, - response_json_list_=response_json_list_, - method_='PUT') + return self.json_post(show_error=show_error, + debug=debug, + die_on_error_=die_on_error_, + response_json_list_=response_json_list_, + method_='PUT') def json_delete(self, show_error=True, debug=False, die_on_error_=False, response_json_list_=None): - return self.get_as_json(method_='DELETE') + return self.get_as_json(method_='DELETE') def get(self, method_='GET'): if self.debug: - self.logger.debug("LFUtils.get: url: "+self.requested_url) + self.logger.debug("LFUtils.get: url: " + self.requested_url) # https://stackoverflow.com/a/59635684/11014343 if (self.proxies is not None) and (len(self.proxies) > 0): opener = request.build_opener(request.ProxyHandler(self.proxies)) - #opener = urllib.request.build_opener(myrequest.ProxyHandler(self.proxies)) + # opener = urllib.request.build_opener(myrequest.ProxyHandler(self.proxies)) request.install_opener(opener) myrequest = request.Request(url=self.requested_url, @@ -271,7 +273,7 @@ class LFRequest: self.print_errors() return None if responses[0] is None: - self.logger.debug("No response from "+self.requested_url) + self.logger.debug("No response from " + self.requested_url) return None json_data = json.loads(responses[0].read().decode('utf-8')) return json_data @@ -288,7 +290,7 @@ class LFRequest: self.post_data = data def has_errors(self): - return (True, False)[len(self.error_list)>0] + return (True, False)[len(self.error_list) > 0] def print_errors(self): if not self.has_errors: @@ -297,6 +299,7 @@ class LFRequest: for err in self.error_list: self.logger.error("error: %s" % err) + def plain_get(url_=None, debug_=False, die_on_error_=False, proxies_=None): """ This static method does not respect LFRequest.proxy, it is not set in scope here @@ -337,8 +340,8 @@ def plain_get(url_=None, debug_=False, die_on_error_=False, proxies_=None): def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, error_list_=None, debug_=False): logger = logging.getLogger(__name__) - #logger.error("LFRequest::print_diagnostics: error_.__class__: %s"%error_.__class__) - #logger.error(pformat(error_)) + # logger.error("LFRequest::print_diagnostics: error_.__class__: %s"%error_.__class__) + # logger.error(pformat(error_)) if url_ is None: logger.warning("WARNING LFRequest::print_diagnostics: url_ is None") @@ -387,7 +390,8 @@ def print_diagnostics(url_=None, request_=None, responses_=None, error_=None, er if (error_list_ is not None) and isinstance(error_list_, list): error_list_.append("[%s HTTP %s] <%s> : %s" % (method, err_code, err_full_url, err_reason)) else: - logger.debug(" Content-type:[%s] Accept[%s]" % (request_.get_header('Content-type'), request_.get_header('Accept'))) + logger.debug( + " Content-type:[%s] Accept[%s]" % (request_.get_header('Content-type'), request_.get_header('Accept'))) if hasattr(request_, "data") and (request_.data is not None): logger.debug(" Data:") From 12f42638434f6ddaed3d4a764ffc07f432cfe2d5 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 11:24:32 -0800 Subject: [PATCH 625/731] lfcli_base: Fix whitespace Signed-off-by: Matthew Stidham --- py-json/LANforge/lfcli_base.py | 85 ++++++++++++++++------------------ 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 3fe4004a..934d9ffa 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -17,7 +17,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit() - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) debug_printer = pprint.PrettyPrinter(indent=2) @@ -30,17 +29,14 @@ if os.environ.get("LF_USE_AUTOGEN") == 1: LFSession = lanforge_api.LFSession - class LFCliBase: - - SHOULD_RUN = 0 # indicates normal operation - SHOULD_QUIT = 1 # indicates to quit loops, close files, send SIGQUIT to threads and return - SHOULD_HALT = 2 # indicates to quit loops, send SIGABRT to threads and exit + SHOULD_RUN = 0 # indicates normal operation + SHOULD_QUIT = 1 # indicates to quit loops, close files, send SIGQUIT to threads and return + SHOULD_HALT = 2 # indicates to quit loops, send SIGABRT to threads and exit # - LOGGING - _logger = logging.getLogger(__name__) - # do not use `super(LFCLiBase,self).__init__(self, host, port, _debug) # that is py2 era syntax and will force self into the host variable, making you # very confused. @@ -63,7 +59,7 @@ class LFCliBase: self.proxy = {} self.adjust_proxy(_proxy_str) - if (_local_realm is not None): + if _local_realm: self.local_realm = _local_realm # if (_debug): @@ -258,9 +254,9 @@ class LFCliBase: if debug_: debug_printer.pprint(_data) json_response = lf_r.json_post(show_error=debug_, - debug=debug_, - response_json_list_=response_json_list_, - die_on_error_=self.exit_on_error) + debug=debug_, + response_json_list_=response_json_list_, + die_on_error_=self.exit_on_error) if debug_ and (response_json_list_ is not None): pprint.pprint(response_json_list_) except Exception as x: @@ -347,7 +343,7 @@ class LFCliBase: def json_delete(self, _req_url, debug_=False): debug_ |= self.debug if debug_: - print("DELETE: "+_req_url) + print("DELETE: " + _req_url) json_response = None try: # print("----- DELETE ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ") @@ -358,7 +354,7 @@ class LFCliBase: die_on_error_=self.exit_on_error) json_response = lf_r.json_delete(debug=debug_, die_on_error_=False) print(json_response) - #debug_printer.pprint(json_response) + # debug_printer.pprint(json_response) if (json_response is None) and debug_: print("LFCliBase.json_delete: no entity/response, probabily status 404") return None @@ -424,11 +420,11 @@ class LFCliBase: print("Could not connect to LANforge GUI") sys.exit(1) - #return ALL messages in list form + # return ALL messages in list form def get_result_list(self): return self.test_results - #return ALL fail messages in list form + # return ALL fail messages in list form def get_failed_result_list(self): fail_list = [] for result in self.test_results: @@ -436,7 +432,7 @@ class LFCliBase: fail_list.append(result) return fail_list - #return ALL pass messages in list form + # return ALL pass messages in list form def get_passed_result_list(self): pass_list = [] for result in self.test_results: @@ -455,7 +451,7 @@ class LFCliBase: def get_all_message(self): return "\n".join(self.test_results) - #determines if overall test passes via comparing passes vs. fails + # determines if overall test passes via comparing passes vs. fails def passes(self): pass_counter = 0 fail_counter = 0 @@ -468,11 +464,11 @@ class LFCliBase: return True return False - #EXIT script with a fail + # EXIT script with a fail def exit_fail(self, message="%d out of %d tests failed. Exiting script with script failure."): - total_len=len(self.get_result_list()) - fail_len=len(self.get_failed_result_list()) - print(message %(fail_len,total_len)) + total_len = len(self.get_result_list()) + fail_len = len(self.get_failed_result_list()) + print(message % (fail_len, total_len)) sys.exit(1) # use this inside the class to log a failure result and print it if wished @@ -483,17 +479,17 @@ class LFCliBase: if self.exit_on_fail: sys.exit(1) - #EXIT script with a success - def exit_success(self,message="%d out of %d tests passed successfully. Exiting script with script success."): - num_total=len(self.get_result_list()) - num_passing=len(self.get_passed_result_list()) - print(message %(num_passing,num_total)) + # EXIT script with a success + def exit_success(self, message="%d out of %d tests passed successfully. Exiting script with script success."): + num_total = len(self.get_result_list()) + num_passing = len(self.get_passed_result_list()) + print(message % (num_passing, num_total)) sys.exit(0) - def success(self,message="%d out of %d tests passed successfully."): - num_total=len(self.get_result_list()) - num_passing=len(self.get_passed_result_list()) - print(message %(num_passing,num_total)) + def success(self, message="%d out of %d tests passed successfully."): + num_total = len(self.get_result_list()) + num_passing = len(self.get_passed_result_list()) + print(message % (num_passing, num_total)) # use this inside the class to log a pass result and print if wished. def _pass(self, message, print_=False): @@ -517,7 +513,6 @@ class LFCliBase: # print("lfclibase::self.proxy: ") # pprint.pprint(self.proxy) - @staticmethod def logg2(level="debug", mesg=None): if (mesg is None) or (mesg == ""): @@ -539,8 +534,8 @@ class LFCliBase: """ if (mesg is None) or (mesg == "") or (level is None): return - userhome=os.path.expanduser('~') - session = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':','-') + userhome = os.path.expanduser('~') + session = str(datetime.datetime.now().strftime("%Y-%m-%d-%H-h-%M-m-%S-s")).replace(':', '-') if filename is None: if not os.path.isdir("%s/report-data/%s" % (userhome, session)): if not os.path.isdir('%s/report-data' % userhome): @@ -557,7 +552,7 @@ class LFCliBase: logging.warning(mesg) elif level == "error": logging.error(mesg) - + @staticmethod def parse_time(time_string): if isinstance(time_string, str): @@ -645,7 +640,7 @@ class LFCliBase: optional = parser.add_argument_group('optional arguments') required = parser.add_argument_group('required arguments') - #Optional Args + # Optional Args optional.add_argument('--mgr', default='localhost', help='hostname for where LANforge GUI is running') @@ -687,13 +682,13 @@ class LFCliBase: default=None, help="Specify a file to send debug output to") if more_optional is not None: - for argument in more_optional: - if 'default' in argument.keys(): - optional.add_argument(argument['name'], help=argument['help'], default=argument['default']) - else: - optional.add_argument(argument['name'], help=argument['help']) + for argument in more_optional: + if 'default' in argument.keys(): + optional.add_argument(argument['name'], help=argument['help'], default=argument['default']) + else: + optional.add_argument(argument['name'], help=argument['help']) - #Required Args + # Required Args required.add_argument('--radio', help='radio EID, e.g: 1.wiphy2') required.add_argument('--security', @@ -736,7 +731,7 @@ class LFCliBase: filename = open(filename, 'r') return [line.split(',') for line in filename.readlines()] - #Function creates random characters made of letters + # Function creates random characters made of letters @staticmethod def random_chars(size, chars=None): if chars is None: @@ -745,11 +740,11 @@ class LFCliBase: @staticmethod def get_milliseconds(timestamp): - return (timestamp - datetime.datetime(1970,1,1)).total_seconds()*1000 + return (timestamp - datetime.datetime(1970, 1, 1)).total_seconds() * 1000 @staticmethod def get_seconds(timestamp): - return (timestamp - datetime.datetime(1970,1,1)).total_seconds() + return (timestamp - datetime.datetime(1970, 1, 1)).total_seconds() @staticmethod def replace_special_char(special_str): @@ -770,4 +765,4 @@ class LFCliBase: bgnAC : 11, abgnAX : 12, bgnAX : 13 -""" +""" From 42921c4e7a10c3ef2d4956eb98d2b9195a3f3fd4 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 11:30:46 -0800 Subject: [PATCH 626/731] scenario.py: Remove unused import Signed-off-by: Matthew Stidham --- py-scripts/scenario.py | 1 - 1 file changed, 1 deletion(-) diff --git a/py-scripts/scenario.py b/py-scripts/scenario.py index 5f6f3105..cd44b3b0 100755 --- a/py-scripts/scenario.py +++ b/py-scripts/scenario.py @@ -4,7 +4,6 @@ import os import importlib import argparse import time -import requests if sys.version_info[0] != 3: print("This script requires Python 3") From 29e5f810784828457ddc19cc721bd9039f729be4 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 11:32:06 -0800 Subject: [PATCH 627/731] GhostRequest: Use staticmethod where relevant Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index ce0dc586..b46329df 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -29,8 +29,8 @@ RecordInflux = InfluxRequest.RecordInflux class CSVReader: - def read_csv(self, - file, + @staticmethod + def read_csv(file, sep='\t'): df = open(file).read().split('\n') rows = list() @@ -39,8 +39,8 @@ class CSVReader: rows.append(x.split(sep)) return rows - def get_column(self, - df, + @staticmethod + def get_column(df, value): index = df[0].index(value) values = [] @@ -48,7 +48,8 @@ class CSVReader: values.append(row[index]) return values - def get_columns(self, df, targets): + @staticmethod + def get_columns(df, targets): target_index = [] for item in targets: target_index.append(df[0].index(item)) @@ -60,7 +61,8 @@ class CSVReader: results.append(row_data) return results - def to_html(self, df): + @staticmethod + def to_html(df): html = '' html = html + ('' '' @@ -78,7 +80,8 @@ class CSVReader: '
') return html - def filter_df(self, df, column, expression, target): + @staticmethod + def filter_df(df, column, expression, target): target_index = df[0].index(column) counter = 0 targets = [0] @@ -98,7 +101,8 @@ class CSVReader: counter += 1 return list(map(df.__getitem__, targets)) - def concat(self, dfs): + @staticmethod + def concat(dfs): return list(itertools.chain.from_iterable(dfs)) From ecea4c13a4b11a8e7f1e3a63ccaaa30119ceaae0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 11:37:26 -0800 Subject: [PATCH 628/731] GhostRequest: Cleanup whitespace Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index b46329df..56a2be1e 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -208,7 +208,6 @@ class GhostRequest: def custom_post(self, folder, - authors, title='custom'): self.upload_images(folder) head = '''This is a custom post created via a script''' @@ -219,11 +218,9 @@ class GhostRequest: text=head) def kpi_to_ghost(self, - authors, folders, parent_folder=None, title=None, - server_pull=None, ghost_host=None, port=22, user_push=None, @@ -231,13 +228,12 @@ class GhostRequest: customer=None, testbed=None, test_run=None, - target_folders=list(), + target_folders=None, grafana_token=None, grafana_host=None, grafana_port=3000, grafana_datasource='InfluxDB', grafana_bucket=None): - global dut_hw, dut_sw, dut_model, dut_serial now = datetime.now() @@ -444,7 +440,7 @@ class GhostRequest: # create Grafana Dashboard target_files = [] for folder in target_folders: - target_file=folder.split('/')[-1] + '/kpi.csv' + target_file = folder.split('/')[-1] + '/kpi.csv' try: open(target_file) target_files.append(target_file) @@ -506,7 +502,8 @@ class GhostRequest: Influx Host: %s
Influx Port: %s
Influx Organization: %s
- Influx Bucket: %s
''' % (influx_error, self.influx_host, self.influx_port, self.influx_org, self.influx_bucket) + Influx Bucket: %s
''' % ( + influx_error, self.influx_host, self.influx_port, self.influx_org, self.influx_bucket) raw_test_tags = list() test_tag_table = '' @@ -528,8 +525,8 @@ class GhostRequest: else: column_name = column dut_table_columns += ( - '
%s%s
%s%s
Date: Mon, 6 Dec 2021 11:56:43 -0800 Subject: [PATCH 629/731] pyjwt no longer support python 3.6 Signed-off-by: Matthew Stidham --- python.3.6.requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python.3.6.requirements.txt b/python.3.6.requirements.txt index d4de7118..3f28dc43 100644 --- a/python.3.6.requirements.txt +++ b/python.3.6.requirements.txt @@ -23,7 +23,7 @@ influxdb-client>=1.23.0 iperf3==0.1.10 itsdangerous>=2.0.1 Jinja2>=3.0.2 -pyjwt>=2.3.0 +pyjwt>=2.2.0 kiwisolver>=1.3.1 lxml>=4.6.4 MarkupSafe>=2.0.1 From bc47c2408781ea2fb898a97aa13112a446a67c62 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 14:07:44 -0800 Subject: [PATCH 630/731] mine_regression_results: Initial commit Signed-off-by: Matthew Stidham --- py-scripts/tools/mine_regression_results.py | 65 +++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 py-scripts/tools/mine_regression_results.py diff --git a/py-scripts/tools/mine_regression_results.py b/py-scripts/tools/mine_regression_results.py new file mode 100755 index 00000000..7f210eed --- /dev/null +++ b/py-scripts/tools/mine_regression_results.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +import pandas as pd +import argparse + + +class MineRegression: + def __init__(self, + system_information=None, + save_csv=False): + self.df = None + self.system_info = system_information + self.save_csv = save_csv + + def generate_csv(self): + if self.system_info: + systems = pd.read_csv(self.system_info) + ips = systems['Machine'] + else: + system_info = {'192.168.92.18': ['3.7.7', '5.4.4', 'F30', '.local'], + '192.168.92.12': ['3.9.7', '5.4.4', 'F34', '.local'], + '192.168.93.51': ['3.7.7', '5.4.4', 'F30', 'venv'], + '192.168.92.15': ['3.6.6', '5.4.4', 'F27', '.local']} + ips = list(system_info.keys()) + systems = pd.DataFrame(system_info).transpose().reset_index() + systems.columns = ['Machine', 'Python version', 'LF version', 'Fedora version', 'environment'] + results = [pd.read_html('http://%s/html-reports/latest.html' % url)[0] for url in ips] + for result in list(range(0, len(ips))): + results[result]['Machine'] = ips[result] + self.df = pd.concat(results) + self.df = pd.merge(self.df, systems, on='Machine') + self.df = self.df[self.df['STDOUT'] == 'STDOUT'] + + def generate_report(self): + system_variations = self.df[['Python version', 'LF version', 'Fedora version', 'environment']].drop_duplicates().reset_index( + drop=True) + errors = list() + for index in system_variations.index: + variation = system_variations.iloc[index] + result = self.df.loc[self.df[['Python version', 'LF version', 'Fedora version', 'environment']].isin(dict( + variation).values()).all(axis=1), :].dropna(subset=['STDERR']).shape[0] + errors.append(result) + system_variations['errors'] = errors + if self.save_csv: + system_variations.to_csv('regression_suite_results.csv') + else: + print(system_variations.sort_values('errors')) + + +def main(): + parser = argparse.ArgumentParser(description='Compare regression results from different systems') + parser.add_argument('--system_info', help='location of system information csv', default=None) + parser.add_argument('--save_csv', help='save CSV of results', default=False) + + args = parser.parse_args() + + Miner = MineRegression(system_information=args.system_info, + save_csv=args.save_csv) + + Miner.generate_csv() + + Miner.generate_report() + + +if __name__ == '__main__': + main() From 89260e21e32232f8119aca3c74037eefc3a31534 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 14:28:31 -0800 Subject: [PATCH 631/731] regression_test: Allow more than one radio to be defined in regression_test Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 1124ab8a..501eb812 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -21,7 +21,7 @@ Help() } -while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:" option; do +while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:M:" option; do case "${option}" in h) # display Help Help @@ -64,6 +64,9 @@ while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:" option; do H) ./lf_help_check.bash ;; + M) + RADIO2=${OPTARG} + ;; *) ;; @@ -101,6 +104,9 @@ if [[ ${#RADIO_USED} -eq 0 ]]; then # Allow the user to change the radio they te RADIO_USED="wiphy1" fi +if [[ ${#RADIO2} -eq 0 ]]; then # Allow the user to change the radio they test against + RADIO_USED="wiphy0" +fi if [[ ${#UPSTREAM} -eq 0 ]]; then UPSTREAM="eth1" fi @@ -355,9 +361,9 @@ else "./test_ip_connection.py --radio $RADIO_USED --num_stations $NUM_STA --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format excel --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" - "./test_ip_connection.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --ipv6" + "./test_ip_connection.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --ipv6 --test_duration 15s" "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" - "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" + "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --radio2 $RADIO2" "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_tcp' --upstream_port 1.1.$UPSTREAM --radio 'radio==1.1.wiphy0 stations==10 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --radio From 56c30eb0ac58b6335b01ce41fb1ac16776ce9249 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 14:29:35 -0800 Subject: [PATCH 632/731] test_ipv4_ps: Allow user to define radio to create monitor on Signed-off-by: Matthew Stidham --- py-scripts/test_ipv4_ps.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py-scripts/test_ipv4_ps.py b/py-scripts/test_ipv4_ps.py index ab2facbe..46a21ac2 100755 --- a/py-scripts/test_ipv4_ps.py +++ b/py-scripts/test_ipv4_ps.py @@ -21,7 +21,7 @@ Realm = realm.Realm class IPV4VariableTime(LFCliBase): def __init__(self, ssid, security, password, sta_list, name_prefix, upstream, radio, - host="localhost", port=8080, + radio2, host="localhost", port=8080, side_a_min_rate=56, side_a_max_rate=0, side_b_min_rate=56, side_b_max_rate=0, number_template="00000", test_duration="5m", use_ht160=False, @@ -37,6 +37,7 @@ class IPV4VariableTime(LFCliBase): self.security = security self.password = password self.radio = radio + self.radio2 = radio2 self.number_template = number_template self.debug = _debug_on self.name_prefix = name_prefix @@ -107,7 +108,7 @@ class IPV4VariableTime(LFCliBase): self.vap_profile.set_command_flag("add_vap", "use-bss-transition", 1) self.vap_profile.create(resource=1, radio="wiphy1", channel=161, up_=True, debug=False, suppress_related_commands_=True) - self.monitor.create(resource_=1, channel=161, radio_="wiphy2", name_="moni0") + self.monitor.create(resource_=1, channel=161, radio_=self.radio2, name_="moni0") self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug) self.cx_profile.create(endp_type="lf_udp", side_a=self.station_profile.station_names, side_b=self.upstream, sleep_time=0) @@ -201,6 +202,7 @@ Generic command layout: optional.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) optional.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000) optional.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="5m") + optional.add_argument('--radio2', help='radio to create monitor on', default='1.wiphy2') args = parser.parse_args() num_sta = 2 @@ -219,6 +221,7 @@ Generic command layout: ssid=args.ssid, password=args.passwd, radio=args.radio, + radio2=args.radio2, security=args.security, test_duration=args.test_duration, use_ht160=False, side_a_min_rate=args.a_min, side_b_min_rate=args.b_min, _debug_on=args.debug) From 4035e5e90c45d62393f852aece31ee5994d692c9 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 14:53:22 -0800 Subject: [PATCH 633/731] test_l4: Fix improper time interval parameters Signed-off-by: Matthew Stidham --- py-scripts/test_l4.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/test_l4.py b/py-scripts/test_l4.py index 06e1b077..8f2acfb9 100755 --- a/py-scripts/test_l4.py +++ b/py-scripts/test_l4.py @@ -351,7 +351,7 @@ python3 ./test_l4.py layer4traffic = ','.join([[*x.keys()][0] for x in ip_test.local_realm.json_get('layer4')['endpoint']]) ip_test.cx_profile.monitor(col_names=['name', 'bytes-rd', 'urls/s', 'bytes-wr'], report_file=rpt_file, - duration_sec=ip_test.local_realm.parse_time(args.test_duration).total_seconds(), + duration_sec=args.test_duration, created_cx=layer4traffic, output_format=output_form, script_name='test_l4', From b09daaa945f3861b2487a7c59b539a6a799296f7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 15:10:56 -0800 Subject: [PATCH 634/731] run_cv_scenario: Remove unused variable names Signed-off-by: Matthew Stidham --- py-scripts/run_cv_scenario.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/py-scripts/run_cv_scenario.py b/py-scripts/run_cv_scenario.py index 2cb6e02d..51d3ffbc 100755 --- a/py-scripts/run_cv_scenario.py +++ b/py-scripts/run_cv_scenario.py @@ -58,6 +58,7 @@ class RunCvScenario(LFCliBase): port_counter = 0 attempts = 6 + alias_map = None while (attempts > 0) and (port_counter > 0): sleep(1) attempts -= 1 @@ -74,7 +75,7 @@ class RunCvScenario(LFCliBase): if (port_counter != 0) and (attempts == 0): print("There appears to be a vAP in this database, quitting.") - pprint(alias_map) + pprint.pprint(alias_map) exit(1) data = { @@ -147,14 +148,12 @@ class RunCvScenario(LFCliBase): sleep(1) if time.time() > (begin_time + (6 * 1000)): print("waited %d sec for text blobs to update" % self.load_timeout_sec) - load_completed = True break status_response = self.json_get("/") if "text_records_last_updated_ms" in status_response: updated = int(status_response["text_records_last_updated_ms"]) print(", , , , , , , , , updated at %d" % updated) if updated > blobs_last_updated: - load_completed = True break else: pprint.pprint(status_response) @@ -162,7 +161,7 @@ class RunCvScenario(LFCliBase): "type": "ALL", "name": "ALL" }) - delta: int = (time.time() * 1000) - begin_time + delta: float = (time.time() * 1000) - begin_time print("blobs loaded in %d ms" % delta) # next show duts @@ -201,7 +200,6 @@ class RunCvScenario(LFCliBase): "sleep 1", "exit" ] - response_json = [] for command in commands: data = { "cmd": command @@ -231,8 +229,8 @@ class RunCvScenario(LFCliBase): else: response_json = [] print("running %s..." % command, end='') - response = self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, - response_json_list_=response_json) + self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, + response_json_list_=response_json) if debug_: LFUtils.debug_printer.pprint(response_json) print("...proceeding") From ed03860677367764abfab93c13d13304f82713df Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 15:11:53 -0800 Subject: [PATCH 635/731] rvr_scenario: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/rvr_scenario.py | 46 ++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/py-scripts/rvr_scenario.py b/py-scripts/rvr_scenario.py index 80b666af..1c1e7951 100755 --- a/py-scripts/rvr_scenario.py +++ b/py-scripts/rvr_scenario.py @@ -12,7 +12,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -29,9 +28,12 @@ Realm = realm.Realm cvScenario.test_scenario = args.test_scenario """ + class RunCvScenario(LFCliBase): - def __init__(self, lfhost="localhost", lfport=8080, debug_=False, lanforge_db_=None, cv_scenario_=None, cv_test_=None, test_scenario_=None): - super().__init__( _lfjson_host=lfhost, _lfjson_port=lfport, _debug=debug_, _exit_on_error=True, _exit_on_fail=True) + def __init__(self, lfhost="localhost", lfport=8080, debug_=False, lanforge_db_=None, cv_scenario_=None, + cv_test_=None, test_scenario_=None): + super().__init__(_lfjson_host=lfhost, _lfjson_port=lfport, _debug=debug_, _exit_on_error=True, + _exit_on_fail=True) self.lanforge_db = lanforge_db_ self.cv_scenario = cv_scenario_ self.cv_test = cv_test_ @@ -45,13 +47,13 @@ class RunCvScenario(LFCliBase): def build(self): data = { "name": "BLANK", - "action":"overwrite", - "clean_dut":"yes", + "action": "overwrite", + "clean_dut": "yes", "clean_chambers": "yes" } self.json_post("/cli-json/load", data) sleep(1) - port_counter = 0; + port_counter = 0 attempts = 6 while (attempts > 0) and (port_counter > 0): sleep(1) @@ -74,8 +76,8 @@ class RunCvScenario(LFCliBase): data = { "name": self.lanforge_db, - "action":"overwrite", - "clean_dut":"yes", + "action": "overwrite", + "clean_dut": "yes", "clean_chambers": "yes" } self.json_post("/cli-json/load", data) @@ -86,7 +88,7 @@ class RunCvScenario(LFCliBase): def start(self, debug_=False): # /gui_cli takes commands keyed on 'cmd', so we create an array of commands commands = [ - #"cv apply '%s'" % self.cv_scenario, + # "cv apply '%s'" % self.cv_scenario, "sleep 5", "cv build", "sleep 5", @@ -103,9 +105,10 @@ class RunCvScenario(LFCliBase): "cv click test_ref Start", "sleep 2", "cv click test_ref 'Another Iteration'", - "sleep 240", #sleep for (test duration for 1 time test takes x num iterations requested) - this example is 2 iterations - "cv click test_ref 'Another Iteration'", #unselect Another Iteration before test ends - "sleep 50" #finish test + "sleep 240", + # sleep for (test duration for 1 time test takes x num iterations requested) - this example is 2 iterations + "cv click test_ref 'Another Iteration'", # unselect Another Iteration before test ends + "sleep 50" # finish test "cv get test_ref 'Report Location:'", "sleep 5", "cv click test_ref 'Save HTML'", @@ -115,7 +118,6 @@ class RunCvScenario(LFCliBase): "sleep 1", "exit" ] - response_json = [] for command in commands: data = { "cmd": command @@ -123,7 +125,7 @@ class RunCvScenario(LFCliBase): try: debug_par = "" if debug_: - debug_par="?_debug=1" + debug_par = "?_debug=1" if command.endswith("is_built"): print("Waiting for scenario to build...", end='') self.localrealm.wait_while_building(debug_=False) @@ -136,18 +138,16 @@ class RunCvScenario(LFCliBase): else: response_json = [] print("running %s..." % command, end='') - response = self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, response_json_list_=response_json) + self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, response_json_list_=response_json) if debug_: LFUtils.debug_printer.pprint(response_json) print("...proceeding") - except Exception as x: print(x) self._pass("report finished", print_=True) - def stop(self): pass @@ -165,15 +165,15 @@ def main(): Example: ./rvr_scenario.py --lfmgr 127.0.0.1 --lanforge_db 'handsets' --cv_test --test_scenario 'test-20' """) - parser.add_argument("-m", "--lfmgr", type=str, + parser.add_argument("-m", "--lfmgr", type=str, help="address of the LANforge GUI machine (localhost is default)") - parser.add_argument("-o", "--port", type=int, + parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") parser.add_argument("--lanforge_db", "--db", "--lanforge_scenario", type=str, help="Name of test scenario database (see Status Tab)") - parser.add_argument("-c", "--cv_scenario", type=str, required=True, + parser.add_argument("-c", "--cv_scenario", type=str, required=True, help="Name of Chamber View test scenario (see CV Manage Scenarios)") - parser.add_argument("-n", "--cv_test", type=str, required = True, + parser.add_argument("-n", "--cv_test", type=str, required=True, help="Chamber View test") parser.add_argument("-s", "--test_profile", "--test_settings", type=str, required=True, help="Name of the saved CV test settings") @@ -220,7 +220,9 @@ Example: exit(1) report_file = run_cv_scenario.get_report_file_name() - print("Report file saved to "+report_file) + print("Report file saved to " + report_file) + + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 25f537a027bc266499cdc74de5121520d2f8bf1d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 15:12:39 -0800 Subject: [PATCH 636/731] sta_connect: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/sta_connect.py | 50 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/py-scripts/sta_connect.py b/py-scripts/sta_connect.py index f2e5e59f..a9fac8f4 100755 --- a/py-scripts/sta_connect.py +++ b/py-scripts/sta_connect.py @@ -13,7 +13,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) LFUtils = importlib.import_module("py-json.LANforge.LFUtils") @@ -62,7 +61,7 @@ class StaConnect(Realm): self.station_names = [] self.cx_names = {} if _sta_name is not None: - self.station_names = [ _sta_name ] + self.station_names = [_sta_name] self.resulting_stations = {} self.resulting_endpoints = {} @@ -99,23 +98,22 @@ class StaConnect(Realm): def num_associated(self, bssid): counter = 0 # print("there are %d results" % len(self.station_results)) - fields = "_links,port,alias,ip,ap,port+type" if (self.station_results is None) or (len(self.station_results) < 1): self.get_failed_result_list() - for eid,record in self.station_results.items(): - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - #pprint(eid) - #pprint(record) + for eid, record in self.station_results.items(): + # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + # pprint(eid) + # pprint(record) if record["ap"] == bssid: counter += 1 - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") return counter def clear_test_results(self): self.resulting_stations = {} self.resulting_endpoints = {} super().clear_test_results() - #super(StaConnect, self).clear_test_results().test_results.clear() + # super(StaConnect, self).clear_test_results().test_results.clear() def run(self): if not self.setup(): @@ -231,7 +229,7 @@ class StaConnect(Realm): else: connected_stations[sta_name] = sta_url data = { - "shelf":1, + "shelf": 1, "resource": self.resource, "port": "ALL", "probe_flags": 1 @@ -242,7 +240,7 @@ class StaConnect(Realm): for sta_name in self.station_names: sta_url = self.get_station_url(sta_name) - station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") + station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") self.resulting_stations[sta_url] = station_info ap = station_info["interface"]["ap"] ip = station_info["interface"]["ip"] @@ -250,13 +248,14 @@ class StaConnect(Realm): print(" %s +AP %s, " % (sta_name, ap), end="") if self.dut_bssid != "": if self.dut_bssid.lower() == ap.lower(): - self._pass(sta_name+" connected to BSSID: " + ap) + self._pass(sta_name + " connected to BSSID: " + ap) # self.test_results.append("PASSED: ) # print("PASSED: Connected to BSSID: "+ap) else: - self._fail("%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap)) + self._fail( + "%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap)) else: - self._fail(sta_name+" did not connect to AP") + self._fail(sta_name + " did not connect to AP") return False if ip == "0.0.0.0": @@ -274,8 +273,8 @@ class StaConnect(Realm): # Create UDP endpoints for sta_name in self.station_names: - self.cx_names["testUDP-"+sta_name] = { "a": "testUDP-%s-A" % sta_name, - "b": "testUDP-%s-B" % sta_name} + self.cx_names["testUDP-" + sta_name] = {"a": "testUDP-%s-A" % sta_name, + "b": "testUDP-%s-B" % sta_name} data = { "alias": "testUDP-%s-A" % sta_name, "shelf": 1, @@ -288,9 +287,9 @@ class StaConnect(Realm): self.json_post("/cli-json/add_endp", data, suppress_related_commands_=True) data = { - "name" : "testUDP-%s-A" % sta_name, - "flag" : "UseAutoNAT", - "val" : 1 + "name": "testUDP-%s-A" % sta_name, + "flag": "UseAutoNAT", + "val": 1 } self.json_post("/cli-json/set_endp_flag", data, suppress_related_commands_=True) @@ -306,9 +305,9 @@ class StaConnect(Realm): self.json_post("/cli-json/add_endp", data, suppress_related_commands_=True) data = { - "name" : "testUDP-%s-B" % sta_name, - "flag" : "UseAutoNAT", - "val" : 1 + "name": "testUDP-%s-B" % sta_name, + "flag": "UseAutoNAT", + "val": 1 } self.json_post("/cli-json/set_endp_flag", data, suppress_related_commands_=True) @@ -329,8 +328,8 @@ class StaConnect(Realm): self.json_post("/cli-json/set_cx_report_timer", data, suppress_related_commands_=True) # Create TCP endpoints - self.cx_names["testTCP-"+sta_name] = {"a": "testTCP-%s-A" % sta_name, - "b": "testTCP-%s-B" % sta_name} + self.cx_names["testTCP-" + sta_name] = {"a": "testTCP-%s-A" % sta_name, + "b": "testTCP-%s-B" % sta_name} data = { "alias": "testTCP-%s-A" % sta_name, "shelf": 1, @@ -506,7 +505,7 @@ Example: staConnect.run() - run_results = staConnect.get_result_list() + staConnect.get_result_list() if not staConnect.passes(): print("FAIL: Some tests failed") @@ -522,6 +521,7 @@ Example: print(staConnect.get_all_message()) + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From ec51c57370483540dbd8ffbe5feb3c1b28ae8dfc Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 15:13:22 -0800 Subject: [PATCH 637/731] sta_connect_multi_example: Fix whitespace Signed-off-by: Matthew Stidham --- py-scripts/sta_connect_multi_example.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/py-scripts/sta_connect_multi_example.py b/py-scripts/sta_connect_multi_example.py index 999c9187..4dd8ebaf 100755 --- a/py-scripts/sta_connect_multi_example.py +++ b/py-scripts/sta_connect_multi_example.py @@ -5,12 +5,10 @@ import os import importlib import argparse - if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) # if you lack __init__.py in this directory you will not find sta_connect module @@ -32,14 +30,14 @@ def main(): description='''\ Example of how to instantiate StaConnect and run the test ''') - #args = parser.parse_args() - add this line if adding arguments + # args = parser.parse_args() - add this line if adding arguments parser.parse_args() # create multiple OPEN stations station_names = LFUtils.port_name_series(start_id=0, end_id=1) test = StaConnect("localhost", 8080, _debugOn=False, _exit_on_error=True, - _cleanup_on_exit=False, _runtime_sec=360, _exit_on_fail=True) + _cleanup_on_exit=False, _runtime_sec=360, _exit_on_fail=True) test.sta_mode = sta_connect.MODE_AUTO test.upstream_resource = 1 test.upstream_port = "eth1" From a30ca8f07eb1ee0c356770f29309a71e7971307c Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 15:18:23 -0800 Subject: [PATCH 638/731] test_client_admission: Remove unused arguments Signed-off-by: Matthew Stidham --- py-scripts/test_client_admission.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/test_client_admission.py b/py-scripts/test_client_admission.py index d19d36d7..16360b7c 100755 --- a/py-scripts/test_client_admission.py +++ b/py-scripts/test_client_admission.py @@ -49,7 +49,7 @@ class LoadLayer3(Realm): self.cx_profile.side_b_min_bps = 0 self.cx_profile.side_b_max_bps = 0 - def precleanup(self, num_sta): + def precleanup(self): num_sta = self.num_sta station_list = LFUtils.port_name_series(prefix="sta", start_id=0, @@ -80,7 +80,7 @@ class LoadLayer3(Realm): self.local_realm._fail("Stations failed to get IPs", print_=True) return 0 - def start(self, num_sta): + def start(self): num_sta = self.num_sta station_list = LFUtils.port_name_series(prefix="sta", start_id=0, @@ -118,9 +118,9 @@ def main(): obj = LoadLayer3(lfclient_host=args.host, lfclient_port=8080, ssid=args.ssid, paswd=args.passwd, security=args.security, radio=args.radio, num_sta=args.num_sta) - obj.precleanup(num_sta=args.num_sta) + obj.precleanup() - obj.start(num_sta=args.num_sta) + obj.start() if __name__ == '__main__': From 0763d67f5cccd0289550d0fec7379c3c7d2f26d8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 15:25:49 -0800 Subject: [PATCH 639/731] test_l3_unicast_traffic_gen: More pythonic way to do a for loop. Avoids unnecessary variables Signed-off-by: Matthew Stidham --- py-scripts/test_l3_unicast_traffic_gen.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/py-scripts/test_l3_unicast_traffic_gen.py b/py-scripts/test_l3_unicast_traffic_gen.py index 1e2e8dd9..8a66583b 100755 --- a/py-scripts/test_l3_unicast_traffic_gen.py +++ b/py-scripts/test_l3_unicast_traffic_gen.py @@ -50,8 +50,7 @@ class L3VariableTimeLongevity(LFCliBase): self.cx_profile = self.local_realm.new_l3_cx_profile() self.station_profiles = [] - index = 0 - for radio in radios: + for index in range(0, len(radios)): self.station_profile = self.local_realm.new_station_profile() self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = ssid_list[index] @@ -60,7 +59,6 @@ class L3VariableTimeLongevity(LFCliBase): self.station_profile.number_template = self.number_template self.station_profile.mode = 0 self.station_profiles.append(self.station_profile) - index += 1 self.cx_profile.host = self.host self.cx_profile.port = self.port From b9067250b7a10f353d2f72e631bf6933f42fdef2 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 15:28:41 -0800 Subject: [PATCH 640/731] test_l3_unicast_traffic_gen: Remove unused variables Signed-off-by: Matthew Stidham --- py-scripts/test_l3_unicast_traffic_gen.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/py-scripts/test_l3_unicast_traffic_gen.py b/py-scripts/test_l3_unicast_traffic_gen.py index 8a66583b..23f11ed2 100755 --- a/py-scripts/test_l3_unicast_traffic_gen.py +++ b/py-scripts/test_l3_unicast_traffic_gen.py @@ -79,7 +79,8 @@ class L3VariableTimeLongevity(LFCliBase): cx_rx_map[item] = value_rx return cx_rx_map - def __compare_vals(self, old_list, new_list): + @staticmethod + def __compare_vals(old_list, new_list): passes = 0 expected_passes = 0 if len(old_list) == len(new_list): @@ -117,7 +118,6 @@ class L3VariableTimeLongevity(LFCliBase): cur_time = datetime.datetime.now() old_rx_values = self.__get_rx_values() - filtered_old_rx_values = [] filtered_old_rx_values = old_rx_values end_time = self.local_realm.parse_time(self.test_duration) + cur_time @@ -131,7 +131,6 @@ class L3VariableTimeLongevity(LFCliBase): time.sleep(1) new_rx_values = self.__get_rx_values() - filtered_new_rx_values = [] filtered_new_rx_values = new_rx_values expected_passes += 1 @@ -140,7 +139,6 @@ class L3VariableTimeLongevity(LFCliBase): else: self._fail("FAIL: Not all stations increased traffic", print_fail) break - old_rx_values = new_rx_values cur_time = datetime.datetime.now() if passes == expected_passes: @@ -154,8 +152,7 @@ class L3VariableTimeLongevity(LFCliBase): url = "cli-json/set_port" self.json_post(url, data) - def cleanup(self, resource): - resource = 1 + def cleanup(self,): data = { "name": "BLANK", "action": "overwrite" @@ -219,7 +216,6 @@ class L3VariableTimeLongevity(LFCliBase): print("or the json_post failed either way {} did not set up dhcp so test may not pass data ".format( self.side_b)) - resource = 1 index = 0 for station_profile, station_list in zip(self.station_profiles, self.station_lists): station_profile.use_security(station_profile.security, station_profile.ssid, station_profile.ssid_pass) @@ -239,8 +235,8 @@ class L3VariableTimeLongevity(LFCliBase): def valid_endp_type(endp_type): - valid_endp_type = ['lf_udp', 'lf_udp6', 'lf_tcp', 'lf_tcp6'] - if str(endp_type) in valid_endp_type: + valid_endp_types = ['lf_udp', 'lf_udp6', 'lf_tcp', 'lf_tcp6'] + if str(endp_type) in valid_endp_types: return endp_type else: print('invalid endp_type. Valid types lf_udp, lf_udp6, lf_tcp, lf_tcp6') @@ -371,7 +367,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type lf_tcp --upstream index = 0 station_lists = [] - for radio in radios: + for _ in radios: number_of_stations = int(number_of_stations_per_radio_list[index]) if number_of_stations > MAX_NUMBER_OF_STATIONS: print("number of stations per radio exceeded max of : {}".format(MAX_NUMBER_OF_STATIONS)) @@ -397,7 +393,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type lf_tcp --upstream side_a_min_rate=256000, side_b_min_rate=256000, _debug_on=args.debug) - ip_var_test.cleanup(station_list) + ip_var_test.cleanup() ip_var_test.build() if not ip_var_test.passes(): print(ip_var_test.get_fail_message()) @@ -408,7 +404,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type lf_tcp --upstream print(ip_var_test.get_fail_message()) exit(1) time.sleep(30) - ip_var_test.cleanup(station_list) + ip_var_test.cleanup() if ip_var_test.passes(): print("Full test passed, all connections increased rx bytes") From 7aeef0674cbc546be159cb95d1db040a49f5ec05 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 15:32:35 -0800 Subject: [PATCH 641/731] test_l3_unicast_traffic_gen: Fix potential unassigned variable error Signed-off-by: Matthew Stidham --- py-scripts/test_l3_unicast_traffic_gen.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/py-scripts/test_l3_unicast_traffic_gen.py b/py-scripts/test_l3_unicast_traffic_gen.py index 23f11ed2..2afa10c5 100755 --- a/py-scripts/test_l3_unicast_traffic_gen.py +++ b/py-scripts/test_l3_unicast_traffic_gen.py @@ -217,6 +217,7 @@ class L3VariableTimeLongevity(LFCliBase): self.side_b)) index = 0 + temp_station_list = [] for station_profile, station_list in zip(self.station_profiles, self.station_lists): station_profile.use_security(station_profile.security, station_profile.ssid, station_profile.ssid_pass) station_profile.set_number_template(station_profile.number_template) @@ -224,7 +225,6 @@ class L3VariableTimeLongevity(LFCliBase): print("radio: {} station_profile: {} Creating stations: {} ".format(self.radio_list[index], station_profile, station_list)) - temp_station_list = [] for station in range(len(station_list)): temp_station_list.append(str(self.resource) + "." + station_list[station]) station_profile.create(radio=self.radio_list[index], sta_names_=station_list, debug=False) @@ -330,17 +330,8 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type lf_tcp --upstream required=True) args = parser.parse_args() - if args.test_duration: - test_duration = args.test_duration - - if args.endp_type: - endp_type = args.endp_type - side_b = args.upstream_port - if args.radio: - radios = args.radio - radio_offset = 0 number_of_stations_offset = 1 ssid_offset = 2 @@ -354,7 +345,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type lf_tcp --upstream ssid_password_list = [] index = 0 - for radio in radios: + for radio in args.radio: radio_name = radio[radio_offset] radio_name_list.append(radio_name) number_of_stations_per_radio = radio[number_of_stations_offset] @@ -367,7 +358,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type lf_tcp --upstream index = 0 station_lists = [] - for _ in radios: + for _ in args.radio: number_of_stations = int(number_of_stations_per_radio_list[index]) if number_of_stations > MAX_NUMBER_OF_STATIONS: print("number of stations per radio exceeded max of : {}".format(MAX_NUMBER_OF_STATIONS)) @@ -381,15 +372,15 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type lf_tcp --upstream number_template="00", station_lists=station_lists, name_prefix="var_time", - endp_type=endp_type, + endp_type=args.endp_type, side_b=side_b, - radios=radios, + radios=args.radio, radio_name_list=radio_name_list, number_of_stations_per_radio_list=number_of_stations_per_radio_list, ssid_list=ssid_list, ssid_password_list=ssid_password_list, resource=1, - security="wpa2", test_duration=test_duration, + security="wpa2", test_duration=args.test_duration, side_a_min_rate=256000, side_b_min_rate=256000, _debug_on=args.debug) From 3744ddfbb0f8b03623d1750e30c6f005e45f2683 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 15:35:55 -0800 Subject: [PATCH 642/731] regression_test: Fix radio2 argument Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 501eb812..236cfae5 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -105,7 +105,7 @@ if [[ ${#RADIO_USED} -eq 0 ]]; then # Allow the user to change the radio they te fi if [[ ${#RADIO2} -eq 0 ]]; then # Allow the user to change the radio they test against - RADIO_USED="wiphy0" + RADIO2="wiphy0" fi if [[ ${#UPSTREAM} -eq 0 ]]; then UPSTREAM="eth1" From 7b4bb1dab7d5170090ed44ab6b272bf5c0b3f313 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 15:37:25 -0800 Subject: [PATCH 643/731] regression_test: Needs backslashes for test_l3_longevity command Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 236cfae5..58008cd0 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -365,8 +365,8 @@ else "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --radio2 $RADIO2" "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_tcp' --upstream_port 1.1.$UPSTREAM --radio - 'radio==1.1.wiphy0 stations==10 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --radio + "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_tcp' --upstream_port 1.1.$UPSTREAM --radio \ + 'radio==1.1.wiphy0 stations==10 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --radio \ 'radio==1.1.wiphy1 stations==1 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --test_duration 5s --influx_host c7-graphana --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 --influx_tag testbed regression_test --influx_tag DUT ROG -o longevity.csv" "./test_l3_powersave_traffic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" #"./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput -m $MGR" From 7b36739a8b074da99afab5987b23b6861a2e9176 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 15:52:06 -0800 Subject: [PATCH 644/731] regression_test: Data engineering 101 One data entry per row One row per data entry One variable per column One column per variable Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 58008cd0..dfe77f96 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -546,16 +546,12 @@ function test() { else echo "No errors detected" fi - results+=(" - - - - - - - - -") + results+=(" + + + + + ") } function start_tests() { @@ -632,6 +628,7 @@ td.testname { + From 404301cae9c0cc3507f9e73fbb2c2920df83c9fa Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:30:51 -0800 Subject: [PATCH 645/731] create_wanlink: Fix incorect Type error Signed-off-by: Matthew Stidham --- py-json/create_wanlink.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-json/create_wanlink.py b/py-json/create_wanlink.py index d533ddac..83322b48 100755 --- a/py-json/create_wanlink.py +++ b/py-json/create_wanlink.py @@ -34,7 +34,7 @@ j_printer = pprint.PrettyPrinter(indent=2) resource_id = 1 -def main(args={}): +def main(args): base_url = 'http://'+args['host']+':8080' print(base_url) json_post = "" @@ -62,7 +62,7 @@ def main(args={}): if isinstance(value, dict) and "_links" in value: num_wanlinks = 1 except urllib.error.HTTPError as error: - print("Error code "+error.code) + print("Error code %s" % error.code) lf_r = LFRequest.LFRequest(base_url+"/cli-json/rm_endp") lf_r.addPostData({ @@ -162,7 +162,7 @@ def main(args={}): # print("value not a dict") except urllib.error.HTTPError as error: - print("Error code "+error.code) + print("Error code %s " % error.code) continue # print("starting wanlink:") @@ -192,7 +192,7 @@ def main(args={}): running = 1 except urllib.error.HTTPError as error: - print("Error code "+error.code) + print("Error code %s" % error.code) continue print("Wanlink is running") From b83179c70d27b1060fd3384a964645776f908c07 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:32:13 -0800 Subject: [PATCH 646/731] cv_dut_profile: Fix incorrect type error Signed-off-by: Matthew Stidham --- py-json/cv_dut_profile.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/py-json/cv_dut_profile.py b/py-json/cv_dut_profile.py index e1a7ad32..1013a3ce 100644 --- a/py-json/cv_dut_profile.py +++ b/py-json/cv_dut_profile.py @@ -127,13 +127,13 @@ class cv_dut(LFCliBase): ssid_flags=0, ssid_flags_mask=0xFFFFFFFF): req_url = "/cli-json/add_dut_ssid" - print("name:" + dut_name, - "ssid_idx:" + ssid_idx, - "ssid:" + ssid, - "passwd:" + passwd, - "bssid:" + bssid, - "ssid_flags:" + str(ssid_flags), - "ssid_flags_mask:" + str(ssid_flags_mask)) + print("name: %s" % dut_name, + "ssid_idx: %s" % ssid_idx, + "ssid: %s" % ssid, + "passwd: %s" % passwd, + "bssid: %s" % bssid, + "ssid_flags: %s" % ssid_flags, + "ssid_flags_mask: %s" % ssid_flags_mask) self.json_post(req_url, { "name": dut_name, From ceb08808e144d2af7da2e0b9cc692e49b5324ef8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:32:56 -0800 Subject: [PATCH 647/731] dataplane_test_profile: Unused variable Signed-off-by: Matthew Stidham --- py-json/dataplane_test_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/dataplane_test_profile.py b/py-json/dataplane_test_profile.py index 77004472..0ec6f35a 100644 --- a/py-json/dataplane_test_profile.py +++ b/py-json/dataplane_test_profile.py @@ -39,7 +39,7 @@ class DataPlaneTest(ChamberViewBase): def main(): - obj = DataPlaneTest(lfclient_host="localhost", lfclient_port=8080, debug_=True) + DataPlaneTest(lfclient_host="localhost", lfclient_port=8080, debug_=True) if __name__ == '__main__': From 6e9ddbb0297ec8252401507364dbb087c20e57d9 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:33:29 -0800 Subject: [PATCH 648/731] dut_profile: Unused parameters Signed-off-by: Matthew Stidham --- py-json/dut_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/dut_profile.py b/py-json/dut_profile.py index d02e1978..aa1a9f28 100644 --- a/py-json/dut_profile.py +++ b/py-json/dut_profile.py @@ -53,7 +53,7 @@ class DUTProfile(LFCliBase): if name in self.__dict__: self.__dict__[name] = value - def create(self, name=None, param_=None, flags=None, flags_mask=None, notes=None): + def create(self, name=None, flags=None, flags_mask=None): data = {} if (name is not None) and (name != ""): data["name"] = name From bd3191456a4eb5b32567636e11b92a62c49d386e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:34:17 -0800 Subject: [PATCH 649/731] fio_endp_profile: Unused variables Signed-off-by: Matthew Stidham --- py-json/fio_endp_profile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/py-json/fio_endp_profile.py b/py-json/fio_endp_profile.py index 9396240b..5eed7b7d 100644 --- a/py-json/fio_endp_profile.py +++ b/py-json/fio_endp_profile.py @@ -175,8 +175,6 @@ class FIOEndpProfile(LFCliBase): self.local_realm.json_post("/cli-json/nc_show_endpoints", {"endpoint": "all"}) for port_name in ports: for num_connection in range(connections_per_port): - shelf = self.local_realm.name_to_eid(port_name)[0] - resource = self.local_realm.name_to_eid(port_name)[1] name = self.local_realm.name_to_eid(port_name)[2] endp_data = { From 4a73628b74c03f7d6dd950ebbc74de0a68209c92 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 6 Dec 2021 17:39:23 -0700 Subject: [PATCH 650/731] dut.json : updated for consistant use of BSSID_USED test.json : updated for consistant use of BSSID_USED lf_check.py : updated for use of BSSID_USED Updated AP Auto test Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_001_AX88U_dut.json | 4 +- py-scripts/tools/ct_002_AX12_dut.json | 4 +- py-scripts/tools/ct_003_AX88U_dut.json | 4 +- py-scripts/tools/ct_004_AX88U_dut.json | 4 +- py-scripts/tools/ct_AX88U_dut.json | 4 +- py-scripts/tools/ct_tests.json | 4 +- py-scripts/tools/ct_us_001_scripts.json | 8 +-- py-scripts/tools/ct_us_001_tests.json | 91 +++++++++++++------------ py-scripts/tools/ct_us_002_tests.json | 30 ++++---- py-scripts/tools/ct_us_003_tests.json | 46 +++++++------ py-scripts/tools/ct_us_004_tests.json | 74 ++++++++++---------- py-scripts/tools/lf_check.py | 4 +- 12 files changed, 145 insertions(+), 132 deletions(-) diff --git a/py-scripts/tools/ct_001_AX88U_dut.json b/py-scripts/tools/ct_001_AX88U_dut.json index 691d2a4e..27ab8eba 100644 --- a/py-scripts/tools/ct_001_AX88U_dut.json +++ b/py-scripts/tools/ct_001_AX88U_dut.json @@ -13,8 +13,8 @@ "DUT_HW": "1.0", "DUT_SN": "12345678", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} } } } diff --git a/py-scripts/tools/ct_002_AX12_dut.json b/py-scripts/tools/ct_002_AX12_dut.json index 3c0de000..ddb0fc74 100644 --- a/py-scripts/tools/ct_002_AX12_dut.json +++ b/py-scripts/tools/ct_002_AX12_dut.json @@ -11,8 +11,8 @@ "USE_DUT_NAME": "Netgear-AX12", "DUT_SW": "3.0.0.4.386_44266", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"NETGEAR59","SSID_PW_USED":"crispynest798","BSSID":"94:a6:7e:54:d4:31","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"NETGEAR59-5G","SSID_PW_USED":"crispynest798","BSSID":"94:a6:7e:54:d4:33","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"NETGEAR59","SSID_PW_USED":"crispynest798","BSSID_USED":"94:a6:7e:54:d4:31","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"NETGEAR59-5G","SSID_PW_USED":"crispynest798","BSSID_USED":"94:a6:7e:54:d4:33","SECURITY_USED":"wpa2"} } } diff --git a/py-scripts/tools/ct_003_AX88U_dut.json b/py-scripts/tools/ct_003_AX88U_dut.json index e16e16a9..318d0b9c 100644 --- a/py-scripts/tools/ct_003_AX88U_dut.json +++ b/py-scripts/tools/ct_003_AX88U_dut.json @@ -10,8 +10,8 @@ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "USE_DUT_NAME": "ASUSRT-AX88U", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID":"0c:9d:92:02:42:e0","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID":"0c:9d:92:02:42:e4","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"0c:9d:92:02:42:e0","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"0c:9d:92:02:42:e4","SECURITY_USED":"wpa2"} } } diff --git a/py-scripts/tools/ct_004_AX88U_dut.json b/py-scripts/tools/ct_004_AX88U_dut.json index 687ee690..ea6ddb60 100644 --- a/py-scripts/tools/ct_004_AX88U_dut.json +++ b/py-scripts/tools/ct_004_AX88U_dut.json @@ -11,8 +11,8 @@ "USE_DUT_NAME": "ASUSRT-AX88U", "DUT_SW": "3.0.0.4.386_44266", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID":"d4:5d:64:a0:7f:78","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID":"d4:5d:64:a0:7f:7c","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:78","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:7c","SECURITY_USED":"wpa2"} } } } diff --git a/py-scripts/tools/ct_AX88U_dut.json b/py-scripts/tools/ct_AX88U_dut.json index 28aff673..eae17342 100644 --- a/py-scripts/tools/ct_AX88U_dut.json +++ b/py-scripts/tools/ct_AX88U_dut.json @@ -10,8 +10,8 @@ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "USE_DUT_NAME": "ASUSRT-AX88U", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} } } } diff --git a/py-scripts/tools/ct_tests.json b/py-scripts/tools/ct_tests.json index 52430ad6..4a40fafd 100644 --- a/py-scripts/tools/ct_tests.json +++ b/py-scripts/tools/ct_tests.json @@ -13,8 +13,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 9273fff6..caf1748b 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -143,8 +143,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -182,8 +182,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 9c36d48d..5ccf78ab 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -1,7 +1,10 @@ { "ct_tests_001":{ "Notes":[ - "This json file describes tests to be run by LANforge system" + "This json file describes tests to be run by LANforge system", + "When doing a create_chamberview.py --create_scenario ", + "has no correlation to the --instance_name , instance name is used ", + "as a unique identifier for tha chamber-view test run" ] }, "test_suites":{ @@ -115,8 +118,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -154,8 +157,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -228,8 +231,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -267,8 +270,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -309,8 +312,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -348,8 +351,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -389,8 +392,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -428,8 +431,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -469,8 +472,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -495,7 +498,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto_1 --config_name test_con --upstream eth2", - " --dut5_0 'USE_DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'USE_DUT_NAME lanforge DUT_BSSID_2G (1)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", @@ -552,8 +556,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -591,8 +595,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -633,8 +637,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -672,8 +676,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -713,8 +717,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -752,8 +756,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -793,8 +797,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -819,7 +823,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto_1 --config_name test_con --upstream eth2", - " --dut5_0 'USE_DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'USE_DUT_NAME lanforge DUT_BSSID_2G (1)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", @@ -855,8 +860,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -881,7 +886,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " --dut5_0 'USE_DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'USE_DUT_NAME lanforge DUT_BSSID_2G (1)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME lanforge BSSID (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME lanforge BSSID (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", @@ -917,8 +923,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -937,13 +943,14 @@ "ap_auto": { "enabled": "TRUE", "command": "lf_ap_auto_test.py", - "timeout":"25200", + "timeout":"1800", "iterations":"1", "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " --dut5_0 'USE_DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'USE_DUT_NAME lanforge DUT_BSSID_2G (1)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 45013704..c9c118ac 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -42,8 +42,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -67,7 +67,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS", " --instance_name ap_auto --config_name test_con --upstream UPSTREAM_PORT", - " --dut5_0 'USE_DUT_NAME lanforge BSSID (1)' --dut2_0 'USE_DUT_NAME lanforge BSSID (1)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", " --max_stations_2 32 --max_stations_5 32 --max_stations_dual 100 --radio2 1.1.wiphy1", " --radio5 1.1.wiphy2 --set 'Basic Client Connectivity' 1", " --set 'Multi Band Performance' 0 --set 'Stability' 0 --set 'Multi-Station Throughput vs Pkt Size' 0,", @@ -116,8 +117,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ATH10K_9984":{ @@ -152,8 +153,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ATH10K_9984_dp":{ @@ -190,8 +191,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_AX200_wc":{ @@ -225,8 +226,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_AX200_dp":{ @@ -263,8 +264,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=NETGEAR59 security=WPA2 password=crispynest798 bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=NETGEAR59-5G security=WPA2 password=crispynest798 bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=NETGEAR59 security=WPA2 password=crispynest798 bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=NETGEAR59-5G security=WPA2 password=crispynest798 bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -288,7 +289,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " --dut5_0 'USE_DUT_NAME lanforge BSSID (2)' --dut2_0 'USE_DUT_NAME lanforge BSSID (1)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy0 --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index 9d453d5d..bea18774 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -51,8 +51,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -90,8 +90,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -164,8 +164,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -203,8 +203,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -245,8 +245,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -283,8 +283,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -324,8 +324,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -363,8 +363,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -404,8 +404,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -430,7 +430,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " --dut5_0 'USE_DUT_NAME lanforge BSSID (2)' --dut2_0 'USE_DUT_NAME lanforge BSSID (1)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy1 --radio2 1.2.wiphy0 --radio2 1.2.wiphy1 --radio2 1.3.wiphy0 --radio2 1.3.wiphy1", " --radio5 1.1.wiphy0 --radio5 1.1.wiphy1 --radio5 1.2.wiphy0 --radio5 1.2.wiphy1 --radio5 1.3.wiphy0 --radio5 1.3.wiphy1", @@ -466,8 +467,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -492,7 +493,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " --dut5_0 'USE_DUT_NAME lanforge BSSID (2)' --dut2_0 'USE_DUT_NAME lanforge BSSID (1)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy1 --radio2 1.2.wiphy0 --radio2 1.2.wiphy1 --radio2 1.3.wiphy0 --radio2 1.3.wiphy1", " --radio5 1.1.wiphy0 --radio5 1.1.wiphy1 --radio5 1.2.wiphy0 --radio5 1.2.wiphy1 --radio5 1.3.wiphy0 --radio5 1.3.wiphy1", diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index 68d0e5e0..36452b64 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -75,8 +75,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -114,8 +114,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -189,8 +189,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -228,8 +228,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -270,8 +270,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -309,8 +309,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -350,8 +350,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -389,8 +389,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -430,8 +430,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -514,8 +514,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -553,8 +553,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -595,8 +595,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -634,8 +634,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -675,8 +675,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -714,8 +714,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -755,8 +755,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -781,7 +781,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto_1 --config_name test_con --upstream eth2", - " --dut5_0 'USE_DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'USE_DUT_NAME lanforge DUT_BSSID_2G (1)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", @@ -817,8 +818,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -843,7 +844,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " --dut5_0 'USE_DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'USE_DUT_NAME lanforge DUT_BSSID_2G (1)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 5fc10a9b..ff5ca8de 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -768,9 +768,9 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if 'SSID_PW_USED' in args_list_element: self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace( 'SSID_PW_USED', self.wireless_network_dict[idx]['SSID_PW_USED']) - if 'BSSID' in args_list_element: + if 'BSSID_USED' in args_list_element: self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace( - 'BSSID', self.wireless_network_dict[idx]['BSSID']) + 'BSSID_USED', self.wireless_network_dict[idx]['BSSID_USED']) # use_ssid_idx is ephemeral and used only for # variable replacement , remove From fa06f99269d8660563a7c368a214e8d5cdb0a8ec Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 6 Dec 2021 17:52:02 -0700 Subject: [PATCH 651/731] dut.json : differenciate between SSID and BSSID test.json : differenciate between SSID and BSSID lf_check.py : differenciate between SSID and BSSID Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_001_AX88U_dut.json | 4 +- py-scripts/tools/ct_002_AX12_dut.json | 4 +- py-scripts/tools/ct_003_AX88U_dut.json | 4 +- py-scripts/tools/ct_004_AX88U_dut.json | 4 +- py-scripts/tools/ct_AX88U_dut.json | 4 +- py-scripts/tools/ct_tests.json | 4 +- py-scripts/tools/ct_us_001_scripts.json | 8 +-- py-scripts/tools/ct_us_001_tests.json | 80 ++++++++++++------------- py-scripts/tools/ct_us_002_tests.json | 32 +++++----- py-scripts/tools/ct_us_003_tests.json | 48 +++++++-------- py-scripts/tools/ct_us_004_tests.json | 76 +++++++++++------------ py-scripts/tools/lf_check.py | 4 +- 12 files changed, 136 insertions(+), 136 deletions(-) diff --git a/py-scripts/tools/ct_001_AX88U_dut.json b/py-scripts/tools/ct_001_AX88U_dut.json index 27ab8eba..593c54e5 100644 --- a/py-scripts/tools/ct_001_AX88U_dut.json +++ b/py-scripts/tools/ct_001_AX88U_dut.json @@ -13,8 +13,8 @@ "DUT_HW": "1.0", "DUT_SN": "12345678", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_TO_USE":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_TO_USE":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} } } } diff --git a/py-scripts/tools/ct_002_AX12_dut.json b/py-scripts/tools/ct_002_AX12_dut.json index ddb0fc74..0193d267 100644 --- a/py-scripts/tools/ct_002_AX12_dut.json +++ b/py-scripts/tools/ct_002_AX12_dut.json @@ -11,8 +11,8 @@ "USE_DUT_NAME": "Netgear-AX12", "DUT_SW": "3.0.0.4.386_44266", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"NETGEAR59","SSID_PW_USED":"crispynest798","BSSID_USED":"94:a6:7e:54:d4:31","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"NETGEAR59-5G","SSID_PW_USED":"crispynest798","BSSID_USED":"94:a6:7e:54:d4:33","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"NETGEAR59","SSID_PW_USED":"crispynest798","BSSID_TO_USE":"94:a6:7e:54:d4:31","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"NETGEAR59-5G","SSID_PW_USED":"crispynest798","BSSID_TO_USE":"94:a6:7e:54:d4:33","SECURITY_USED":"wpa2"} } } diff --git a/py-scripts/tools/ct_003_AX88U_dut.json b/py-scripts/tools/ct_003_AX88U_dut.json index 318d0b9c..758fa5c4 100644 --- a/py-scripts/tools/ct_003_AX88U_dut.json +++ b/py-scripts/tools/ct_003_AX88U_dut.json @@ -10,8 +10,8 @@ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "USE_DUT_NAME": "ASUSRT-AX88U", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"0c:9d:92:02:42:e0","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"0c:9d:92:02:42:e4","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_TO_USE":"0c:9d:92:02:42:e0","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_TO_USE":"0c:9d:92:02:42:e4","SECURITY_USED":"wpa2"} } } diff --git a/py-scripts/tools/ct_004_AX88U_dut.json b/py-scripts/tools/ct_004_AX88U_dut.json index ea6ddb60..62043975 100644 --- a/py-scripts/tools/ct_004_AX88U_dut.json +++ b/py-scripts/tools/ct_004_AX88U_dut.json @@ -11,8 +11,8 @@ "USE_DUT_NAME": "ASUSRT-AX88U", "DUT_SW": "3.0.0.4.386_44266", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:78","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"d4:5d:64:a0:7f:7c","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_TO_USE":"d4:5d:64:a0:7f:78","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_TO_USE":"d4:5d:64:a0:7f:7c","SECURITY_USED":"wpa2"} } } } diff --git a/py-scripts/tools/ct_AX88U_dut.json b/py-scripts/tools/ct_AX88U_dut.json index eae17342..646f72f8 100644 --- a/py-scripts/tools/ct_AX88U_dut.json +++ b/py-scripts/tools/ct_AX88U_dut.json @@ -10,8 +10,8 @@ "DUT_SET_NAME": "DUT_NAME ASUSRT-AX88U", "USE_DUT_NAME": "ASUSRT-AX88U", "wireless_network_dict":{ - "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_USED":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, - "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_USED":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} + "ssid_idx=0":{"ssid_idx":"0","SSID_USED":"asus11ax-2","SSID_PW_USED":"hello123","BSSID_TO_USE":"3c:7c:3f:55:4d:60","SECURITY_USED":"wpa2"}, + "ssid_idx=1":{"ssid_idx":"1","SSID_USED":"asus11ax-5","SSID_PW_USED":"hello123","BSSID_TO_USE":"3c:7c:3f:55:4d:64","SECURITY_USED":"wpa2"} } } } diff --git a/py-scripts/tools/ct_tests.json b/py-scripts/tools/ct_tests.json index 4a40fafd..77cf9a96 100644 --- a/py-scripts/tools/ct_tests.json +++ b/py-scripts/tools/ct_tests.json @@ -13,8 +13,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index caf1748b..8bfdd3f9 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -143,8 +143,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -182,8 +182,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 5ccf78ab..25ec6ee3 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -118,8 +118,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -157,8 +157,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -231,8 +231,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -270,8 +270,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -312,8 +312,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -351,8 +351,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -392,8 +392,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -431,8 +431,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -472,8 +472,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -556,8 +556,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -595,8 +595,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -637,8 +637,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -676,8 +676,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -717,8 +717,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -756,8 +756,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -797,8 +797,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -823,8 +823,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto_1 --config_name test_con --upstream eth2", - " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", - " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", @@ -860,8 +860,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -923,8 +923,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -949,8 +949,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", - " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index c9c118ac..1e27d487 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -42,8 +42,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -67,8 +67,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS", " --instance_name ap_auto --config_name test_con --upstream UPSTREAM_PORT", - " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", - " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", " --max_stations_2 32 --max_stations_5 32 --max_stations_dual 100 --radio2 1.1.wiphy1", " --radio5 1.1.wiphy2 --set 'Basic Client Connectivity' 1", " --set 'Multi Band Performance' 0 --set 'Stability' 0 --set 'Multi-Station Throughput vs Pkt Size' 0,", @@ -117,8 +117,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ATH10K_9984":{ @@ -153,8 +153,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ATH10K_9984_dp":{ @@ -191,8 +191,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_AX200_wc":{ @@ -226,8 +226,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_AX200_dp":{ @@ -264,8 +264,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=NETGEAR59 security=WPA2 password=crispynest798 bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=NETGEAR59-5G security=WPA2 password=crispynest798 bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=NETGEAR59 security=WPA2 password=crispynest798 bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=NETGEAR59-5G security=WPA2 password=crispynest798 bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -289,8 +289,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", - " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy0 --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index bea18774..a393436e 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -51,8 +51,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -90,8 +90,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -164,8 +164,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -203,8 +203,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -245,8 +245,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -283,8 +283,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -324,8 +324,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -363,8 +363,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -404,8 +404,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -430,8 +430,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", - " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy1 --radio2 1.2.wiphy0 --radio2 1.2.wiphy1 --radio2 1.3.wiphy0 --radio2 1.3.wiphy1", " --radio5 1.1.wiphy0 --radio5 1.1.wiphy1 --radio5 1.2.wiphy0 --radio5 1.2.wiphy1 --radio5 1.3.wiphy0 --radio5 1.3.wiphy1", @@ -467,8 +467,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -493,8 +493,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", - " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy1 --radio2 1.2.wiphy0 --radio2 1.2.wiphy1 --radio2 1.3.wiphy0 --radio2 1.3.wiphy1", " --radio5 1.1.wiphy0 --radio5 1.1.wiphy1 --radio5 1.2.wiphy0 --radio5 1.2.wiphy1 --radio5 1.3.wiphy0 --radio5 1.3.wiphy1", diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index 36452b64..c23ebba9 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -75,8 +75,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -114,8 +114,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -189,8 +189,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -228,8 +228,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -270,8 +270,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -309,8 +309,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -350,8 +350,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -389,8 +389,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -430,8 +430,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -514,8 +514,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -553,8 +553,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -595,8 +595,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -634,8 +634,8 @@ "args":"", "args_list":[ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -675,8 +675,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -714,8 +714,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ] }, @@ -755,8 +755,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -781,8 +781,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto_1 --config_name test_con --upstream eth2", - " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", - " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", @@ -818,8 +818,8 @@ "args":"", "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name USE_DUT_NAME", - " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", - " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_USED'", + " --ssid 'ssid_idx=0 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", + " --ssid 'ssid_idx=1 ssid=SSID_USED security=SECURITY_USED password=SSID_PW_USED bssid=BSSID_TO_USE'", " --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num USE_DUT_NAME" ]}, "create_chamberview_ap":{ @@ -844,8 +844,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_USED (1)'", - " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_USED (2)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index ff5ca8de..cc677ff0 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -768,9 +768,9 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if 'SSID_PW_USED' in args_list_element: self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace( 'SSID_PW_USED', self.wireless_network_dict[idx]['SSID_PW_USED']) - if 'BSSID_USED' in args_list_element: + if 'BSSID_TO_USE' in args_list_element: self.test_dict[test]['args_list'][index] = self.test_dict[test]['args_list'][index].replace( - 'BSSID_USED', self.wireless_network_dict[idx]['BSSID_USED']) + 'BSSID_TO_USE', self.wireless_network_dict[idx]['BSSID_TO_USE']) # use_ssid_idx is ephemeral and used only for # variable replacement , remove From 7f7d759db92db0e4e0d636c0b978b4ce17e0af9f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:39:46 -0800 Subject: [PATCH 652/731] l3_cxprofile: Use static method when we can Signed-off-by: Matthew Stidham --- py-json/l3_cxprofile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-json/l3_cxprofile.py b/py-json/l3_cxprofile.py index aab3a743..2a9ccef1 100644 --- a/py-json/l3_cxprofile.py +++ b/py-json/l3_cxprofile.py @@ -95,7 +95,8 @@ class L3CXProfile(LFCliBase): cx_rx_map[item] = value_rx return cx_rx_map - def __compare_vals(self, old_list, new_list): + @staticmethod + def __compare_vals(old_list, new_list): passes = 0 expected_passes = 0 if len(old_list) == len(new_list): From 695fa8b9b11243d6bd31ded4a7f2aee318f399a2 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:40:46 -0800 Subject: [PATCH 653/731] l3_cxprofile: No need to make it self.data Signed-off-by: Matthew Stidham --- py-json/l3_cxprofile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-json/l3_cxprofile.py b/py-json/l3_cxprofile.py index 2a9ccef1..00a218dc 100644 --- a/py-json/l3_cxprofile.py +++ b/py-json/l3_cxprofile.py @@ -76,10 +76,10 @@ class L3CXProfile(LFCliBase): return self.created_cx.keys() def get_cx_report(self): - self.data = {} + data = dict() for cx_name in self.get_cx_names(): - self.data[cx_name] = self.json_get("/cx/" + cx_name).get(cx_name) - return self.data + data[cx_name] = self.json_get("/cx/" + cx_name).get(cx_name) + return data def __get_rx_values(self): cx_list = self.json_get("endp?fields=name,rx+bytes") From 374f4cb0e9f3dfcc5959c70978239fa370414ca7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:41:16 -0800 Subject: [PATCH 654/731] l3_cxprofile: Fix redundant parentheses Signed-off-by: Matthew Stidham --- py-json/l3_cxprofile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-json/l3_cxprofile.py b/py-json/l3_cxprofile.py index 00a218dc..ea399a12 100644 --- a/py-json/l3_cxprofile.py +++ b/py-json/l3_cxprofile.py @@ -135,7 +135,7 @@ class L3CXProfile(LFCliBase): if (duration_sec is None) or (duration_sec <= 1): raise ValueError("L3CXProfile::monitor wants duration_sec > 1 second") - if (duration_sec <= monitor_interval_ms): + if duration_sec <= monitor_interval_ms: raise ValueError("L3CXProfile::monitor wants duration_sec > monitor_interval") if report_file is None: raise ValueError("Monitor requires an output file to be defined") @@ -370,7 +370,7 @@ class L3CXProfile(LFCliBase): print("Starting CXs...") for cx_name in self.created_cx.keys(): if self.debug: - print("cx-name: %s" % (cx_name)) + print("cx-name: %s" % cx_name) self.json_post("/cli-json/set_cx_state", { "test_mgr": "default_tm", "cx_name": cx_name, @@ -396,13 +396,13 @@ class L3CXProfile(LFCliBase): if len(self.created_cx) != 0: for cx_name in self.created_cx.keys(): if self.debug: - print("Cleaning cx: %s" % (cx_name)) + print("Cleaning cx: %s" % cx_name) self.local_realm.rm_cx(cx_name) for side in range(len(self.created_cx[cx_name])): ename = self.created_cx[cx_name][side] if self.debug: - print("Cleaning endpoint: %s" % (ename)) + print("Cleaning endpoint: %s" % ename) self.local_realm.rm_endp(self.created_cx[cx_name][side]) self.clean_cx_lists() From bf8c8ed24a199a1056eddfc33775ece811a0dab1 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:54:02 -0800 Subject: [PATCH 655/731] test_ip_variable_time: Fix logic Signed-off-by: Matthew Stidham --- py-scripts/test_ip_variable_time.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index 0657c0fc..12cedfde 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -291,8 +291,7 @@ class IPVariableTime(Realm): compared_report_format = self.compared_report.split('.')[-1] # if compared_report_format not in ['csv', 'json', 'dta', 'pkl','html','xlsx','parquet','h5']: if compared_report_format != 'csv': - print(ValueError("Cannot process this file type. Please select a different file and re-run script.")) - exit(1) + raise ValueError("Cannot process this file type. Please select a different file and re-run script.") else: compared_rept = self.compared_report @@ -301,7 +300,7 @@ class IPVariableTime(Realm): port_mgr_cols=port_mgr_cols, report_file=report_f, systeminfopath=systeminfopath, - duration_sec=Realm.parse_time(self.test_duration).total_seconds(), + duration_sec=self.test_duration, monitor_interval_ms=monitor_interval, created_cx=layer3connections, output_format=output, @@ -601,7 +600,7 @@ python3 ./test_ip_variable_time.py args = parser.parse_args() num_sta = 1 - if (args.num_stations is not None) and (int(args.num_stations) > 0): + if args.num_stations: print("one") num_sta = int(args.num_stations) if not args.use_existing_sta: From 5d4dabee8047c933947cf4b2dfb3e31134a09175 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:54:38 -0800 Subject: [PATCH 656/731] l3_cxprofile: Replace BaseException with more explicit logic Signed-off-by: Matthew Stidham --- py-json/l3_cxprofile.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/py-json/l3_cxprofile.py b/py-json/l3_cxprofile.py index ea399a12..104f16c9 100644 --- a/py-json/l3_cxprofile.py +++ b/py-json/l3_cxprofile.py @@ -129,14 +129,12 @@ class L3CXProfile(LFCliBase): arguments=None, compared_report=None, debug=False): - try: + if duration_sec: duration_sec = self.parse_time(duration_sec).seconds - except BaseException: - - if (duration_sec is None) or (duration_sec <= 1): - raise ValueError("L3CXProfile::monitor wants duration_sec > 1 second") - if duration_sec <= monitor_interval_ms: - raise ValueError("L3CXProfile::monitor wants duration_sec > monitor_interval") + else: + raise ValueError("L3CXProfile::monitor wants duration_sec > 1 second") + if duration_sec <= monitor_interval_ms: + raise ValueError("L3CXProfile::monitor wants duration_sec > monitor_interval") if report_file is None: raise ValueError("Monitor requires an output file to be defined") if systeminfopath is None: @@ -270,12 +268,11 @@ class L3CXProfile(LFCliBase): for port in portdata_df['port-alias']: if port in cross_connect: layer3_alias.append(port) - try: + if len(layer3_alias) == layer3.shape[0]: layer3['alias'] = layer3_alias - except BaseException: - print("The Stations or Connection on LANforge did not match expected, \ + else: + raise ValueError("The Stations or Connection on LANforge did not match expected, \ Check if LANForge initial state correct or delete/cleanup corrects") - exit(1) timestamp_df = pd.merge(layer3, portdata_df, on='alias') else: @@ -348,8 +345,8 @@ class L3CXProfile(LFCliBase): # comparison to last report / report inputted if compared_report is not None: - compared_df = pandas_extensions.compare_two_df(dataframe_one=pandas_extensions.file_to_df(report_file), - dataframe_two=pandas_extensions.file_to_df(compared_report)) + pandas_extensions.compare_two_df(dataframe_one=pandas_extensions.file_to_df(report_file), + dataframe_two=pandas_extensions.file_to_df(compared_report)) exit(1) # append compared df to created one if output_format.lower() != 'csv': @@ -442,8 +439,6 @@ class L3CXProfile(LFCliBase): side_a_info = self.local_realm.name_to_eid(port_name, debug=debug_) side_a_shelf = side_a_info[0] side_a_resource = side_a_info[1] - if port_name.find('.') < 0: - port_name = "%d.%s" % (side_a_info[1], port_name) cx_name = "%s%s-%i" % (self.name_prefix, side_a_info[2], len(self.created_cx)) @@ -545,7 +540,6 @@ class L3CXProfile(LFCliBase): side_b_info = self.local_realm.name_to_eid(port_name, debug=debug_) side_b_shelf = side_b_info[0] side_b_resource = side_b_info[1] - side_b_name = side_b_info[2] cx_name = "%s%s-%i" % (self.name_prefix, port_name, len(self.created_cx)) endp_a_name = cx_name + "-A" From 2141ce103e202c4c7c53c8134a954752c584f005 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:55:59 -0800 Subject: [PATCH 657/731] l3_cxprofile: Improve is not None logic, it's redundant Signed-off-by: Matthew Stidham --- py-json/l3_cxprofile.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/py-json/l3_cxprofile.py b/py-json/l3_cxprofile.py index 104f16c9..04a805e3 100644 --- a/py-json/l3_cxprofile.py +++ b/py-json/l3_cxprofile.py @@ -145,7 +145,7 @@ class L3CXProfile(LFCliBase): raise ValueError("L3CXProfile::monitor wants monitor_interval >= 1 second") if layer3_cols is None: raise ValueError("L3CXProfile::monitor wants a list of column names to monitor") - if output_format is not None: + if output_format: if output_format.lower() != report_file.split('.')[-1]: raise ValueError('Filename %s has an extension that does not match output format %s .' % ( report_file, output_format)) @@ -163,15 +163,15 @@ class L3CXProfile(LFCliBase): default_cols = ['Timestamp', 'Timestamp milliseconds epoch', 'Timestamp seconds epoch', 'Duration elapsed'] default_cols.extend(layer3_cols) # append alias to port_mgr_cols if not present needed later - if port_mgr_cols is not None: + if port_mgr_cols: if 'alias' not in port_mgr_cols: port_mgr_cols.append('alias') - if port_mgr_cols is not None: + if port_mgr_cols: default_cols.extend(port_mgr_cols) header_row = default_cols - if port_mgr_cols is not None: + if port_mgr_cols: port_mgr_cols = [self.replace_special_char(x) for x in port_mgr_cols] port_mgr_cols_labelled = [] for col_name in port_mgr_cols: @@ -210,7 +210,7 @@ class L3CXProfile(LFCliBase): stations = [station.split('.')[-1] for station in sta_list] stations = ','.join(stations) - if port_mgr_cols is not None: + if port_mgr_cols: port_mgr_response = self.json_get("/port/1/1/%s?fields=%s" % (stations, port_mgr_fields)) layer_3_response = self.json_get("/endp/%s?fields=%s" % (created_cx, layer3_fields)) @@ -238,7 +238,7 @@ class L3CXProfile(LFCliBase): layer3 = pd.DataFrame(result.values()) layer3.columns = ['l3-' + x for x in layer3.columns] - if port_mgr_cols is not None: # create dataframe from port mgr results + if port_mgr_cols: # create dataframe from port mgr results result = dict() if type(port_mgr_response) is dict: print("port_mgr_response {pmr}".format(pmr=port_mgr_response)) @@ -294,13 +294,13 @@ class L3CXProfile(LFCliBase): probe_results['TX Bitrate'] = probe_port.tx_bitrate probe_results['TX Mbps'] = probe_port.tx_mbit probe_results['TX MCS ACTUAL'] = probe_port.tx_mcs - if probe_port.tx_mcs is not None: + if probe_port.tx_mcs: probe_results['TX MCS'] = int(probe_port.tx_mcs) % 8 else: probe_results['TX MCS'] = probe_port.tx_mcs probe_results['TX NSS'] = probe_port.tx_nss probe_results['TX MHz'] = probe_port.tx_mhz - if probe_port.tx_gi is not None: + if probe_port.tx_gi: probe_results['TX GI ns'] = (probe_port.tx_gi * 10**9) else: probe_results['TX GI ns'] = probe_port.tx_gi @@ -311,13 +311,13 @@ class L3CXProfile(LFCliBase): probe_results['RX Bitrate'] = probe_port.rx_bitrate probe_results['RX Mbps'] = probe_port.rx_mbit probe_results['RX MCS ACTUAL'] = probe_port.rx_mcs - if probe_port.rx_mcs is not None: + if probe_port.rx_mcs: probe_results['RX MCS'] = int(probe_port.rx_mcs) % 8 else: probe_results['RX MCS'] = probe_port.rx_mcs probe_results['RX NSS'] = probe_port.rx_nss probe_results['RX MHz'] = probe_port.rx_mhz - if probe_port.rx_gi is not None: + if probe_port.rx_gi: probe_results['RX GI ns'] = (probe_port.rx_gi * 10**9) else: probe_results['RX GI ns'] = probe_port.rx_gi @@ -344,7 +344,7 @@ class L3CXProfile(LFCliBase): df.to_csv(str(report_file), index=False) # comparison to last report / report inputted - if compared_report is not None: + if compared_report: pandas_extensions.compare_two_df(dataframe_one=pandas_extensions.file_to_df(report_file), dataframe_two=pandas_extensions.file_to_df(compared_report)) exit(1) @@ -511,7 +511,7 @@ class L3CXProfile(LFCliBase): self.local_realm.json_post(url, data, debug_=debug_, suppress_related_commands_=suppress_related_commands) - if tos is not None: + if tos: self.local_realm.set_endp_tos(endp_a_name, tos) self.local_realm.set_endp_tos(endp_b_name, tos) From fcc578e6f945cb26bc6ffc38f3794c49ebdf8742 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 16:59:07 -0800 Subject: [PATCH 658/731] lfdata: Use static methods where possible. use error flag when called Signed-off-by: Matthew Stidham --- py-json/lfdata.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/py-json/lfdata.py b/py-json/lfdata.py index 1486b2b7..f6889703 100644 --- a/py-json/lfdata.py +++ b/py-json/lfdata.py @@ -22,9 +22,10 @@ class LFDataCollection: self.debug = debug or local_realm.debug def json_get(self, _req_url, debug_=False): - return self.parent_realm.json_get(_req_url, debug_=False) + return self.parent_realm.json_get(_req_url, debug_=debug_) - def check_json_validity(self, keyword=None, json_response=None): + @staticmethod + def check_json_validity(keyword=None, json_response=None): if json_response is None: raise ValueError( "Cannot find columns requested to be searched in port manager. Exiting script, please retry.") @@ -32,12 +33,12 @@ class LFDataCollection: raise ValueError( "Cannot find proper information from json. Please check your json request. Exiting script, please retry.") - def get_milliseconds(self, - timestamp): + @staticmethod + def get_milliseconds(timestamp): return (timestamp - datetime.datetime(1970, 1, 1)).total_seconds() * 1000 - def get_seconds(self, - timestamp): + @staticmethod + def get_seconds(timestamp): return (timestamp - datetime.datetime(1970, 1, 1)).total_seconds() # only for ipv4_variable_time at the moment From ec9bceea4e84b54dec3ca409a87e32431a54d2bf Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 17:00:29 -0800 Subject: [PATCH 659/731] multicast_profile.clean_mc_list: Looks like this is what it was supposed to do Signed-off-by: Matthew Stidham --- py-json/multicast_profile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/py-json/multicast_profile.py b/py-json/multicast_profile.py index 847817a9..a7125703 100644 --- a/py-json/multicast_profile.py +++ b/py-json/multicast_profile.py @@ -31,12 +31,11 @@ class MULTICASTProfile(LFCliBase): self.name_prefix = name_prefix_ self.number_template = number_template_ - @staticmethod - def clean_mc_lists(): + def clean_mc_lists(self): # Clean out our local lists, this by itself does NOT remove anything from LANforge manager. # but, if you are trying to modify existing connections, then clearing these arrays and # re-calling 'create' will do the trick. - created_mc = {} + self.created_mc = {} def get_mc_names(self): return self.created_mc.keys() From e00ad53428c8ea62502ffbb0701f7342a579d3b4 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 17:03:16 -0800 Subject: [PATCH 660/731] port_probe: Fix whitespace Signed-off-by: Matthew Stidham --- py-json/port_probe.py | 200 +++++++++++++++++++++++------------------- 1 file changed, 108 insertions(+), 92 deletions(-) diff --git a/py-json/port_probe.py b/py-json/port_probe.py index ae58e342..508d0ad2 100644 --- a/py-json/port_probe.py +++ b/py-json/port_probe.py @@ -6,7 +6,6 @@ import sys import os from pprint import pprint - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -83,7 +82,8 @@ class ProbePort(LFCliBase): print("tx_bitrate {tx_bitrate}".format(tx_bitrate=tx_bitrate)) self.tx_bitrate = tx_bitrate.split(':')[-1].strip(' ') if 'MHz' in tx_bitrate: - self.tx_mhz = [x.strip('\t') for x in text if 'tx bitrate' in x][0].split('MHz')[0].rsplit(' ')[-1].strip(' ') + self.tx_mhz = [x.strip('\t') for x in text if 'tx bitrate' in x][0].split('MHz')[0].rsplit(' ')[-1].strip( + ' ') print("tx_mhz {tx_mhz}".format(tx_mhz=self.tx_mhz)) try: @@ -117,7 +117,8 @@ class ProbePort(LFCliBase): # rx will received : 6Mbps encoding is legacy frame try: if 'MHz' in rx_bitrate: - self.rx_mhz = [x.strip('\t') for x in text if 'rx bitrate' in x][0].split('MHz')[0].rsplit(' ')[-1].strip(' ') + self.rx_mhz = [x.strip('\t') for x in text if 'rx bitrate' in x][0].split('MHz')[0].rsplit(' ')[ + -1].strip(' ') print("rx_mhz {rx_mhz}".format(rx_mhz=self.rx_mhz)) self.rx_mgt_6Mb_frame = False else: @@ -177,10 +178,10 @@ class ProbePort(LFCliBase): N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) R = 0 # coding , (Determined by the modulation, MCS ) N_ss = 0 # Number of Spatial Streams - T_dft = 3.2 * 10**-6 # Constant for HT - T_gi_short = .4 * 10**-6 # Guard index. - T_gi_long = .8 * 10**-6 # Guard index. - bw = 20 + T_dft = 3.2 * 10 ** -6 # Constant for HT + T_gi_short = .4 * 10 ** -6 # Guard index. + T_gi_long = .8 * 10 ** -6 # Guard index. + bw = 20 # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith try: @@ -239,14 +240,16 @@ class ProbePort(LFCliBase): R = 5 / 6 N_bpscs = 6 - print("tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( - mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) + print( + "tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( + mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) self.tx_data_rate_gi_short_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_short)) / 1000000 print("tx_data_rate gi_short {data_rate} Mbit/s".format(data_rate=self.tx_data_rate_gi_short_Mbps)) - print("tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( - mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) + print( + "tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( + mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) self.tx_data_rate_gi_long_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_long)) / 1000000 print("data_rate gi_long {data_rate} Mbps".format(data_rate=self.tx_data_rate_gi_long_Mbps)) @@ -263,9 +266,9 @@ class ProbePort(LFCliBase): N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) R = 0 # coding , (Determined by the modulation, MCS ) N_ss = 0 # Number of Spatial Streams - T_dft = 3.2 * 10**-6 # Constant for HT - T_gi_short = .4 * 10**-6 # Guard index. - T_gi_long = .8 * 10**-6 # Guard index. + T_dft = 3.2 * 10 ** -6 # Constant for HT + T_gi_short = .4 * 10 ** -6 # Guard index. + T_gi_long = .8 * 10 ** -6 # Guard index. # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith if self.rx_mgt_6Mb_frame: @@ -329,36 +332,38 @@ class ProbePort(LFCliBase): R = 5 / 6 N_bpscs = 6 - print("mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( - mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) + print( + "mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( + mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) self.rx_data_rate_gi_short_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_short)) / 1000000 print("rx_data_rate gi_short {data_rate} Mbit/s".format(data_rate=self.rx_data_rate_gi_short_Mbps)) - print("mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( - mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) + print( + "mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( + mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) self.rx_data_rate_gi_long_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_long)) / 1000000 print("rx_data_rate gi_long {data_rate} Mbps".format(data_rate=self.rx_data_rate_gi_long_Mbps)) - if abs(self.rx_mbit - self.rx_data_rate_gi_short_Mbps) <= abs(self.rx_mbit - self.rx_data_rate_gi_long_Mbps): + if abs(self.rx_mbit - self.rx_data_rate_gi_short_Mbps) <= abs( + self.rx_mbit - self.rx_data_rate_gi_long_Mbps): self.rx_mbit_calc = self.rx_data_rate_gi_short_Mbps self.rx_gi = T_gi_short else: self.rx_mbit_calc = self.rx_data_rate_gi_long_Mbps self.rx_gi = T_gi_long - def calculated_data_rate_tx_VHT(self): # TODO compare with standard for 40 MHz if values change N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) R = 0 # coding , (Determined by the modulation, MCS ) N_ss = 0 # Number of Spatial Streams - T_dft = 3.2 * 10**-6 # Constant for HT - T_gi_short = .4 * 10**-6 # Guard index. - T_gi_long = .8 * 10**-6 # Guard index. - bw = 20 + T_dft = 3.2 * 10 ** -6 # Constant for HT + T_gi_short = .4 * 10 ** -6 # Guard index. + T_gi_long = .8 * 10 ** -6 # Guard index. + bw = 20 # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith try: @@ -385,54 +390,56 @@ class ProbePort(LFCliBase): # MCS (Modulation Coding Scheme) determines the constands # MCS 0 == Modulation BPSK R = 1/2 , N_bpscs = 1, # Only for HT configuration - if self.tx_mcs == 0 : + if self.tx_mcs == 0: R = 1 / 2 N_bpscs = 1 # MCS 1 == Modulation QPSK R = 1/2 , N_bpscs = 2 - elif self.tx_mcs == 1 : + elif self.tx_mcs == 1: R = 1 / 2 N_bpscs = 2 # MCS 2 == Modulation QPSK R = 3/4 , N_bpscs = 2 - elif self.tx_mcs == 2 : + elif self.tx_mcs == 2: R = 3 / 4 N_bpscs = 2 # MCS 3 == Modulation 16-QAM R = 1/2 , N_bpscs = 4 - elif self.tx_mcs == 3 : + elif self.tx_mcs == 3: R = 1 / 2 N_bpscs = 4 # MCS 4 == Modulation 16-QAM R = 3/4 , N_bpscs = 4 - elif self.tx_mcs == 4 : + elif self.tx_mcs == 4: R = 3 / 4 N_bpscs = 4 # MCS 5 == Modulation 64-QAM R = 2/3 , N_bpscs = 6 - elif self.tx_mcs == 5 : + elif self.tx_mcs == 5: R = 2 / 3 N_bpscs = 6 # MCS 6 == Modulation 64-QAM R = 3/4 , N_bpscs = 6 - elif self.tx_mcs == 6 : + elif self.tx_mcs == 6: R = 3 / 4 N_bpscs = 6 # MCS 7 == Modulation 64-QAM R = 5/6 , N_bpscs = 6 - elif self.tx_mcs == 7 : + elif self.tx_mcs == 7: R = 5 / 6 N_bpscs = 6 # MCS 8 == Modulation 256-QAM R = 3/4 , N_bpscs = 8 - elif self.tx_mcs == 8 : + elif self.tx_mcs == 8: R = 3 / 4 N_bpscs = 8 # MCS 9 == Modulation 256-QAM R = 5/6 , N_bpscs = 8 - elif self.tx_mcs == 9 : + elif self.tx_mcs == 9: R = 5 / 6 N_bpscs = 8 - print("tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( - mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) + print( + "tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( + mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) self.tx_data_rate_gi_short_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_short)) / 1000000 print("tx_data_rate gi_short {data_rate} Mbit/s".format(data_rate=self.tx_data_rate_gi_short_Mbps)) - print("tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( - mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) + print( + "tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( + mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) self.tx_data_rate_gi_long_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_long)) / 1000000 print("data_rate gi_long {data_rate} Mbps".format(data_rate=self.tx_data_rate_gi_long_Mbps)) @@ -449,9 +456,9 @@ class ProbePort(LFCliBase): N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) R = 0 # coding , (Determined by the modulation, MCS ) N_ss = 0 # Number of Spatial Streams - T_dft = 3.2 * 10**-6 # Constant for HT - T_gi_short = .4 * 10**-6 # Guard index. - T_gi_long = .8 * 10**-6 # Guard index. + T_dft = 3.2 * 10 ** -6 # Constant for HT + T_gi_short = .4 * 10 ** -6 # Guard index. + T_gi_long = .8 * 10 ** -6 # Guard index. # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith if self.rx_mgt_6Mb_frame is True: @@ -483,59 +490,62 @@ class ProbePort(LFCliBase): # MCS (Modulation Coding Scheme) determines the constands # MCS 0 == Modulation BPSK R = 1/2 , N_bpscs = 1, # Only for HT configuration - if self.rx_mcs == 0 : + if self.rx_mcs == 0: R = 1 / 2 N_bpscs = 1 # MCS 1 == Modulation QPSK R = 1/2 , N_bpscs = 2 - elif self.rx_mcs == 1 : + elif self.rx_mcs == 1: R = 1 / 2 N_bpscs = 2 # MCS 2 == Modulation QPSK R = 3/4 , N_bpscs = 2 - elif self.rx_mcs == 2 : + elif self.rx_mcs == 2: R = 3 / 4 N_bpscs = 2 # MCS 3 == Modulation 16-QAM R = 1/2 , N_bpscs = 4 - elif self.rx_mcs == 3 : + elif self.rx_mcs == 3: R = 1 / 2 N_bpscs = 4 # MCS 4 == Modulation 16-QAM R = 3/4 , N_bpscs = 4 - elif self.rx_mcs == 4 : + elif self.rx_mcs == 4: R = 3 / 4 N_bpscs = 4 # MCS 5 == Modulation 64-QAM R = 2/3 , N_bpscs = 6 - elif self.rx_mcs == 5 : + elif self.rx_mcs == 5: R = 2 / 3 N_bpscs = 6 # MCS 6 == Modulation 64-QAM R = 3/4 , N_bpscs = 6 - elif self.rx_mcs == 6 : + elif self.rx_mcs == 6: R = 3 / 4 N_bpscs = 6 # MCS 7 == Modulation 64-QAM R = 5/6 , N_bpscs = 6 - elif self.rx_mcs == 7 : + elif self.rx_mcs == 7: R = 5 / 6 N_bpscs = 6 # MCS 8 == Modulation 256-QAM R = 3/4 , N_bpscs = 8 - elif self.rx_mcs == 8 : + elif self.rx_mcs == 8: R = 3 / 4 N_bpscs = 8 # MCS 9 == Modulation 256-QAM R = 5/6 , N_bpscs = 8 - elif self.rx_mcs == 9 : + elif self.rx_mcs == 9: R = 5 / 6 N_bpscs = 8 - print("mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( - mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) + print( + "mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( + mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) self.rx_data_rate_gi_short_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_short)) / 1000000 print("rx_data_rate gi_short {data_rate} Mbit/s".format(data_rate=self.rx_data_rate_gi_short_Mbps)) - print("mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( - mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) + print( + "mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( + mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) self.rx_data_rate_gi_long_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_long)) / 1000000 print("rx_data_rate gi_long {data_rate} Mbps".format(data_rate=self.rx_data_rate_gi_long_Mbps)) - if abs(self.rx_mbit - self.rx_data_rate_gi_short_Mbps) <= abs(self.rx_mbit - self.rx_data_rate_gi_long_Mbps): + if abs(self.rx_mbit - self.rx_data_rate_gi_short_Mbps) <= abs( + self.rx_mbit - self.rx_data_rate_gi_long_Mbps): self.rx_mbit_calc = self.rx_data_rate_gi_short_Mbps self.rx_gi = T_gi_short else: @@ -547,16 +557,17 @@ class ProbePort(LFCliBase): # HE no OFDMA - changes the calculations # ########################################### + def calculated_data_rate_tx_HE(self): # TODO compare with standard for 40 MHz if values change N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) R = 0 # coding , (Determined by the modulation, MCS ) N_ss = 0 # Number of Spatial Streams - T_dft = 3.2 * 10**-6 # Constant for HT - T_gi_short = .4 * 10**-6 # Guard index. - T_gi_long = .8 * 10**-6 # Guard index. - bw = 20 + T_dft = 3.2 * 10 ** -6 # Constant for HT + T_gi_short = .4 * 10 ** -6 # Guard index. + T_gi_long = .8 * 10 ** -6 # Guard index. + bw = 20 # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith try: @@ -583,54 +594,56 @@ class ProbePort(LFCliBase): # MCS (Modulation Coding Scheme) determines the constands # MCS 0 == Modulation BPSK R = 1/2 , N_bpscs = 1, # Only for HT configuration - if self.tx_mcs == 0 : + if self.tx_mcs == 0: R = 1 / 2 N_bpscs = 1 # MCS 1 == Modulation QPSK R = 1/2 , N_bpscs = 2 - elif self.tx_mcs == 1 : + elif self.tx_mcs == 1: R = 1 / 2 N_bpscs = 2 # MCS 2 == Modulation QPSK R = 3/4 , N_bpscs = 2 - elif self.tx_mcs == 2 : + elif self.tx_mcs == 2: R = 3 / 4 N_bpscs = 2 # MCS 3 == Modulation 16-QAM R = 1/2 , N_bpscs = 4 - elif self.tx_mcs == 3 : + elif self.tx_mcs == 3: R = 1 / 2 N_bpscs = 4 # MCS 4 == Modulation 16-QAM R = 3/4 , N_bpscs = 4 - elif self.tx_mcs == 4 : + elif self.tx_mcs == 4: R = 3 / 4 N_bpscs = 4 # MCS 5 == Modulation 64-QAM R = 2/3 , N_bpscs = 6 - elif self.tx_mcs == 5 : + elif self.tx_mcs == 5: R = 2 / 3 N_bpscs = 6 # MCS 6 == Modulation 64-QAM R = 3/4 , N_bpscs = 6 - elif self.tx_mcs == 6 : + elif self.tx_mcs == 6: R = 3 / 4 N_bpscs = 6 # MCS 7 == Modulation 64-QAM R = 5/6 , N_bpscs = 6 - elif self.tx_mcs == 7 : + elif self.tx_mcs == 7: R = 5 / 6 N_bpscs = 6 # MCS 8 == Modulation 256-QAM R = 3/4 , N_bpscs = 8 - elif self.tx_mcs == 8 : + elif self.tx_mcs == 8: R = 3 / 4 N_bpscs = 8 # MCS 9 == Modulation 256-QAM R = 5/6 , N_bpscs = 8 - elif self.tx_mcs == 9 : + elif self.tx_mcs == 9: R = 5 / 6 N_bpscs = 8 - print("tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( - mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) + print( + "tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( + mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) self.tx_data_rate_gi_short_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_short)) / 1000000 print("tx_data_rate gi_short {data_rate} Mbit/s".format(data_rate=self.tx_data_rate_gi_short_Mbps)) - print("tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( - mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) + print( + "tx: mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( + mcs=self.tx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) self.tx_data_rate_gi_long_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_long)) / 1000000 print("data_rate gi_long {data_rate} Mbps".format(data_rate=self.tx_data_rate_gi_long_Mbps)) @@ -647,9 +660,9 @@ class ProbePort(LFCliBase): N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) R = 0 # coding , (Determined by the modulation, MCS ) N_ss = 0 # Number of Spatial Streams - T_dft = 3.2 * 10**-6 # Constant for HT - T_gi_short = .4 * 10**-6 # Guard index. - T_gi_long = .8 * 10**-6 # Guard index. + T_dft = 3.2 * 10 ** -6 # Constant for HT + T_gi_short = .4 * 10 ** -6 # Guard index. + T_gi_long = .8 * 10 ** -6 # Guard index. # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith if self.rx_mgt_6Mb_frame is True: @@ -681,59 +694,62 @@ class ProbePort(LFCliBase): # MCS (Modulation Coding Scheme) determines the constands # MCS 0 == Modulation BPSK R = 1/2 , N_bpscs = 1, # Only for HT configuration - if self.rx_mcs == 0 : + if self.rx_mcs == 0: R = 1 / 2 N_bpscs = 1 # MCS 1 == Modulation QPSK R = 1/2 , N_bpscs = 2 - elif self.rx_mcs == 1 : + elif self.rx_mcs == 1: R = 1 / 2 N_bpscs = 2 # MCS 2 == Modulation QPSK R = 3/4 , N_bpscs = 2 - elif self.rx_mcs == 2 : + elif self.rx_mcs == 2: R = 3 / 4 N_bpscs = 2 # MCS 3 == Modulation 16-QAM R = 1/2 , N_bpscs = 4 - elif self.rx_mcs == 3 : + elif self.rx_mcs == 3: R = 1 / 2 N_bpscs = 4 # MCS 4 == Modulation 16-QAM R = 3/4 , N_bpscs = 4 - elif self.rx_mcs == 4 : + elif self.rx_mcs == 4: R = 3 / 4 N_bpscs = 4 # MCS 5 == Modulation 64-QAM R = 2/3 , N_bpscs = 6 - elif self.rx_mcs == 5 : + elif self.rx_mcs == 5: R = 2 / 3 N_bpscs = 6 # MCS 6 == Modulation 64-QAM R = 3/4 , N_bpscs = 6 - elif self.rx_mcs == 6 : + elif self.rx_mcs == 6: R = 3 / 4 N_bpscs = 6 # MCS 7 == Modulation 64-QAM R = 5/6 , N_bpscs = 6 - elif self.rx_mcs == 7 : + elif self.rx_mcs == 7: R = 5 / 6 N_bpscs = 6 # MCS 8 == Modulation 256-QAM R = 3/4 , N_bpscs = 8 - elif self.rx_mcs == 8 : + elif self.rx_mcs == 8: R = 3 / 4 N_bpscs = 8 # MCS 9 == Modulation 256-QAM R = 5/6 , N_bpscs = 8 - elif self.rx_mcs == 9 : + elif self.rx_mcs == 9: R = 5 / 6 N_bpscs = 8 - print("mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( - mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) + print( + "mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_short {T_gi_short}".format( + mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_short=T_gi_short)) self.rx_data_rate_gi_short_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_short)) / 1000000 print("rx_data_rate gi_short {data_rate} Mbit/s".format(data_rate=self.rx_data_rate_gi_short_Mbps)) - print("mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( - mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) + print( + "mcs {mcs} N_sd {N_sd} N_bpscs {N_bpscs} R {R} N_ss {N_ss} T_dft {T_dft} T_gi_long {T_gi_long}".format( + mcs=self.rx_mcs, N_sd=N_sd, N_bpscs=N_bpscs, R=R, N_ss=N_ss, T_dft=T_dft, T_gi_long=T_gi_long)) self.rx_data_rate_gi_long_Mbps = ((N_sd * N_bpscs * R * float(N_ss)) / (T_dft + T_gi_long)) / 1000000 print("rx_data_rate gi_long {data_rate} Mbps".format(data_rate=self.rx_data_rate_gi_long_Mbps)) - if abs(self.rx_mbit - self.rx_data_rate_gi_short_Mbps) <= abs(self.rx_mbit - self.rx_data_rate_gi_long_Mbps): + if abs(self.rx_mbit - self.rx_data_rate_gi_short_Mbps) <= abs( + self.rx_mbit - self.rx_data_rate_gi_long_Mbps): self.rx_mbit_calc = self.rx_data_rate_gi_short_Mbps self.rx_gi = T_gi_short else: From f8d275ca08e9091972aa43a1a411c8bf0b17f4ad Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 17:05:00 -0800 Subject: [PATCH 661/731] qvlan_profile: Remove unused parameters Signed-off-by: Matthew Stidham --- py-json/qvlan_profile.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/py-json/qvlan_profile.py b/py-json/qvlan_profile.py index 6b41a45d..f1a22033 100644 --- a/py-json/qvlan_profile.py +++ b/py-json/qvlan_profile.py @@ -19,7 +19,6 @@ class QVLANProfile(LFCliBase): local_realm, qvlan_parent="eth1", num_qvlans=1, - admin_down=False, dhcp=False, debug_=False): super().__init__(lfclient_host, lfclient_port, debug_) @@ -116,11 +115,11 @@ class QVLANProfile(LFCliBase): else: raise ValueError("Unknown param name: " + param_name) - def create(self, admin_down=False, debug=False, sleep_time=1): + def create(self, sleep_time=1): print("Creating qvlans...") req_url = "/cli-json/add_vlan" - if not self.dhcp and self.first_ip_addr is not None and self.netmask is not None and self.gateway is not None: + if not self.dhcp and self.first_ip_addr and self.netmask and self.gateway: self.desired_set_port_interest_flags.append("ip_address") self.desired_set_port_interest_flags.append("ip_Mask") self.desired_set_port_interest_flags.append("ip_gateway") @@ -146,8 +145,7 @@ class QVLANProfile(LFCliBase): "vid": i + 1 } self.created_qvlans.append("%s.%s.%s#%d" % (self.shelf, self.resource, - self.qvlan_parent, int( - self.desired_qvlans[i][self.desired_qvlans[i].index('#') + 1:]))) + self.qvlan_parent, int(self.desired_qvlans[i][self.desired_qvlans[i].index('#') + 1:]))) self.local_realm.json_post(req_url, data) time.sleep(sleep_time) From d31adb049c0e47e613e3ab4ea48884831de5d908 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 17:25:00 -0800 Subject: [PATCH 662/731] LFUtils: Cleanup whitespace Signed-off-by: Matthew Stidham --- py-json/LANforge/LFUtils.py | 73 ++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index f321687a..305d9ae7 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -21,7 +21,7 @@ if sys.version_info[0] != 3: sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) LFRequest = importlib.import_module("py-json.LANforge.LFRequest") -Logg = importlib.import_module("lanforge_client.logg") # .Logg +Logg = importlib.import_module("lanforge_client.logg") # .Logg debug_printer = pprint.PrettyPrinter(indent=2) @@ -31,7 +31,8 @@ ADD_STA_FLAGS_DOWN_WPA2 = 68719477760 REPORT_TIMER_MS_FAST = 1500 REPORT_TIMER_MS_SLOW = 3000 -#Used for Speed + +# Used for Speed def parse_size_bps(size_val): if isinstance(size_val, str): size_val.upper() @@ -53,7 +54,8 @@ def parse_size_bps(size_val): else: return size_val -#Used for Size of file + +# Used for Size of file def parse_size(size_val): if isinstance(size_val, str): size_val.upper() @@ -104,6 +106,7 @@ class PortEID: def staNewDownStaRequest(sta_name, resource_id=1, radio="wiphy0", ssid="", passphrase="", debug_on=False): return sta_new_down_sta_request(sta_name, resource_id, radio, ssid, passphrase, debug_on) + def sta_new_down_sta_request(sta_name, resource_id=1, radio="wiphy0", ssid="", passphrase="", debug_on=False): """ For use with add_sta. If you don't want to generate mac addresses via patterns (xx:xx:xx:xx:81:*) @@ -133,6 +136,7 @@ def sta_new_down_sta_request(sta_name, resource_id=1, radio="wiphy0", ssid="", p def portSetDhcpDownRequest(resource_id, port_name, debug_on=False): return port_set_dhcp_down_request(resource_id, port_name, debug_on) + def port_set_dhcp_down_request(resource_id, port_name, debug_on=False): """ See http://localhost:8080/help/set_port @@ -157,6 +161,7 @@ def port_set_dhcp_down_request(resource_id, port_name, debug_on=False): def portDhcpUpRequest(resource_id, port_name, debug_on=False): return port_dhcp_up_request(resource_id, port_name, debug_on) + def port_dhcp_up_request(resource_id, port_name, debug_on=False): """ See http://localhost:8080/help/set_port @@ -182,6 +187,7 @@ def port_dhcp_up_request(resource_id, port_name, debug_on=False): def portUpRequest(resource_id, port_name, debug_on=False): return port_up_request(resource_id, port_name, debug_on) + def port_up_request(resource_id, port_name, debug_on=False): """ See http://localhost:8080/help/set_port @@ -202,9 +208,11 @@ def port_up_request(resource_id, port_name, debug_on=False): debug_printer.pprint(data) return data + def portDownRequest(resource_id, port_name, debug_on=False): return port_down_request(resource_id, port_name, debug_on) + def port_down_request(resource_id, port_name, debug_on=False): """ Does not change the use_dhcp flag @@ -213,7 +221,7 @@ def port_down_request(resource_id, port_name, debug_on=False): :param port_name: :return: """ - + data = { "shelf": 1, "resource": resource_id, @@ -227,6 +235,7 @@ def port_down_request(resource_id, port_name, debug_on=False): debug_printer.pprint(data) return data + def port_reset_request(resource_id, port_name, debug_on=False): """ Does not change the use_dhcp flag @@ -235,7 +244,7 @@ def port_reset_request(resource_id, port_name, debug_on=False): :param port_name: :return: """ - + data = { "shelf": 1, "resource": resource_id, @@ -250,6 +259,7 @@ def port_reset_request(resource_id, port_name, debug_on=False): def generateMac(parent_mac, random_octet, debug=False): return generate_mac(parent_mac=parent_mac, random_octet=random_octet, debug=debug) + def generate_mac(parent_mac, random_octet, debug=False): if debug: print("************ random_octet: %s **************" % (random_octet)) @@ -273,7 +283,8 @@ def portNameSeries(prefix_="sta", start_id_=0, end_id_=1, padding_number_=10000, :param padding_number_: :return: """ - return port_name_series(prefix=prefix_, start_id=start_id_, end_id=end_id_, padding_number=padding_number_, radio=radio) + return port_name_series(prefix=prefix_, start_id=start_id_, end_id=end_id_, padding_number=padding_number_, + radio=radio) def port_name_series(prefix="sta", start_id=0, end_id=1, padding_number=10000, radio=None): @@ -292,7 +303,7 @@ def port_name_series(prefix="sta", start_id=0, end_id=1, padding_number=10000, r eid = None if radio is not None: eid = name_to_eid(radio) - + name_list = [] for i in range((padding_number + start_id), (padding_number + end_id + 1)): sta_name = "%s%s" % (prefix, str(i)[1:]) @@ -313,9 +324,11 @@ def gen_ip_series(ip_addr, netmask, num_ips=None): chosen_ips.append(ip_list[i]) return chosen_ips + def generateRandomHex(): return generate_random_hex() + # generate random hex if you need it for mac addresses def generate_random_hex(): # generate a few random numbers and convert them into hex: @@ -371,6 +384,7 @@ def port_list_to_alias_map(json_list, debug_=False): return reverse_map + def list_to_alias_map(json_list=None, from_element=None, debug_=False): reverse_map = {} if (json_list is None) or (len(json_list) < 1): @@ -461,6 +475,7 @@ def wait_until_ports_admin_down(resource_id=1, base_url="http://localhost:8080", def waitUntilPortsAdminUp(resource_id=1, base_url="http://localhost:8080", port_list=()): return wait_until_ports_admin_up(resource_id=resource_id, base_url=base_url, port_list=port_list) + def wait_until_ports_admin_up(resource_id=1, base_url="http://localhost:8080", port_list=(), debug_=False): print("Waiting until ports appear admin-up...") down_stations = port_list.copy() @@ -484,9 +499,11 @@ def wait_until_ports_admin_up(resource_id=1, base_url="http://localhost:8080", p sleep(1) return None + def waitUntilPortsDisappear(base_url="http://localhost:8080", port_list=(), debug=False): wait_until_ports_disappear(base_url, port_list, debug) + def wait_until_ports_disappear(base_url="http://localhost:8080", port_list=(), debug=False): if (port_list is None) or (len(port_list) < 1): if debug: @@ -500,8 +517,8 @@ def wait_until_ports_disappear(base_url="http://localhost:8080", port_list=(), d else: found_stations = [port_list] - temp_names_by_resource = {1:[]} - temp_query_by_resource = {1:""} + temp_names_by_resource = {1: []} + temp_query_by_resource = {1: ""} for port_eid in port_list: eid = name_to_eid(port_eid) # shelf = eid[0] @@ -512,7 +529,8 @@ def wait_until_ports_disappear(base_url="http://localhost:8080", port_list=(), d temp_names_by_resource[resource_id] = [] port_name = eid[2] temp_names_by_resource[resource_id].append(port_name) - temp_query_by_resource[resource_id] = "%s/%s/%s?fields=alias" % (url, resource_id, ",".join(temp_names_by_resource[resource_id])) + temp_query_by_resource[resource_id] = "%s/%s/%s?fields=alias" % ( + url, resource_id, ",".join(temp_names_by_resource[resource_id])) if debug: pprint.pprint(("temp_query_by_resource", temp_query_by_resource)) while len(found_stations) > 0: @@ -541,7 +559,7 @@ def wait_until_ports_disappear(base_url="http://localhost:8080", port_list=(), d if len(found_stations) > 0: if debug: pprint.pprint(("wait_until_ports_disappear found_stations:", found_stations)) - sleep(1) # safety + sleep(1) # safety return @@ -562,31 +580,32 @@ def name_to_eid(eid_input, non_port=False): if (eid_input is None) or (eid_input == ""): raise ValueError("name_to_eid wants eid like 1.1.sta0 but given[%s]" % eid_input) if type(eid_input) is not str: - raise ValueError("name_to_eid wants string formatted like '1.2.name', not a tuple or list or [%s]" % type(eid_input)) + raise ValueError( + "name_to_eid wants string formatted like '1.2.name', not a tuple or list or [%s]" % type(eid_input)) info = eid_input.split('.') if len(info) == 1: - rv[2] = info[0] # just port name + rv[2] = info[0] # just port name return rv - if (len(info) == 2) and info[0].isnumeric() and not info[1].isnumeric(): # resource.port-name + if (len(info) == 2) and info[0].isnumeric() and not info[1].isnumeric(): # resource.port-name rv[1] = int(info[0]) rv[2] = info[1] return rv - elif (len(info) == 2) and not info[0].isnumeric(): # port-name.qvlan - rv[2] = info[0]+"."+info[1] + elif (len(info) == 2) and not info[0].isnumeric(): # port-name.qvlan + rv[2] = info[0] + "." + info[1] return rv - if (len(info) == 3) and info[0].isnumeric() and info[1].isnumeric(): # shelf.resource.port-name + if (len(info) == 3) and info[0].isnumeric() and info[1].isnumeric(): # shelf.resource.port-name rv[0] = int(info[0]) rv[1] = int(info[1]) rv[2] = info[2] return rv - elif (len(info) == 3) and info[0].isnumeric() and not info[1].isnumeric(): # resource.port-name.qvlan + elif (len(info) == 3) and info[0].isnumeric() and not info[1].isnumeric(): # resource.port-name.qvlan rv[1] = int(info[0]) - rv[2] = info[1]+"."+info[2] + rv[2] = info[1] + "." + info[2] return rv if non_port: @@ -597,14 +616,15 @@ def name_to_eid(eid_input, non_port=False): if (len(info) >= 4): rv[3] = int(info[3]) return rv - - if len(info) == 4: # shelf.resource.port-name.qvlan + + if len(info) == 4: # shelf.resource.port-name.qvlan rv[0] = int(info[0]) rv[1] = int(info[1]) - rv[2] = info[2]+"."+info[3] + rv[2] = info[2] + "." + info[3] return rv + def wait_until_ports_appear(base_url="http://localhost:8080", port_list=(), debug=False): """ Use this method to pause until the LANforge system has caught up and implemented the @@ -650,6 +670,7 @@ def wait_until_ports_appear(base_url="http://localhost:8080", port_list=(), debu print("These stations appeared: " + ", ".join(found_stations)) return + def wait_until_endps(base_url="http://localhost:8080", endp_list=(), debug=False): """ @@ -674,7 +695,7 @@ def wait_until_endps(base_url="http://localhost:8080", endp_list=(), debug=False shelf = eid[0] resource_id = eid[1] port_name = eid[2] - + uri = "%s/%s/%s" % (port_url, resource_id, port_name) lf_r = LFRequest.LFRequest(base_url, uri, debug_=debug) json_response = lf_r.getAsJson() @@ -793,11 +814,11 @@ def expand_endp_histogram(distribution_payload=None): raise ValueError("Unexpected histogram format.") multiplier = int(distribution_payload["histo_category_width"]) formatted_dict = { - #"00000 <= x <= 00001" : "0" + # "00000 <= x <= 00001" : "0" } for bucket_index in range(len(distribution_payload["histogram"]) - 1): - pow1 = (2**bucket_index) * multiplier - pow2 = (2**(bucket_index+1)) * multiplier + pow1 = (2 ** bucket_index) * multiplier + pow2 = (2 ** (bucket_index + 1)) * multiplier if bucket_index == 0: category_name = "00000 <= x <= {:-05.0f}".format(pow2) else: From 5fdadbda64ba45ea714b40d143e559205e7ccf94 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 17:26:36 -0800 Subject: [PATCH 663/731] LFUtils: Remove unused init, the second one was the one which was actually used Signed-off-by: Matthew Stidham --- py-json/LANforge/LFUtils.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index 305d9ae7..75d4d7f5 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -83,11 +83,6 @@ class PortEID: port_id = 0 port_name = "" - def __init__(self, p_resource=1, p_port_id=0, p_port_name=""): - resource = p_resource - port_id = p_port_id - port_name = p_port_name - def __init__(self, json_response): if json_response is None: raise Exception("No json input") @@ -96,9 +91,6 @@ class PortEID: json_s = json_response['interface'] debug_printer(json_s) - resource = json_s['resource'] - port_id = json_s['id'] - port_name = json_s['name'] # end class PortEID From 4e0730126df2141cd62807dc473ee31e850ca299 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 17:30:13 -0800 Subject: [PATCH 664/731] test_l3_longevity: Fix InfluxRequest import Signed-off-by: Matthew Stidham --- py-scripts/test_l3_longevity.py | 1 - 1 file changed, 1 deletion(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 767a0a2e..61d3a92b 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -3005,7 +3005,6 @@ Setting wifi_settings per radio influxdb = None if args.influx_bucket is not None: - from InfluxRequest import RecordInflux influxdb = RecordInflux(_influx_host=args.influx_host, _influx_port=args.influx_port, _influx_org=args.influx_org, From b9de3f896c84be462a4ef77704ad1cce8f0d61c5 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 6 Dec 2021 17:32:19 -0800 Subject: [PATCH 665/731] test_ip_connection doesn't have a test_duration flag Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index dfe77f96..fff2efd2 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -361,7 +361,7 @@ else "./test_ip_connection.py --radio $RADIO_USED --num_stations $NUM_STA --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format excel --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --output_format csv --layer3_cols $COL_NAMES --debug --mgr $MGR --traffic_type lf_udp" - "./test_ip_connection.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --ipv6 --test_duration 15s" + "./test_ip_connection.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --ipv6" "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --radio2 $RADIO2" "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" From 7a2931d2ab0bc834f7561ee845d2d6f9401cd8d8 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 7 Dec 2021 06:56:09 -0700 Subject: [PATCH 666/731] *_test.json : pulled out the stability from AP Auto, AP auto taking over 7 hours. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 4 ++-- py-scripts/tools/ct_us_002_tests.json | 24 +++++++++++++++++------- py-scripts/tools/ct_us_003_tests.json | 4 ++-- py-scripts/tools/ct_us_004_tests.json | 2 +- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 25ec6ee3..be59aa05 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -830,7 +830,7 @@ " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", " --set 'Basic Client Connectivity' 1", " --set 'Multi Band Performance' 1", - " --set 'Stability' 1", + " --set 'Stability' 0", " --set 'Multi-Station Throughput vs Pkt Size' 0,", " --set 'Throughput vs Pkt Size' 1", " --set 'Capacity' 1", @@ -893,7 +893,7 @@ " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", " --set 'Basic Client Connectivity' 1", " --set 'Multi Band Performance' 1", - " --set 'Stability' 1", + " --set 'Stability' 0", " --set 'Multi-Station Throughput vs Pkt Size' 0,", " --set 'Throughput vs Pkt Size' 1", " --set 'Capacity' 1", diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 1e27d487..1a540276 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -66,14 +66,23 @@ "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS", - " --instance_name ap_auto --config_name test_con --upstream UPSTREAM_PORT", + " --instance_name ap_auto --config_name test_con --upstream eth2", " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", - " --max_stations_2 32 --max_stations_5 32 --max_stations_dual 100 --radio2 1.1.wiphy1", - " --radio5 1.1.wiphy2 --set 'Basic Client Connectivity' 1", - " --set 'Multi Band Performance' 0 --set 'Stability' 0 --set 'Multi-Station Throughput vs Pkt Size' 0,", - " --set 'Throughput vs Pkt Size' 0 --set 'Capacity' 0 --set 'Band-Steering' 0 --set 'Skip 2.4 Ghz Tests' 1", + " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", + " --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", + " --radio5 1.1.wiphy0 --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", + " --set 'Basic Client Connectivity' 1", + " --set 'Multi Band Performance' 0", + " --set 'Stability' 0", + " --set 'Multi-Station Throughput vs Pkt Size' 0,", + " --set 'Throughput vs Pkt Size' 0", + " --set 'Capacity' 0", + " --set 'Band-Steering' 0", + " --set 'Skip 2.4 Ghz Tests' 0", " --pull_report --local_lf_report_dir REPORT_PATH", + " --test_tag 'AP_AUTO'", + " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] }, @@ -287,7 +296,7 @@ "timeout": "25200", "args": "", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS", " --instance_name ap_auto --config_name test_con --upstream eth2", " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", @@ -302,7 +311,8 @@ " --set 'Capacity' 0", " --set 'Band-Steering' 0", " --set 'Skip 2.4 Ghz Tests' 0", - " --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'AP_AUTO'", + " --pull_report --local_lf_report_dir REPORT_PATH", + " --test_tag 'AP_AUTO'", " --test_rig TEST_RIG", " --set DUT_SET_NAME" ] diff --git a/py-scripts/tools/ct_us_003_tests.json b/py-scripts/tools/ct_us_003_tests.json index a393436e..014765b1 100644 --- a/py-scripts/tools/ct_us_003_tests.json +++ b/py-scripts/tools/ct_us_003_tests.json @@ -428,7 +428,7 @@ "iterations":"1", "args": "", "args_list":[ - " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", + " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS", " --instance_name ap_auto --config_name test_con --upstream eth2", " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", @@ -500,7 +500,7 @@ " --radio5 1.1.wiphy0 --radio5 1.1.wiphy1 --radio5 1.2.wiphy0 --radio5 1.2.wiphy1 --radio5 1.3.wiphy0 --radio5 1.3.wiphy1", " --set 'Basic Client Connectivity' 1", " --set 'Multi Band Performance' 1", - " --set 'Stability' 1", + " --set 'Stability' 0", " --set 'Multi-Station Throughput vs Pkt Size' 0,", " --set 'Throughput vs Pkt Size' 1", " --set 'Capacity' 1", diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index c23ebba9..4c001c05 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -851,7 +851,7 @@ " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", " --set 'Basic Client Connectivity' 1", " --set 'Multi Band Performance' 1", - " --set 'Stability' 1", + " --set 'Stability' 0", " --set 'Multi-Station Throughput vs Pkt Size' 0,", " --set 'Throughput vs Pkt Size' 1", " --set 'Capacity' 1", From ae94318f07773f657f439b023256a0fd8a97024b Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 7 Dec 2021 08:28:18 -0700 Subject: [PATCH 667/731] lf_check.py : fixed relative paths for lf_qa reports Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index cc677ff0..d7d88ce3 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1496,10 +1496,9 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a report.build_table() if "NA" not in qa_report_html: qa_url = qa_report_html.replace('/home/lanforge', '') - if qa_url.startswith('/'): - qa_url = qa_url[1:] report.set_table_title("LF Check QA ") report.build_table_title() + print("QA Test Results qa_run custom: {qa_url}".format(qa_url=qa_url)) report.build_link("QA Test Results", qa_url) report.set_table_title("LF Check Suite Summary") From 429021499308cc566d3afdcc626d8dbc0eaf82d2 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 09:25:58 -0800 Subject: [PATCH 668/731] create_qvlan: remove unused arguments Signed-off-by: Matthew Stidham --- py-scripts/create_qvlan.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/py-scripts/create_qvlan.py b/py-scripts/create_qvlan.py index 3df7d731..510281ce 100755 --- a/py-scripts/create_qvlan.py +++ b/py-scripts/create_qvlan.py @@ -59,9 +59,7 @@ class CreateQVlan(Realm): def build(self): print("Creating QVLAN stations") self.qvlan_profile.create( - admin_down=False, - sleep_time=.5, - debug=self.debug) + sleep_time=.5) def main(): From b1b612f421230454120386ff4e835dc0ef04ac9b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 10:09:38 -0800 Subject: [PATCH 669/731] regression_test: New Table for system information Record Python version id tags for KPIs Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index fff2efd2..864d2029 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -77,6 +77,8 @@ if [[ ${#MGR} -eq 0 ]]; then # Allow the user to change the radio they test agai MGR="localhost" fi +PYTHON_VERSION=$(python -c 'import sys; print(sys.version)') + #SCENARIO_CHECK="$(python3 -c "import requests; print(requests.get('http://${MGR}:8080/events/').status_code)")" #if [[ ${SCENARIO_CHECK} -eq 200 ]]; then # : @@ -622,9 +624,10 @@ td.testname {

Regression Results

-

$NOW

-

$LAST_COMMIT

-
${CURR_TEST_NAME}$TDTEXT${execution}STDOUT${STDERR}
${testcommand}
${CURR_TEST_NAME}${testcommand}$TDTEXT${execution}STDOUT${STDERR}
Command NameCommand Status Execution time STDOUT
+

$NOW

+

$LAST_COMMIT

+

Test results

+
@@ -641,7 +644,26 @@ td.testname { fname="${HOMEPATH}/html-reports/regression_file-${NOW}.html" echo "$header" >> "$fname" echo "${results[@]}" >> "$fname" - echo "
Command Name
" >> "$fname" + LANFORGE_DATA=$(python -c 'import lanforge_scripts + lfcli=lanforge_scripts.LFCliBase(\"192.168.92.12\",8080) + response=lfcli.json_get(\"/\")') + echo "
+ +
+

System information

+ + + + + + + + + + + + +
Python version>LANforge versionLANforge build date
${PYTHON_VERSION}
" >> "$fname" echo "$tail" >> "$fname" if [ -f "${HOMEPATH}/html-reports/latest.html" ]; then rm -f "${HOMEPATH}/html-reports/latest.html" From 1deae84e5279810307c00571600916341ac4b4f0 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 10:10:37 -0800 Subject: [PATCH 670/731] mine_regression_results: Include Machine name in output Signed-off-by: Matthew Stidham --- py-scripts/tools/mine_regression_results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/mine_regression_results.py b/py-scripts/tools/mine_regression_results.py index 7f210eed..eb861b27 100755 --- a/py-scripts/tools/mine_regression_results.py +++ b/py-scripts/tools/mine_regression_results.py @@ -31,7 +31,7 @@ class MineRegression: self.df = self.df[self.df['STDOUT'] == 'STDOUT'] def generate_report(self): - system_variations = self.df[['Python version', 'LF version', 'Fedora version', 'environment']].drop_duplicates().reset_index( + system_variations = self.df[['Machine', 'Python version', 'LF version', 'Fedora version', 'environment']].drop_duplicates(['Python version', 'LF version', 'Fedora version', 'environment']).reset_index( drop=True) errors = list() for index in system_variations.index: From 215fa5feee5c8d057fc7d6bd68d7d2d06b8480d8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 12:27:29 -0800 Subject: [PATCH 671/731] regression_test: Remove extra character Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 864d2029..31e6a4d6 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -654,7 +654,7 @@ td.testname { - + From 83136bb77992cc5a14192bee7564c009cd8d9ead Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 12:48:41 -0800 Subject: [PATCH 672/731] regression_test: Add System Information to System Information table Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 31e6a4d6..01dbe211 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -77,7 +77,11 @@ if [[ ${#MGR} -eq 0 ]]; then # Allow the user to change the radio they test agai MGR="localhost" fi -PYTHON_VERSION=$(python -c 'import sys; print(sys.version)') +PYTHON_VERSION=$(python3 -c 'import sys; print(sys.version)') + +BuildVersion=$(wget $MGR:8080 -q -O - jq '.VersionInfo.BuildVersion') +BuildDate=$(wget $MGR:8080 -q -O - jq '.VersionInfo.BuildDate') +OS_Version=$(echo /etc/os-release | grep 'VERSION') #SCENARIO_CHECK="$(python3 -c "import requests; print(requests.get('http://${MGR}:8080/events/').status_code)")" #if [[ ${SCENARIO_CHECK} -eq 200 ]]; then @@ -644,9 +648,7 @@ td.testname { fname="${HOMEPATH}/html-reports/regression_file-${NOW}.html" echo "$header" >> "$fname" echo "${results[@]}" >> "$fname" - LANFORGE_DATA=$(python -c 'import lanforge_scripts - lfcli=lanforge_scripts.LFCliBase(\"192.168.92.12\",8080) - response=lfcli.json_get(\"/\")') + LANFORGE_DATA=$(python -c 'import lanforge_scripts; lfcli=lanforge_scripts.LFCliBase(\"192.168.92.12\",8080); response=lfcli.json_get(\"/\")') echo "
Python version>Python version LANforge version LANforge build date

@@ -657,11 +659,13 @@ td.testname { Python version LANforge version LANforge build date + OS Version ${PYTHON_VERSION} - - + ${BuildVersion} + ${BuildDate} + ${OS_Version} " >> "$fname" echo "$tail" >> "$fname" From 4f6ee25c81ef04855a5db181212311ecaf04fe18 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 12:50:36 -0800 Subject: [PATCH 673/731] regression_test: Save hostname to system information table Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 01dbe211..2bac6e5a 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -82,6 +82,7 @@ PYTHON_VERSION=$(python3 -c 'import sys; print(sys.version)') BuildVersion=$(wget $MGR:8080 -q -O - jq '.VersionInfo.BuildVersion') BuildDate=$(wget $MGR:8080 -q -O - jq '.VersionInfo.BuildDate') OS_Version=$(echo /etc/os-release | grep 'VERSION') +HOSTNAME=$(cat /etc/hostname) #SCENARIO_CHECK="$(python3 -c "import requests; print(requests.get('http://${MGR}:8080/events/').status_code)")" #if [[ ${SCENARIO_CHECK} -eq 200 ]]; then @@ -665,7 +666,8 @@ td.testname { ${PYTHON_VERSION} ${BuildVersion} ${BuildDate} - ${OS_Version} + ${OS_Version} + ${HOSTNAME} " >> "$fname" echo "$tail" >> "$fname" From 20ba391fd45eb21e6280572f1d53cdfc06cf804b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 12:54:44 -0800 Subject: [PATCH 674/731] regression_test: Fix html table formatting Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 2bac6e5a..29db8124 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -654,7 +654,7 @@ td.testname {

System information

- +
@@ -662,6 +662,8 @@ td.testname { + + @@ -669,6 +671,7 @@ td.testname { +
Python versionLANforge build date OS Version
${PYTHON_VERSION} ${BuildVersion}${OS_Version} ${HOSTNAME}
" >> "$fname" echo "$tail" >> "$fname" if [ -f "${HOMEPATH}/html-reports/latest.html" ]; then From 9e3c008ffbf07350c530b848d98aa29bab8667ad Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 12:58:28 -0800 Subject: [PATCH 675/731] regression_test: Improve create_chamberview.py command Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 29db8124..87f814e0 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -221,7 +221,7 @@ else "./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" create_bridge_and_station "./create_chamberview.py -m $MGR -cs 'regression_test' \ - --line 'Resource=1.1 Profile=STA-AC Amount=1 Uses-1=$RADIO_USED Freq=-1 DUT=TEST DUT_RADIO=$RADIO_USED Traffic=http' \ + --line 'Resource=1.1 Profile=STA-AC Amount=1 Uses-1=$RADIO_USED Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http' \ --line 'Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=Test DUT_RADIO=$RADIO_USED Traffic=http'" "./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ --ssid 'ssid_idx=0 ssid='$SSID_USED' security='$SECURITY' password='$PASSWD_USED' bssid=04:f0:21:2c:41:84'" From f0f613d3392795942b189c936ac29b7bedf77da8 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 13:00:46 -0800 Subject: [PATCH 676/731] regression_test: Improve create_chamberview.py command Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 87f814e0..4cf0b425 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -222,7 +222,7 @@ else create_bridge_and_station "./create_chamberview.py -m $MGR -cs 'regression_test' \ --line 'Resource=1.1 Profile=STA-AC Amount=1 Uses-1=$RADIO_USED Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http' \ - --line 'Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=Test DUT_RADIO=$RADIO_USED Traffic=http'" + --line 'Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http'" "./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ --ssid 'ssid_idx=0 ssid='$SSID_USED' security='$SECURITY' password='$PASSWD_USED' bssid=04:f0:21:2c:41:84'" "./create_l3.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR --endp_a wiphy0 --endp_b wiphy1" From f1e42e994ce4b902fbc2276d4c8e4c42cf92591a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 13:14:58 -0800 Subject: [PATCH 677/731] regression_test: create_chamberview: Delete old instance of scenario if it already exists Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 4cf0b425..223131b0 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -220,7 +220,7 @@ else testCommands=( "./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" create_bridge_and_station - "./create_chamberview.py -m $MGR -cs 'regression_test' \ + "./create_chamberview.py -m $MGR -cs 'regression_test' --delete_scenario \ --line 'Resource=1.1 Profile=STA-AC Amount=1 Uses-1=$RADIO_USED Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http' \ --line 'Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http'" "./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ From a4bded8f88d9f854c71948fe97644dca43bc3934 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 13:18:18 -0800 Subject: [PATCH 678/731] regression_test: Create station and dataplane Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 223131b0..2dda54e4 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -185,7 +185,18 @@ function create_bridge_and_station() { ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR ./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug --mgr $MGR } - +function create_station_and_dataplane() { + ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR + ./lf_dataplane_test.py --mgr $MGR --lf_user lanforge --lf_password lanforge \ + --instance_name dataplane-instance --config_name test_con --upstream 1.1.$UPSTREAM \ + --dut linksys-8450 --duration 15s --station 1.1.sta0001 \ + --download_speed 85% --upload_speed 0 \ + --test_rig Testbed-01 --pull_report \ + --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ + --influx_bucket ben \ + --influx_tag testbed Ferndale-01 +} if [[ ${#SHORT} -gt 0 ]]; then testCommands=( "./lf_ap_auto_test.py \ @@ -275,15 +286,7 @@ else #"./lf_atten_mod_test.py --host $MGR --debug" #./lf_csv #./lf_dataplane_config - "./lf_dataplane_test.py --mgr $MGR --lf_user lanforge --lf_password lanforge \ - --instance_name dataplane-instance --config_name test_con --upstream 1.1.$UPSTREAM \ - --dut linksys-8450 --duration 15s --station 1.1.sta01500 \ - --download_speed 85% --upload_speed 0 \ - --test_rig Testbed-01 --pull_report \ - --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ - --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ - --influx_bucket ben \ - --influx_tag testbed Ferndale-01" + create_station_and_dataplane #"./lf_dut_sta_vap_test.py --manager $MGR --radio $RADIO_USED \ # --num_sta 1 --sta_id 1 --ssid $SSID_USED --security $SECURITY --upstream $UPSTREAM \ # --protocol lf_udp --min_mbps 1000 --max_mbps 10000 --duration 1" From 2e0f6434844d58af7e2e09d6efe0f7ecc2edc10c Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 13:19:50 -0800 Subject: [PATCH 679/731] regression_test: Create station and sensitivity Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 36 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 2dda54e4..79700e5b 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -197,6 +197,25 @@ function create_station_and_dataplane() { --influx_bucket ben \ --influx_tag testbed Ferndale-01 } +function create_station_and_sensitivity { + ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR + ./lf_rx_sensitivity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ + --instance_name rx-sensitivity-instance --config_name test_con --upstream 1.1.eth2 \ + --dut linksys-8450 --duration 15s --station 1.1.sta0001 \ + --download_speed 85% --upload_speed 0 \ + --raw_line 'txo_preamble\: VHT' \ + --raw_line 'txo_mcs\: 4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT' \ + --raw_line 'spatial_streams\: 3' \ + --raw_line 'bandw_options\: 80' \ + --raw_line 'txo_sgi\: ON' \ + --raw_line 'txo_retries\: No Retry' \ + --raw_line 'txo_txpower\: 17' \ + --test_rig Testbed-01 --pull_report \ + --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ + --influx_bucket ben \ + --influx_tag testbed Ferndale-01 +} if [[ ${#SHORT} -gt 0 ]]; then testCommands=( "./lf_ap_auto_test.py \ @@ -296,22 +315,7 @@ else "./lf_report.py" "./lf_report_test.py" # "./lf_rvr_test.py" - "./lf_rx_sensitivity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name rx-sensitivity-instance --config_name test_con --upstream 1.1.eth2 \ - --dut linksys-8450 --duration 15s --station 1.1.sta01500 \ - --download_speed 85% --upload_speed 0 \ - --raw_line 'txo_preamble\: VHT' \ - --raw_line 'txo_mcs\: 4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT' \ - --raw_line 'spatial_streams\: 3' \ - --raw_line 'bandw_options\: 80' \ - --raw_line 'txo_sgi\: ON' \ - --raw_line 'txo_retries\: No Retry' \ - --raw_line 'txo_txpower\: 17' \ - --test_rig Testbed-01 --pull_report \ - --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ - --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ - --influx_bucket ben \ - --influx_tag testbed Ferndale-01" + create_station_and_sensitivity "./lf_sniff_radio.py \ --mgr $MGR \ --mgr_port 8080 \ From 372920b7a898d82764f89eaef530d6966e61ce96 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 13:29:03 -0800 Subject: [PATCH 680/731] regression_test: create_chamberview is dependent on create_chamberview_dut. run them together without resetting the lanforge between commands. Run create_chamberview_dut before create_chamberview Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 79700e5b..64403a3b 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -197,6 +197,14 @@ function create_station_and_dataplane() { --influx_bucket ben \ --influx_tag testbed Ferndale-01 } +function create_dut_and_chamberview() { + ./create_chamberview.py -m $MGR -cs 'regression_test' --delete_scenario \ + --line "Resource=1.1 Profile=STA-AC Amount=1 Uses-1=$RADIO_USED Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http" \ + --line "Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http" + ./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ + --ssid "ssid_idx=0 ssid='$SSID_USED' security='$SECURITY' password='$PASSWD_USED' bssid=04:f0:21:2c:41:84" + } +} function create_station_and_sensitivity { ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR ./lf_rx_sensitivity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ @@ -250,11 +258,7 @@ else testCommands=( "./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" create_bridge_and_station - "./create_chamberview.py -m $MGR -cs 'regression_test' --delete_scenario \ - --line 'Resource=1.1 Profile=STA-AC Amount=1 Uses-1=$RADIO_USED Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http' \ - --line 'Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http'" - "./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ - --ssid 'ssid_idx=0 ssid='$SSID_USED' security='$SECURITY' password='$PASSWD_USED' bssid=04:f0:21:2c:41:84'" + create_dut_and_chamberview "./create_l3.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR --endp_a wiphy0 --endp_b wiphy1" "./create_l3_stations.py --mgr $MGR --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug" "./create_l4.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR" From 4aa44b0eb461343dcb9bc6df688b69c052bdaebe Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 13:31:40 -0800 Subject: [PATCH 681/731] regression_test: Fix curly brace Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 64403a3b..dfce49c8 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -204,7 +204,7 @@ function create_dut_and_chamberview() { ./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ --ssid "ssid_idx=0 ssid='$SSID_USED' security='$SECURITY' password='$PASSWD_USED' bssid=04:f0:21:2c:41:84" } -} + function create_station_and_sensitivity { ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR ./lf_rx_sensitivity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ From bf6ee9729878bdf28dfb7e031817a3a03b77c674 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 14:48:57 -0800 Subject: [PATCH 682/731] regression_test: Fix system information table Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index dfce49c8..0bcc0f55 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -79,9 +79,9 @@ fi PYTHON_VERSION=$(python3 -c 'import sys; print(sys.version)') -BuildVersion=$(wget $MGR:8080 -q -O - jq '.VersionInfo.BuildVersion') -BuildDate=$(wget $MGR:8080 -q -O - jq '.VersionInfo.BuildDate') -OS_Version=$(echo /etc/os-release | grep 'VERSION') +BuildVersion=$(wget $MGR:8080 -q -O - | jq '.VersionInfo.BuildVersion') +BuildDate=$(wget $MGR:8080 -q -O - | jq '.VersionInfo.BuildDate') +OS_Version=$(cat /etc/os-release | grep 'VERSION=') HOSTNAME=$(cat /etc/hostname) #SCENARIO_CHECK="$(python3 -c "import requests; print(requests.get('http://${MGR}:8080/events/').status_code)")" @@ -672,6 +672,7 @@ td.testname { LANforge version LANforge build date OS Version + Hostname From 3bca34baa43a184aeff80e11186bff86361c0d19 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 7 Dec 2021 16:14:19 -0800 Subject: [PATCH 683/731] regression_test: IP address in device table Start title with Hostname Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 0bcc0f55..52fcb788 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -83,6 +83,7 @@ BuildVersion=$(wget $MGR:8080 -q -O - | jq '.VersionInfo.BuildVersion') BuildDate=$(wget $MGR:8080 -q -O - | jq '.VersionInfo.BuildDate') OS_Version=$(cat /etc/os-release | grep 'VERSION=') HOSTNAME=$(cat /etc/hostname) +IP_ADDRESS=$(ip a sho eth0 | grep 'inet ' | cut -d "/" -f1 | cut -d "t" -f2) #SCENARIO_CHECK="$(python3 -c "import requests; print(requests.get('http://${MGR}:8080/events/').status_code)")" #if [[ ${SCENARIO_CHECK} -eq 200 ]]; then @@ -599,7 +600,7 @@ function html_generator() { header=" -Regression Test Results $NOW +${HOSTNAME} Regression Test Results $NOW + + + + $my_hostname + $my_dev $my_ip + $my_mac + + + +_EOF_ + + +set_background picture-filename ${A}${DesktopFile}${A} +set_background picture-options 'stretched' +# From 8edb0cdb8d6a7e5e857e06dab20af355be98706a Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 8 Dec 2021 13:00:55 -0800 Subject: [PATCH 701/731] lf_graph.py: lf_graph had a very confusing assignment for init values which was unstable. Needs further work, but this will work for now. Signed-off-by: Matthew Stidham --- py-scripts/lf_graph.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index b07cc61a..58a2d194 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -202,8 +202,6 @@ class lf_scatter_graph: _y_data_set = [[30, 55, 69, 37]] if _label is None: _label = ["num1", "num2"] - if _color is None: - _color = ["r", "y"] self.x_data_set = _x_data_set self.y_data_set = _y_data_set self.xaxis_name = _xaxis_name @@ -280,8 +278,6 @@ class lf_stacked_graph: _data_set = [[1, 2, 3, 4], [1, 1, 1, 1], [1, 1, 1, 1]] if _label is None: _label = ['Success', 'Fail'] - if _color is None: - _color = ["b", "g"] self.data_set = _data_set # [x_axis,y1_axis,y2_axis] self.xaxis_name = _xaxis_name self.yaxis_name = _yaxis_name From 5f9fd108a838afb75a315f31cfa060ac55e5a1f2 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 8 Dec 2021 13:27:01 -0800 Subject: [PATCH 702/731] regression_test: Include location of python environment in system information table Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 6deb7a5c..65efcfda 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -84,6 +84,7 @@ BuildDate=$(wget $MGR:8080 -q -O - | jq '.VersionInfo.BuildDate') OS_Version=$(cat /etc/os-release | grep 'VERSION=') HOSTNAME=$(cat /etc/hostname) IP_ADDRESS=$(ip a sho eth0 | grep 'inet ' | cut -d "/" -f1 | cut -d "t" -f2) +PYTHON_ENVIRONMENT=$(which python3) #SCENARIO_CHECK="$(python3 -c "import requests; print(requests.get('http://${MGR}:8080/events/').status_code)")" #if [[ ${SCENARIO_CHECK} -eq 200 ]]; then @@ -670,6 +671,7 @@ td.testname { OS Version Hostname IP Address + Python Environment @@ -680,6 +682,7 @@ td.testname { ${OS_Version} ${HOSTNAME} ${IP_ADDRESS} + ${PYTHON_ENVIRONMENT} " >> "$fname" From edadf4f5454b1740b3ffeee3933a5089eb07182b Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 8 Dec 2021 13:29:48 -0800 Subject: [PATCH 703/731] testgroup2: Fix linting errors Signed-off-by: Matthew Stidham --- py-scripts/testgroup2.py | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/py-scripts/testgroup2.py b/py-scripts/testgroup2.py index 792d490b..019e2f79 100755 --- a/py-scripts/testgroup2.py +++ b/py-scripts/testgroup2.py @@ -14,7 +14,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -42,13 +41,17 @@ class TestGroup2(Realm): list_groups=None, tg_action=None, cx_action=None, - add_cx_list=[], - rm_cx_list=[], + add_cx_list=None, + rm_cx_list=None, show_group=None, _debug_on=False, _exit_on_error=False, _exit_on_fail=False): super().__init__(host, port) + if rm_cx_list is None: + rm_cx_list = [] + if add_cx_list is None: + add_cx_list = [] self.upstream = upstream self.host = host self.port = port @@ -86,13 +89,12 @@ class TestGroup2(Realm): self.cx_profile.side_b_min_bps = side_b_min_rate self.cx_profile.side_b_max_bps = side_b_max_rate - self.tg_action = tg_action - self.cx_action = cx_action + self.tg_action = tg_action + self.cx_action = cx_action self.list_groups = list_groups - self.show_group = show_group + self.show_group = show_group self.tg_profile = self.new_test_group_profile() - if group_name is None and list_groups is None and (tg_action is not None or cx_action is not None or - add_cx_list is not None or rm_cx_list is not None or show_group is not None): + if not group_name and not list_groups and (tg_action or cx_action or add_cx_list or rm_cx_list or show_group): raise ValueError("Group name must be set if manipulating test groups") else: self.tg_profile.group_name = group_name @@ -102,12 +104,11 @@ class TestGroup2(Realm): else: self.add_cx_list = add_cx_list - if rm_cx_list is not None and len(rm_cx_list) == 1 and ',' in rm_cx_list[0]: + if rm_cx_list and len(rm_cx_list) == 1 and ',' in rm_cx_list[0]: self.rm_cx_list = rm_cx_list[0].split(',') else: self.rm_cx_list = rm_cx_list - def pre_cleanup(self): self.cx_profile.cleanup_prefix() for sta in self.sta_list: @@ -130,7 +131,7 @@ class TestGroup2(Realm): side_a=self.station_profile.station_names, side_b=self.upstream, sleep_time=0) - self.add_cx_list=self.cx_profile.get_cx_names() + self.add_cx_list = self.cx_profile.get_cx_names() self._pass("PASS: Station build finished") def do_cx_action(self): @@ -173,6 +174,7 @@ class TestGroup2(Realm): print(cx) else: print("No cxs found in %s" % self.tg_profile.group_name) + def update_cxs(self): if len(self.add_cx_list) > 0: print("Adding cxs %s to %s" % (', '.join(self.add_cx_list), self.tg_profile.group_name)) @@ -186,6 +188,7 @@ class TestGroup2(Realm): if cx in self.tg_profile.cx_list: self.tg_profile.cx_list.remove(cx) + def main(): parser = LFCliBase.create_basic_argparse( prog='testgroup2.py', @@ -236,7 +239,7 @@ python3 ./testgroup2.py for group in parser._action_groups: if group.title == "required arguments": required_args = group - break; + break if required_args is not None: required_args.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) required_args.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000) @@ -246,7 +249,7 @@ python3 ./testgroup2.py for group in parser._action_groups: if group.title == "optional arguments": optional_args = group - break; + break if optional_args is not None: optional_args.add_argument('--mode', help='Used to force mode of stations') optional_args.add_argument('--ap', help='Used to force a connection to a particular AP') @@ -254,14 +257,15 @@ python3 ./testgroup2.py tg_group = parser.add_mutually_exclusive_group() tg_group.add_argument('--add_group', help='add new test group', action='store_true', default=False) tg_group.add_argument('--del_group', help='delete test group', action='store_true', default=False) - parser.add_argument('--show_group', help='show connections in current test group', action='store_true', default=False) + parser.add_argument('--show_group', help='show connections in current test group', action='store_true', + default=False) cx_group = parser.add_mutually_exclusive_group() cx_group.add_argument('--start_group', help='start all cxs in chosen test group', default=None) cx_group.add_argument('--stop_group', help='stop all cxs in chosen test group', default=None) cx_group.add_argument('--quiesce_group', help='quiesce all cxs in chosen test groups', default=None) - parser.add_argument('--add_cx', help='add cx to chosen test group', nargs='*', default=[]) + parser.add_argument('--add_cx', help='add cx to chosen test group', nargs='*', default=[]) parser.add_argument('--remove_cx', help='remove cx from chosen test group', nargs='*', default=[]) args = parser.parse_args() @@ -272,7 +276,6 @@ python3 ./testgroup2.py station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, radio=args.radio) - tg_action = None cx_action = None From 3201ee1e800037bd016c05ddde0182017365db12 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 8 Dec 2021 14:57:07 -0800 Subject: [PATCH 704/731] mine_regression_results: Support Python environment control variable Signed-off-by: Matthew Stidham --- py-scripts/tools/mine_regression_results.py | 22 +++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/py-scripts/tools/mine_regression_results.py b/py-scripts/tools/mine_regression_results.py index 034584a1..2b3d2d85 100755 --- a/py-scripts/tools/mine_regression_results.py +++ b/py-scripts/tools/mine_regression_results.py @@ -23,18 +23,32 @@ class MineRegression: dfs = [pd.merge(results[n], systems[n], on='IP') for n in range(len(self.ips))] self.df = pd.concat(dfs) self.df = self.df[self.df['STDOUT'] == 'STDOUT'] + print(self.df.columns) def generate_report(self): system_variations = self.df[ - ['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname']].drop_duplicates( - ['Python version', 'LANforge version', 'OS Version']).reset_index(drop=True) + ['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname', 'Python Environment']].drop_duplicates( + ['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname', 'Python Environment']).reset_index(drop=True) + print(self.df.drop_duplicates('IP')) + print(self.df['IP'].value_counts()) + print(system_variations['IP'].value_counts()) errors = list() + lanforge_errors = list() for index in system_variations.index: + print(system_variations['IP'][index]) variation = system_variations.iloc[index] - result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version']].isin(dict( + result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict( variation).values()).all(axis=1), :].dropna(subset=['STDERR']).shape[0] + print(result) errors.append(result) + + lanforge_result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict( + variation).values()).all(axis=1), :].dropna(subset=['LANforge Error']).shape[0] + print(result) + lanforge_errors.append(lanforge_result) system_variations['errors'] = errors + system_variations['LANforge errors'] = lanforge_errors + system_variations['Python errors'] = system_variations['errors'] - system_variations['LANforge errors'] if self.save_csv: system_variations.to_csv('regression_suite_results.csv') else: @@ -50,7 +64,7 @@ def main(): if args.ip is None: args.ip = ['192.168.92.18', '192.168.92.12', '192.168.93.51', '192.168.92.15'] - + #args.ip = ['192.168.93.51'] Miner = MineRegression(system_information=args.system_info, save_csv=args.save_csv, ips=args.ip) From ebde0fea99460b20bb210f97d2672012883184ce Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 8 Dec 2021 15:03:57 -0800 Subject: [PATCH 705/731] test_ipv4_ttls: Attempting to create stations after stations have already been built has been generating errors. This fixes the problem. Signed-off-by: Matthew Stidham --- py-scripts/test_ipv4_ttls.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/py-scripts/test_ipv4_ttls.py b/py-scripts/test_ipv4_ttls.py index d3115166..1b0e90f0 100755 --- a/py-scripts/test_ipv4_ttls.py +++ b/py-scripts/test_ipv4_ttls.py @@ -141,7 +141,7 @@ class TTLSTest(Realm): self.l3_cx_obj_tcp = IPVariableTime(host=self.host, port=self.port, radio=self.radio, ssid=self.ssid, password=self.password, security=self.security, - use_existing_sta=False, sta_list=self.sta_list, traffic_type="lf_tcp", + use_existing_sta=True, sta_list=self.sta_list, traffic_type="lf_tcp", upstream=self.upstream_port) self.l3_cx_obj_tcp.cx_profile.name_prefix = "tcp-" self.l3_cx_obj_tcp.cx_profile.side_a_min_bps = 128000 @@ -203,12 +203,6 @@ class TTLSTest(Realm): suppress_related_commands_=True, use_radius=True, hs20_enable=False) - self.station_profile.create(radio=self.radio, - sta_names_=self.sta_list, - debug=self.debug, - use_radius=True, - hs20_enable=False) - self._pass("Station build finished") self.l3_cx_obj_udp.build() self.l3_cx_obj_tcp.build() if self.debug: From 9ddfe068452511a5cf031bb5f2d7e1cb319c04bf Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 8 Dec 2021 15:22:52 -0800 Subject: [PATCH 706/731] testgroup2: name_prefix cannot be blank Signed-off-by: Matthew Stidham --- py-scripts/testgroup2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/testgroup2.py b/py-scripts/testgroup2.py index 019e2f79..ab6a7315 100755 --- a/py-scripts/testgroup2.py +++ b/py-scripts/testgroup2.py @@ -295,7 +295,7 @@ python3 ./testgroup2.py port=args.mgr_port, number_template="0000", sta_list=station_list, - name_prefix="", + name_prefix="VT-", upstream=args.upstream_port, ssid=args.ssid, password=args.passwd, From 5820c8e26208ca6d7bdbaf3200de2b7ef83cf4f8 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 8 Dec 2021 16:52:44 -0700 Subject: [PATCH 707/731] test_ip_variable_time.py : initial commit for setting specific channel Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_ip_variable_time.py | 31 ++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index 12cedfde..963d372f 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -147,6 +147,18 @@ class IPVariableTime(Realm): self.cx_profile.side_b_min_bps = side_b_min_rate self.cx_profile.side_b_max_bps = side_b_max_rate + def set_wifi_radio(self, country=0, resource=1, mode="NA", radio="wiphy6", channel=5): + data = { + "shelf": 1, + "resource": resource, + "radio": radio, + "mode": mode, # "NA", #0 for AUTO or "NA" + "channel": channel, + "country": 0, + "frequency": super().channel_freq(channel_=channel) + } + super().json_post("/cli-json/set_wifi_radio", _data=data) + def start(self): # if self.use_existing_station: # to-do- check here if upstream port got IP @@ -335,8 +347,8 @@ def main(): test_ip_variable_time.py: -------------------- Report: -The report will be in /home/lanforge/report-data/_test_ip_variable_time . -if the directory it not present it "should" place it in the local directory from where the script was run. +The report will be in /home/lanforge/report-data/_test_ip_variable_time . +if the directory it not present it "should" place it in the local directory from where the script was run. Generic command layout: @@ -363,7 +375,7 @@ python3 ./test_ip_variable_time.py --ssid netgear --password admin123 --test_duration 2m (default) - --monitor_interval_ms + --monitor_interval_ms --a_min 3000 --b_min 1000 --ap "00:0e:8e:78:e1:76" @@ -377,7 +389,7 @@ python3 ./test_ip_variable_time.py python3 ./test_ip_variable_time.py --upstream_port eth1 (upstream Port) - --traffic_type lf_udp (traffic type, lf_udp | lf_tcp) + --traffic_type lf_udp (traffic type, lf_udp | lf_tcp) --test_duration 5m (duration to run traffic 5m --> 5 Minutes) --create_sta False (False, means it will not create stations and use the sta_names specified below) --sta_names sta000,sta001,sta002 (used if --create_sta False, comma separated names of stations) @@ -453,7 +465,7 @@ python3 ./test_ip_variable_time.py Elapsed | 'elapsed' Destination Addr | 'destination addr' Source Addr | 'source addr' - + Using the port_mgr_cols flag: '4way time (us)' 'activity' @@ -529,7 +541,7 @@ python3 ./test_ip_variable_time.py 'tx-failed %' 'tx-rate' 'wifi retries' - + Can't decide what columns to use? You can just use 'all' to select all available columns from both tables. This script uses two args parsers one in the script the second is Realm args parser @@ -582,7 +594,7 @@ python3 ./test_ip_variable_time.py parser.add_argument('--compared_report', help='report path and file which is wished to be compared with new report', default=None) parser.add_argument('--monitor_interval', - help='how frequently do you want your monitor function to take measurements; \, 35s, 2h', + help='how frequently do you want your monitor function to take measurements, 35s, 2h', default='10s') parser.add_argument('--ipv6', help='Sets the test to use IPv6 traffic instead of IPv4', action='store_true') parser.add_argument('--influx_host') @@ -611,7 +623,7 @@ python3 ./test_ip_variable_time.py else: print("three") station_list = args.sta_names.split(",") - + print("args.num_stations: {create}".format(create=args.num_stations)) print("args.sta_names: {create}".format(create=args.sta_names)) print("args.use_existing_sta: {create} {typeof}".format(create=args.use_existing_sta, typeof=type(args.use_existing_sta))) @@ -671,7 +683,8 @@ python3 ./test_ip_variable_time.py ipv6=args.ipv6, traffic_type=args.traffic_type, _debug_on=args.debug) - + # work in progress - may delete in the future + # ip_var_test.set_wifi_radio(radio=args.radio) ip_var_test.run() From 9d3ff010efd7f644940fd48b6d06ac89f988d216 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 8 Dec 2021 17:38:48 -0700 Subject: [PATCH 708/731] ct_us_001_tests.json : ap_auto update BSSID to BSSID_TO_USE ct_us_004_test.json : ap_auto update BSSID to BSSID_TO_USE Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_tests.json | 8 ++++---- py-scripts/tools/ct_us_004_tests.json | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index be59aa05..6c5d2379 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -498,8 +498,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto_1 --config_name test_con --upstream eth2", - " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID (1)'", - " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID (2)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", @@ -886,8 +886,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto --config_name test_con --upstream eth2", - " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME lanforge BSSID (1)'", - " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME lanforge BSSID (2)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME lanforge BSSID_TO_USE (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME lanforge BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index 4c001c05..3f0f06c5 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -456,7 +456,8 @@ "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge", " --instance_name ap_auto_1 --config_name test_con --upstream eth2", - " --dut5_0 'USE_DUT_NAME lanforge DUT_BSSID_5G (2)' --dut2_0 'USE_DUT_NAME lanforge DUT_BSSID_2G (1)'", + " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME lanforge BSSID_TO_USE (1)'", + " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME lanforge BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", " --radio2 1.1.wiphy0 --radio2 1.1.wiphy2 --radio2 1.1.wiphy4 --radio2 1.1.wiphy5 --radio2 1.1.wiphy6 --radio2 1.1.wiphy7", " --radio5 1.1.wiphy1 --radio5 1.1.wiphy2 --radio5 1.1.wiphy3 --radio5 1.1.wiphy4 --radio5 1.1.wiphy5 --radio5 1.1.wiphy6 --radio5 1.1.wiphy7", From 13a4d79715530a583bf8cc8f8e013425573d4b5d Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 8 Dec 2021 16:42:06 -0800 Subject: [PATCH 709/731] regression_test: Fix partial failure logic. Use Regex Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 65efcfda..17b2a613 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -541,7 +541,7 @@ function test() { execution="$((end-start))" TEXT=$(cat "${FILENAME}".txt) STDERR="" - if [[ "tests failed" == *"${TEXT}" ]] + if [[ $TEXT =~ "tests failed" ]] then TEXTCLASS="partial_failure" TDTEXT="Partial Failure" From d0a6fee9b208fcf6bef27bb4429c1b2aedd6fd3f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 8 Dec 2021 18:00:50 -0700 Subject: [PATCH 710/731] lf_check.py : full test duration broken out to h,m,s from just seconds Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index d7d88ce3..8d0ca2c9 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1171,8 +1171,10 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.logger.info("Suite End Time: {suite_time}".format( suite_time=self.suite_end_time)) suite_time_delta = suite_end_time - suite_start_time - self.suite_duration = "{day}d {seconds}s {msec} ms".format( - day=suite_time_delta.days, seconds=suite_time_delta.seconds, msec=suite_time_delta.microseconds) + minutes, sec = divmod(suite_time_delta.seconds, 60) + hour, minutes = divmod(minutes, 60) + self.suite_duration = "{day}d {hour}h {minutes}m {sec}s {msec} ms".format( + day=suite_time_delta.days, hour=hour, minutes=minutes, sec=sec, msec=suite_time_delta.microseconds) self.logger.info("Suite Duration: {suite_duration}".format( suite_duration=self.suite_duration)) self.finish_html_results() From a9a558ac708dcc4730176adf750c5f6d95dfed70 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 8 Dec 2021 17:16:20 -0800 Subject: [PATCH 711/731] mine_regression_test: Too noisy Signed-off-by: Matthew Stidham --- py-scripts/tools/mine_regression_results.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/py-scripts/tools/mine_regression_results.py b/py-scripts/tools/mine_regression_results.py index 2b3d2d85..f5e200bb 100755 --- a/py-scripts/tools/mine_regression_results.py +++ b/py-scripts/tools/mine_regression_results.py @@ -23,28 +23,21 @@ class MineRegression: dfs = [pd.merge(results[n], systems[n], on='IP') for n in range(len(self.ips))] self.df = pd.concat(dfs) self.df = self.df[self.df['STDOUT'] == 'STDOUT'] - print(self.df.columns) def generate_report(self): system_variations = self.df[ ['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname', 'Python Environment']].drop_duplicates( ['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname', 'Python Environment']).reset_index(drop=True) - print(self.df.drop_duplicates('IP')) - print(self.df['IP'].value_counts()) - print(system_variations['IP'].value_counts()) errors = list() lanforge_errors = list() for index in system_variations.index: - print(system_variations['IP'][index]) variation = system_variations.iloc[index] result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict( variation).values()).all(axis=1), :].dropna(subset=['STDERR']).shape[0] - print(result) errors.append(result) lanforge_result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict( variation).values()).all(axis=1), :].dropna(subset=['LANforge Error']).shape[0] - print(result) lanforge_errors.append(lanforge_result) system_variations['errors'] = errors system_variations['LANforge errors'] = lanforge_errors From 736c318ef38e99ec3e6e6e7bd8ebd9597522965e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 8 Dec 2021 18:15:36 -0700 Subject: [PATCH 712/731] lf_check.py : each test duration to have h,m,s not just seconds Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 8d0ca2c9..cf2b92b7 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -949,8 +949,11 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) time=self.test_end_time)) time_delta = end_time - start_time - self.duration = "{day}d {seconds}s {msec} ms".format( - day=time_delta.days, seconds=time_delta.seconds, msec=time_delta.microseconds) + minutes, seconds = divmod(time_delta.seconds, 60) + hours, minutes = divmod(minutes, 60) + + self.duration = "{day}d {hours}h {minutes}m {seconds}s {msec} ms".format( + day=time_delta.days, hours=hours, minutes=minutes, seconds=seconds, msec=time_delta.microseconds) # If collect meta data is set meta_data_path = "" @@ -1171,10 +1174,10 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) self.logger.info("Suite End Time: {suite_time}".format( suite_time=self.suite_end_time)) suite_time_delta = suite_end_time - suite_start_time - minutes, sec = divmod(suite_time_delta.seconds, 60) - hour, minutes = divmod(minutes, 60) - self.suite_duration = "{day}d {hour}h {minutes}m {sec}s {msec} ms".format( - day=suite_time_delta.days, hour=hour, minutes=minutes, sec=sec, msec=suite_time_delta.microseconds) + minutes, seconds = divmod(suite_time_delta.seconds, 60) + hours, minutes = divmod(minutes, 60) + self.suite_duration = "{day}d {hours}h {minutes}m {seconds}s {msec} ms".format( + day=suite_time_delta.days, hours=hours, minutes=minutes, seconds=seconds, msec=suite_time_delta.microseconds) self.logger.info("Suite Duration: {suite_duration}".format( suite_duration=self.suite_duration)) self.finish_html_results() From 70dd8c3e5f6133c59c9d45c75e46cbe18347f1c2 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 9 Dec 2021 08:00:06 -0700 Subject: [PATCH 713/731] ct_us_001_scripts.json : updated for using radio intexes ct_us_001_tests.json : updated to use UPSTREAM_PORT Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 170 ++++++++++++++++++------ py-scripts/tools/ct_us_001_tests.json | 2 +- 2 files changed, 130 insertions(+), 42 deletions(-) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 8bfdd3f9..ce9659c6 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -222,46 +222,63 @@ "load_db":"NONE", "command":"test_l3_longevity.py", "args":"", - "args_list":[" --mgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2", + "args_list":[ + " --mgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT", " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"]}, "example_security_connection0":{ "enabled":"TRUE", "command":"example_security_connection.py", "args":"", - "args_list":["--mgr LF_MGR_IP --num_stations 4", - " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --radio wiphy1 --security SECURITY_USED --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --radio wiphy1 --security SECURITY_USED", + " --debug"]}, "example_security_connection1":{ "enabled":"TRUE", "command":"example_security_connection.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --num_stations 4 --ssid SSID_USED --passwd SSID_PW_USED", - " --radio wiphy1 --security SECURITY_USED --debug"]}, + "args_list":[ + "--mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --debug"]}, "example_security_connection2":{ "enabled":"TRUE", "command":"example_security_connection.py", "args":"", - "args_list":["use_ssid_idx=1 --mgr LF_MGR_IP --num_stations 4 --ssid SSID_USED --passwd SSID_PW_USED --radio wiphy1 --security SECURITY_USED --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --debug"]}, "example_security_connection3":{ "enabled":"TRUE", "command":"example_security_connection.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --num_stations 4 --ssid SSID_USED --passwd SSID_PW_USED --radio wiphy1 --security SECURITY_USED --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --debug"]}, "sta_connect2":{ "enabled":"FALSE", "command":"sta_connect2.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --dut_ssid SSID_USED --dut_passwd SSID_PW_USED --dut_security SECURITY_USED"]}, + "args_list":[ + " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --radio wiphy1 --dut_ssid SSID_USED --dut_passwd SSID_PW_USED --dut_security SECURITY_USED", + " --debug"]}, "sta_connect_example":{ "enabled":"FALSE", "command":"sta_connect_example.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP "]}, + "args_list":[ + " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --radio wiphy1 --dut_ssid SSID_USED --dut_passwd SSID_PW_USED --dut_security SECURITY_USED", + " --debug"]}, "test_fileio":{ - "enabled":"TRUE", + "enabled":"FALSE", "command":"test_fileio.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --macvlan_parent eth2 --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 --netmask 255.255.255.0 --test_duration 30s --gateway 192.168.92.1"]}, + "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --macvlan_parent UPSTREAM_PORT --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 --netmask 255.255.255.0 --test_duration 30s --gateway 192.168.92.1"]}, "test_generic0":{ "enabled":"FALSE", "command":"test_generic.py", @@ -296,72 +313,136 @@ "enabled":"TRUE", "command":"test_ip_connection.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, - "test_ip_variable_time0-ipv4":{ + "args_list":[ + " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --radio wiphy1 --dut_ssid SSID_USED --dut_passwd SSID_PW_USED --dut_security SECURITY_USED", + " --debug"]}, + "test_ip_variable_time_ipv4_udp":{ "enabled":"TRUE", "command":"test_ip_variable_time.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"]}, - "test_ip_variable_time1-ipv4":{ + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", + " use_ssid_indx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", + " --traffic_type lf_udp", + " --debug"]}, + "test_ip_variable_time_ipv4_tcp":{ "enabled":"TRUE", "command":"test_ip_variable_time.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"]}, - "test_ip_connection-ipv6":{ + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", + " use_ssid_indx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", + " --traffic_type lf_tcp", + " --debug"]}, + "test_ip_connection_ipv6_udp":{ "enabled":"FALSE", "command":"test_ip_connection.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --ipv6 --debug"]}, - "test_ip_variable_time0-ipv6":{ + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", + " use_ssid_indx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", + " --traffic_type lf_udp", + " --ipv6", + " --debug"]}, + "test_ip_variable_time_ipv6_tcp":{ "enabled":"TRUE", "command":"test_ip_variable_time.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --ipv6 --traffic_type lf_udp --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", + " use_ssid_indx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", + " --traffic_type lf_tcp", + " --ipv6", + " --debug"]}, "test_ip_variable_time1-ipv6":{ - "enabled":"TRUE", + "enabled":"FALSE", "command":"test_ip_variable_time.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped --ipv6 --traffic_type lf_udp --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", + " use_ssid_indx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", + " --traffic_type lf_tcp", + " --ipv6", + " --debug"]}, "test_l4_bytes-rd":{ "enabled":"TRUE", "command":"test_l4.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --test_type bytes-rd --test_duration 15s --url 'dl http://10.40.0.1 /dev/null' --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED ", + " --test_type bytes-rd --test_duration 15s --url 'dl http://10.40.0.1 /dev/null'", + " --debug"]}, "test_l4_bytes-wr":{ "enabled":"FALSE", "command":"test_l4.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --test_type bytes-wr --test_duration 15s --url 'ul http://10.40.0.1' --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_type bytes-wr --test_duration 15s --url 'ul http://10.40.0.1' --debug"]}, "test_l4_urls_s":{ "enabled":"TRUE", "command":"test_l4.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --test_type urls --test_duration 15s --requests_per_ten 600 --target_per_ten 600 --url 'dl http://10.40.0.1 /dev/null' --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --test_type urls --test_duration 15s --requests_per_ten 600 --target_per_ten 600 --url 'dl http://10.40.0.1 /dev/null'", + " --debug"]}, "test_l4_ftp_bytes-rd":{ "enabled":"TRUE", "command":"test_l4.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --ftp --test_type bytes-rd --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null' --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --ftp --test_type bytes-rd --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null'", + " --debug"]}, "test_l4_ftp_bytes-wr":{ "enabled":"FALSE", "command":"test_l4.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --ftp --test_type bytes-wr --test_duration 15s --url 'ul ftp://10.40.0.1' --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --ftp --test_type bytes-wr --test_duration 15s --url 'ul ftp://10.40.0.1'", + " --debug"]}, "test_l4_ftp_urls_s":{ "enabled":"TRUE", "command":"test_l4.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --security SECURITY_USED --ssid SSID_USED --passwd SSID_PW_USED --ftp --test_type urls --requests_per_ten 600 --target_per_ten 600 --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null' --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --ftp --test_type urls --requests_per_ten 600 --target_per_ten 600 --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null'", + " --debug"]}, "test_l3_longevity_1":{ "enabled":"TRUE", "command":"test_l3_longevity.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2 --radio 'radio==wiphy0,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"]}, + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, "test_l3_powersave_traffic":{ "enabled":"FALSE", "command":"test_l3_powersave_traffic.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --debug"]}, "test_status_msg":{ "enabled":"TRUE", "command":"test_status_msg.py", @@ -375,43 +456,50 @@ "enabled":"TRUE", "command":"create_bridge.py", "args":"", - "args_list":["--mgr LF_MGR_IP --radio wiphy1 --upstream_port eth2 --target_device sta0000 --debug"]}, + "args_list":["--mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT --target_device sta0000 --debug"]}, "create_l3":{ "enabled":"FALSE", "command":"create_l3.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --debug"]}, "create_l4":{ "enabled":"TRUE", "command":"create_l4.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " --debug"]}, "create_l3_stations":{ "enabled":"TRUE", "load_db":"NONE", "command":"create_l3_stations.py", "args":"", - "args_list":[" --mgr LF_MGR_IP ", - " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " + "args_list":[ + " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " ] }, "create_macvlan":{ - "enabled":"TRUE", + "enabled":"FALSE", "command":"create_macvlan.py", "args":"", - "args_list":["--mgr LF_MGR_IP --radio wiphy1 --macvlan_parent eth2 --debug"]}, + "args_list":["--mgr LF_MGR_IP --radio wiphy1 --macvlan_parent UPSTREAM_PORT --debug"]}, "create_station":{ - "enabled":"TRUE", + "enabled":"FALSE", "command":"create_station.py", "args":"", "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, "create_vap":{ - "enabled":"TRUE", + "enabled":"FALSE", "command":"create_vap.py", "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, + "args_list":[" --mgr LF_MGR_IP --radio wiphy1 use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, "create_qvlan":{ - "enabled":"TRUE", + "enabled":"FALSE", "command":"create_qvlan.py", "args":"", "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --qvlan_parent eth2"]}, diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 6c5d2379..ce92d25d 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -26,7 +26,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port eth2 ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", " --test_rig TEST_RIG --test_tag 'l3_longevity'", From 5c50b61621b2926d1ade94722e528518b59f2a93 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 9 Dec 2021 09:07:16 -0800 Subject: [PATCH 714/731] test_status_msg: Check if message_list_response exists, otherwise pass. It will post a LANforge error output if you don't write your LANforge URL properly. Signed-off-by: Matthew Stidham --- py-scripts/test_status_msg.py | 145 ++++++++++++++++++---------------- 1 file changed, 75 insertions(+), 70 deletions(-) diff --git a/py-scripts/test_status_msg.py b/py-scripts/test_status_msg.py index 1a5f1cc2..38ba6b9b 100755 --- a/py-scripts/test_status_msg.py +++ b/py-scripts/test_status_msg.py @@ -67,12 +67,13 @@ class TestStatusMessage(LFCliBase): message_response = self.json_get(self.session_url) if self.debug: pprint(message_response) - if "empty" in message_response: - self._pass("empty response, zero messages") - elif "messages" in message_response: - messages_a = message_response["messages"] - if len(messages_a) > 0: - self._fail("we should have zero messages") + if message_response: + if "empty" in message_response: + self._pass("empty response, zero messages") + elif "messages" in message_response: + messages_a = message_response["messages"] + if len(messages_a) > 0: + self._fail("we should have zero messages") for msg_num in (1, 2, 3, 4, 5): # print("----- ----- ----- ----- ----- ----- %s ----- ----- ----- ----- ----- " % msg_num) @@ -84,9 +85,10 @@ class TestStatusMessage(LFCliBase): "message": "message %s" % msg_num }) message_response = self.json_get(self.session_url) - if len(message_response["messages"]) != msg_num: - pprint(message_response) - self._fail("we should have %s messages" % msg_num) + if message_response: + if len(message_response["messages"]) != msg_num: + pprint(message_response) + self._fail("we should have %s messages" % msg_num) self._pass("created and listed %s messages counted" % msg_num) @@ -97,81 +99,84 @@ class TestStatusMessage(LFCliBase): """ message_list_response = self.json_get(self.session_url) - if "empty" in message_list_response: - self._fail("empty response, we expect 1 or more messages") - msg_num = 0 - for message_o in message_list_response["messages"]: - msg_url = message_o["_links"] - print("Message url: " + msg_url) - message_response = self.json_get(msg_url) - if self.debug: - pprint(message_response) - for content_o in message_response["messages"]: - msg_num += 1 - print("id %s" % content_o["message_id"]) - print("key %s" % content_o["message"]["key"]) - print("content-type %s" % content_o["message"]["content-type"]) - print("message %s" % content_o["message"]["message"]) + if message_list_response: + if "empty" in message_list_response: + self._fail("empty response, we expect 1 or more messages") + msg_num = 0 + for message_o in message_list_response["messages"]: + msg_url = message_o["_links"] + print("Message url: " + msg_url) + message_response = self.json_get(msg_url) + if self.debug: + pprint(message_response) + for content_o in message_response["messages"]: + msg_num += 1 + print("id %s" % content_o["message_id"]) + print("key %s" % content_o["message"]["key"]) + print("content-type %s" % content_o["message"]["content-type"]) + print("message %s" % content_o["message"]["message"]) - if msg_num != self.msg_count: - self._fail("(stop) expected %s messages, saw %s" % (self.msg_count, msg_num)) - else: - self._pass("saw correct number of messages") + if msg_num != self.msg_count: + self._fail("(stop) expected %s messages, saw %s" % (self.msg_count, msg_num)) + else: + self._pass("saw correct number of messages") def cleanup(self): """delete messages and delete the session""" message_list_response = self.json_get(self.session_url) - if "empty" in message_list_response: - self._fail("empty response, we expect 1 or more messages") - last_link = "" - msg_num = 0 - for message_o in message_list_response["messages"]: - # print("Delete Message url: "+msg_url) - last_link = message_o["_links"] - msg_num += 1 + if message_list_response: + if "empty" in message_list_response: + self._fail("empty response, we expect 1 or more messages") + last_link = "" + msg_num = 0 + for message_o in message_list_response["messages"]: + # print("Delete Message url: "+msg_url) + last_link = message_o["_links"] + msg_num += 1 - if msg_num != self.msg_count: - self._fail("(cleanup) expected %s messages, saw %s" % (self.msg_count, msg_num)) - message_response = self.json_delete(last_link) - if self.debug: - pprint(message_response) + if msg_num != self.msg_count: + self._fail("(cleanup) expected %s messages, saw %s" % (self.msg_count, msg_num)) + message_response = self.json_delete(last_link) + if self.debug: + pprint(message_response) # check message removal message_list_response = self.json_get(self.session_url) - msg_num = len(message_list_response["messages"]) - if msg_num != (self.msg_count - 1): - self._fail("(cleanup) expected %s messages, saw %s" % ((self.msg_count - 1), msg_num)) - else: - self._pass("(cleanup) messages decreased by one") - - all_url = self.session_url + "/all" - message_response = self.json_delete(all_url) - if self.debug: - pprint(message_response) - - message_list_response = self.json_get(self.session_url) - if self.debug: - pprint(message_list_response) - if "messages" in message_list_response: + if message_list_response: msg_num = len(message_list_response["messages"]) - elif "empty" in message_list_response: - msg_num = 0 + if msg_num != (self.msg_count - 1): + self._fail("(cleanup) expected %s messages, saw %s" % ((self.msg_count - 1), msg_num)) + else: + self._pass("(cleanup) messages decreased by one") - if msg_num == 0: - return "deleted all messages in session" - else: - self._fail("failed to delete all messages in session") + all_url = self.session_url + "/all" + message_response = self.json_delete(all_url) + if self.debug: + pprint(message_response) - if 'empty' in self.json_get(self.session_url).keys(): + message_list_response = self.json_get(self.session_url) if self.debug: - print("--- del -------------------- -------------------- --------------------") - self.exit_on_error = False - self.json_delete("%s/this" % self.session_url, debug_=False) - if self.debug: - print("--- ~del -------------------- -------------------- --------------------") - else: - return 'ports deleted successfully' + pprint(message_list_response) + if "messages" in message_list_response: + msg_num = len(message_list_response["messages"]) + elif "empty" in message_list_response: + msg_num = 0 + + if msg_num == 0: + return "deleted all messages in session" + else: + self._fail("failed to delete all messages in session") + + if 'empty' in message_list_response.keys(): + if self.debug: + print("--- del -------------------- -------------------- --------------------") + self.exit_on_error = False + self.json_delete("%s/this" % self.session_url, debug_=False) + if self.debug: + print("--- ~del -------------------- -------------------- --------------------") + else: + return 'ports deleted successfully' sessions_list_response = self.json_get("/status-msg") if self.debug: From 6ceb57adbc010014b219bf5596991754808f70a5 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 9 Dec 2021 09:44:07 -0800 Subject: [PATCH 715/731] regression_test: Echo "LANforge error" on screen when LANforge spits out a warning or error Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 17b2a613..fdbea83f 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -534,6 +534,7 @@ function test() { if [[ $ERROR_DATA =~ "LANforge Error Messages" ]] then LANforgeError="Lanforge Error" + echo "LANforge Error" else LANforgeError="" fi From ad30e6fc52b53f2b7a88baf1f1dd74d56b33841c Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 9 Dec 2021 10:42:24 -0800 Subject: [PATCH 716/731] regression_test: Be able to use multiple realms on one device Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index fdbea83f..5c8a81c5 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -110,14 +110,14 @@ if [[ ${#SSID_USED} -eq 0 ]]; then #Network credentials fi if [[ ${#RADIO_USED} -eq 0 ]]; then # Allow the user to change the radio they test against - RADIO_USED="wiphy1" + RADIO_USED="1.1.wiphy1" fi if [[ ${#RADIO2} -eq 0 ]]; then # Allow the user to change the radio they test against - RADIO2="wiphy0" + RADIO2="1.1.wiphy0" fi if [[ ${#UPSTREAM} -eq 0 ]]; then - UPSTREAM="eth1" + UPSTREAM="1.1.eth1" fi if [[ ${#BSSID} -eq 0 ]]; then @@ -190,7 +190,7 @@ function create_bridge_and_station() { function create_station_and_dataplane() { ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR ./lf_dataplane_test.py --mgr $MGR --lf_user lanforge --lf_password lanforge \ - --instance_name dataplane-instance --config_name test_con --upstream 1.1.$UPSTREAM \ + --instance_name dataplane-instance --config_name test_con --upstream $UPSTREAM \ --dut linksys-8450 --duration 15s --station 1.1.sta0001 \ --download_speed 85% --upload_speed 0 \ --test_rig Testbed-01 --pull_report \ @@ -370,7 +370,7 @@ else "./test_ip_variable_time.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --test_duration 15s --debug --mgr $MGR --ipv6 --traffic_type lf_udp" "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --radio2 $RADIO2" "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_tcp' --upstream_port 1.1.$UPSTREAM --radio \ + "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_tcp' --upstream_port $UPSTREAM --radio \ 'radio==1.1.wiphy0 stations==10 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --radio \ 'radio==1.1.wiphy1 stations==1 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --test_duration 5s --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 -o longevity.csv" "./test_l3_powersave_traffic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" From c8946f0a6975ed9abb3eb3abe19b36372ae3d7f4 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 9 Dec 2021 10:50:38 -0800 Subject: [PATCH 717/731] regression_test: add resource flag Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 46 ++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 5c8a81c5..9574cfd8 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -21,7 +21,7 @@ Help() } -while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:M:" option; do +while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:M:C:" option; do case "${option}" in h) # display Help Help @@ -67,6 +67,9 @@ while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:M:" option; do M) RADIO2=${OPTARG} ;; + C) + RESOURCE=${OPTARG} + ;; *) ;; @@ -124,6 +127,10 @@ if [[ ${#BSSID} -eq 0 ]]; then BSSID="04:f0:21:2c:41:84" fi +if [[ $RESOURCE -eq 0 ]]; then + RESOURCE="1.1" +fi + FILE="/tmp/gui-update.lock" if test -f "$FILE"; then echo "Finish updating your GUI" @@ -191,7 +198,7 @@ function create_station_and_dataplane() { ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR ./lf_dataplane_test.py --mgr $MGR --lf_user lanforge --lf_password lanforge \ --instance_name dataplane-instance --config_name test_con --upstream $UPSTREAM \ - --dut linksys-8450 --duration 15s --station 1.1.sta0001 \ + --dut linksys-8450 --duration 15s --station $RESOURCE.sta0001 \ --download_speed 85% --upload_speed 0 \ --test_rig Testbed-01 --pull_report \ #--influx_host 192.168.100.153 --influx_port 8086 --influx_org Candela \ @@ -201,8 +208,8 @@ function create_station_and_dataplane() { } function create_dut_and_chamberview() { ./create_chamberview.py -m $MGR -cs 'regression_test' --delete_scenario \ - --line "Resource=1.1 Profile=STA-AC Amount=1 Uses-1=$RADIO_USED Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http" \ - --line "Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http" + --line "Resource=$RESOURCE Profile=STA-AC Amount=1 Uses-1=$RADIO_USED Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http" \ + --line "Resource=$RESOURCE Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http" ./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ --ssid "ssid_idx=0 ssid='$SSID_USED' security='$SECURITY' password='$PASSWD_USED' bssid=04:f0:21:2c:41:84" } @@ -210,8 +217,8 @@ function create_dut_and_chamberview() { function create_station_and_sensitivity { ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR ./lf_rx_sensitivity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name rx-sensitivity-instance --config_name test_con --upstream 1.1.eth2 \ - --dut linksys-8450 --duration 15s --station 1.1.sta0001 \ + --instance_name rx-sensitivity-instance --config_name test_con --upstream $UPSTREAM \ + --dut linksys-8450 --duration 15s --station $RESOURCE.sta0001 \ --download_speed 85% --upload_speed 0 \ --raw_line 'txo_preamble\: VHT' \ --raw_line 'txo_mcs\: 4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT' \ @@ -230,11 +237,12 @@ if [[ ${#SHORT} -gt 0 ]]; then testCommands=( "./lf_ap_auto_test.py \ --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth1 \ + --instance_name ap-auto-instance --config_name test_con --upstream $UPSTREAM \ --dut5_0 '$DUT5' \ --dut2_0 '$DUT2' \ - --radio2 1.1.wiphy0 \ - --radio2 1.1.wiphy1 \ + --radio2 $RADIO_USED \ + --radio2 $RADIO2 \ + --radio2 $RADIO2 \ --set 'Basic Client Connectivity' 1 \ --set 'Multi Band Performance' 1 \ --set 'Skip 2.4Ghz Tests' 1 \ @@ -252,7 +260,7 @@ if [[ ${#SHORT} -gt 0 ]]; then ) else testCommands=( - "./create_bond.py --network_dev_list eth0,eth1 --debug --mgr $MGR" + "./create_bond.py --network_dev_list eth0,$UPSTREAM --debug --mgr $MGR" create_bridge_and_station create_dut_and_chamberview "./create_l3.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR --endp_a wiphy0 --endp_b wiphy1" @@ -272,19 +280,19 @@ else #"./docstrings.py --mgr $MGR" #"./scripts_deprecated/event_break_flood.py --mgr $MGR" "./example_security_connection.py --num_stations $NUM_STA --ssid $SSID_USED \ - --passwd $PASSWD_USED --radio 1.1.$RADIO_USED --security wpa2 --debug --mgr $MGR" + --passwd $PASSWD_USED --radio $RADIO_USED --security wpa2 --debug --mgr $MGR" #./ftp_html.py #./grafana_profile "./lf_ap_auto_test.py \ --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth1 \ + --instance_name ap-auto-instance --config_name test_con --upstream $UPSTREAM \ --dut5_0 '$DUT5' \ --dut2_0 '$DUT2' \ --max_stations_2 64 \ --max_stations_5 64 \ --max_stations_dual 64 \ - --radio2 1.1.wiphy0 \ - --radio2 1.1.wiphy1 \ + --radio2 $RADIO_USED \ + --radio2 $RADIO2 \ --set 'Basic Client Connectivity' 1 \ --set 'Multi Band Performance' 1 \ --set 'Skip 2.4Ghz Tests' 1 \ @@ -321,15 +329,15 @@ else "./lf_tr398_test.py --mgr $MGR --upstream $UPSTREAM" #./lf_webpage "./lf_wifi_capacity_test.py --mgr $MGR --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name this_inst --config_name test_con --upstream 1.1.eth2 --batch_size 1,5,25,50,100 --loop_iter 1 \ + --instance_name this_inst --config_name test_con --upstream $UPSTREAM --batch_size 1,5,25,50,100 --loop_iter 1 \ --protocol UDP-IPv4 --duration 6000 --pull_report --ssid $SSID_USED --paswd $PASSWD_USED --security $SECURITY\ - --test_rig Testbed-01 --create_stations --stations 1.1.sta0000,1.1.sta0001" + --test_rig Testbed-01 --create_stations --stations $RESOURCE.sta0000,$RESOURCE.sta0001" "./measure_station_time_up.py --radio $RADIO_USED --num_stations 3 --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED \ --debug --report_file measure_station_time_up.pkl --radio2 wiphy1" "./create_station.py --mgr $MGR --radio $RADIO_USED --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED && ./modify_station.py \ --mgr $MGR \ --radio $RADIO_USED \ - --station 1.1.sta0000 \ + --station $RESOURCE.sta0000 \ --security $SECURITY \ --ssid $SSID_USED \ --passwd $PASSWD_USED \ @@ -371,8 +379,8 @@ else "./test_ipv4_ps.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --radio2 $RADIO2" "./test_ipv4_ttls.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./test_l3_longevity.py --mgr $MGR --endp_type 'lf_tcp' --upstream_port $UPSTREAM --radio \ - 'radio==1.1.wiphy0 stations==10 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --radio \ - 'radio==1.1.wiphy1 stations==1 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --test_duration 5s --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 -o longevity.csv" + 'radio==$RADIO_USED stations==10 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --radio \ + 'radio==$RADIO2 stations==1 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY' --test_duration 5s --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 -o longevity.csv" "./test_l3_powersave_traffic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" #"./test_l3_scenario_throughput.py -t 15s -sc test_l3_scenario_throughput -m $MGR" #./test_l3_unicast_traffic_gen From bfccba0f7697e7d013a0e1a370d50e5aa5e202ee Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 9 Dec 2021 10:52:07 -0800 Subject: [PATCH 718/731] regression_test: Improve resource specification Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 9574cfd8..212041c2 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -175,7 +175,7 @@ fi TEST_DIR="${REPORT_DATA}/${NOW}" function run_l3_longevity() { - ./test_l3_longevity.py --test_duration 15s --upstream_port eth1 --radio "radio==wiphy0 stations==4 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY" --radio "radio==wiphy1 stations==4 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY" --lfmgr "$MGR" + ./test_l3_longevity.py --test_duration 15s --upstream_port $UPSTREAM --radio "radio==wiphy0 stations==4 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY" --radio "radio==wiphy1 stations==4 ssid==$SSID_USED ssid_pw==$PASSWD_USED security==$SECURITY" --lfmgr "$MGR" } function testgroup_list_groups() { ./scenario.py --load test_l3_scenario_throughput @@ -192,7 +192,7 @@ function testgroup_delete_group() { } function create_bridge_and_station() { ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR - ./create_bridge.py --radio $RADIO_USED --upstream_port eth1 --target_device sta0000 --debug --mgr $MGR + ./create_bridge.py --radio $RADIO_USED --upstream_port $UPSTREAM --target_device $RESOURCE.sta0000 --debug --mgr $MGR } function create_station_and_dataplane() { ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR @@ -209,7 +209,7 @@ function create_station_and_dataplane() { function create_dut_and_chamberview() { ./create_chamberview.py -m $MGR -cs 'regression_test' --delete_scenario \ --line "Resource=$RESOURCE Profile=STA-AC Amount=1 Uses-1=$RADIO_USED Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http" \ - --line "Resource=$RESOURCE Profile=upstream Amount=1 Uses-1=eth1 Uses-2=AUTO Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http" + --line "Resource=$RESOURCE Profile=upstream Amount=1 Uses-1=$UPSTREAM Uses-2=AUTO Freq=-1 DUT=regression_dut DUT_RADIO=$RADIO_USED Traffic=http" ./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \ --ssid "ssid_idx=0 ssid='$SSID_USED' security='$SECURITY' password='$PASSWD_USED' bssid=04:f0:21:2c:41:84" } @@ -260,14 +260,14 @@ if [[ ${#SHORT} -gt 0 ]]; then ) else testCommands=( - "./create_bond.py --network_dev_list eth0,$UPSTREAM --debug --mgr $MGR" + "./create_bond.py --network_dev_list $RESOURCE.eth0,$UPSTREAM --debug --mgr $MGR" create_bridge_and_station create_dut_and_chamberview "./create_l3.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR --endp_a wiphy0 --endp_b wiphy1" "./create_l3_stations.py --mgr $MGR --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug" "./create_l4.py --radio $RADIO_USED --ssid $SSID_USED --password $PASSWD_USED --security $SECURITY --debug --mgr $MGR" - "./create_macvlan.py --radio 1.$RADIO_USED --macvlan_parent eth1 --debug --mgr $MGR" - "./create_qvlan.py --first_qvlan_ip 192.168.1.50 --mgr $MGR --qvlan_parent eth1" + "./create_macvlan.py --radio 1.$RADIO_USED --macvlan_parent $UPSTREAM --debug --mgr $MGR" + "./create_qvlan.py --first_qvlan_ip 192.168.1.50 --mgr $MGR --qvlan_parent $UPSTREAM" "./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" "./create_vap.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR" #"./create_vr.py --mgr $MGR --vr_name 2.vr0 --ports 2.br0,2.vap2 --services 1.br0=dhcp,nat --services 1.vr0=radvd --debug" From a68ebc8e9f98c85bde416dfc288a7efcd8a30e3d Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Thu, 9 Dec 2021 12:48:33 -0800 Subject: [PATCH 719/731] lf_webpage.py: updated for generating kpi.csv, single band 5G and 2.4G works, graphing temporarily disabled(WIP) --- py-scripts/lf_webpage.py | 178 +++++++++++++++++++++++++++------------ 1 file changed, 123 insertions(+), 55 deletions(-) diff --git a/py-scripts/lf_webpage.py b/py-scripts/lf_webpage.py index be2c5820..32f80daf 100755 --- a/py-scripts/lf_webpage.py +++ b/py-scripts/lf_webpage.py @@ -26,6 +26,7 @@ Realm = realm.Realm PortUtils = realm.PortUtils lf_report = importlib.import_module("py-scripts.lf_report") lf_graph = importlib.import_module("py-scripts.lf_graph") +lf_kpi_csv = importlib.import_module("py-scripts.lf_kpi_csv") class HttpDownload(Realm): @@ -473,59 +474,65 @@ class HttpDownload(Realm): return graph_png def generate_report(self, date, num_stations, duration, test_setup_info, dataset, lis, bands, threshold_2g, - threshold_5g, threshold_both, dataset2, summary_table_value, result_data, test_input_infor): + threshold_5g, threshold_both, dataset2, summary_table_value, result_data, test_rig, + test_tag, dut_hw_version, dut_sw_version, dut_model_num, dut_serial_num, test_id, + test_input_infor, csv_outfile): report = lf_report.lf_report(_results_dir_name="webpage_test", _output_html="Webpage.html", _output_pdf="Webpage.pdf") - report.set_title("WEBPAGE DOWNLOAD TEST") - report.set_date(date) - report.build_banner() - report.set_table_title("Test Setup Information") - report.build_table_title() - report.test_setup_table(value="Device under test", test_setup_data=test_setup_info) - - report.set_obj_html("Objective", - "The Webpage Download Test is designed to test the performance of the Access Point.The goal is to check whether the webpage loading time of all the " + str( - num_stations) + " clients which are downloading at the same time meets the expectation when clients connected on single radio as well as dual radio") - report.build_objective() - report.set_obj_html("Download Time Graph", - "The below graph provides information about the download time taken by each client to download webpage for test duration of " + str( - duration) + " min") - report.build_objective() - graph = self.generate_graph(dataset=dataset, lis=lis, bands=bands) - report.set_graph_image(graph) - report.set_csv_filename(graph) - report.move_csv_file() - report.move_graph_image() - report.build_graph() - report.set_obj_html("Download Rate Graph", - "The below graph provides information about the download rate in Mbps of each client to download the webpage for test duration of " + str( - duration) + " min") - report.build_objective() - graph2 = self.graph_2(dataset2, lis=lis, bands=bands) - print("graph name {}".format(graph2)) - report.set_graph_image(graph2) - report.set_csv_filename(graph2) - report.move_csv_file() - report.move_graph_image() - report.build_graph() - report.set_obj_html("Summary Table Description", - "This Table shows you the summary result of Webpage Download Test as PASS or FAIL criteria. If the average time taken by " + str( - num_stations) + " clients to access the webpage is less than " + str( - threshold_2g) + "s it's a PASS criteria for 2.4 ghz clients, If the average time taken by " + "" + str( - num_stations) + " clients to access the webpage is less than " + str( - threshold_5g) + "s it's a PASS criteria for 5 ghz clients and If the average time taken by " + str( - num_stations) + " clients to access the webpage is less than " + str( - threshold_both) + "s it's a PASS criteria for 2.4 ghz and 5ghz clients") - - report.build_objective() - test_setup1 = pd.DataFrame(summary_table_value) - report.set_table_dataframe(test_setup1) - report.build_table() - - report.set_obj_html("Download Time Table Description", - "This Table will provide you information of the minimum, maximum and the average time taken by clients to download a webpage in seconds") - - report.build_objective() + # Section commented because graphing breaks two band report generation + # TODO: Fix graphing bug with multiple bands being recorded + # + # report.set_title("WEBPAGE DOWNLOAD TEST") + # report.set_date(date) + # report.build_banner() + # report.set_table_title("Test Setup Information") + # report.build_table_title() + # + # report.test_setup_table(value="Device under test", test_setup_data=test_setup_info) + # + # report.set_obj_html("Objective", + # "The Webpage Download Test is designed to test the performance of the Access Point.The goal is to check whether the webpage loading time of all the " + str( + # num_stations) + " clients which are downloading at the same time meets the expectation when clients connected on single radio as well as dual radio") + # report.build_objective() + # report.set_obj_html("Download Time Graph", + # "The below graph provides information about the download time taken by each client to download webpage for test duration of " + str( + # duration) + " min") + # report.build_objective() + # graph = self.generate_graph(dataset=dataset, lis=lis, bands=bands) + # report.set_graph_image(graph) + # report.set_csv_filename(graph) + # report.move_csv_file() + # report.move_graph_image() + # report.build_graph() + # report.set_obj_html("Download Rate Graph", + # "The below graph provides information about the download rate in Mbps of each client to download the webpage for test duration of " + str( + # duration) + " min") + # report.build_objective() + # graph2 = self.graph_2(dataset2, lis=lis, bands=bands) + # print("graph name {}".format(graph2)) + # report.set_graph_image(graph2) + # report.set_csv_filename(graph2) + # report.move_csv_file() + # report.move_graph_image() + # report.build_graph() + # report.set_obj_html("Summary Table Description", + # "This Table shows you the summary result of Webpage Download Test as PASS or FAIL criteria. If the average time taken by " + str( + # num_stations) + " clients to access the webpage is less than " + str( + # threshold_2g) + "s it's a PASS criteria for 2.4 ghz clients, If the average time taken by " + "" + str( + # num_stations) + " clients to access the webpage is less than " + str( + # threshold_5g) + "s it's a PASS criteria for 5 ghz clients and If the average time taken by " + str( + # num_stations) + " clients to access the webpage is less than " + str( + # threshold_both) + "s it's a PASS criteria for 2.4 ghz and 5ghz clients") + # + # report.build_objective() + # test_setup1 = pd.DataFrame(summary_table_value) + # report.set_table_dataframe(test_setup1) + # report.build_table() + # + # report.set_obj_html("Download Time Table Description", + # "This Table will provide you information of the minimum, maximum and the average time taken by clients to download a webpage in seconds") + # + # report.build_objective() x = [] for fcc in list(result_data.keys()): fcc_type = result_data[fcc]["min"] @@ -577,12 +584,52 @@ class HttpDownload(Realm): z2.append(i) download_table_value = { - "": bands, + "Band": bands, "Minimum": z, "Maximum": z1, "Average": z2 - } + + # Get the report path to create the kpi.csv path + kpi_path = report.get_report_path() + print("kpi_path :{kpi_path}".format(kpi_path=kpi_path)) + + kpi_csv = lf_kpi_csv.lf_kpi_csv( + _kpi_path=kpi_path, + _kpi_test_rig=test_rig, + _kpi_test_tag=test_tag, + _kpi_dut_hw_version=dut_hw_version, + _kpi_dut_sw_version=dut_sw_version, + _kpi_dut_model_num=dut_model_num, + _kpi_dut_serial_num=dut_serial_num, + _kpi_test_id=test_id) + kpi_csv.kpi_dict['Units'] = "Mbps" + for band in range(len(download_table_value["Band"])): + kpi_csv.kpi_csv_get_dict_update_time() + kpi_csv.kpi_dict['Graph-Group'] = "Webpage Download {band}".format( + band=download_table_value['Band'][band]) + kpi_csv.kpi_dict['short-description'] = "Webpage download {band} Minimum".format( + band=download_table_value['Band'][band]) + kpi_csv.kpi_dict['numeric-score'] = "{min}".format(min=download_table_value['Minimum'][band]) + kpi_csv.kpi_csv_write_dict(kpi_csv.kpi_dict) + kpi_csv.kpi_dict['short-description'] = "Webpage download {band} Maximum".format( + band=download_table_value['Band'][band]) + kpi_csv.kpi_dict['numeric-score'] = "{max}".format(max=download_table_value['Maximum'][band]) + kpi_csv.kpi_csv_write_dict(kpi_csv.kpi_dict) + kpi_csv.kpi_dict['short-description'] = "Webpage download {band} Average".format( + band=download_table_value['Band'][band]) + kpi_csv.kpi_dict['numeric-score'] = "{avg}".format(avg=download_table_value['Average'][band]) + kpi_csv.kpi_csv_write_dict(kpi_csv.kpi_dict) + + if csv_outfile is not None: + current_time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime()) + csv_outfile = "{}_{}-test_l3_longevity.csv".format( + csv_outfile, current_time) + csv_outfile = report.file_add_path(csv_outfile) + print("csv output file : {}".format(csv_outfile)) + + exit() + test_setup = pd.DataFrame(download_table_value) report.set_table_dataframe(test_setup) report.build_table() @@ -612,13 +659,29 @@ def main(): parser.add_argument('--passwd', help='WiFi passphrase/password/key') parser.add_argument('--target_per_ten', help='number of request per 10 minutes', default=100) parser.add_argument('--file_size', type=str, help='specify the size of file you want to download', default='5MB') - parser.add_argument('--bands', nargs="+", help='specify which band testing you want to run eg 5G OR 2.4G OR Both', default=["5G", "2.4G", "Both"]) + parser.add_argument('--bands', nargs="+", help='specify which band testing you want to run eg 5G OR 2.4G OR Both', + default=["5G", "2.4G", "Both"]) parser.add_argument('--duration', type=int, help='time to run traffic') parser.add_argument('--threshold_5g', help="Enter the threshold value for 5G Pass/Fail criteria", default="60") parser.add_argument('--threshold_2g', help="Enter the threshold value for 2.4G Pass/Fail criteria", default="90") parser.add_argument('--threshold_both', help="Enter the threshold value for Both Pass/Fail criteria", default="50") parser.add_argument('--ap_name', help="specify the ap model ", default="TestAP") parser.add_argument('--ssh_port', type=int, help="specify the ssh port eg 22", default=22) + parser.add_argument("--test_rig", default="", help="test rig for kpi.csv, testbed that the tests are run on") + parser.add_argument("--test_tag", default="", + help="test tag for kpi.csv, test specific information to differentiate the test") + parser.add_argument("--dut_hw_version", default="", + help="dut hw version for kpi.csv, hardware version of the device under test") + parser.add_argument("--dut_sw_version", default="", + help="dut sw version for kpi.csv, software version of the device under test") + parser.add_argument("--dut_model_num", default="", + help="dut model for kpi.csv, model number / name of the device under test") + parser.add_argument("--dut_serial_num", default="", + help="dut serial for kpi.csv, serial number / serial number of the device under test") + parser.add_argument("--test_priority", default="", help="dut model for kpi.csv, test-priority is arbitrary number") + parser.add_argument("--test_id", default="lf_webpage", help="test-id for kpi.csv, script or test name") + parser.add_argument('--csv_outfile', help="--csv_outfile ", default="") + args = parser.parse_args() test_time = datetime.now() @@ -783,7 +846,12 @@ def main(): duration=args.duration, test_setup_info=test_setup_info, dataset=dataset, lis=lis, bands=args.bands, threshold_2g=args.threshold_2g, threshold_5g=args.threshold_5g, threshold_both=args.threshold_both, dataset2=dataset2, - summary_table_value=summary_table_value, result_data=result_data, test_input_infor=test_input_infor) + summary_table_value=summary_table_value, result_data=result_data, + test_rig=args.test_rig, test_tag=args.test_tag, dut_hw_version=args.dut_hw_version, + dut_sw_version=args.dut_sw_version, dut_model_num=args.dut_model_num, + dut_serial_num=args.dut_serial_num, test_id=args.test_id, + test_input_infor=test_input_infor, csv_outfile=args.csv_outfile) + if __name__ == '__main__': From 8457c8ae7733a529eabfe2d6c0832623f70a21ac Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 9 Dec 2021 12:21:39 -0700 Subject: [PATCH 720/731] ct_us_001_scripts.json: l3_longevity test for AX200 with flags and mode ct_us_001_tests.json: l3_longevity test for AX200 with flags and mode Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 88 ++++++++++++++++++++++--- py-scripts/tools/ct_us_001_tests.json | 73 +++++++++++++++++++- 2 files changed, 151 insertions(+), 10 deletions(-) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index ce9659c6..905890cd 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -223,9 +223,79 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", - " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000"]}, + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_for_l3":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_enable_flags":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED wifi_mode==0 wifi_settings==wifi_settings enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_AX200_5g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_AX200_5g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_AX200_2g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_AX200_2g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=0 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, "example_security_connection0":{ "enabled":"TRUE", "command":"example_security_connection.py", @@ -315,7 +385,7 @@ "args":"", "args_list":[ " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --radio wiphy1 --dut_ssid SSID_USED --dut_passwd SSID_PW_USED --dut_security SECURITY_USED", + " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", " --debug"]}, "test_ip_variable_time_ipv4_udp":{ "enabled":"TRUE", @@ -323,7 +393,7 @@ "args":"", "args_list":[ " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", - " use_ssid_indx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", " --traffic_type lf_udp", " --debug"]}, @@ -333,7 +403,7 @@ "args":"", "args_list":[ " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", - " use_ssid_indx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " use_ssid_inx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", " --traffic_type lf_tcp", " --debug"]}, @@ -343,7 +413,7 @@ "args":"", "args_list":[ " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", - " use_ssid_indx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", " --traffic_type lf_udp", " --ipv6", @@ -354,7 +424,7 @@ "args":"", "args_list":[ " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", - " use_ssid_indx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", " --traffic_type lf_tcp", " --ipv6", @@ -365,7 +435,7 @@ "args":"", "args_list":[ " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", - " use_ssid_indx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", " --traffic_type lf_tcp", " --ipv6", diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index ce92d25d..1f6360cb 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -44,6 +44,31 @@ ] } }, + "suite_l3f":{ + "test_l3_longevity":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED wifi_mode==0 wifi_settings==wifi_settings enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" + ] + } + }, "suite_l3_wifi":{ "test_l3_longevity":{ "enabled":"TRUE", @@ -51,7 +76,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 1s --upstream_port eth2 ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 1s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", @@ -212,6 +237,52 @@ " " ] }, + "clean_up_cxs_endp_sta_flags_AX200_5g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_AX200_5g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_AX200_2g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_AX200_2g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=0 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, "test_l3_longevity":{ "enabled":"TRUE", "load_db":"skip", From 496d0296fa29819a7c29a948728c1c8e1532831d Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 9 Dec 2021 18:04:57 -0700 Subject: [PATCH 721/731] ct_us_001_scripts.json : added l3_longevity regressions with flag settings ct_us_001_tests.json : added l3_longevity regressions with flag settings lf_check.py : the word alloc error , is a message in the probe Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 271 +++++++++--------------- py-scripts/tools/ct_us_001_tests.json | 52 +++++ py-scripts/tools/lf_check.py | 5 + 3 files changed, 161 insertions(+), 167 deletions(-) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 905890cd..36915ead 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -50,19 +50,69 @@ ]} }, "suite_l3":{ - "test_l3_longevity":{ + "clean_up_cxs_endp_sta_flags_5q_all":{ "enabled":"TRUE", - "load_db":"skip", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_5g_all":{ + "enabled":"TRUE", + "load_db":"NONE", "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", - " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", - " --test_rig TEST_RIG --test_tag 'l3_longevity'" + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_2q_all":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_2g_all":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "lf_qa":{ + "enabled":"TRUE", + "timeout":"600", + "load_db":"skip", + "command":"./tools/lf_qa.py", + "args":"", + "args_list":[ + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } - }, + }, "suite_l3r":{ "test_l3_longevity":{ "enabled":"TRUE", @@ -113,7 +163,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } }, @@ -263,7 +313,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 60s --polling_interval 10s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", @@ -286,7 +336,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=0 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=0 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=0 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", @@ -296,89 +346,58 @@ " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" ] }, - "example_security_connection0":{ + "clean_up_cxs_endp_sta_flags_5q_all":{ "enabled":"TRUE", - "command":"example_security_connection.py", + "command":"lf_cleanup.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --radio wiphy1 --security SECURITY_USED", - " --debug"]}, - "example_security_connection1":{ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_5g_all":{ "enabled":"TRUE", - "command":"example_security_connection.py", + "load_db":"NONE", + "command":"test_l3_longevity.py", "args":"", "args_list":[ - "--mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", - " --debug"]}, - "example_security_connection2":{ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_2q_all":{ "enabled":"TRUE", - "command":"example_security_connection.py", + "command":"lf_cleanup.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", - " --debug"]}, - "example_security_connection3":{ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_2g_all":{ "enabled":"TRUE", - "command":"example_security_connection.py", + "load_db":"NONE", + "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", - " --debug"]}, - "sta_connect2":{ - "enabled":"FALSE", - "command":"sta_connect2.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --radio wiphy1 --dut_ssid SSID_USED --dut_passwd SSID_PW_USED --dut_security SECURITY_USED", - " --debug"]}, - "sta_connect_example":{ - "enabled":"FALSE", - "command":"sta_connect_example.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --radio wiphy1 --dut_ssid SSID_USED --dut_passwd SSID_PW_USED --dut_security SECURITY_USED", - " --debug"]}, - "test_fileio":{ - "enabled":"FALSE", - "command":"test_fileio.py", - "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --macvlan_parent UPSTREAM_PORT --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 --netmask 255.255.255.0 --test_duration 30s --gateway 192.168.92.1"]}, - "test_generic0":{ - "enabled":"FALSE", - "command":"test_generic.py", - "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --num_stations 4 --type lfping --dest 10.40.0.1 --debug"]}, - "test_generic1":{ - "enabled":"FALSE", - "command":"test_generic.py", - "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --num_stations 4 --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security SECURITY_USED --debug"]}, - "test_generic2":{ - "enabled":"FALSE", - "command":"test_generic.py", - "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --num_stations 4 --type iperf3 --debug"]}, - "test_generic3":{ - "enabled":"FALSE", - "command":"test_generic.py", - "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --num_stations 4 --type lfcurl --dest 10.40.0.1 --file_output /home/lanforge/Documents/lfcurl_output.txt --debug"]}, - "testgroup":{ - "enabled":"FALSE", - "command":"testgroup.py", - "args":"", - "args_list":["--mgr LF_MGR_IP --group_name group1 --add_group --list_groups --debug"]}, - "testgroup5":{ - "enabled":"FALSE", - "command":"testgroup.py", - "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --num_stations 4 --ssid lanforge --passwd password --security SECURITY_USED --radio wiphy0 --group_name group0 --add_group"]}, + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, "test_ip_connection-ipv4":{ "enabled":"TRUE", "command":"test_ip_connection.py", @@ -403,12 +422,12 @@ "args":"", "args_list":[ " --mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT", - " use_ssid_inx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", + " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", " --test_duration 15s --output_format csv --layer3_cols name,tx_bytes,rx_bytes,dropped", " --traffic_type lf_tcp", " --debug"]}, "test_ip_connection_ipv6_udp":{ - "enabled":"FALSE", + "enabled":"TRUE", "command":"test_ip_connection.py", "args":"", "args_list":[ @@ -419,7 +438,7 @@ " --ipv6", " --debug"]}, "test_ip_variable_time_ipv6_tcp":{ - "enabled":"TRUE", + "enabled":"FALSE", "command":"test_ip_variable_time.py", "args":"", "args_list":[ @@ -440,59 +459,6 @@ " --traffic_type lf_tcp", " --ipv6", " --debug"]}, - "test_l4_bytes-rd":{ - "enabled":"TRUE", - "command":"test_l4.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED ", - " --test_type bytes-rd --test_duration 15s --url 'dl http://10.40.0.1 /dev/null'", - " --debug"]}, - "test_l4_bytes-wr":{ - "enabled":"FALSE", - "command":"test_l4.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", - " --test_type bytes-wr --test_duration 15s --url 'ul http://10.40.0.1' --debug"]}, - "test_l4_urls_s":{ - "enabled":"TRUE", - "command":"test_l4.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", - " --test_type urls --test_duration 15s --requests_per_ten 600 --target_per_ten 600 --url 'dl http://10.40.0.1 /dev/null'", - " --debug"]}, - "test_l4_ftp_bytes-rd":{ - "enabled":"TRUE", - "command":"test_l4.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", - " --ftp --test_type bytes-rd --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null'", - " --debug"]}, - "test_l4_ftp_bytes-wr":{ - "enabled":"FALSE", - "command":"test_l4.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", - " --ftp --test_type bytes-wr --test_duration 15s --url 'ul ftp://10.40.0.1'", - " --debug"]}, - "test_l4_ftp_urls_s":{ - "enabled":"TRUE", - "command":"test_l4.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", - " --ftp --test_type urls --requests_per_ten 600 --target_per_ten 600 --test_duration 15s --url 'dl ftp://10.40.0.1 /dev/null'", - " --debug"]}, "test_l3_longevity_1":{ "enabled":"TRUE", "command":"test_l3_longevity.py", @@ -528,7 +494,7 @@ "args":"", "args_list":["--mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT --target_device sta0000 --debug"]}, "create_l3":{ - "enabled":"FALSE", + "enabled":"TRUE", "command":"create_l3.py", "args":"", "args_list":[ @@ -553,40 +519,11 @@ " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " ] }, - "create_macvlan":{ - "enabled":"FALSE", - "command":"create_macvlan.py", - "args":"", - "args_list":["--mgr LF_MGR_IP --radio wiphy1 --macvlan_parent UPSTREAM_PORT --debug"]}, - "create_station":{ - "enabled":"FALSE", - "command":"create_station.py", - "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, - "create_vap":{ - "enabled":"FALSE", - "command":"create_vap.py", - "args":"", - "args_list":[" --mgr LF_MGR_IP --radio wiphy1 use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"]}, - "create_qvlan":{ - "enabled":"FALSE", - "command":"create_qvlan.py", - "args":"", - "args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --qvlan_parent eth2"]}, "wlan_capacity_calculator1":{ "enabled":"TRUE", "command":"./wlan_capacity_calculator.py", "args":"", "args_list":["-sta 11abg -t Voice -p 48 -m 106 -e WEP -q Yes -b 1 2 5.5 11 -pre Long -s N/A -co G.711 -r Yes -c Yes"]}, - "wlan_capacity_calculator2":{ - "enabled":"TRUE", - "command":"./wlan_capacity_calculator.py", - "args":"","args_list":["-sta 11n -t Voice -d 17 -ch 40 -gu 800 -high 9 -e WEP -q Yes -ip 5 -mc 42 -b 6 9 12 24 -m 1538 -co G.729 -pl Greenfield -cw 15 -r Yes -c Yes"]}, - "wlan_capacity_calculator3":{ - "enabled":"TRUE", - "command":"./wlan_capacity_calculator.py", - "args":"", - "args_list":["-sta 11ac -t Voice -d 9 -spa 3 -ch 20 -gu 800 -high 1 -e TKIP -q Yes -ip 3 -mc 0 -b 6 12 24 54 -m 1518 -co Greenfield -cw 15 -rc Yes"]}, "lf_report_test":{ "enabled":"TRUE", "load_db":"NONE", @@ -613,7 +550,7 @@ "command":"./tools/lf_qa.py", "args":"", "args_list":[ - " --path REPORT_PATH --store --png --database DATABASE_SQLITE" + " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" ] } } diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 1f6360cb..acf71d58 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -283,6 +283,58 @@ " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" ] }, + "clean_up_cxs_endp_sta_flags_5q_all":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_5g_all":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_2q_all":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_2g_all":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, "test_l3_longevity":{ "enabled":"TRUE", "load_db":"skip", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index cf2b92b7..06ad0fa8 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -1052,6 +1052,11 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) if 'ERROR: Could not find component: TestTag' in text: self.test_result = "Success" background = self.background_green + # probe command for test_ip_variable_time.py has + # the word alloc error and erros in it + elif 'alloc error' in text: + self.test_result = "Success" + background = self.background_green # leave the space in after error to not pick up tx # errors or rx errors elif 'error ' in text.lower(): From e241a13e8c6ffd238542931f575bd15cdfad2db1 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 9 Dec 2021 18:30:42 -0700 Subject: [PATCH 722/731] ct_us_002_tests.json : added test_l3_longevity.py using flags ct_us_004_tests.json : update test_l3_longevity.py for using flags Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_002_tests.json | 106 +++++++++++++++++++++++++- py-scripts/tools/ct_us_004_tests.json | 98 ++++++++++++++++++++++++ 2 files changed, 200 insertions(+), 4 deletions(-) diff --git a/py-scripts/tools/ct_us_002_tests.json b/py-scripts/tools/ct_us_002_tests.json index 1a540276..41fbaf7f 100644 --- a/py-scripts/tools/ct_us_002_tests.json +++ b/py-scripts/tools/ct_us_002_tests.json @@ -12,7 +12,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port eth2 ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", " --test_rig TEST_RIG --test_tag 'l3_longevity'", @@ -66,7 +66,7 @@ "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS", - " --instance_name ap_auto --config_name test_con --upstream eth2", + " --instance_name ap_auto --config_name test_con --upstream UPSTREAM_PORT", " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", @@ -107,13 +107,111 @@ " " ] }, + "clean_up_cxs_endp_sta_flags_AX200_5g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_AX200_5g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_AX200_2g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_AX200_2g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=0 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_5q_all":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_5g_all":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_2q_all":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_2g_all":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, "test_l3_longevity":{ "enabled":"TRUE", "load_db":"skip", "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port eth2 ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", " --test_rig TEST_RIG --test_tag 'l3_longevity'" @@ -297,7 +395,7 @@ "args": "", "args_list":[ " --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user LF_MGR_USER --lf_password LF_MGR_PASS", - " --instance_name ap_auto --config_name test_con --upstream eth2", + " --instance_name ap_auto --config_name test_con --upstream UPSTREAM_PORT", " use_ssid_idx=0 --dut2_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (1)'", " use_ssid_idx=1 --dut5_0 'USE_DUT_NAME SSID_USED BSSID_TO_USE (2)'", " --max_stations_2 8 --max_stations_5 8 --max_stations_dual 1", diff --git a/py-scripts/tools/ct_us_004_tests.json b/py-scripts/tools/ct_us_004_tests.json index 3f0f06c5..0a8a544c 100644 --- a/py-scripts/tools/ct_us_004_tests.json +++ b/py-scripts/tools/ct_us_004_tests.json @@ -169,6 +169,104 @@ " " ] }, + "clean_up_cxs_endp_sta_flags_AX200_5g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_AX200_5g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_AX200_2g":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_AX200_2g":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=0 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=0 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_5q_all":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_5g_all":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, + "clean_up_cxs_endp_sta_flags_2q_all":{ + "enabled":"TRUE", + "command":"lf_cleanup.py", + "args":"", + "args_list":[ + " --mgr LF_MGR_IP --cxs --sta" + ]}, + "test_l3_longevity_flags_2g_all":{ + "enabled":"TRUE", + "load_db":"NONE", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000", + " --test_rig TEST_RIG --test_tag 'l3_longevity'", + " --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN" + ] + }, "test_l3_longevity":{ "enabled":"TRUE", "load_db":"skip", From 22525435ba84957622b8f9aa702c7baac0fa9479 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 10 Dec 2021 06:23:09 -0700 Subject: [PATCH 723/731] ct_us_001_scripts.json : testing updates Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index 36915ead..f110bafa 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -407,7 +407,7 @@ " use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", " --debug"]}, "test_ip_variable_time_ipv4_udp":{ - "enabled":"TRUE", + "enabled":"FALSE", "command":"test_ip_variable_time.py", "args":"", "args_list":[ @@ -417,7 +417,7 @@ " --traffic_type lf_udp", " --debug"]}, "test_ip_variable_time_ipv4_tcp":{ - "enabled":"TRUE", + "enabled":"FALSE", "command":"test_ip_variable_time.py", "args":"", "args_list":[ @@ -427,7 +427,7 @@ " --traffic_type lf_tcp", " --debug"]}, "test_ip_connection_ipv6_udp":{ - "enabled":"TRUE", + "enabled":"FALSE", "command":"test_ip_connection.py", "args":"", "args_list":[ @@ -484,23 +484,11 @@ "command":"test_status_msg.py", "args":"", "args_list":["--mgr LF_MGR_IP --action run_test"]}, - "test_wanlink":{ - "enabled":"TRUE", - "command":"test_wanlink.py", - "args":"","args_list":["--mgr LF_MGR_IP --debug"]}, "create_bridge":{ "enabled":"TRUE", "command":"create_bridge.py", "args":"", "args_list":["--mgr LF_MGR_IP --radio wiphy1 --upstream_port UPSTREAM_PORT --target_device sta0000 --debug"]}, - "create_l3":{ - "enabled":"TRUE", - "command":"create_l3.py", - "args":"", - "args_list":[ - " --mgr LF_MGR_IP --radio wiphy1 --num_stations 4 --upstream_port UPSTREAM_PORT", - " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED", - " --debug"]}, "create_l4":{ "enabled":"TRUE", "command":"create_l4.py", From a8b76143d522b5cd19a4a32233c5751a9ad7bd30 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 10 Dec 2021 07:37:16 -0700 Subject: [PATCH 724/731] lf_check.py : information in NA for lf_qa.py links lf_qa.py : initial work reporting broken links Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 7 ++++++- py-scripts/tools/lf_qa.py | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 06ad0fa8..d1bfc8a2 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -435,11 +435,16 @@ Database: {db} http://{hostname}/{report}""".format(hostname=self.hostname, suite=self.test_suite, db=self.database_sqlite, report=report_url) # Put in report information current two methods supported, - message_txt += """ + if "NA" not in self.qa_report_html: + message_txt += """ QA Report Dashboard: http://{ip_qa}/{qa_url} NOTE: Diagrams are links in dashboard""".format(ip_qa=ip, qa_url=qa_url) + else: + message_txt += """ +QA Report Dashboard: lf_qa.py was not run as last script of test suite""" + if (self.email_title_txt != ""): mail_subject = "{email} [{hostname}] {suite} {date}".format(email=self.email_title_txt, hostname=self.hostname, suite=self.test_suite, db=self.database_sqlite, date=datetime.datetime.now()) diff --git a/py-scripts/tools/lf_qa.py b/py-scripts/tools/lf_qa.py index 0e332ddc..59625cd9 100755 --- a/py-scripts/tools/lf_qa.py +++ b/py-scripts/tools/lf_qa.py @@ -747,8 +747,8 @@ Usage: lf_qa.py --store --png --path --databas report.set_table_title("QA Test Results") report.build_table_title() - # report.set_text("lanforge-scripts git sha: {}".format(git_sha)) - # report.build_text() + # report.set_text("QA broken links, check if server correct: {server} example --server 'http:/192.168.0.101/".format(server=__server)) + report.build_text() html_results = csv_dash.get_html_results() report.set_custom_html(html_results) report.build_custom() From 040ca877578c91e3425c5466b6b28805acde057e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 10 Dec 2021 07:47:13 -0700 Subject: [PATCH 725/731] ct_us_001_scripts.json : shortened one of the script runs Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001_scripts.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/py-scripts/tools/ct_us_001_scripts.json b/py-scripts/tools/ct_us_001_scripts.json index f110bafa..82169b25 100755 --- a/py-scripts/tools/ct_us_001_scripts.json +++ b/py-scripts/tools/ct_us_001_scripts.json @@ -63,7 +63,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 30s --polling_interval 5s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", @@ -89,7 +89,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 30s --polling_interval 5s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", @@ -176,7 +176,7 @@ "args_list":[ " " ] - }, + }, "lf_cleanup":{ "enabled":"TRUE", "load_db":"skip", @@ -313,7 +313,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 60s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 60s --polling_interval 5s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", @@ -336,7 +336,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 60s --polling_interval 5s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=0 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=0 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=0 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", @@ -359,7 +359,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 60s --polling_interval 5s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", @@ -385,7 +385,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 120s --polling_interval 10s --upstream_port UPSTREAM_PORT ", + " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 60s --polling_interval 5s --upstream_port UPSTREAM_PORT ", " use_ssid_idx=1 --radio 'radio==wiphy1,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy2,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", " use_ssid_idx=1 --radio 'radio==wiphy3,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED',wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down) ", From 32c2b76b2533d892fa897af50078494108459d4a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 10 Dec 2021 14:28:34 -0700 Subject: [PATCH 726/731] port_probe.py : removed exception when looking for NSS on tx and rx ,check string first before parsing. Signed-off-by: Chuck SmileyRekiere --- py-json/port_probe.py | 73 ++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/py-json/port_probe.py b/py-json/port_probe.py index 50fd84e8..28526b94 100644 --- a/py-json/port_probe.py +++ b/py-json/port_probe.py @@ -88,29 +88,25 @@ class ProbePort(LFCliBase): self.tx_mhz = 20 print("HT: tx_mhz {tx_mhz}".format(tx_mhz=self.tx_mhz)) - try: - tx_mcs = [x.strip('\t') for x in text if 'tx bitrate' in x][0].split(':')[1].strip('\t') - self.tx_mcs = int(tx_mcs.split('MCS')[1].strip(' ').split(' ')[0]) - print("self.tx_mcs {tx_mcs}".format(tx_mcs=self.tx_mcs)) - try: - self.tx_nss = [x.strip('\t') for x in text if 'tx bitrate' in x][0].split('NSS')[1].strip(' ') - except BaseException: - # nss is not present need to derive from MCS for HT - if 0 <= self.tx_mcs <= 7: - self.tx_nss = 1 - elif 8 <= self.tx_mcs <= 15: - self.tx_nss = 2 - elif 16 <= self.tx_mcs <= 23: - self.tx_nss = 3 - elif 24 <= self.tx_mcs <= 31: - self.tx_nss = 4 - print("tx_nss {tx_nss}".format(tx_nss=self.tx_nss)) - self.tx_mbit = float(self.tx_bitrate.split(' ')[0]) - print("tx_mbit {tx_mbit}".format(tx_mbit=self.tx_mbit)) - self.calculated_data_rate_tx_HT() - - except IndexError as error: - print(error) + tx_mcs = [x.strip('\t') for x in text if 'tx bitrate' in x][0].split(':')[1].strip('\t') + self.tx_mcs = int(tx_mcs.split('MCS')[1].strip(' ').split(' ')[0]) + print("self.tx_mcs {tx_mcs}".format(tx_mcs=self.tx_mcs)) + if 'NSS' in text: + self.tx_nss = [x.strip('\t') for x in text if 'tx bitrate' in x][0].split('NSS')[1].strip(' ') + else: + # nss is not present need to derive from MCS for HT + if 0 <= self.tx_mcs <= 7: + self.tx_nss = 1 + elif 8 <= self.tx_mcs <= 15: + self.tx_nss = 2 + elif 16 <= self.tx_mcs <= 23: + self.tx_nss = 3 + elif 24 <= self.tx_mcs <= 31: + self.tx_nss = 4 + print("tx_nss {tx_nss}".format(tx_nss=self.tx_nss)) + self.tx_mbit = float(self.tx_bitrate.split(' ')[0]) + print("tx_mbit {tx_mbit}".format(tx_mbit=self.tx_mbit)) + self.calculated_data_rate_tx_HT() rx_bitrate = [x for x in text if 'rx bitrate' in x][0].replace('\t', ' ') print("rx_bitrate {rx_bitrate}".format(rx_bitrate=rx_bitrate)) @@ -126,22 +122,21 @@ class ProbePort(LFCliBase): else: self.rx_mhz = 20 - try: - rx_mcs = [x.strip('\t') for x in text if 'rx bitrate' in x][0].split(':')[1].strip('\t') - self.rx_mcs = int(rx_mcs.split('MCS')[1].strip(' ').split(' ')[0]) - print("self.rx_mcs {rx_mcs}".format(rx_mcs=self.rx_mcs)) - try: - self.rx_nss = [x.strip('\t') for x in text if 'rx bitrate' in x][0].split('NSS')[1].strip(' ') - except BaseException: - # nss is not present need to derive from MCS for HT - if 0 <= self.rx_mcs <= 7: - self.rx_nss = 1 - elif 8 <= self.rx_mcs <= 15: - self.rx_nss = 2 - elif 16 <= self.rx_mcs <= 23: - self.rx_nss = 3 - elif 24 <= self.rx_mcs <= 31: - self.rx_nss = 4 + rx_mcs = [x.strip('\t') for x in text if 'rx bitrate' in x][0].split(':')[1].strip('\t') + self.rx_mcs = int(rx_mcs.split('MCS')[1].strip(' ').split(' ')[0]) + print("self.rx_mcs {rx_mcs}".format(rx_mcs=self.rx_mcs)) + if 'NSS' in text: + self.rx_nss = [x.strip('\t') for x in text if 'rx bitrate' in x][0].split('NSS')[1].strip(' ') + else: + # nss is not present need to derive from MCS for HT + if 0 <= self.rx_mcs <= 7: + self.rx_nss = 1 + elif 8 <= self.rx_mcs <= 15: + self.rx_nss = 2 + elif 16 <= self.rx_mcs <= 23: + self.rx_nss = 3 + elif 24 <= self.rx_mcs <= 31: + self.rx_nss = 4 self.rx_mbit = self.rx_bitrate.split(' ')[0] print("rx_nss {rx_nss}".format(rx_nss=self.rx_nss)) From ca5c1f6aace4d34695ceb5f97426c56a5580bf1e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 10 Dec 2021 14:35:12 -0700 Subject: [PATCH 727/731] port_probe.py : removed exception for receive Signed-off-by: Chuck SmileyRekiere --- py-json/port_probe.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/py-json/port_probe.py b/py-json/port_probe.py index 28526b94..dc1aee8a 100644 --- a/py-json/port_probe.py +++ b/py-json/port_probe.py @@ -138,17 +138,15 @@ class ProbePort(LFCliBase): elif 24 <= self.rx_mcs <= 31: self.rx_nss = 4 - self.rx_mbit = self.rx_bitrate.split(' ')[0] - print("rx_nss {rx_nss}".format(rx_nss=self.rx_nss)) - self.rx_mbit = float(self.rx_bitrate.split(' ')[0]) - print("rx_mbit {rx_mbit}".format(rx_mbit=self.rx_mbit)) - self.calculated_data_rate_rx_HT() - if 'HE not supported' in [x.strip('\t') for x in text if 'HE' in x]: - self.he = False - else: - self.he = True - except IndexError as error: - print(error) + self.rx_mbit = self.rx_bitrate.split(' ')[0] + print("rx_nss {rx_nss}".format(rx_nss=self.rx_nss)) + self.rx_mbit = float(self.rx_bitrate.split(' ')[0]) + print("rx_mbit {rx_mbit}".format(rx_mbit=self.rx_mbit)) + self.calculated_data_rate_rx_HT() + if 'HE not supported' in [x.strip('\t') for x in text if 'HE' in x]: + self.he = False + else: + self.he = True def getSignalAvgCombined(self): return self.signals['signal avg'].split(' ')[0] From 73ac0b91ea63f235084bde8c7bf11809e29981a0 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 10 Dec 2021 16:05:11 -0700 Subject: [PATCH 728/731] port_probe.py : support for VHT and HE (non - ofdma) Signed-off-by: Chuck SmileyRekiere --- py-json/port_probe.py | 94 ++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 50 deletions(-) diff --git a/py-json/port_probe.py b/py-json/port_probe.py index dc1aee8a..a0998b67 100644 --- a/py-json/port_probe.py +++ b/py-json/port_probe.py @@ -28,9 +28,6 @@ class ProbePort(LFCliBase): self.probepath = "/probe/1/%s/%s" % (hunks[-2], hunks[-1]) self.response = None self.signals = None - self.he = None - - self.he = False self.ofdma = False self.tx_bitrate = None @@ -76,8 +73,8 @@ class ProbePort(LFCliBase): self.signals = dict(zip(keys, values)) tx_bitrate = [x for x in text if 'tx bitrate' in x][0].replace('\t', ' ') - if 'HE' in tx_bitrate: - print("HE not supported ") + # if 'HE' in tx_bitrate: + # print("HE not supported ") print("tx_bitrate {tx_bitrate}".format(tx_bitrate=tx_bitrate)) self.tx_bitrate = tx_bitrate.split(':')[-1].strip(' ') if 'MHz' in tx_bitrate: @@ -106,7 +103,12 @@ class ProbePort(LFCliBase): print("tx_nss {tx_nss}".format(tx_nss=self.tx_nss)) self.tx_mbit = float(self.tx_bitrate.split(' ')[0]) print("tx_mbit {tx_mbit}".format(tx_mbit=self.tx_mbit)) - self.calculated_data_rate_tx_HT() + if 'HE' in tx_bitrate: + self.calculated_data_rate_tx_HE() + elif 'VHT' in tx_bitrate: + self.calculated_data_rate_tx_VHT() + else: + self.calculated_data_rate_tx_HT() rx_bitrate = [x for x in text if 'rx bitrate' in x][0].replace('\t', ' ') print("rx_bitrate {rx_bitrate}".format(rx_bitrate=rx_bitrate)) @@ -123,30 +125,33 @@ class ProbePort(LFCliBase): self.rx_mhz = 20 rx_mcs = [x.strip('\t') for x in text if 'rx bitrate' in x][0].split(':')[1].strip('\t') - self.rx_mcs = int(rx_mcs.split('MCS')[1].strip(' ').split(' ')[0]) - print("self.rx_mcs {rx_mcs}".format(rx_mcs=self.rx_mcs)) - if 'NSS' in text: - self.rx_nss = [x.strip('\t') for x in text if 'rx bitrate' in x][0].split('NSS')[1].strip(' ') - else: - # nss is not present need to derive from MCS for HT - if 0 <= self.rx_mcs <= 7: - self.rx_nss = 1 - elif 8 <= self.rx_mcs <= 15: - self.rx_nss = 2 - elif 16 <= self.rx_mcs <= 23: - self.rx_nss = 3 - elif 24 <= self.rx_mcs <= 31: - self.rx_nss = 4 + # MCS is not in the 6.0MBit/s frame + if 'MCS' in rx_mcs: + self.rx_mcs = int(rx_mcs.split('MCS')[1].strip(' ').split(' ')[0]) + print("self.rx_mcs {rx_mcs}".format(rx_mcs=self.rx_mcs)) + if 'NSS' in text: + self.rx_nss = [x.strip('\t') for x in text if 'rx bitrate' in x][0].split('NSS')[1].strip(' ') + else: + # nss is not present need to derive from MCS for HT + if 0 <= self.rx_mcs <= 7: + self.rx_nss = 1 + elif 8 <= self.rx_mcs <= 15: + self.rx_nss = 2 + elif 16 <= self.rx_mcs <= 23: + self.rx_nss = 3 + elif 24 <= self.rx_mcs <= 31: + self.rx_nss = 4 - self.rx_mbit = self.rx_bitrate.split(' ')[0] - print("rx_nss {rx_nss}".format(rx_nss=self.rx_nss)) - self.rx_mbit = float(self.rx_bitrate.split(' ')[0]) - print("rx_mbit {rx_mbit}".format(rx_mbit=self.rx_mbit)) - self.calculated_data_rate_rx_HT() - if 'HE not supported' in [x.strip('\t') for x in text if 'HE' in x]: - self.he = False - else: - self.he = True + self.rx_mbit = self.rx_bitrate.split(' ')[0] + print("rx_nss {rx_nss}".format(rx_nss=self.rx_nss)) + self.rx_mbit = float(self.rx_bitrate.split(' ')[0]) + print("rx_mbit {rx_mbit}".format(rx_mbit=self.rx_mbit)) + if 'HE' in rx_bitrate: + self.calculated_data_rate_rx_HE() + elif 'VHT' in rx_bitrate: + self.calculated_data_rate_rx_VHT() + else: + self.calculated_data_rate_rx_HT() def getSignalAvgCombined(self): return self.signals['signal avg'].split(' ')[0] @@ -164,6 +169,7 @@ class ProbePort(LFCliBase): return ' '.join(self.signals['beacon signal avg']).replace(' ', '') def calculated_data_rate_tx_HT(self): + print("calculated_data_rate_tx_HT") # TODO compare with standard for 40 MHz if values change N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) @@ -175,11 +181,7 @@ class ProbePort(LFCliBase): bw = 20 # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith - # try: bw = int(self.tx_mhz) - # except BaseException: - # print("port_probe.py: WARNING unable to parse tx MHz (BW) , check probe output will use {bw}".format(bw=bw)) - print("Mhz {Mhz}".format(Mhz=self.tx_mhz)) if bw == 20: N_sd = 52 @@ -253,6 +255,7 @@ class ProbePort(LFCliBase): self.tx_gi = T_gi_long def calculated_data_rate_rx_HT(self): + print("calculated_data_rate_rx_HT") N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) R = 0 # coding , (Determined by the modulation, MCS ) @@ -333,6 +336,7 @@ class ProbePort(LFCliBase): self.rx_gi = T_gi_long def calculated_data_rate_tx_VHT(self): + print("calculated_data_rate_tx_VHT") # TODO compare with standard for 40 MHz if values change N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) @@ -344,10 +348,7 @@ class ProbePort(LFCliBase): bw = 20 # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith - try: - bw = int(self.tx_mhz) - except BaseException: - print("port_probe.py: WARNING unable to parse tx MHz (BW) , check probe output will use {bw}".format(bw=bw)) + bw = int(self.tx_mhz) print("Mhz {Mhz}".format(Mhz=self.tx_mhz)) if bw == 20: @@ -430,6 +431,7 @@ class ProbePort(LFCliBase): self.tx_gi = T_gi_long def calculated_data_rate_rx_VHT(self): + print("calculated_data_rate_rx_VHT") N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) R = 0 # coding , (Determined by the modulation, MCS ) @@ -439,10 +441,7 @@ class ProbePort(LFCliBase): T_gi_long = .8 * 10 ** -6 # Guard index. # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith - try: - bw = int(self.rx_mhz) - except BaseException: - print("port_probe.py: {} WARNING unable to parse rx MHz (BW) , check probe output will use ") + bw = int(self.rx_mhz) print("Mhz {Mhz}".format(Mhz=self.rx_mhz)) if bw == 20: N_sd = 52 @@ -524,6 +523,7 @@ class ProbePort(LFCliBase): ########################################### def calculated_data_rate_tx_HE(self): + print("calculated_data_rate_tx_HE") # TODO compare with standard for 40 MHz if values change N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) @@ -535,11 +535,7 @@ class ProbePort(LFCliBase): bw = 20 # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith - try: - bw = int(self.tx_mhz) - except BaseException: - print("port_probe.py: WARNING unable to parse tx MHz (BW) , check probe output will use {bw}".format(bw=bw)) - + bw = int(self.tx_mhz) print("Mhz {Mhz}".format(Mhz=self.tx_mhz)) if bw == 20: N_sd = 52 @@ -621,6 +617,7 @@ class ProbePort(LFCliBase): self.tx_gi = T_gi_long def calculated_data_rate_rx_HE(self): + print("calculated_data_rate_rx_HE") N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith N_bpscs = 0 # Number of coded bits per Subcarrier(Determined by the modulation, MCS) R = 0 # coding , (Determined by the modulation, MCS ) @@ -630,10 +627,7 @@ class ProbePort(LFCliBase): T_gi_long = .8 * 10 ** -6 # Guard index. # Note the T_gi is not exactly know so need to calculate bothh with .4 and .8 # the nubmer of Data Subcarriers is based on modulation and bandwith - try: - bw = int(self.rx_mhz) - except BaseException: - print("port_probe.py: {} WARNING unable to parse rx MHz (BW) , check probe output will use ") + bw = int(self.rx_mhz) print("Mhz {Mhz}".format(Mhz=self.rx_mhz)) if bw == 20: N_sd = 52 From 32c88026fc71667aa56ab09614eebd1b2c13c462 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 10 Dec 2021 17:18:36 -0700 Subject: [PATCH 729/731] port_probe.py : alight adjusment to not error on modes without an MCS, support for earlier modes may be supported later. Signed-off-by: Chuck SmileyRekiere --- py-json/port_probe.py | 50 +++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/py-json/port_probe.py b/py-json/port_probe.py index a0998b67..378a85cc 100644 --- a/py-json/port_probe.py +++ b/py-json/port_probe.py @@ -84,31 +84,33 @@ class ProbePort(LFCliBase): else: self.tx_mhz = 20 print("HT: tx_mhz {tx_mhz}".format(tx_mhz=self.tx_mhz)) - tx_mcs = [x.strip('\t') for x in text if 'tx bitrate' in x][0].split(':')[1].strip('\t') - self.tx_mcs = int(tx_mcs.split('MCS')[1].strip(' ').split(' ')[0]) - print("self.tx_mcs {tx_mcs}".format(tx_mcs=self.tx_mcs)) - if 'NSS' in text: - self.tx_nss = [x.strip('\t') for x in text if 'tx bitrate' in x][0].split('NSS')[1].strip(' ') + if 'MCS' in tx_mcs: + self.tx_mcs = int(tx_mcs.split('MCS')[1].strip(' ').split(' ')[0]) + print("self.tx_mcs {tx_mcs}".format(tx_mcs=self.tx_mcs)) + if 'NSS' in text: + self.tx_nss = [x.strip('\t') for x in text if 'tx bitrate' in x][0].split('NSS')[1].strip(' ') + else: + # nss is not present need to derive from MCS for HT + if 0 <= self.tx_mcs <= 7: + self.tx_nss = 1 + elif 8 <= self.tx_mcs <= 15: + self.tx_nss = 2 + elif 16 <= self.tx_mcs <= 23: + self.tx_nss = 3 + elif 24 <= self.tx_mcs <= 31: + self.tx_nss = 4 + print("tx_nss {tx_nss}".format(tx_nss=self.tx_nss)) + self.tx_mbit = float(self.tx_bitrate.split(' ')[0]) + print("tx_mbit {tx_mbit}".format(tx_mbit=self.tx_mbit)) + if 'HE' in tx_bitrate: + self.calculated_data_rate_tx_HE() + elif 'VHT' in tx_bitrate: + self.calculated_data_rate_tx_VHT() + else: + self.calculated_data_rate_tx_HT() else: - # nss is not present need to derive from MCS for HT - if 0 <= self.tx_mcs <= 7: - self.tx_nss = 1 - elif 8 <= self.tx_mcs <= 15: - self.tx_nss = 2 - elif 16 <= self.tx_mcs <= 23: - self.tx_nss = 3 - elif 24 <= self.tx_mcs <= 31: - self.tx_nss = 4 - print("tx_nss {tx_nss}".format(tx_nss=self.tx_nss)) - self.tx_mbit = float(self.tx_bitrate.split(' ')[0]) - print("tx_mbit {tx_mbit}".format(tx_mbit=self.tx_mbit)) - if 'HE' in tx_bitrate: - self.calculated_data_rate_tx_HE() - elif 'VHT' in tx_bitrate: - self.calculated_data_rate_tx_VHT() - else: - self.calculated_data_rate_tx_HT() + print("No tx MCS value:{tx_bitrate}".format(tx_bitrate=tx_bitrate)) rx_bitrate = [x for x in text if 'rx bitrate' in x][0].replace('\t', ' ') print("rx_bitrate {rx_bitrate}".format(rx_bitrate=rx_bitrate)) @@ -152,6 +154,8 @@ class ProbePort(LFCliBase): self.calculated_data_rate_rx_VHT() else: self.calculated_data_rate_rx_HT() + else: + print("No rx MCS value:{rx_bitrate}".format(rx_bitrate=rx_bitrate)) def getSignalAvgCombined(self): return self.signals['signal avg'].split(' ')[0] From d67b4f42be96ec81e34ec90b1c7e7466da388c19 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 11 Dec 2021 07:09:04 -0700 Subject: [PATCH 730/731] csv_processor.py test file moved to scripts_deprecated Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => scripts_deprecated}/csv_processor.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-scripts/{ => scripts_deprecated}/csv_processor.py (100%) diff --git a/py-scripts/csv_processor.py b/py-scripts/scripts_deprecated/csv_processor.py similarity index 100% rename from py-scripts/csv_processor.py rename to py-scripts/scripts_deprecated/csv_processor.py From a00b4e6489166827e85c4f1262c8f1671e994a11 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 11 Dec 2021 07:21:53 -0700 Subject: [PATCH 731/731] lf_influx_db.json : no longer used by lf_check.py moved to scripts deprecated Signed-off-by: Chuck SmileyRekiere --- py-scripts/{ => scripts_deprecated}/lf_influx_db.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename py-scripts/{ => scripts_deprecated}/lf_influx_db.json (100%) diff --git a/py-scripts/lf_influx_db.json b/py-scripts/scripts_deprecated/lf_influx_db.json similarity index 100% rename from py-scripts/lf_influx_db.json rename to py-scripts/scripts_deprecated/lf_influx_db.json