From e7b1a639c8c98294b5bbbd7737cb23a657e25136 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sun, 20 Jun 2021 09:55:55 -0600 Subject: [PATCH 001/152] lf_dataplane_test.py : added influx config read from json lf_influx_db.json : sample file - may need a place for sample files The influx db configuration can be read from a passed in json file --influx_json , there is not error checking on if the parameters are entered correctly. Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_dataplane_test.py | 23 ++++++++++++++++++++++- py-scripts/lf_influx_db.json | 12 ++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 py-scripts/lf_influx_db.json diff --git a/py-scripts/lf_dataplane_test.py b/py-scripts/lf_dataplane_test.py index 18420bfc..40b44f1a 100755 --- a/py-scripts/lf_dataplane_test.py +++ b/py-scripts/lf_dataplane_test.py @@ -285,6 +285,7 @@ def main(): cv_add_base_parser(parser) # see cv_test_manager.py parser.add_argument('--json', help="--json json input file", default="") + parser.add_argument('--influx_json', help="--influx_json influx config json input file", default="") parser.add_argument("-u", "--upstream", type=str, default="", help="Upstream port for wifi capacity test ex. 1.1.eth2") parser.add_argument("--station", type=str, default="", @@ -311,7 +312,6 @@ def main(): except: print("Error reading {}".format(args.json)) # json configuation takes presidence to command line - # TODO see if there is easier way to search presence, look at parser args if "mgr" in json_data: args.mgr = json_data["mgr"] if "port" in json_data: @@ -344,6 +344,27 @@ def main(): json_data_tmp = [[x] for x in json_data["raw_line"]] 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)) + # json configuation takes presidence to command line + # influx DB configuration + if "influx_host" in influx_json_data: + args.influx_host = influx_json_data["influx_host"] + if "influx_port" in influx_json_data: + args.influx_port = influx_json_data["influx_port"] + if "influx_org" in influx_json_data: + args.influx_org = influx_json_data["influx_org"] + if "influx_token" in influx_json_data: + args.influx_token = influx_json_data["influx_token"] + if "influx_bucket" in influx_json_data: + args.influx_bucket = influx_json_data["influx_bucket"] + cv_base_adjust_parser(args) CV_Test = DataplaneTest(lf_host = args.mgr, diff --git a/py-scripts/lf_influx_db.json b/py-scripts/lf_influx_db.json new file mode 100644 index 00000000..3aee6cfa --- /dev/null +++ b/py-scripts/lf_influx_db.json @@ -0,0 +1,12 @@ +{ + "influx_host":"192.168.100.201", + "influx_port": "8086", + "influx_org": "Candela", + "influx_token": "-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ==", + "influx_bucket": "ben", + "influx_tag": "testbed Ferndale-01" +} + + + + \ No newline at end of file From 886cde22442d29db4d79da31c6592c7cd63a5675 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sun, 20 Jun 2021 15:11:35 -0600 Subject: [PATCH 002/152] lf_check.py: update to have customized email title, text and remote lf_mgr information lf_check.json : json example Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.json | 20 ++++++++++++++----- py-scripts/tools/lf_check.py | 36 +++++++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/py-scripts/tools/lf_check.json b/py-scripts/tools/lf_check.json index 3fb614bb..8ef66e95 100644 --- a/py-scripts/tools/lf_check.json +++ b/py-scripts/tools/lf_check.json @@ -8,7 +8,10 @@ "email_list_production": "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" + "host_ip_test": "192.168.95.6", + "lf_mgr": "192.168.100.116", + "email_title_txt": "Dataplane Test", + "email_txt": "Dataplane Regression testing " }, "test_network":{ "http_test_ip": "10.40.0.10", @@ -37,10 +40,17 @@ "suite_two":{ "test_l3_longevity":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"--test_duration 15s --polling_interval 5s --upstream_port eth1 --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"} }, - - "TEST_DICTONARY":{ - "create_l3":{"enabled":"TRUE","command":"create_l4.py","args":"--radio RADIO_USED --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"}, - "test_l3_longevity":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"--test_duration 15s --polling_interval 5s --upstream_port eth1 --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"} + "suite_dp":{ + "create_station":{"enabled":"TRUE","command":"create_station.py","args":"--radio RADIO_USED --start_id 2 --num_stations 1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"}, + "data_plane_0":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"}, + "data_plane_1":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"}, + "data_plane_2":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"} + }, + "TEST_DICTIONARY":{ + "create_station":{"enabled":"TRUE","command":"create_station.py","args":"--radio RADIO_USED --start_id 2 --num_stations 1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"}, + "data_plane_0":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"}, + "data_plane_1":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"}, + "data_plane_2":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"} } } } diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index f80b7a38..0fd143e8 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -125,6 +125,10 @@ class lf_check(): self.host_ip_production = None self.email_list_test = "" self.host_ip_test = None + self.email_title_txt = "" + self.email_txt = "" + self.lf_mgr = "" # lanforge tests are run against if passed in + # NOT complete : will send the email results def send_results_email(self, report_file=None): @@ -139,12 +143,23 @@ class lf_check(): #command = 'echo "$HOSTNAME mail system works!" | mail -s "Test: $HOSTNAME $(date)" chuck.rekiere@candelatech.com' hostname = socket.gethostname() ip = socket.gethostbyname(hostname) - message_txt = """Results from {hostname}: + if(self.email_txt != ""): + message_txt = """{email_txt} lanforge target {lf_mgr} +Results from {hostname}: +http://{ip}/{report} +NOTE: for now to see stdout and stderr remove /home/lanforge from path. +""".format(hostname=hostname, ip=ip, report=report_url, email_txt=self.email_txt, lf_mgr=self.lf_mgr) + + else: + message_txt = """Results from {hostname}: http://{ip}/{report} NOTE: for now to see stdout and stderr remove /home/lanforge from path. """.format(hostname=hostname, ip=ip, report=report_url) - mail_subject = "Regression Test [{hostname}] {date}".format(hostname=hostname, date=datetime.datetime.now()) + if(self.email_title_txt != ""): + mail_subject = "{} [{hostname}] {date}".format(self.email_title_txt,hostname=hostname, date=datetime.datetime.now()) + else: + 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) @@ -301,14 +316,28 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. exit(1) if "email_list_test" in self.json_data["test_parameters"]: self.email_list_test = self.json_data["test_parameters"]["email_list_test"] + print(self.email_list_test) else: self.logger.info("email_list_test not in test_parameters json") exit(1) if "host_ip_test" in self.json_data["test_parameters"]: - self.email_list_test = self.json_data["test_parameters"]["host_ip_test"] + self.host_ip_test = self.json_data["test_parameters"]["host_ip_test"] else: self.logger.info("host_ip_test not in test_parameters json") exit(1) + if "email_title_txt" in self.json_data["test_parameters"]: + self.email_title_txt = self.json_data["test_parameters"]["email_title_txt"] + else: + self.logger.info("email_title_txt not in test_parameters json") + if "email_txt" in self.json_data["test_parameters"]: + self.email_txt = self.json_data["test_parameters"]["email_txt"] + else: + self.logger.info("email_txt not in test_parameters json") + if "lf_mgr" in self.json_data["test_parameters"]: + self.lf_mgr_port = self.json_data["test_parameters"]["lf_mgr"] + else: + self.logger.info("lf_mgr not in test_parameters json") + def read_test_network(self): if "http_test_ip" in self.json_data["test_network"]: @@ -392,6 +421,7 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. self.host_ip_production = section['HOST_IP_PRODUCTION'] self.email_list_test = section['EMAIL_LIST_TEST'] self.host_ip_test = section['HOST_IP_TEST'] + self.logger.info("self.email_list_test:{}".format(self.email_list_test)) if 'TEST_NETWORK' in config_file.sections(): section = config_file['TEST_NETWORK'] From 1daf71ede43d114fd8af0b79a6c54c7faf4bdf3f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sun, 20 Jun 2021 15:28:52 -0600 Subject: [PATCH 003/152] lf_check.py : more descriptive on what the git sha represents 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 0fd143e8..150a7dfb 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -764,7 +764,7 @@ Example : report.start_content_div() report.set_table_title("LF Check Test Results") report.build_table_title() - report.set_text("git sha: {}".format(git_sha)) + report.set_text("lanforge-scripts git sha: {}".format(git_sha)) report.build_text() html_results = check.get_html_results() report.set_custom_html(html_results) From 10723d6d8b6ff1c8ec9be4d85e97225c38927d87 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sun, 20 Jun 2021 16:07:15 -0600 Subject: [PATCH 004/152] lf_check.py : use shlex to split command yet preserve --raw_line parameters Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 150a7dfb..144b9205 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -56,6 +56,7 @@ import subprocess import csv import shutil from os import path +import shlex # lf_report is from the parent of the current file dir_path = os.path.dirname(os.path.realpath(__file__)) @@ -595,12 +596,14 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. stderr_log = open(stderr_log_txt, 'a') # HERE is thwere the test is run - print("running {}".format(command)) + # print("running {}".format(command)) + # need to take into account --raw_line parameters + command = shlex.split(command) + print("running {command}".format(command=command)) try: - process = subprocess.Popen((command).split(' '), shell=False, stdout=stdout_log, stderr=stderr_log, universal_newlines=True) + process = subprocess.Popen(command, 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 try: - #out, err = process.communicate() process.wait(timeout=int(self.test_timeout)) except subprocess.TimeoutExpired: process.terminate() From 2c980bb902a3ea50083bf34a15f92f52460486b4 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sun, 20 Jun 2021 16:20:03 -0600 Subject: [PATCH 005/152] lf_check.py : cosmetic changes 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 144b9205..157de35e 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -599,7 +599,7 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. # print("running {}".format(command)) # need to take into account --raw_line parameters command = shlex.split(command) - print("running {command}".format(command=command)) + self.logger.info("running {command}".format(command=command)) try: process = subprocess.Popen(command, 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 @@ -630,7 +630,7 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. background = self.background_purple self.html_results += """ - """ + str(test) + """""" + str(command) + """ + """ + str(test) + """""" + str(command) + """ """ + str(self.test_result) + """ STDOUT""" if self.test_result == "Failure": From 9c79fa1c04633f71a6b6cdabe912a11a7f5a79a0 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sun, 20 Jun 2021 16:40:01 -0600 Subject: [PATCH 006/152] lf_check.py : removed passing the command to the logger - modified formatting Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 157de35e..a8935ab2 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -595,11 +595,10 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. #self.logger.info("stderr_log_txt: {}".format(stderr_log_txt)) stderr_log = open(stderr_log_txt, 'a') - # HERE is thwere the test is run - # print("running {}".format(command)) # need to take into account --raw_line parameters command = shlex.split(command) - self.logger.info("running {command}".format(command=command)) + # do NOT pass command into self.logger.info will modify formatting + print("running {command}".format(command=command)) try: process = subprocess.Popen(command, 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 From 81dd3cd82851c2e792a08362dc523820552e318e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 21 Jun 2021 06:28:49 -0600 Subject: [PATCH 007/152] lf_check.py : corrected output on the Command for presentation Running the command needed shlex to preserve the --raw_line, this affected the printed output, shlex is only used for running Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index a8935ab2..e167223c 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -595,12 +595,13 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. #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 - command = shlex.split(command) - # do NOT pass command into self.logger.info will modify formatting - print("running {command}".format(command=command)) + # 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)) try: - process = subprocess.Popen(command, shell=False, stdout=stdout_log, stderr=stderr_log, universal_newlines=True) + 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 try: process.wait(timeout=int(self.test_timeout)) From f8f1297450dbd4c0dfbb4818ec387c99e4c6e88f Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 21 Jun 2021 21:36:41 -0700 Subject: [PATCH 008/152] JAG: updated Enums: parameters are more clearly strings, numerals or bit flags Signed-off-by: Jed Reynolds --- py-json/LANforge/lf_json_autogen.py | 1346 +++++++++++++-------------- 1 file changed, 673 insertions(+), 673 deletions(-) diff --git a/py-json/LANforge/lf_json_autogen.py b/py-json/LANforge/lf_json_autogen.py index 0cd95b6f..144c48e9 100644 --- a/py-json/LANforge/lf_json_autogen.py +++ b/py-json/LANforge/lf_json_autogen.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated by LANforge JsonApiPythonGenerator, Fri Jun 18 14:04:25 PDT 2021 + Generated by LANforge JsonApiPythonGenerator, Mon Jun 21 21:27:41 PDT 2021 This file expects to live in py-json/LANforge directory. ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" import sys @@ -1435,10 +1435,10 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_bgp_peer_flags(Enum): - ENABLE_PEER = 1 # Set this to zero if you don't want this peer enabled. - PEER_CLIENT = 2 # Sets corresponding Xorp flag in BGP Peer section. - PEER_CONFED_MEMBER = 4 # Sets corresponding Xorp flag in BGP Peer section. - PEER_UNICAST_V4 = 8 # Sets corresponding Xorp flag in BGP Peer section. + 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. def post_add_bgp_peer(self, @@ -1556,8 +1556,8 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_cd_flags(Enum): - ERR = 2 # Set to kernel mode. - RUNNING = 1 # Set to running state. + ERR = 0x2 # Set to kernel mode. + RUNNING = 0x1 # Set to running state. def post_add_cd(self, @@ -1642,9 +1642,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_chamber_chamber_flags(Enum): - OPEN = 4 # (3) Door is open, no real isolation right now. - PHANTOM = 1 # (1) Chamber is not actually here right now. - VIRTUAL = 2 # (2) No real chamber, open-air grouping of equipment. + 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. def post_add_chamber(self, @@ -1707,8 +1707,8 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_chamber_cx_chamber_cx_flags(Enum): - 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! + CONNECTED = 0x1 # (1) Connected to something. If flag is not set, connection is open to the air (maybe with antenna) + TERMINATED = 0x2 # (2) Connection is terminated, signal shall not pass! def post_add_chamber_cx(self, @@ -1778,19 +1778,19 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_channel_group_types(Enum): - clear = 0 # Channel(s) are bundled into a single span. No conversion or - e_m = 0 # Channel(s) are signalled using E&M signalling (specific - fcshdlc = 0 # The zapdel driver performs HDLC encoding and decoding on the - fxogs = 0 # Channel(s) are signalled using FXO Groundstart protocol. - fxoks = 0 # Channel(s) are signalled using FXO Koolstart protocol. - fxols = 0 # Channel(s) are signalled using FXO Loopstart protocol. - fxsgs = 0 # Channel(s) are signalled using FXS Groundstart protocol. - fxsks = 0 # Channel(s) are signalled using FXS Koolstart protocol. - fxsls = 0 # Channel(s) are signalled using FXS Loopstart protocol. - indclear = 0 # Like 'clear' except all channels are treated individually and - nethdlc = 0 # The zaptel driver bundles the channels together into an - rawhdlc = 0 # The zaptel driver performs HDLC encoding and decoding on the - unused = 0 # No signalling is performed, each channel in the list remains idle + 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, @@ -1856,19 +1856,19 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_dut_dut_flags(Enum): - p_11r = 512 # Use .11r connection logic on all ssids, deprecated, see add_dut_ssid. - AP_MODE = 2 # (2) DUT acts as AP. - DHCPD_LAN = 64 # Provides DHCP server on LAN port - DHCPD_WAN = 128 # Provides DHCP server on WAN port - EAP_PEAP = 2048 # Use EAP-PEAP connection logic on all ssids, deprecated, see add_dut_ssid. - EAP_TTLS = 1024 # Use EAP-TTLS connection logic on all ssids, deprecated, see add_dut_ssid. - INACTIVE = 4 # (3) Ignore this in ChamberView, etc - NOT_DHCPCD = 4096 # Station/edge device that is NOT using DHCP. - STA_MODE = 1 # (1) DUT acts as Station. - WEP = 8 # Use WEP encryption on all ssids, deprecated, see add_dut_ssid. - WPA = 16 # Use WPA encryption on all ssids, deprecated, see add_dut_ssid. - WPA2 = 32 # Use WPA2 encryption on all ssids, deprecated, see add_dut_ssid. - WPA3 = 256 # Use WPA3 encryption on all ssids, deprecated, see add_dut_extras. + 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. def post_add_dut(self, @@ -1970,13 +1970,13 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_dut_ssid_dut_flags(Enum): - p_11r = 512 # Use .11r connection logic - EAP_PEAP = 2048 # Use EAP-PEAP connection logic - EAP_TTLS = 1024 # Use EAP-TTLS connection logic - WEP = 8 # Use WEP encryption - WPA = 16 # Use WPA encryption - WPA2 = 32 # Use WPA2 encryption - WPA3 = 256 # Use WPA3 encryption + 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 def post_add_dut_ssid(self, @@ -2013,31 +2013,31 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_endp_payload_pattern(Enum): - PRBS_11_8_10 = 0 # PRBS (see above) - PRBS_15_0_14 = 0 # PRBS (see above) - PRBS_4_0_3 = 0 # Use linear feedback shift register to generate pseudo random sequence. - PRBS_7_0_6 = 0 # PRBS (see above) - custom = 0 # Enter your own payload with the set_endp_payload cmd. - decreasing = 0 # bytes start at FF and decrease, wrapping if needed - increasing = 0 # bytes start at 00 and increase, wrapping if needed - ones = 0 # payload is all ones (FF) - random = 0 # generate a new random payload each time sent - random_fixed = 0 # means generate one random payload, and send it over and over again. - zeros = 0 # payload is all zeros (00) + 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 add_endp_type(Enum): - custom_ether = 0 # LF frames with custom options, use with playback - custom_mc_udp = 0 # LF Multicast UDP IPv4 - custom_tcp = 0 # LF TCP IPv4 frame with custom options - custom_udp = 0 # LF UDP IPv4 frame with custom options - lf = 0 # LF protocol - lf_sctp = 0 # SCTP IPv4 protocol - lf_sctp6 = 0 # SCTP IPv6 protocol - lf_tcp = 0 # TCP IPv4 connection - lf_tcp6 = 0 # TCP IPv6 connection - lf_udp = 0 # UDP IPv4 connection - lf_udp6 = 0 # UDP IPv6 connection - mc_udp = 0 # LF Multicast IPv4 + 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, @@ -2121,29 +2121,29 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_file_endp_fio_flags(Enum): - AUTO_MOUNT = 2 # (2) Attempt to mount with the provided information if not already mounted. - AUTO_UNMOUNT = 4 # (4) Attempt to un-mount when stopping test. - CHECK_MOUNT = 1 # (1) Attempt to verify NFS and SMB mounts match the configured values. - O_APPEND = 512 # (512) Open files for writing with O_APPEND instead - O_DIRECT = 8 # (8) Open file with O_DIRECT flag, disables caching. Must use block-size read/write calls. - O_LARGEFILE = 32 # (32) Open files with O_LARGEFILE. This allows greater than 2GB files on 32-bit systems. - UNLINK_BW = 16 # (16) Unlink file before writing. This works around issues with CIFS for some file-servers. - UNMOUNT_FORCE = 64 # (64) Use -f flag when calling umount - UNMOUNT_LAZY = 128 # (128) Use -l flag when calling umount - USE_FSTATFS = 256 # (256) Use fstatfs system call to verify file-system type when opening files. + 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. class add_file_endp_payload_pattern(Enum): - PRBS_11_8_10 = 0 # PRBS (see above) - PRBS_15_0_14 = 0 # PRBS (see above) - PRBS_4_0_3 = 0 # Use linear feedback shift register to generate pseudo random sequence. - PRBS_7_0_6 = 0 # PRBS (see above) - custom = 0 # Enter your own payload with the set_endp_payload cmd. - decreasing = 0 # bytes start at FF and decrease, wrapping if needed. - increasing = 0 # bytes start at 00 and increase, wrapping if needed. - ones = 0 # Payload is all ones (FF). - random = 0 # generate a new random payload each time sent. - random_fixed = 0 # Means generate one random payload, and send it over - zeros = 0 # Payload is all zeros (00). + 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). def post_add_file_endp(self, @@ -2262,7 +2262,7 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_group_flags(Enum): - group_total_rates = 4 # Set rates as total for group. + group_total_rates = 0x4 # Set rates as total for group. def post_add_group(self, @@ -2291,27 +2291,27 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_l4_endp_http_auth_type(Enum): - BASIC = 1 # Basic authentication - DIGEST = 2 # Digest (MD5) authentication - GSSNEGOTIATE = 4 # GSS authentication - NTLM = 8 # NTLM authentication + BASIC = 0x1 # Basic authentication + DIGEST = 0x2 # Digest (MD5) authentication + GSSNEGOTIATE = 0x4 # GSS authentication + NTLM = 0x8 # NTLM authentication class add_l4_endp_proxy_auth_type(Enum): - BASIC = 1 # 1 Basic authentication - BIND_DNS = 512 # 512 Make DNS requests go out endpoints Port. - DIGEST = 2 # 2 Digest (MD5) authentication - DISABLE_EPSV = 4096 # 4096 Disable FTP EPSV option - DISABLE_PASV = 2048 # 2048 Disable FTP PASV option (will use PORT command) - GSSNEGOTIATE = 4 # 4 GSS authentication - INCLUDE_HEADERS = 256 # 256 especially for IMAP - NTLM = 8 # 8 NTLM authentication - USE_DEFLATE_COMPRESSION = 128 # 128 Use deflate compression - USE_GZIP_COMPRESSION = 64 # 64 Use gzip compression - USE_IPV6 = 1024 # 1024 Resolve URL is IPv6. Will use IPv4 if not selected. - USE_PROXY_CACHE = 32 # 32 Use proxy cache + 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 class add_l4_endp_type(Enum): - l4_generic = 0 # Layer 4 type + l4_generic = 0x0 # Layer 4 type def post_add_l4_endp(self, @@ -2376,9 +2376,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_monitor_flags(Enum): - disable_ht40 = 2048 # Disable HT-40 even if hardware and AP support it. - disable_ht80 = 134217728 # Disable HT80 (for AC chipset NICs only) - ht160_enable = 4294967296 # Enable HT160 mode. + 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. def post_add_monitor(self, @@ -2513,47 +2513,47 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_profile_profile_flags(Enum): - p_11r = 64 # Use 802.11r roaming setup. - BSS_TRANS = 1024 # Enable BSS Transition logic - DHCP_SERVER = 1 # This should provide DHCP server. - EAP_PEAP = 512 # Enable EAP-PEAP - EAP_TTLS = 128 # Use 802.1x EAP-TTLS - NAT = 256 # Enable NAT if this object is in a virtual router - SKIP_DHCP_ROAM = 16 # Ask station to not re-do DHCP on roam. - WEP = 2 # Use WEP encryption - WPA = 4 # Use WPA encryption - WPA2 = 8 # Use WPA2 encryption - WPA3 = 32 # Use WPA3 encryption + p_11r = 0x40 # Use 802.11r roaming setup. + 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 class add_profile_wifi_mode(Enum): - p_802_11a = 1 # 802.11a - AUTO = 0 # 802.11g - 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 - as_is = 0 # Make no changes to current configuration - b = 2 # 802.11b - bg = 7 # 802.11bg - bgn = 6 # 802.11bgn - bgnAC = 11 # 802.11bgn-AC - bgnAX = 13 # 802.11bgn-AX - bond = 9 # Bonded pair of Ethernet ports. - bridged_ap = 2 # AP device in bridged mode. The EIDs may specify radio and bridged port. - client = 8 # Client-side non-WiFi device (Ethernet port, for instance). - g = 3 # 802.11g - mobile_sta = 6 # Mobile station device. Expects to connect to DUT AP(s) and upstream LANforge. - monitor = 5 # Monitor device/sniffer. The EIDs may specify which radios to use. - peer = 10 # Edge device, client or server (Ethernet port, for instance). - rdd = 7 # Pair of redirect devices, typically associated with VR to act as traffic endpoint - routed_ap = 3 # AP in routed mode. The EIDs may specify radio and upstream port. - sta = 1 # Station device, most likely non mobile. The EIDs may specify radio(s) to use. - uplink = 11 # Uplink towards rest of network (can go in virtual router and do NAT) - upstream = 4 # Upstream server device. The EIDs may specify which ports to use. - vlan = 12 # 802.1q VLAN. Specify VID with the 'freq' option. + p_802_11a = "p_802_11a" # 802.11a + AUTO = "AUTO" # 802.11g + 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, @@ -2685,41 +2685,41 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_sta_flags(Enum): - p_80211r_pmska_cache = 67108864 # Enable oportunistic PMSKA caching for WPA2 (Related to 802.11r). - p_80211u_additional = 1048576 # AP requires additional step for access (802.11u Interworking) - p_80211u_auto = 262144 # Enable 802.11u (Interworking) Auto-internetworking feature. Always enabled currently. - p_80211u_e911 = 2097152 # AP claims emergency services reachable (802.11u Interworking) - p_80211u_e911_unauth = 4194304 # AP provides Unauthenticated emergency services (802.11u Interworking) - p_80211u_enable = 131072 # Enable 802.11u (Interworking) feature. - p_80211u_gw = 524288 # AP Provides access to internet (802.11u Interworking) - p_8021x_radius = 33554432 # Use 802.1x (RADIUS for AP). - create_admin_down = 68719476736 # Station should be created admin-down. - custom_conf = 32 # Use Custom wpa_supplicant config file. - disable_twt = 17592186044416 # Disable TWT mode - disable_fast_reauth = 8589934592 # Disable fast_reauth option for virtual stations. - disable_gdaf = 16777216 # AP: Disable DGAF (used by HotSpot 2.0). - disable_ht80 = 134217728 # Disable HT80 (for AC chipset NICs only) - disable_roam = 2147483648 # Disable automatic station roaming based on scan results. - disable_sgi = 16384 # Disable SGI (Short Guard Interval). - hs20_enable = 8388608 # Enable Hotspot 2.0 (HS20) feature. Requires WPA-2. - ht160_enable = 4294967296 # Enable HT160 mode. - ht40_disable = 2048 # Disable HT-40 even if hardware and AP support it. - ibss_mode = 536870912 # Station should be in IBSS mode. - lf_sta_migrate = 32768 # OK-To-Migrate (Allow station migration between LANforge radios) - mesh_mode = 17179869184 # Station should be in MESH mode. - no_supp_op_class_ie = 274877906944 # Do not include supported-oper-class-IE in assoc requests. May work around AP bugs. - osen_enable = 1073741824 # Enable OSEN protocol (OSU Server-only Authentication) - passive_scan = 8192 # Use passive scanning (don't send probe requests). - power_save_enable = 34359738368 # Station should enable power-save. May not work in all drivers/configurations. - scan_ssid = 4096 # Enable SCAN-SSID flag in wpa_supplicant. - txo_enable = 549755813888 # Enable/disable tx-offloads, typically managed by set_wifi_txo command - use_bss_transition = 8796093022208 # Enable BSS transition. - use_wpa3 = 1099511627776 # Enable WPA-3 (SAE Personal) mode. - verbose = 65536 # Verbose-Debug: Increase debug info in wpa-supplicant and hostapd logs. - wds_mode = 137438953472 # WDS station (sort of like a lame mesh), not supported on ath10k - wep_enable = 512 # Use wpa_supplicant configured for WEP encryption. - wpa2_enable = 1024 # Use wpa_supplicant configured for WPA2 encryption. - wpa_enable = 16 # Enable WPA + 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_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 class add_sta_mode(Enum): p_802_11a = 1 # 802.11a @@ -2739,11 +2739,11 @@ class LFJsonPost(LFCliBase): g = 3 # 802.11g class add_sta_rate(Enum): - _a_g = 0 # 6 Mbps, 9 Mbps, 12 Mbps, 18 Mbps, 24 Mbps, 36 Mbps, 48 Mbps, 54 Mbps - _b = 0 # 1Mbps, 2Mbps, 5.5 Mbps, 11 Mbps - DEFAULT = 0 # Use maximum available speed - MCS0_76 = 0 # /n rates - _bitmap_ = 0 # '0xff 00 ...' to directly specify the MCS bitmap. + _a_g = "_a_g" # 6 Mbps, 9 Mbps, 12 Mbps, 18 Mbps, 24 Mbps, 36 Mbps, 48 Mbps, 54 Mbps + _b = "_b" # 1Mbps, 2Mbps, 5.5 Mbps, 11 Mbps + DEFAULT = "DEFAULT" # Use maximum available speed + MCS0_76 = "MCS0_76" # /n rates + _bitmap_ = "_bitmap_" # '0xff 00 ...' to directly specify the MCS bitmap. def post_add_sta(self, @@ -2981,18 +2981,18 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_traffic_profile_traffic_profile_flags(Enum): - BI_DIRECTIONAL = 2 # Should we do bi-directional traffic? - IPERF_UDP = 4 # If Iperf, should use UDP. If not set, then will use TCP. - UP = 1 # Upload direction (this not set means download) + 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) class add_traffic_profile_wifi_mode(Enum): - Iperf3_Client = 6 # iperf3 client - Iperf3_Server = 5 # iperf3 server - as_is = 0 # Make no changes to current configuration - http = 3 # Not yet implemented - https = 4 # Not yet implemented - tcp = 2 - udp = 1 + 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, @@ -3058,34 +3058,34 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_vap_flags(Enum): - p_80211h_enable = 268435456 # Enable 802.11h (needed for running on DFS channels) Requires 802.11d. - p_80211r_pmska_cache = 67108864 # Enable oportunistic PMSKA caching for WPA2 (Related to 802.11r). - p_80211u_additional = 1048576 # AP requires additional step for access (802.11u Interworking) - p_80211u_auto = 262144 # Enable 802.11u (Interworking) Auto-internetworking feature. Always enabled currently. - p_80211u_e911 = 2097152 # AP claims emergency services reachable (802.11u Interworking) - p_80211u_e911_unauth = 4194304 # AP provides Unauthenticated emergency services (802.11u Interworking) - p_80211u_enable = 131072 # Enable 802.11u (Interworking) feature. - p_80211u_gw = 524288 # AP Provides access to internet (802.11u Interworking) - p_8021x_radius = 33554432 # Use 802.1x (RADIUS for AP). - create_admin_down = 68719476736 # Station should be created admin-down. - disable_dgaf = 16777216 # AP Disable DGAF (used by HotSpot 2.0). - disable_ht40 = 2048 # Disable HT-40 (will use HT-20 if available). - disable_ht80 = 134217728 # Disable HT80 (for AC chipset NICs only) - enable_80211d = 64 # Enable 802.11D to broadcast country-code & channels in VAPs - enable_wpa = 16 # Enable WPA - hostapd_config = 32 # Use Custom hostapd config file. - hs20_enable = 8388608 # Enable Hotspot 2.0 (HS20) feature. Requires WPA-2. - ht160_enable = 4294967296 # Enable HT160 mode. - osen_enable = 1073741824 # Enable OSEN protocol (OSU Server-only Authentication) - pri_sec_ch_enable = 256 # Enable Primary/Secondary channel switch. - short_preamble = 128 # Allow short-preamble - use_bss_load = 2199023255552 # Enable BSS Load IE in Beacons and Probe Responses (.11e). - use_bss_transition = 8796093022208 # Enable BSS transition. - use_rrm_report = 4398046511104 # Enable Radio measurements IE in beacon and probe responses. - use_wpa3 = 1099511627776 # Enable WPA-3 (SAE Personal) mode. - verbose = 65536 # Verbose-Debug: Increase debug info in wpa-supplicant and hostapd logs. - wep_enable = 512 # Enable WEP Encryption - wpa2_enable = 1024 # Enable WPA2 Encryption + 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 class add_vap_mode(Enum): p_802_11a = 1 # 802.11a @@ -3165,39 +3165,39 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_venue_freq_24(Enum): - ALL = 65535 # ALL - Ch_1 = 1 # Channel 1 - Ch_2 = 2 # Channel 2 - Ch_3 = 4 # Channel 3 + ALL = 0xffff # ALL + Ch_1 = 0x1 # Channel 1 + Ch_2 = 0x2 # Channel 2 + Ch_3 = 0x4 # Channel 3 class add_venue_freq_5(Enum): - Ch_100 = 2048 # Channel 100 5500 - Ch_104 = 4096 # Channel 104 5520 - Ch_108 = 8192 # Channel 108 5540 - Ch_112 = 16384 # Channel 112 5560 - Ch_116 = 32768 # Channel 116 5580 - Ch_120 = 65536 # Channel 120 5600 - Ch_124 = 131072 # Channel 124 5620 - Ch_128 = 262144 # Channel 128 5640 - Ch_132 = 524288 # Channel 132 5660 - Ch_136 = 1048576 # Channel 136 5680 - Ch_140 = 2097152 # Channel 140 5700 - Ch_149 = 4194304 # Channel 149 5745 - Ch_153 = 8388608 # Channel 153 5765 - Ch_157 = 16777216 # Channel 157 5785 - Ch_161 = 33554432 # Channel 161 5805 - Ch_165 = 67108864 # Channel 165 5825 - Ch_36 = 1 # Channel 36 5180 - Ch_38 = 2 # Channel 38 5190 - Ch_40 = 4 # Channel 40 5200 - Ch_42 = 8 # Channel 42 5210 - Ch_44 = 16 # Channel 44 5220 - Ch_46 = 32 # Channel 46 5230 - Ch_48 = 64 # Channel 48 5240 - Ch_52 = 128 # Channel 52 5260 - Ch_56 = 256 # Channel 56 5280 - Ch_60 = 512 # Channel 60 5300 - Ch_64 = 1024 # Channel 64 5320 + 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 def post_add_venue(self, @@ -3324,19 +3324,19 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_vr_flags(Enum): - p_4BYTE_AS_NUMBER = 64 # Sets corresponding Xorp flag. - BGP_CONFED = 256 # Configure BGP in a confederation. - BGP_DAMPING = 512 # Enable BGP damping section in Xorp configuration file. - ENABLE_BGP = 32 # Set this to zero if you don't want BGP on this VR. - RIP_ACCEPT_DR = 2048 # Tell RIP to accept default-routes. - ROUTE_REFLECTOR = 128 # Act as BGP Route Reflector. - USE_IPV6 = 16 # Enable IPv6 OSPF routing for this virtual router. - USE_IPV6_RADVD = 8 # Enable IPv6 RADV Daemon for interfaces in this virtual router. - USE_RIP = 1024 # Enable RIP routing protocol in Xorp. - USE_XORP_MCAST = 2 # Enable Xorp Multicast routing (requires OSPF to be enabled currently) - USE_XORP_OLSR = 4096 # Enable OLSR routing protocol in Xorp. - USE_XORP_OSPF = 1 # Enable Xorp router daemon with OSPF (IPv4) protocol - USE_XORP_SHA = 4 # Enable Telcordia's Xorp SHA option (requires OSPF to be enabled) + 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) def post_add_vr(self, @@ -3379,11 +3379,11 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_vr_bgp_flags(Enum): - p_4BYTE_AS_NUMBER = 64 # Sets corresponding Xorp flag. - BGP_CONFED = 256 # Configure BGP in a confederation. - BGP_DAMPING = 512 # Enable BGP damping section in Xorp configuration file. - ENABLE_BGP = 32 # Set this to zero if you don't want BGP on this VR. - ROUTE_REFLECTOR = 128 # Act as BGP Route Reflector. + 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. def post_add_vr_bgp(self, @@ -3430,20 +3430,20 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_vrcx_flags(Enum): - custom_dhcpd = 1024 # Use custom DHCP config file - dhcpd_enabled = 512 # Serve IPv4 DHCP on this interface - ipv6_enabled = 8192 # Serve IPv6 DHCP on this interface - nat_enabled = 256 # This connection will NAT outgoing packets - subnet_0 = 1 # Specify subnet 0 - subnet_1 = 2 # Specify subnet 1 - subnet_2 = 4 # Specify subnet 2 - subnet_3 = 8 # Specify subnet 3 - subnet_4 = 16 # Specify subnet 4 - subnet_5 = 32 # Specify subnet 5 - subnet_6 = 64 # Specify subnet 6 - subnet_7 = 128 # Specify subnet 7 - use_multicast = 2048 # Use this interface for multicast and-rp - use_vrrp = 4096 # Use this interface for VRRP + 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 def post_add_vrcx(self, @@ -3559,41 +3559,41 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_sta_flags(Enum): - p_80211r_pmska_cache = 67108864 # Enable oportunistic PMSKA caching for WPA2 (Related to 802.11r). - p_80211u_additional = 1048576 # AP requires additional step for access (802.11u Interworking) - p_80211u_auto = 262144 # Enable 802.11u (Interworking) Auto-internetworking feature. Always enabled currently. - p_80211u_e911 = 2097152 # AP claims emergency services reachable (802.11u Interworking) - p_80211u_e911_unauth = 4194304 # AP provides Unauthenticated emergency services (802.11u Interworking) - p_80211u_enable = 131072 # Enable 802.11u (Interworking) feature. - p_80211u_gw = 524288 # AP Provides access to internet (802.11u Interworking) - p_8021x_radius = 33554432 # Use 802.1x (RADIUS for AP). - create_admin_down = 68719476736 # Station should be created admin-down. - custom_conf = 32 # Use Custom wpa_supplicant config file. - disable_twt = 17592186044416 # Disable TWT mode - disable_fast_reauth = 8589934592 # Disable fast_reauth option for virtual stations. - disable_gdaf = 16777216 # AP: Disable DGAF (used by HotSpot 2.0). - disable_ht80 = 134217728 # Disable HT80 (for AC chipset NICs only) - disable_roam = 2147483648 # Disable automatic station roaming based on scan results. - disable_sgi = 16384 # Disable SGI (Short Guard Interval). - hs20_enable = 8388608 # Enable Hotspot 2.0 (HS20) feature. Requires WPA-2. - ht160_enable = 4294967296 # Enable HT160 mode. - ht40_disable = 2048 # Disable HT-40 even if hardware and AP support it. - ibss_mode = 536870912 # Station should be in IBSS mode. - lf_sta_migrate = 32768 # OK-To-Migrate (Allow station migration between LANforge radios) - mesh_mode = 17179869184 # Station should be in MESH mode. - no_supp_op_class_ie = 274877906944 # Do not include supported-oper-class-IE in assoc requests. May work around AP bugs. - osen_enable = 1073741824 # Enable OSEN protocol (OSU Server-only Authentication) - passive_scan = 8192 # Use passive scanning (don't send probe requests). - power_save_enable = 34359738368 # Station should enable power-save. May not work in all drivers/configurations. - scan_ssid = 4096 # Enable SCAN-SSID flag in wpa_supplicant. - txo_enable = 549755813888 # Enable/disable tx-offloads, typically managed by set_wifi_txo command - use_bss_transition = 8796093022208 # Enable BSS transition. - use_wpa3 = 1099511627776 # Enable WPA-3 (SAE Personal) mode. - verbose = 65536 # Verbose-Debug: Increase debug info in wpa-supplicant and hostapd logs. - wds_mode = 137438953472 # WDS station (sort of like a lame mesh), not supported on ath10k - wep_enable = 512 # Use wpa_supplicant configured for WEP encryption. - wpa2_enable = 1024 # Use wpa_supplicant configured for WPA2 encryption. - wpa_enable = 16 # Enable WPA + 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_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 class add_sta_mode(Enum): p_802_11a = 1 # 802.11a @@ -3613,11 +3613,11 @@ class LFJsonPost(LFCliBase): g = 3 # 802.11g class add_sta_rate(Enum): - _a_g = 0 # 6 Mbps, 9 Mbps, 12 Mbps, 18 Mbps, 24 Mbps, 36 Mbps, 48 Mbps, 54 Mbps - _b = 0 # 1Mbps, 2Mbps, 5.5 Mbps, 11 Mbps - DEFAULT = 0 # Use maximum available speed - MCS0_76 = 0 # /n rates - _bitmap_ = 0 # '0xff 00 ...' to directly specify the MCS bitmap. + _a_g = "_a_g" # 6 Mbps, 9 Mbps, 12 Mbps, 18 Mbps, 24 Mbps, 36 Mbps, 48 Mbps, 54 Mbps + _b = "_b" # 1Mbps, 2Mbps, 5.5 Mbps, 11 Mbps + DEFAULT = "DEFAULT" # Use maximum available speed + MCS0_76 = "MCS0_76" # /n rates + _bitmap_ = "_bitmap_" # '0xff 00 ...' to directly specify the MCS bitmap. def post_add_vsta(self, @@ -3684,7 +3684,7 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_wl_endp_wle_flags(Enum): - SHOW_WP = 1 # Show WanPaths in wanlink endpoint table in GUI + SHOW_WP = 0x1 # Show WanPaths in wanlink endpoint table in GUI def post_add_wl_endp(self, @@ -3858,13 +3858,13 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class c_show_ports_probe_flags(Enum): - BRIDGE = 8 # 8 include bridges - EASY_IP_INFO = 16 # 16 Everything but gateway information, which is expensive to probe. - ETHTOOL = 4 # 4 include ethtool results - GW = 32 # 32 include gateway information - GW_FORCE_REFRESH = 64 # 64 Force GW (re)probe. Otherwise, cached values *might* be used. - MII = 2 # 2 include MII - WIFI = 1 # 1 include wifi stations + 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 def post_c_show_ports(self, @@ -4029,9 +4029,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class clear_port_counters_extra(Enum): - dhcp4_lease = 0 # Remove dhcp lease files for IPv4 DHCP - dhcp6_lease = 0 # Remove dhcp lease files for IPv6 DHCP - dhcp_leases = 0 # Remove dhcp lease files for IPv4 and IPv6 DHCP + 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, @@ -4674,23 +4674,23 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class log_level_level(Enum): - ALL = 4294967295 # Log everything - CUST1 = 65536 # Cust-1, latency info (65536) - DB = 128 # Database related logging (128) - DBG = 32 # debug (32) - DBG2 = 4096 # very verbose logging (4096) - DIS = 1 # disasters (1) - ERR = 2 # errors (2) - INF = 8 # info (8) - LIO = 8192 # IO logging (8192) - LL_PROF = 32768 # Profiling information (32768) - OUT1 = 16384 # Some std-out logging (16384) - PARSE = 2048 # PARSE specific (2048) - SCRIPT = 1024 # Scripting specific stuff (1024) - SEC = 64 # log security violations (64) - TRC = 16 # function trace (16) - WRN = 4 # warnings (4) - XMT = 256 # Output going to clients (256) + 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) def post_log_level(self, @@ -4893,13 +4893,13 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class nc_show_ports_probe_flags(Enum): - BRIDGE = 8 # 8 include bridges - EASY_IP_INFO = 16 # 16 Everything but gateway information, which is expensive to probe. - ETHTOOL = 4 # 4 include ethtool results - GW = 32 # 32 include gateway information - GW_FORCE_REFRESH = 64 # 64 Force GW (re)probe. Otherwise, cached values *might* be used. - MII = 2 # 2 include MII - WIFI = 1 # 1 include wifi stations + 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 def post_nc_show_ports(self, @@ -5255,9 +5255,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class reset_port_pre_ifdown(Enum): - P_IN = 0 # Only call the portal login (do not reset drivers/supplicant/dhcp) - P_OUT = 0 # Only call the portal logout (do not reset drivers/supplicant/dhcp) - YES = 0 # (include logout) Call portal-bot.pl ... --logout before going down. + 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, @@ -6063,9 +6063,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class scan_wifi_extra(Enum): - NA = 0 # (or left blank) the system does a full scan - dump = 0 # then only cached values are returned - trigger_freq__freq_ = 0 # scan exactly those frequencies + 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, @@ -6098,12 +6098,12 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_arm_info_arm_flags(Enum): - random_payload = 65536 # Use random payload sizes instead of linear increase - rel_tstamp = 1024 # Use Relative Timestamps. This will increase performance - slow_start = 8192 # Use slow-start logic. This ramps up - udp_checksum = 16384 # Use UDP Checksums. - use_gw_mac = 4096 # Use default gateway's MAC for destination MAC. - use_tcp = 32768 # Use TCP instead of UDP protocol. (Note this is NOT stateful TCP!) + 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!) def post_set_arm_info(self, @@ -6261,11 +6261,11 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_cx_state_cx_state(Enum): - DELETED = 0 # Deletes the CX(s). - QUIESCE = 0 # Stop transmitting and gracefully stop cross-connect. - RUNNING = 0 # Sets the CX(s) in the running state. - STOPPED = 0 # Sets the CX(s) in the stopped state. - SWITCH = 0 # Sets the CX(s) in the running state, stopping any conflicting tests. + 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, @@ -6401,18 +6401,18 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_endp_flag_flag(Enum): - AutoHelper = 0 # Automatically run on helper process - ClearPortOnStart = 0 # clear stats on start - DoChecksum = 0 # Enable checksumming - EnableConcurrentSrcIP = 0 # Concurrent source IPs? - EnableLinearSrcIP = 0 # linearized source IPs - EnableLinearSrcIPPort = 0 # linearized IP ports - EnableRndSrcIP = 0 # randomize source IP - KernelMode = 0 # Enable kernel mode - QuiesceAfterDuration = 0 # quiesce after time period - QuiesceAfterRange = 0 # quiesce after range of bytes - Unmanaged = 0 # Set endpoint unmanaged - UseAutoNAT = 0 # NAT friendly behavior + 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, @@ -6441,17 +6441,17 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_endp_payload_payload_type(Enum): - PRBS_11_8_10 = 0 # PRBS (see above) - PRBS_15_0_14 = 0 # PRBS (see above) - PRBS_4_0_3 = 0 # Use linear feedback shift register to generate pseudo random sequence. - PRBS_7_0_6 = 0 # PRBS (see above) - custom = 0 # Enter your own payload with the set_endp_payload - decreasing = 0 # bytes start at FF and decrease, wrapping if needed. - increasing = 0 # bytes start at 00 and increase, wrapping if needed. - ones = 0 # Payload is all ones (FF). - random = 0 # generate a new random payload each time sent. - random_fixed = 0 # means generate one random payload, and send it over and over again. - zeros = 0 # Payload is all zeros (00). + 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, @@ -6582,10 +6582,10 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_endp_tos_tos(Enum): - LOWCOST = 0 - LOWDELAY = 0 - RELIABILITY = 0 - THROUGHPUT = 0 + LOWCOST = "LOWCOST" + LOWDELAY = "LOWDELAY" + RELIABILITY = "RELIABILITY" + THROUGHPUT = "THROUGHPUT" def post_set_endp_tos(self, @@ -6641,61 +6641,61 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_event_interest_ei_flags(Enum): - CLEAR = 0 # will clear interest - SET = 1 # set interest flag + CLEAR = 0x0 # will clear interest + SET = 0x1 # set interest flag class set_event_interest_events1(Enum): - BAD_TOS = 4194304 # Endpoint has bad ToS values configured. - Bad_MAC = 1048576 # Invalid MAC address configured. - Cleared = 8192 # Counters were cleared for some entity. - Connect = 256 # WiFi interface connected to AP. - Custom = 4 # Custom event (generated by USER in GUI or CLI). - DHCP_Fail = 32768 # DHCP Failed, maybe out of leases? - DHCP_Timeout = 65536 # Timed out talking to DHCP server. - DHCP4_Error = 131072 # DHCP gave out duplicated IP address. - DHCP6_Error = 262144 # DHCPv6 gave out duplicated IPv6 address. - Disconnect = 128 # WiFi interface disconnected from AP. - Endp_Started = 64 # Endpoint was started. - Endp_Stopped = 32 # Endpoint stopped for some reason. - Link_Down = 1 # Notify when Interface Link goes DOWN. - Link_Errors = 16384 # Port shows low-level link errors. - Link_Up = 2 # Notify when Interface Link goes UP. - Login = 1024 # CLI/GUI user connected to LANforge. - Logout = 512 # CLI/GUI user disconnected from LANforge. - Migrated = 2097152 # Port (station network interface) migrated. - NO_RX_SINCE = 8388608 # Endpoint threshold alert. - NO_RX_SINCE_CLEARED = 16777216 # Endpoint threshold alert cleared. - RX_BPS_OOR_1M = 536870912 # Endpoint threshold alert. - RX_BPS_OOR_1M_CLEARED = 1073741824 # Endpoint threshold alert cleared. - RX_BPS_OOR_30S = 134217728 # Endpoint threshold alert. - RX_BPS_OOR_30S_CLEARED = 268435456 # Endpoint threshold alert cleared. - RX_BPS_OOR_3S = 33554432 # Endpoint threshold alert. - RX_BPS_OOR_3S_CLEARED = 67108864 # Endpoint threshold alert cleared. - Resource_Down = 8 # Resource has crashed, rebooted, etc. - Resource_Up = 16 # Resource has connected to manager. - Start_Reports = 4096 # Start saving report data files (CSV). - Stop_Reports = 2048 # Stop saving report data files (CSV). - TX_BPS_OOR_3S = 2147483648 # Endpoint threshold alert. - WiFi_Config = 524288 # WiFi Configuration Error. + 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. class set_event_interest_events2(Enum): - FW_CRASH = 2048 # Firmware for entity has crashed. - FW_FAIL = 4096 # Firmware failed powerup, may require reboot. - IFDOWN_FAIL = 32768 # IFDOWN-PRE Script (ifup --logout) returned error code. - IFDOWN_OK = 65536 # IFDOWN-PRE Script (ifup --logout) completed successfully. - IFUP_FAIL = 8192 # IFUP-POST Script returned error code. - IFUP_OK = 16384 # IFUP-POST Script completed successfully. - RX_DROP_OOR_1M = 512 # Endpoint threshold alert. - RX_DROP_OOR_1M_CLEARED = 1024 # Endpoint threshold alert cleared. - RX_DROP_OOR_3S = 128 # Endpoint threshold alert. - RX_DROP_OOR_3S_CLEARED = 256 # Endpoint threshold alert cleared. - RX_LAT_OOR = 32 # Endpoint threshold alert. - RX_LAT_OOR_CLEARED = 64 # Endpoint threshold alert cleared. - TX_BPS_OOR_1M = 8 # Endpoint threshold alert. - TX_BPS_OOR_1M_CLEARED = 16 # Endpoint threshold alert cleared. - TX_BPS_OOR_30S = 2 # Endpoint threshold alert. - TX_BPS_OOR_30S_CLEARED = 4 # Endpoint threshold alert cleared. - TX_BPS_OOR_3S_CLEARED = 1 # Endpoint threshold alert cleared. + 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. def post_set_event_interest(self, @@ -6756,12 +6756,12 @@ class LFJsonPost(LFCliBase): WiFi_Config = 19 # WiFi Configuration Error. class set_event_priority_priority(Enum): - AUTO = 0 # Let event creator decide the priority. - CRITICAL = 4 - DEBUG = 1 - FATAL = 5 - INFO = 2 - WARNING = 3 + AUTO = "AUTO" # Let event creator decide the priority. + CRITICAL = "CRITICAL" + DEBUG = "DEBUG" + FATAL = "FATAL" + INFO = "INFO" + WARNING = "WARNING" def post_set_event_priority(self, @@ -6827,12 +6827,12 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_flag_flag(Enum): - brief = 0 # Request more abbreviated output to various commands. - prompt_newlines = 0 # Add a newline after every prompt. Can help with scripts - push_all_rpts = 0 # If enabled, server will send port, endpoint, and other - push_endp_rpts = 0 # If enabled, server will send endpoint reports without - request_keyed_text = 0 # Normally most keyed-text events are only sent to the GUI - stream_events = 0 # Normally the CLI will not show Events (as seen in the Event + 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, @@ -7042,117 +7042,117 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_port_cmd_flags(Enum): - abort_if_scripts = 1024 # Forceably abort all ifup/down scripts on this Port. - force_MII_probe = 4 # Force MII probe - from_dhcp = 512 # Settings come from DHCP client. - from_user = 128 # from_user (Required to change Mgt Port config - new_gw_probe = 32 # Force new GW probe - new_gw_probe_dev = 64 # Force new GW probe for ONLY this interface - no_hw_probe = 8 # Don't probe hardware - probe_wifi = 16 # Probe WIFI - reset_transceiver = 1 # Reset transciever - restart_link_neg = 2 # Restart link negotiation - skip_port_bounce = 256 # skip-port-bounce (Don't ifdown/up - use_pre_ifdown = 2048 # Call pre-ifdown script before bringing interface down. + 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. class set_port_current_flags(Enum): - adv_100bt_fd = 8388608 # advert-100bt-FD - adv_100bt_hd = 4194304 # advert-100bt-HD - adv_10bt_fd = 2097152 # advert-10bt-FD - adv_10bt_hd = 1048576 # advert-10bt-HD - adv_10g_fd = 34359738368 # advert-10G-FD - adv_2_5g_fd = 17179869184 # advert-2.5G-FD - adv_5g_fd = 288230376151711744 # Advertise 5Gbps link speed. - adv_flow_ctl = 134217728 # advert-flow-control - auto_neg = 256 # auto-negotiate - aux_mgt = 140737488355328 # Enable Auxillary-Management flag for this port. - fixed_100bt_fd = 16 # Fixed-100bt-FD - fixed_100bt_hd = 8 # Fixed-100bt-HD - fixed_10bt_fd = 4 # Fixed-10bt-FD - fixed_10bt_hd = 2 # Fixed-10bt-HD (half duplex) - ftp_enabled = 70368744177664 # Enable FTP (vsftpd) service for this port. - gro_enabled = 274877906944 # GRO-Enabled - gso_enabled = 1099511627776 # GSO-Enabled - http_enabled = 35184372088832 # Enable HTTP (nginx) service for this port. - if_down = 1 # Interface Down - ignore_dhcp = 562949953421312 # Don't set DHCP acquired IP on interface, - ipsec_client = 18014398509481984 # Enable client IPSEC xfrm on this port. - ipsec_concentrator = 36028797018963968 # Enable concentrator (upstream) IPSEC xfrm on this port. - lro_enabled = 137438953472 # LRO-Enabled - no_dhcp_rel = 8796093022208 # No-DHCP-Release - no_dhcp_restart = 281474976710656 # Disable restart of DHCP on link connect (ie, wifi). - no_ifup_post = 1125899906842624 # Skip ifup-post script if we can detect that we - promisc = 268435456 # PROMISC - radius_enabled = 9007199254740992 # Enable RADIUS service (using hostapd as radius server) - rxfcs = 4398046511104 # RXFCS - service_dns = 72057594037927936 # Enable DNS (dnsmasq) service on this port. - staged_ifup = 17592186044416 # Staged-IFUP - tso_enabled = 68719476736 # TSO-Enabled - ufo_enabled = 549755813888 # UFO-Enabled - use_dhcp = 2147483648 # USE-DHCP - use_dhcpv6 = 2199023255552 # USE-DHCPv6 + 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 class set_port_dhcp_client_id(Enum): - NA = 0 # Do not change from current value. - NONE = 0 # Do not use dhcp client ID. - _string_ = 0 # Use the string for the client ID. - __DEVNAME = 0 # Use the interface's name as the client ID. - __MAC = 0 # Use interface's MAC address for the client ID. + NA = "NA" # Do not change from current value. + NONE = "NONE" # Do not use dhcp client ID. + _string_ = "_string_" # Use the string for the client ID. + __DEVNAME = "__DEVNAME" # Use the interface's name as the client ID. + __MAC = "__MAC" # Use interface's MAC address for the client ID. class set_port_dhcp_hostname(Enum): - NA = 0 # Do not change from current value. - NONE = 0 # Do not use dhcp Hostname - _string_ = 0 # Use the string for the Hostname. - __ALIAS__ = 0 # Use alias if set, or EID behaviour if alias is not set.. - __EID__ = 0 # Use hostname 'CT-[resource-id].[port-name]' + NA = "NA" # Do not change from current value. + NONE = "NONE" # Do not use dhcp Hostname + _string_ = "_string_" # Use the string for the Hostname. + __ALIAS__ = "__ALIAS__" # Use alias if set, or EID behaviour if alias is not set.. + __EID__ = "__EID__" # Use hostname 'CT-[resource-id].[port-name]' class set_port_dhcp_vendor_id(Enum): - NA = 0 # Do not change from current value. - NONE = 0 # Do not use dhcp vendor ID - _string_ = 0 # Use the string for the vendor ID. + NA = "NA" # Do not change from current value. + NONE = "NONE" # Do not use dhcp vendor ID + _string_ = "_string_" # Use the string for the vendor ID. class set_port_flags2(Enum): - bypass_disconnect = 512 # Logically disconnect the cable (link-down) - bypass_enabled = 16 # Enable Bypass Device - bypass_power_down = 128 # Should bypass be on when we shutdown or loose power? - bypass_power_on = 256 # Should bypass be on when we first power up? - supports_bypass = 2 # Support Bypass Devices - use_stp = 1 # Use Spanning Tree Protocol + 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 class set_port_interest(Enum): - alias = 4096 # Port alias - aux_mgt = 536870912 # Enable/disable Auxillary-Management for a port - bridge = 65536 # BRIDGE - bypass = 262144 # Bypass - command_flags = 1 # apply command flags - cpu_mask = 1048576 # CPU Mask, useful for pinning process to CPU core - current_flags = 2 # apply current flags - dhcp = 16384 # including client-id. - dhcp_rls = 67108864 # DHCP release - dhcpv6 = 16777216 # Use DHCPv6 - gen_offload = 524288 # Generic offload flags, everything but LRO - ifdown = 8388608 # Down interface - interal_use_1 = 2048 # (INTERNAL USE) - ip_Mask = 8 # IP mask - ip_address = 4 # IP address - ip_gateway = 16 # IP gateway - ipv6_addrs = 131072 # IPv6 Address - link_speed = 128 # Link speed - lro_offload = 2097152 # LRO (Must be disabled when used in Wanlink, - mac_address = 32 # MAC address - mtu = 256 # MTU - no_apply_dhcp = 2147483648 # Enable/disable NO-APPLY-DHCP flag for a port - no_dhcp_conn = 1073741824 # Enable/disable NO-DHCP-ON-CONNECT flag for a port - promisc_mode = 1024 # PROMISC mode - rpt_timer = 32768 # Report Timer - rx_all = 8192 # Rx-ALL - rxfcs = 33554432 # RXFCS - skip_ifup_roam = 4294967296 # Enable/disable SKIP-IFUP-ON-ROAM flag for a port - sta_br_id = 4194304 # WiFi Bridge identifier. 0 means no bridging. - supported_flags = 64 # apply supported flags - svc_ftpd = 268435456 # Enable/disable FTP Service for a port - svc_httpd = 134217728 # Enable/disable HTTP Service for a port - tx_queue_length = 512 # TX Queue Length + 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 def post_set_port(self, @@ -7305,7 +7305,7 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_resource_resource_flags(Enum): - skip_load_db_on_start = 1 # Should we skip loading the DB on start? + skip_load_db_on_start = 0x1 # Should we skip loading the DB on start? def post_set_resource(self, @@ -7350,8 +7350,8 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_rfgen_rfgen_flags(Enum): - one_burst = 8 # Run for about 1 second and stop. Uses 5-sec sweep time for single pulse train. - running = 2 # Should we start the RF Generator or not? + 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? def post_set_rfgen(self, @@ -7400,31 +7400,31 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_script_flags(Enum): - SCR_COMPLETED = 128 # Set automatically by LANforge. - SCR_HIDE_CONSTRAINTS = 8192 # Hide constraints messages. - SCR_HIDE_CSV = 32 # Don't print the CSV data in the report. - SCR_HIDE_HUNT = 2048 # Hide the individual hunt steps..just show results. - SCR_HIDE_ITER_DETAILS = 8 # Hide iteration detail reports. - SCR_HIDE_LAT = 4096 # Hide latency distribution reports. - SCR_HIDE_LEGEND = 16 # Don't print the legend in the report. - SCR_LOOP = 256 # Loop script until manually stopped. - SCR_NO_KEYED_RPT = 2 # Script should NOT send reports to the CLI/GUI. - SCR_RUN_ON_MGR = 64 # Set automatically by LANforge. - SCR_SHOW_ATTENUATION = 16384 # Show attenuation packet stats. - SCR_SHOW_DUPS = 512 # Report duplicate packets. - SCR_SHOW_GOLDEN_3P = 131072 # Add 'golden' third-party AP graph for comparison (where available). - SCR_SHOW_GOLDEN_LF = 65536 # Add 'golden' LANforge graph for comparison (where available). - SCR_SHOW_OOO = 1024 # Report out-of-order packets. - SCR_STOPPED = 1 # Script should NOT have any affect on the endpoint. - SCR_SYMMETRIC = 4 # This script should apply settings to the peer endpoing as well. - SCR_USE_MSS = 32768 # When setting packet size, set TCP MSS instead if endpoint supports that. + 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. class set_script_type(Enum): - NONE = 0 # Delete any existing script. - Script2544 = 0 # For RFC 2544 type testing. - ScriptAtten = 0 # For Attenuators only. - ScriptHunt = 0 # Hunt for maximum speed with constraints. - ScriptWL = 0 # For iterating through WanLink settings + 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, @@ -7654,12 +7654,12 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wanpath_corruption_flags(Enum): - BIT_FLIP = 4 # Flip a random bit in a byte. - BIT_TRANSPOSE = 8 # Transpose two side-by-side bits in a byte. - DO_CHAIN_ON_HIT = 16 # Do next corruption if this corruption is applied. - OVERWRITE_FIXED = 2 # Write a fixed value to a byte. - OVERWRITE_RANDOM = 1 # Write a random value to a byte. - RECALC_CSUMS = 32 # Attempt to re-calculate UDP and TCP checksums. + 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. def post_set_wanpath_corruption(self, @@ -7733,9 +7733,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wanpath_running_running(Enum): - AS_PARENT = 0 # then it will be started and stopped as the parent WanLink is. - RUNNING = 0 # then it will be running at all times - STOPPED = 0 # then it will not be running at any time. + 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, @@ -7764,20 +7764,20 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wifi_corruptions_corrupt_flags(Enum): - MSG_TYPE_DEAUTH = 2 # de-authentication message - MSG_TYPE_EAPOL = 1 # Any EAPOL message - MSG_TYPE_EAPOL_1_OF_2 = 64 # EAPOL message 1/2 - MSG_TYPE_EAPOL_1_OF_4 = 4 # EAPOL message 1/4 - MSG_TYPE_EAPOL_2_OF_2 = 128 # EAPOL message 2/2 - MSG_TYPE_EAPOL_2_OF_4 = 8 # EAPOL message 2/4 - MSG_TYPE_EAPOL_3_OF_4 = 16 # EAPOL message 3/4 - MSG_TYPE_EAPOL_4_OF_4 = 32 # EAPOL message 4/4 - MSG_TYPE_EAPOL_ASSOC = 512 # EAP Association - MSG_TYPE_EAPOL_KEY_REQ = 256 # EAP Key Request (not sure if this works properly) - MST_TYPE_EAPOL_ID_REQ = 1024 # EAP Identity request - MST_TYPE_EAPOL_ID_RESP = 2048 # EAP Identity response - MST_TYPE_EAPOL_OTHER_REQ = 4096 # EAP Requests that do not match other things. - MST_TYPE_EAPOL_OTHER_RESP = 8192 # EAP Responses that do not match other things. + 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. def post_set_wifi_corruptions(self, @@ -7989,14 +7989,14 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wifi_radio_flags(Enum): - ct_sta_mode = 262144 # Enable CT-STA mode if radio supports it. Efficiently replaces sw-crypt in some firmware. - firmware_cfg = 524288 # Apply firmware config. - hw_sim = 1 # Create hw-sim virtual radio if radio does not already exist. - ignore_radar = 1048576 # Ignore RADAR events reported by firmware. - no_scan_share = 64 # Disable sharing scan results. - no_sw_crypt = 131072 # Disable software-crypt for this radio. Disables some virtual-station features. - use_syslog = 536870912 # Put supplicant logs in syslog instead of a file. - verbose = 65536 # Verbose-Debug: Increase debug info in wpa-supplicant and hostapd logs. + 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. class set_wifi_radio_mode(Enum): p_802_11a = 1 # 802.11a @@ -8143,12 +8143,12 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wl_corruption_flags(Enum): - BIT_FLIP = 4 # Flip a random bit in a byte. - BIT_TRANSPOSE = 8 # Transpose two side-by-side bits in a byte. - DO_CHAIN_ON_HIT = 16 # Do next corruption if this corruption is applied. - OVERWRITE_FIXED = 2 # Write a fixed value to a byte. - OVERWRITE_RANDOM = 1 # Write a random value to a byte. - RECALC_CSUMS = 32 # Attempt to re-calculate UDP and TCP checksums. + 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. def post_set_wl_corruption(self, @@ -8185,8 +8185,8 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wl_qdisc_qdisc(Enum): - FIFO = 0 # is the default queuing discipline, no arguments - WRR__queue_queue_____ = 0 # Weighted Round Robbin is also available + 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, @@ -8213,12 +8213,12 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wanpath_corruption_flags(Enum): - BIT_FLIP = 4 # Flip a random bit in a byte. - BIT_TRANSPOSE = 8 # Transpose two side-by-side bits in a byte. - DO_CHAIN_ON_HIT = 16 # Do next corruption if this corruption is applied. - OVERWRITE_FIXED = 2 # Write a fixed value to a byte. - OVERWRITE_RANDOM = 1 # Write a random value to a byte. - RECALC_CSUMS = 32 # Attempt to re-calculate UDP and TCP checksums. + 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. def post_set_wp_corruption(self, @@ -8292,9 +8292,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wanpath_running_running(Enum): - AS_PARENT = 0 # then it will be started and stopped as the parent WanLink is. - RUNNING = 0 # then it will be running at all times - STOPPED = 0 # then it will not be running at any time. + 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_wp_running(self, @@ -8323,18 +8323,18 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class show_alerts_type(Enum): - All = 0 - CX = 0 - Card = 0 - Channel_Group = 0 - CollisionDomain = 0 - Endp = 0 - PESQ = 0 - PPP_Link = 0 - Port = 0 - Shelf = 0 - Span = 0 - Test_Mgr = 0 + 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, @@ -8679,18 +8679,18 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class show_events_type(Enum): - All = 0 - CX = 0 - Card = 0 - Channel_Group = 0 - CollisionDomain = 0 - Endp = 0 - PESQ = 0 - PPP_Link = 0 - Port = 0 - Shelf = 0 - Span = 0 - Test_Mgr = 0 + 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, @@ -9274,10 +9274,10 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class sniff_port_flags(Enum): - DUMPCAP = 2 # Use command-line dumpcap, more efficient than tshark - MATE_TERMINAL = 4 # Launch tshark/dumpcap in mate-terminal - MATE_XTERM = 8 # Launch tshark/dumpcap in xterm - TSHARK = 1 # Use command-line tshark instead of wireshark + 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 def post_sniff_port(self, From 190e45f1fb2a395a06c96b8abe60610a927df068 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 21 Jun 2021 23:34:39 -0700 Subject: [PATCH 009/152] JAG: enum values corrected to have API values, toggle values {0,1} no longer bit-flags, no enums items _name_like_this_ Signed-off-by: Jed Reynolds --- py-json/LANforge/lf_json_autogen.py | 769 ++++++++++++++++++++++++++-- 1 file changed, 736 insertions(+), 33 deletions(-) diff --git a/py-json/LANforge/lf_json_autogen.py b/py-json/LANforge/lf_json_autogen.py index 144c48e9..3b687206 100644 --- a/py-json/LANforge/lf_json_autogen.py +++ b/py-json/LANforge/lf_json_autogen.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated by LANforge JsonApiPythonGenerator, Mon Jun 21 21:27:41 PDT 2021 + Generated by LANforge JsonApiPythonGenerator, Mon Jun 21 23:25:47 PDT 2021 This file expects to live in py-json/LANforge directory. ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" import sys @@ -10,6 +10,7 @@ from enum import Enum from LANforge import LFRequest from LANforge.lfcli_base import LFCliBase from lfcli_base import LFCliBase +from typing import NewType, Type class LFJsonGet(LFCliBase): def __init__(self, lfclient_host='localhost', @@ -1435,11 +1436,29 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_bgp_peer_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_add_bgp_peer(self, p_as=None, @@ -1556,8 +1575,8 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_cd_flags(Enum): - ERR = 0x2 # Set to kernel mode. - RUNNING = 0x1 # Set to running state. + ERR = 2 # Set to kernel mode. + RUNNING = 1 # Set to running state. def post_add_cd(self, @@ -1642,10 +1661,28 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_chamber_chamber_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_add_chamber(self, chamber_type=None, @@ -1707,8 +1744,8 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_chamber_cx_chamber_cx_flags(Enum): - CONNECTED = 0x1 # (1) Connected to something. If flag is not set, connection is open to the air (maybe with antenna) - TERMINATED = 0x2 # (2) Connection is terminated, signal shall not pass! + 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, @@ -1779,7 +1816,7 @@ class LFJsonPost(LFCliBase): class add_channel_group_types(Enum): 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 + 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. @@ -1856,6 +1893,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_dut_dut_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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 @@ -1870,6 +1910,21 @@ class LFJsonPost(LFCliBase): 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. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_add_dut(self, antenna_count1=None, @@ -1970,6 +2025,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_dut_ssid_dut_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + p_11r = 0x200 # Use .11r connection logic EAP_PEAP = 0x800 # Use EAP-PEAP connection logic EAP_TTLS = 0x400 # Use EAP-TTLS connection logic @@ -1978,6 +2036,21 @@ class LFJsonPost(LFCliBase): WPA2 = 0x20 # Use WPA2 encryption WPA3 = 0x100 # Use WPA3 encryption + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_add_dut_ssid(self, bssid=None, @@ -2121,6 +2194,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_file_endp_fio_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. @@ -2132,6 +2208,21 @@ class LFJsonPost(LFCliBase): 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. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class add_file_endp_payload_pattern(Enum): PRBS_11_8_10 = "PRBS_11_8_10" # PRBS (see above) PRBS_15_0_14 = "PRBS_15_0_14" # PRBS (see above) @@ -2262,8 +2353,26 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_group_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + group_total_rates = 0x4 # Set rates as total for group. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_add_group(self, flags=None, @@ -2291,12 +2400,33 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_l4_endp_http_auth_type(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + BASIC = 0x1 # Basic authentication DIGEST = 0x2 # Digest (MD5) authentication GSSNEGOTIATE = 0x4 # GSS authentication NTLM = 0x8 # NTLM authentication + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class add_l4_endp_proxy_auth_type(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + BASIC = 0x1 # 1 Basic authentication BIND_DNS = 0x200 # 512 Make DNS requests go out endpoints Port. DIGEST = 0x2 # 2 Digest (MD5) authentication @@ -2310,9 +2440,42 @@ class LFJsonPost(LFCliBase): USE_IPV6 = 0x400 # 1024 Resolve URL is IPv6. Will use IPv4 if not selected. USE_PROXY_CACHE = 0x20 # 32 Use proxy cache + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class add_l4_endp_type(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + l4_generic = 0x0 # Layer 4 type + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_add_l4_endp(self, alias=None, @@ -2376,10 +2539,28 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_monitor_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_add_monitor(self, aid=None, @@ -2513,6 +2694,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_profile_profile_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + p_11r = 0x40 # Use 802.11r roaming setup. BSS_TRANS = 0x400 # Enable BSS Transition logic DHCP_SERVER = 0x1 # This should provide DHCP server. @@ -2525,8 +2709,23 @@ class LFJsonPost(LFCliBase): WPA2 = 0x8 # Use WPA2 encryption WPA3 = 0x20 # Use WPA3 encryption + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class add_profile_wifi_mode(Enum): - p_802_11a = "p_802_11a" # 802.11a + p_802_11a = "802.11a" # 802.11a AUTO = "AUTO" # 802.11g abg = "abg" # 802.11abg abgn = "abgn" # 802.11abgn @@ -2685,6 +2884,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_sta_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. @@ -2721,6 +2923,21 @@ class LFJsonPost(LFCliBase): wpa2_enable = 0x400 # Use wpa_supplicant configured for WPA2 encryption. wpa_enable = 0x10 # Enable WPA + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class add_sta_mode(Enum): p_802_11a = 1 # 802.11a AUTO = 0 # 802.11g @@ -2739,11 +2956,11 @@ class LFJsonPost(LFCliBase): g = 3 # 802.11g class add_sta_rate(Enum): - _a_g = "_a_g" # 6 Mbps, 9 Mbps, 12 Mbps, 18 Mbps, 24 Mbps, 36 Mbps, 48 Mbps, 54 Mbps - _b = "_b" # 1Mbps, 2Mbps, 5.5 Mbps, 11 Mbps + 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 - _bitmap_ = "_bitmap_" # '0xff 00 ...' to directly specify the MCS bitmap. + MCS0_76 = "MCS0-76" # /n rates + p_bitmap_ = "[bitmap]" # '0xff 00 ...' to directly specify the MCS bitmap. def post_add_sta(self, @@ -2810,9 +3027,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_t1_span_buildout(Enum): - _15db = 6 # -15db (CSU) - _22_5db = 7 # -22.5db (CSU) - _7_5db = 5 # -7.5db (CSU) + 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 @@ -2981,13 +3198,31 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_traffic_profile_traffic_profile_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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) + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class add_traffic_profile_wifi_mode(Enum): - Iperf3_Client = "Iperf3_Client" # iperf3 client - Iperf3_Server = "Iperf3_Server" # iperf3 server + 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 @@ -3058,6 +3293,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_vap_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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) @@ -3087,6 +3325,21 @@ class LFJsonPost(LFCliBase): wep_enable = 0x200 # Enable WEP Encryption wpa2_enable = 0x400 # Enable WPA2 Encryption + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class add_vap_mode(Enum): p_802_11a = 1 # 802.11a AUTO = 0 # 802.11g @@ -3165,12 +3418,33 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_venue_freq_24(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + ALL = 0xffff # ALL Ch_1 = 0x1 # Channel 1 Ch_2 = 0x2 # Channel 2 Ch_3 = 0x4 # Channel 3 + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class add_venue_freq_5(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + Ch_100 = 0x800 # Channel 100 5500 Ch_104 = 0x1000 # Channel 104 5520 Ch_108 = 0x2000 # Channel 108 5540 @@ -3199,6 +3473,21 @@ class LFJsonPost(LFCliBase): Ch_60 = 0x200 # Channel 60 5300 Ch_64 = 0x400 # Channel 64 5320 + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_add_venue(self, description=None, @@ -3324,6 +3613,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_vr_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. @@ -3338,6 +3630,21 @@ class LFJsonPost(LFCliBase): 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) + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_add_vr(self, alias=None, @@ -3379,12 +3686,30 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_vr_bgp_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_add_vr_bgp(self, bgp_id=None, @@ -3430,6 +3755,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_vrcx_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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 @@ -3445,6 +3773,21 @@ class LFJsonPost(LFCliBase): use_multicast = 0x800 # Use this interface for multicast and-rp use_vrrp = 0x1000 # Use this interface for VRRP + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_add_vrcx(self, dhcp_dns=None, @@ -3559,6 +3902,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_sta_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. @@ -3595,6 +3941,21 @@ class LFJsonPost(LFCliBase): wpa2_enable = 0x400 # Use wpa_supplicant configured for WPA2 encryption. wpa_enable = 0x10 # Enable WPA + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class add_sta_mode(Enum): p_802_11a = 1 # 802.11a AUTO = 0 # 802.11g @@ -3613,11 +3974,11 @@ class LFJsonPost(LFCliBase): g = 3 # 802.11g class add_sta_rate(Enum): - _a_g = "_a_g" # 6 Mbps, 9 Mbps, 12 Mbps, 18 Mbps, 24 Mbps, 36 Mbps, 48 Mbps, 54 Mbps - _b = "_b" # 1Mbps, 2Mbps, 5.5 Mbps, 11 Mbps + 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 - _bitmap_ = "_bitmap_" # '0xff 00 ...' to directly specify the MCS bitmap. + MCS0_76 = "MCS0-76" # /n rates + p_bitmap_ = "[bitmap]" # '0xff 00 ...' to directly specify the MCS bitmap. def post_add_vsta(self, @@ -3684,7 +4045,7 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_wl_endp_wle_flags(Enum): - SHOW_WP = 0x1 # Show WanPaths in wanlink endpoint table in GUI + SHOW_WP = 1 # Show WanPaths in wanlink endpoint table in GUI def post_add_wl_endp(self, @@ -3858,6 +4219,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class c_show_ports_probe_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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 @@ -3866,6 +4230,21 @@ class LFJsonPost(LFCliBase): MII = 0x2 # 2 include MII WIFI = 0x1 # 1 include wifi stations + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_c_show_ports(self, port=None, @@ -4674,6 +5053,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class log_level_level(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + ALL = 0xffffffff # Log everything CUST1 = 0x10000 # Cust-1, latency info (65536) DB = 0x80 # Database related logging (128) @@ -4692,6 +5074,21 @@ class LFJsonPost(LFCliBase): WRN = 0x4 # warnings (4) XMT = 0x100 # Output going to clients (256) + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_log_level(self, level=None, @@ -4893,6 +5290,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class nc_show_ports_probe_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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 @@ -4901,6 +5301,21 @@ class LFJsonPost(LFCliBase): MII = 0x2 # 2 include MII WIFI = 0x1 # 1 include wifi stations + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_nc_show_ports(self, port=None, @@ -5255,8 +5670,8 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class reset_port_pre_ifdown(Enum): - 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) + 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. @@ -6065,7 +6480,7 @@ class LFJsonPost(LFCliBase): class scan_wifi_extra(Enum): 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 + trigger_freq__freq_ = "trigger freq [freq]" # scan exactly those frequencies def post_scan_wifi(self, @@ -6098,6 +6513,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_arm_info_arm_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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 @@ -6105,6 +6523,21 @@ class LFJsonPost(LFCliBase): 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!) + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_set_arm_info(self, arm_flags=None, @@ -6641,10 +7074,31 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_event_interest_ei_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + CLEAR = 0x0 # will clear interest SET = 0x1 # set interest flag + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class set_event_interest_events1(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + BAD_TOS = 0x400000 # Endpoint has bad ToS values configured. Bad_MAC = 0x100000 # Invalid MAC address configured. Cleared = 0x2000 # Counters were cleared for some entity. @@ -6678,7 +7132,25 @@ class LFJsonPost(LFCliBase): TX_BPS_OOR_3S = 0x80000000 # Endpoint threshold alert. WiFi_Config = 0x80000 # WiFi Configuration Error. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class set_event_interest_events2(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. @@ -6697,6 +7169,21 @@ class LFJsonPost(LFCliBase): TX_BPS_OOR_30S_CLEARED = 0x4 # Endpoint threshold alert cleared. TX_BPS_OOR_3S_CLEARED = 0x1 # Endpoint threshold alert cleared. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_set_event_interest(self, ei_flags=None, @@ -7042,6 +7529,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_port_cmd_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. @@ -7055,7 +7545,25 @@ class LFJsonPost(LFCliBase): skip_port_bounce = 0x100 # skip-port-bounce (Don't ifdown/up use_pre_ifdown = 0x800 # Call pre-ifdown script before bringing interface down. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class set_port_current_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + adv_100bt_fd = 0x800000 # advert-100bt-FD adv_100bt_hd = 0x400000 # advert-100bt-HD adv_10bt_fd = 0x200000 # advert-10bt-FD @@ -7092,26 +7600,44 @@ class LFJsonPost(LFCliBase): use_dhcp = 0x80000000 # USE-DHCP use_dhcpv6 = 0x20000000000 # USE-DHCPv6 + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class set_port_dhcp_client_id(Enum): NA = "NA" # Do not change from current value. NONE = "NONE" # Do not use dhcp client ID. - _string_ = "_string_" # Use the string for the client ID. - __DEVNAME = "__DEVNAME" # Use the interface's name as the client ID. - __MAC = "__MAC" # Use interface's MAC address for the 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 set_port_dhcp_hostname(Enum): NA = "NA" # Do not change from current value. NONE = "NONE" # Do not use dhcp Hostname - _string_ = "_string_" # Use the string for the Hostname. - __ALIAS__ = "__ALIAS__" # Use alias if set, or EID behaviour if alias is not set.. - __EID__ = "__EID__" # Use hostname 'CT-[resource-id].[port-name]' + 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 set_port_dhcp_vendor_id(Enum): NA = "NA" # Do not change from current value. NONE = "NONE" # Do not use dhcp vendor ID - _string_ = "_string_" # Use the string for the vendor ID. + p_string_ = "[string]" # Use the string for the vendor ID. class set_port_flags2(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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? @@ -7119,7 +7645,25 @@ class LFJsonPost(LFCliBase): supports_bypass = 0x2 # Support Bypass Devices use_stp = 0x1 # Use Spanning Tree Protocol + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class set_port_interest(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + alias = 0x1000 # Port alias aux_mgt = 0x20000000 # Enable/disable Auxillary-Management for a port bridge = 0x10000 # BRIDGE @@ -7154,6 +7698,21 @@ class LFJsonPost(LFCliBase): svc_httpd = 0x8000000 # Enable/disable HTTP Service for a port tx_queue_length = 0x200 # TX Queue Length + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_set_port(self, alias=None, @@ -7305,7 +7864,7 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_resource_resource_flags(Enum): - skip_load_db_on_start = 0x1 # Should we skip loading the DB on start? + skip_load_db_on_start = 1 # Should we skip loading the DB on start? def post_set_resource(self, @@ -7350,9 +7909,27 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_rfgen_rfgen_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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? + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_set_rfgen(self, bb_gain=None, @@ -7400,6 +7977,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_script_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. @@ -7419,6 +7999,21 @@ class LFJsonPost(LFCliBase): 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. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class set_script_type(Enum): NONE = "NONE" # Delete any existing script. Script2544 = "Script2544" # For RFC 2544 type testing. @@ -7654,6 +8249,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wanpath_corruption_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. @@ -7661,6 +8259,21 @@ class LFJsonPost(LFCliBase): OVERWRITE_RANDOM = 0x1 # Write a random value to a byte. RECALC_CSUMS = 0x20 # Attempt to re-calculate UDP and TCP checksums. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_set_wanpath_corruption(self, byte=None, @@ -7764,6 +8377,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wifi_corruptions_corrupt_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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 @@ -7779,6 +8395,21 @@ class LFJsonPost(LFCliBase): 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. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_set_wifi_corruptions(self, corrupt_flags=None, @@ -7989,6 +8620,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wifi_radio_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. @@ -7998,6 +8632,21 @@ class LFJsonPost(LFCliBase): 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. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + class set_wifi_radio_mode(Enum): p_802_11a = 1 # 802.11a AUTO = 0 # 802.11g @@ -8143,6 +8792,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wl_corruption_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. @@ -8150,6 +8802,21 @@ class LFJsonPost(LFCliBase): OVERWRITE_RANDOM = 0x1 # Write a random value to a byte. RECALC_CSUMS = 0x20 # Attempt to re-calculate UDP and TCP checksums. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_set_wl_corruption(self, byte=None, @@ -8186,7 +8853,7 @@ class LFJsonPost(LFCliBase): class set_wl_qdisc_qdisc(Enum): FIFO = "FIFO" # is the default queuing discipline, no arguments - WRR__queue_queue_____ = "WRR__queue_queue_____" # Weighted Round Robbin is also available + WRR__queue_queue_____ = "WRR,[queue,queue,...]" # Weighted Round Robbin is also available def post_set_wl_qdisc(self, @@ -8213,6 +8880,9 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wanpath_corruption_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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. @@ -8220,6 +8890,21 @@ class LFJsonPost(LFCliBase): OVERWRITE_RANDOM = 0x1 # Write a random value to a byte. RECALC_CSUMS = 0x20 # Attempt to re-calculate UDP and TCP checksums. + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_set_wp_corruption(self, byte=None, @@ -9274,11 +9959,29 @@ class LFJsonPost(LFCliBase): ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class sniff_port_flags(Enum): + selected_named_flag_map = {} + temp_flag_value = 0x0 + 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 + def update_flag_value(self): + self.temp_flag_value = 0x0 + for flag in self.selected_named_flag_map.keys(): + self.temp_flag_value |= flag.value + + def add_flag(self, flag_name): + self.selected_named_flag_map.put(flag_name, 0) + self.update_flag_value() + + def clear_flag(self, flag_name): + if self.selected_named_flag_map.contains(flag_name): + self.selected_named_flag_map.remove(flag_name) + self.update_flag_value() + + def post_sniff_port(self, display=None, From fabac8fb1c21c18343c760ed1eba72daf6bcf8ab Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 22 Jun 2021 10:38:57 -0700 Subject: [PATCH 010/152] Add mode flag to create_station.py Signed-off-by: Matthew Stidham --- py-scripts/create_station.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/py-scripts/create_station.py b/py-scripts/create_station.py index 62e4973e..f35aa101 100755 --- a/py-scripts/create_station.py +++ b/py-scripts/create_station.py @@ -27,6 +27,7 @@ class CreateStation(Realm): _password=None, _host=None, _port=None, + _mode=0, _sta_list=None, _number_template="00000", _radio="wiphy0", @@ -43,6 +44,7 @@ class CreateStation(Realm): self.ssid = _ssid self.security = _security self.password = _password + self.mode = _mode self.sta_list = _sta_list self.radio = _radio self.timeout = 120 @@ -56,7 +58,7 @@ class CreateStation(Realm): self.station_profile.ssid_pass = self.password, self.station_profile.security = self.security self.station_profile.number_template_ = self.number_template - self.station_profile.mode = 0 + self.station_profile.mode = self.mode if self.debug: print("----- Station List ----- ----- ----- ----- ----- ----- \n") pprint.pprint(self.sta_list) @@ -111,6 +113,9 @@ Command example: required = parser.add_argument_group('required arguments') required.add_argument('--start_id', help='--start_id default 0', default=0) + optional = parser.add_argument_group('Optional arguments') + optional.add_argument('--mode', help='Mode for your station (as a number)',default=0) + args = parser.parse_args() # if args.debug: # pprint.pprint(args) @@ -151,6 +156,7 @@ Command example: _password=args.passwd, _security=args.security, _sta_list=station_list, + _mode=args.mode, _radio=args.radio, _set_txo_data=None, _proxy_str=args.proxy, From 7c9ca69060832b9dc162b0243cda62161d17b560 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Tue, 22 Jun 2021 13:10:13 -0700 Subject: [PATCH 011/152] Made changes to be compatible with different test types and consolidated scripts --- py-json/l4_cxprofile.py | 59 ++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 9 deletions(-) diff --git a/py-json/l4_cxprofile.py b/py-json/l4_cxprofile.py index 0fccce11..2834e990 100644 --- a/py-json/l4_cxprofile.py +++ b/py-json/l4_cxprofile.py @@ -21,6 +21,7 @@ class L4CXProfile(LFCliBase): self.local_realm = local_realm self.created_cx = {} self.created_endp = [] + self.test_type = "urls/s" self.lfclient_port = lfclient_port self.lfclient_host = lfclient_host @@ -69,6 +70,34 @@ class L4CXProfile(LFCliBase): print(".", end='') print("") + def compare_vals(self, old_list, new_list): + passes = 0 + expected_passes = 0 + if len(old_list) == len(new_list): + for item, value in old_list.items(): + expected_passes += 1 + if new_list[item] > old_list[item]: + passes += 1 + if passes == expected_passes: + return True + else: + return False + else: + return False + + def get_bytes(self): + time.sleep(1) + cx_list = self.json_get("layer4/list?fields=name,%s" % self.test_type, debug_=self.debug) + # print("==============\n", cx_list, "\n==============") + cx_map = {} + for cx_name in cx_list['endpoint']: + if cx_name != 'uri' and cx_name != 'handler': + for item, value in cx_name.items(): + for value_name, value_rx in value.items(): + if item in self.created_cx.keys() and value_name == self.test_type: + cx_map[item] = value_rx + return cx_map + def check_request_rate(self): endp_list = self.json_get("layer4/list?fields=urls/s") expected_passes = 0 @@ -88,7 +117,6 @@ class L4CXProfile(LFCliBase): return passes == expected_passes - def cleanup(self): print("Cleaning up cxs and endpoints") if len(self.created_cx) != 0: @@ -110,7 +138,7 @@ class L4CXProfile(LFCliBase): def create(self, ports=[], sleep_time=.5, debug_=False, suppress_related_commands_=None): cx_post_data = [] for port_name in ports: - print("port_name: {} len: {} self.local_realm.name_to_eid(port_name): {}".format(port_name,len(self.local_realm.name_to_eid(port_name)),self.local_realm.name_to_eid(port_name),)) + print("port_name: {} len: {} self.local_realm.name_to_eid(port_name): {}".format(port_name, len(self.local_realm.name_to_eid(port_name)), self.local_realm.name_to_eid(port_name))) 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] @@ -186,7 +214,6 @@ class L4CXProfile(LFCliBase): print(header_row) # Step 2 - Monitor columns - start_time = datetime.datetime.now() end_time = start_time + datetime.timedelta(seconds=duration_sec) sleep_interval = round(duration_sec // 5) @@ -198,6 +225,9 @@ class L4CXProfile(LFCliBase): passes = 0 expected_passes = 0 timestamps = [] + if self.test_type != 'urls/s': + old_rx_values = self.get_bytes() + for test in range(1+iterations): while datetime.datetime.now() < end_time: if col_names is None: @@ -219,14 +249,25 @@ class L4CXProfile(LFCliBase): timestamps.append(t) value_map[t] = response expected_passes += 1 - if self.check_errors(debug): - if self.check_request_rate(): + if self.test_type == 'urls/s': + if self.check_errors(self.debug): + if self.check_request_rate(): + passes += 1 + else: + self._fail("FAIL: Request rate did not exceed target rate") + break + else: + self._fail("FAIL: Errors found getting to %s " % self.url) + break + + else: + new_rx_values = self.get_bytes() + expected_passes += 1 + if self.compare_vals(old_rx_values, new_rx_values): passes += 1 else: - self._fail("FAIL: Request rate did not exceed 90% target rate") - self.exit_fail() - else: - self._fail("FAIL: Errors found getting to %s " % self.url) + self._fail("FAIL: Not all stations increased traffic") + self.exit_fail() time.sleep(monitor_interval) print(value_map) From 5f947ec16cd10bf4e3bdbe30e62cf5ef5dc82ef7 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Tue, 22 Jun 2021 13:12:01 -0700 Subject: [PATCH 012/152] Added checks for cli options, makes better use of l4_cxprofile --- py-scripts/test_l4.py | 149 +++++++++++++++--------------------------- 1 file changed, 51 insertions(+), 98 deletions(-) diff --git a/py-scripts/test_l4.py b/py-scripts/test_l4.py index 42e3019b..db3cca2c 100755 --- a/py-scripts/test_l4.py +++ b/py-scripts/test_l4.py @@ -69,6 +69,7 @@ import realm import time import datetime from realm import TestGroupProfile +from port_utils import PortUtils class IPV4L4(LFCliBase): @@ -93,6 +94,8 @@ class IPV4L4(LFCliBase): _debug_on=False, upstream_port="eth1", ftp=False, + source=None, + dest=None, test_type=None, _exit_on_error=False, _exit_on_fail=False): @@ -117,11 +120,11 @@ class IPV4L4(LFCliBase): self.target_requests_per_ten = int(target_requests_per_ten) self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port) - self.l4cxprofile = realm.L4CXProfile(lfclient_host=host, - lfclient_port=port, local_realm=self.local_realm) self.station_profile = self.local_realm.new_station_profile() self.cx_profile = self.local_realm.new_l4_cx_profile() + self.port_util = PortUtils(self.local_realm) + self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = self.ssid self.station_profile.ssid_pass = self.password @@ -131,18 +134,23 @@ class IPV4L4(LFCliBase): self.test_type = test_type self.ftp_user = ftp_user self.ftp_passwd = ftp_passwd + self.source = source + self.dest = dest if self.ap is not None: self.station_profile.set_command_param("add_sta", "ap", self.ap) self.cx_profile.url = self.url + self.cx_profile.test_type = self.test_type self.cx_profile.requests_per_ten = self.requests_per_ten + self.cx_profile.target_requests_per_ten = self.target_requests_per_ten self.ftp = ftp if self.ftp and 'ftp://' not in self.url: print("WARNING! FTP test chosen, but ftp:// not present in url!") if self.test_type != 'urls/s' and self.test_type != 'bytes-wr' and self.test_type != 'bytes-rd': - raise ValueError("Unknown test type: %s\nValid test types are urls/s, bytes-rd, or bytes-wr" % self.test_type) + raise ValueError( + "Unknown test type: %s\nValid test types are urls/s, bytes-rd, or bytes-wr" % self.test_type) def build(self): # Build stations @@ -154,57 +162,27 @@ class IPV4L4(LFCliBase): self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug) self._pass("PASS: Station build finished") + temp_url = self.url.split(" ") + if temp_url[0] == 'ul' or temp_url[0] == 'dl': + if len(temp_url) == 2: + if self.url.startswith("ul") and self.source not in self.url: + self.cx_profile.url += " " + self.source + elif self.url.startswith("dl") and self.dest not in self.url: + self.cx_profile.url += " " + self.dest + else: + raise ValueError("ul or dl required in url to indicate direction") if self.ftp: + if self.ftp_user is not None and self.ftp_passwd is not None: + if ("%s:%s" % (self.ftp_user, self.ftp_passwd)) not in self.url: + temp_url = self.url.split("//") + temp_url = ("//%s:%s@" % (self.ftp_user, self.ftp_passwd)).join(temp_url) + self.cx_profile.url = temp_url self.cx_profile.create(ports=self.station_profile.station_names, sleep_time=.5, debug_=self.debug, - suppress_related_commands_=True, ftp=self.ftp, - user=self.ftp_user, passwd=self.ftp_passwd, - source=self.source) + suppress_related_commands_=True) else: self.cx_profile.create(ports=self.station_profile.station_names, sleep_time=.5, debug_=self.debug, suppress_related_commands_=None) - def __check_request_rate(self): - endp_list = self.json_get("layer4/list?fields=urls/s") - expected_passes = 0 - passes = 0 - if endp_list is not None and endp_list['endpoint'] is not None: - endp_list = endp_list['endpoint'] - for item in endp_list: - for name, info in item.items(): - if name in self.cx_profile.created_cx.keys(): - expected_passes += 1 - if info['urls/s'] * self.requests_per_ten >= self.target_requests_per_ten * .9: - passes += 1 - return passes == expected_passes - - def __compare_vals(self, old_list, new_list): - passes = 0 - expected_passes = 0 - if len(old_list) == len(new_list): - for item, value in old_list.items(): - expected_passes += 1 - if new_list[item] > old_list[item]: - passes += 1 - if passes == expected_passes: - return True - else: - return False - else: - return False - - def __get_bytes(self): - time.sleep(1) - cx_list = self.json_get("layer4/list?fields=name,%s" % self.test_type, debug_=self.debug) - # print("==============\n", cx_list, "\n==============") - cx_map = {} - for cx_name in cx_list['endpoint']: - if cx_name != 'uri' and cx_name != 'handler': - for item, value in cx_name.items(): - for value_name, value_rx in value.items(): - if item in self.cx_profile.created_cx.keys() and value_name == self.test_type: - cx_map[item] = value_rx - return cx_map - def start(self, print_pass=False, print_fail=False): if self.ftp: self.port_util.set_ftp(port_name=self.local_realm.name_to_eid(self.upstream_port)[2], resource=1, on=True) @@ -216,45 +194,9 @@ class IPV4L4(LFCliBase): else: self._fail("Stations failed to get IPs", print_fail) exit(1) + self.cx_profile.start_cx() print("Starting test") - curr_time = datetime.datetime.now() - if self.test_type != 'urls/s': - old_rx_values = self.__get_bytes() - end_time = self.local_realm.parse_time(self.test_duration) + curr_time - sleep_interval = self.local_realm.parse_time(self.test_duration) // 5 - passes = 0 - expected_passes = 0 - - for test in range(self.num_tests): - expected_passes += 1 - while curr_time < end_time: - time.sleep(sleep_interval.total_seconds()) - curr_time = datetime.datetime.now() - - if self.test_type == 'urls/s': - if self.cx_profile.check_errors(self.debug): - if self.__check_request_rate(): - passes += 1 - else: - self._fail("FAIL: Request rate did not exceed target rate", print_fail) - break - else: - self._fail("FAIL: Errors found getting to %s " % self.url, print_fail) - break - - else: - new_rx_values = self.__get_bytes() - expected_passes += 1 - if self.__compare_vals(old_rx_values, new_rx_values): - passes += 1 - 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: - self._pass("PASS: All tests passes", print_pass) def stop(self): self.cx_profile.stop_cx() @@ -267,6 +209,8 @@ class IPV4L4(LFCliBase): self.station_profile.cleanup(sta_list) LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=sta_list, debug=self.debug) + + def main(): parser = LFCliBase.create_basic_argparse( prog='test_l4', @@ -337,9 +281,16 @@ python3 ./test_l4.py 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 {url/s, bytes-rd, bytes-wr}', default='bytes-rd') - optional.add_argument('--ftp_user', help='--ftp_user sets the username to be used for ftp', default="lanforge") - optional.add_argument('--ftp_passwd', help='--ftp_user sets the password to be used for ftp', default="lanforge") + optional.add_argument('--test_type', help='Choose type of test to run {url/s, 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="/tmp/data_slug_4K.bin") args = parser.parse_args() @@ -410,6 +361,8 @@ python3 ./test_l4.py ftp=args.ftp, ftp_user=args.ftp_user, ftp_passwd=args.ftp_passwd, + source=args.source, + dest=args.dest, test_type=args.test_type, _debug_on=args.debug, test_duration=args.test_duration, @@ -424,22 +377,22 @@ python3 ./test_l4.py layer4traffic = ','.join([[*x.keys()][0] for x in ip_test.local_realm.json_get('layer4')['endpoint']]) except: pass - ip_test.l4cxprofile.monitor(col_names=['bytes-rd', 'urls/s', 'bytes-wr'], - report_file=rpt_file, - duration_sec=ip_test.local_realm.parse_time(args.test_duration).total_seconds(), - created_cx=layer4traffic, - output_format=output_form, - script_name='test_l4', - arguments=args, - debug=args.debug) + ip_test.cx_profile.monitor(col_names=['bytes-rd', 'urls/s', 'bytes-wr'], + report_file=rpt_file, + duration_sec=ip_test.local_realm.parse_time(args.test_duration).total_seconds(), + created_cx=layer4traffic, + output_format=output_form, + script_name='test_l4', + arguments=args, + debug=args.debug) ip_test.stop() if not ip_test.passes(): print(ip_test.get_fail_message()) exit(1) time.sleep(30) - ip_test.cleanup(station_list) + # ip_test.cleanup(station_list) if ip_test.passes(): - print("Full test passed, all endpoints met or exceeded 90 percent of the target rate") + print("Full test passed") if __name__ == "__main__": From c2586f83437f5981d12a4b417509ca7f2bfdcf13 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 22 Jun 2021 14:30:38 -0700 Subject: [PATCH 013/152] Grafana and Ghost integration updates Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 34 ++-- py-dashboard/GrafanaRequest.py | 257 ++++++++++++++++++++++++++++-- py-json/station_profile.py | 3 + py-scripts/ghost_profile.py | 66 ++++---- py-scripts/grafana_profile.py | 220 +------------------------ py-scripts/wifi_cap_to_grafana.sh | 4 +- 6 files changed, 310 insertions(+), 274 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index aa593cdc..0b673495 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -20,6 +20,7 @@ import subprocess from scp import SCPClient import paramiko from GrafanaRequest import GrafanaRequest +import time class CSVReader: @@ -168,6 +169,11 @@ class GhostRequest: grafana_port=3000): text = '' csvreader = CSVReader() + if grafana_token is not None: + grafana = GrafanaRequest(grafana_token, + grafana_host, + grafanajson_port=grafana_port + ) if test_run is None: test_run = sorted(folders)[0].split('/')[-1].strip('/') for folder in folders: @@ -184,7 +190,7 @@ class GhostRequest: scp_pull.get(folder, recursive=True) target_folder = str(folder).rstrip('/').split('/')[-1] target_folders.append(target_folder) - print(target_folder) + print('Target folder: %s' % target_folder) try: target_file = '%s/kpi.csv' % target_folder print('target file %s' % target_file) @@ -216,9 +222,10 @@ class GhostRequest: print(local_path) try: sftp.mkdir(local_path) + scp_push.put(target_folder, recursive=True, remote_path=local_path) except: print('folder %s already exists' % local_path) - scp_push.put(target_folder, recursive=True, remote_path=local_path) + print(target_folder) files = sftp.listdir(local_path + '/' + target_folder) # print('Files: %s' % files) for file in files: @@ -237,21 +244,26 @@ class GhostRequest: self.images = [] if grafana_token is not None: - GR = GrafanaRequest(grafana_token, - grafana_host, - grafanajson_port=grafana_port - ) - GR.create_snapshot(title=grafana_dashboard) - snapshot = GR.list_snapshots()[-1] - text = text + '' % (snapshot['externalUrl'], '%') + # get the details of the dashboard through the API, and set the end date to the youngest KPI + grafana.list_dashboards() + + grafana.create_snapshot(title=grafana_dashboard) + time.sleep(3) + snapshot = grafana.list_snapshots()[-1] + print(snapshot) + text = text + '' % (grafana_host, snapshot['key'], '%') now = date.now() if title is None: title = "%s %s %s %s:%s report" % (now.day, now.month, now.year, now.hour, now.minute) - if grafana_dashboard is not None: - pass + # create Grafana Dashboard + target_files = [] + for folder in folders: + target_files.append(folder.strip('/home/lanforge/html-reports/') + '/kpi.csv') + grafana.create_custom_dashboard(target_csvs=target_files, + title=title) self.create_post(title=title, text=text, diff --git a/py-dashboard/GrafanaRequest.py b/py-dashboard/GrafanaRequest.py index fc585ab6..5c873b2c 100644 --- a/py-dashboard/GrafanaRequest.py +++ b/py-dashboard/GrafanaRequest.py @@ -12,7 +12,34 @@ if sys.version_info[0] != 3: import requests import json +import string +import random +class CSVReader: + def __init__(self): + self.shape = None + + def read_csv(self, + file, + sep='\t'): + df = open(file).read().split('\n') + rows = list() + for x in df: + if len(x) > 0: + rows.append(x.split(sep)) + length = list(range(0, len(df[0]))) + columns = dict(zip(df[0], length)) + self.shape = (length, columns) + return rows + + def get_column(self, + df, + value): + index = df[0].index(value) + values = [] + for row in df[1:]: + values.append(row[index]) + return values class GrafanaRequest: def __init__(self, @@ -35,6 +62,7 @@ class GrafanaRequest: self.grafanajson_url = "http://%s:%s" % (_grafanajson_host, grafanajson_port) self.data = dict() self.data['overwrite'] = _overwrite + self.csvreader = CSVReader() def create_bucket(self, bucket_name=None): @@ -45,7 +73,7 @@ class GrafanaRequest: def list_dashboards(self): url = self.grafanajson_url + '/api/search' print(url) - return json.loads(requests.get(url,headers=self.headers).text) + return json.loads(requests.get(url, headers=self.headers).text) def create_dashboard(self, dashboard_name=None, @@ -77,31 +105,226 @@ class GrafanaRequest: datastore['dashboard'] = dashboard datastore['overwrite'] = False data = json.dumps(datastore, indent=4) - #return print(data) return requests.post(grafanajson_url, headers=self.headers, data=data, verify=False) def create_dashboard_from_dict(self, - dictionary=None): + dictionary=None, + overwrite=False): grafanajson_url = self.grafanajson_url + '/api/dashboards/db' datastore = dict() dashboard = dict(json.loads(dictionary)) datastore['dashboard'] = dashboard - datastore['overwrite'] = False + datastore['overwrite'] = overwrite data = json.dumps(datastore, indent=4) - #return print(data) return requests.post(grafanajson_url, headers=self.headers, data=data, verify=False) + def get_graph_groups(self, target_csvs): # Get the unique values in the Graph-Group column + dictionary = dict() + for target_csv in target_csvs: + if len(target_csv) > 1: + csv = self.csvreader.read_csv(target_csv) + # Unique values in the test-id column + scripts = list(set(self.csvreader.get_column(csv, 'test-id'))) + # we need to make sure we match each Graph Group to the script it occurs in + for script in scripts: + # Unique Graph Groups for each script + dictionary[script] = list(set(self.csvreader.get_column(csv, 'Graph-Group'))) + print(dictionary) + return dictionary def create_custom_dashboard(self, - datastore=None): - data = json.dumps(datastore, indent=4) - return requests.post(self.grafanajson_url, headers=self.headers, data=data, verify=False) + scripts=None, + title=None, + bucket=None, + graph_groups=None, + graph_groups_file=None, + target_csvs=None, + testbed=None, + datasource='InfluxDB', + from_date='now-1y', + to_date='now', + graph_height=8, + graph__width=12): + options = string.ascii_lowercase + string.ascii_uppercase + string.digits + uid = ''.join(random.choice(options) for i in range(9)) + input1 = dict() + annotations = dict() + annotations['builtIn'] = 1 + annotations['datasource'] = '-- Grafana --' + annotations['enable'] = True + annotations['hide'] = True + annotations['iconColor'] = 'rgba(0, 211, 255, 1)' + annotations['name'] = 'Annotations & Alerts' + annotations['type'] = 'dashboard' + annot = dict() + annot['list'] = list() + annot['list'].append(annotations) + + templating = dict() + templating['list'] = list() + + timedict = dict() + timedict['from'] = from_date + timedict['to'] = to_date + + panels = list() + index = 1 + if graph_groups_file: + print("graph_groups_file: %s" % graph_groups_file) + target_csvs = open(graph_groups_file).read().split('\n') + graph_groups = self.get_graph_groups( + target_csvs) # Get the list of graph groups which are in the tests we ran + unit_dict = dict() + for csv in target_csvs: + if len(csv) > 1: + print(csv) + unit_dict.update(self.get_units(csv)) + if target_csvs: + print('Target CSVs: %s' % target_csvs) + graph_groups = self.get_graph_groups( + target_csvs) # Get the list of graph groups which are in the tests we ran + unit_dict = dict() + for csv in target_csvs: + if len(csv) > 1: + print(csv) + unit_dict.update(self.get_units(csv)) + for scriptname in graph_groups.keys(): + for graph_group in graph_groups[scriptname]: + panel = dict() + + gridpos = dict() + gridpos['h'] = graph_height + gridpos['w'] = graph__width + gridpos['x'] = 0 + gridpos['y'] = 0 + + legend = dict() + legend['avg'] = False + legend['current'] = False + legend['max'] = False + legend['min'] = False + legend['show'] = True + legend['total'] = False + legend['values'] = False + + options = dict() + options['alertThreshold'] = True + + #groupBy = list() + #groupBy.append(self.groupby('$__interval', 'time')) + #groupBy.append(self.groupby('null', 'fill')) + + #targets = list() + #counter = 0 + #new_target = self.maketargets(bucket, scriptname, groupBy, counter, graph_group, testbed) + #targets.append(new_target) + + fieldConfig = dict() + fieldConfig['defaults'] = dict() + fieldConfig['overrides'] = list() + + transformation = dict() + transformation['id'] = "renameByRegex" + transformation_options = dict() + transformation_options['regex'] = "(.*) value.*" + transformation_options['renamePattern'] = "$1" + transformation['options'] = transformation_options + + xaxis = dict() + xaxis['buckets'] = None + xaxis['mode'] = "time" + xaxis['name'] = None + xaxis['show'] = True + xaxis['values'] = list() + + yaxis = dict() + yaxis['format'] = 'short' + #yaxis['label'] = unit_dict[graph_group] + yaxis['logBase'] = 1 + yaxis['max'] = None + yaxis['min'] = None + yaxis['show'] = True + + yaxis1 = dict() + yaxis1['align'] = False + yaxis1['alignLevel'] = None + + panel['aliasColors'] = dict() + panel['bars'] = False + panel['dashes'] = False + panel['dashLength'] = 10 + panel['datasource'] = datasource + panel['fieldConfig'] = fieldConfig + panel['fill'] = 0 + panel['fillGradient'] = 0 + panel['gridPos'] = gridpos + panel['hiddenSeries'] = False + panel['id'] = index + panel['legend'] = legend + panel['lines'] = True + panel['linewidth'] = 1 + panel['nullPointMode'] = 'null' + panel['options'] = options + panel['percentage'] = False + panel['pluginVersion'] = '7.5.4' + panel['pointradius'] = 2 + panel['points'] = True + panel['renderer'] = 'flot' + panel['seriesOverrides'] = list() + panel['spaceLength'] = 10 + panel['stack'] = False + panel['steppedLine'] = False + #panel['targets'] = targets + panel['thresholds'] = list() + panel['timeFrom'] = None + panel['timeRegions'] = list() + panel['timeShift'] = None + if graph_group is not None: + panel['title'] = scriptname + ' ' + graph_group + else: + panel['title'] = scriptname + panel['transformations'] = list() + panel['transformations'].append(transformation) + panel['type'] = "graph" + panel['xaxis'] = xaxis + panel['yaxes'] = list() + panel['yaxes'].append(yaxis) + panel['yaxes'].append(yaxis) + panel['yaxis'] = yaxis1 + + panels.append(panel) + index = index + 1 + input1['annotations'] = annot + input1['editable'] = True + input1['gnetId'] = None + input1['graphTooltip'] = 0 + input1['links'] = list() + input1['panels'] = panels + input1['refresh'] = False + input1['schemaVersion'] = 27 + input1['style'] = 'dark' + input1['tags'] = list() + input1['templating'] = templating + input1['time'] = timedict + input1['timepicker'] = dict() + input1['timezone'] = '' + input1['title'] = ("Testbed: %s" % title) + input1['uid'] = uid + input1['version'] = 11 + return self.create_dashboard_from_dict(dictionary=json.dumps(input1)) + + # def create_custom_dashboard(self, + # datastore=None): + # data = json.dumps(datastore, indent=4) + # return requests.post(self.grafanajson_url, headers=self.headers, data=data, verify=False) def create_snapshot(self, title): + print('create snapshot') grafanajson_url = self.grafanajson_url + '/api/snapshots' - data=self.get_dashboard(title) + data = self.get_dashboard(title) data['expires'] = 3600 - data['external'] = True + data['external'] = False + data['timeout'] = 15 print(data) return requests.post(grafanajson_url, headers=self.headers, json=data, verify=False).text @@ -112,9 +335,21 @@ class GrafanaRequest: def get_dashboard(self, target): dashboards = self.list_dashboards() + print(target) for dashboard in dashboards: if dashboard['title'] == target: uid = dashboard['uid'] grafanajson_url = self.grafanajson_url + '/api/dashboards/uid/' + uid print(grafanajson_url) - return json.loads(requests.get(grafanajson_url, headers=self.headers, verify=False).text) \ No newline at end of file + return json.loads(requests.get(grafanajson_url, headers=self.headers, verify=False).text) + + def get_units(self, csv): + df = self.csvreader.read_csv(csv) + units = self.csvreader.get_column(df, 'Units') + test_id = self.csvreader.get_column(df, 'test-id') + maxunit = max(set(units), key = units.count) + maxtest = max(set(test_id), key = test_id.count) + d = dict() + d[maxunit] = maxtest + print(maxunit, maxtest) + return d diff --git a/py-json/station_profile.py b/py-json/station_profile.py index 69241d89..d42cedc1 100644 --- a/py-json/station_profile.py +++ b/py-json/station_profile.py @@ -229,6 +229,9 @@ class StationProfile: self.set_command_param("add_sta", "ieee80211w", 2) # self.add_sta_data["key"] = passwd + def station_mode_to_number(self,mode): + modes = ['a','b','g','abg','an','abgn','bgn','bg','abgn-AC','bgn-AC','an-AC'] + def add_security_extra(self, security): types = {"wep": "wep_enable", "wpa": "wpa_enable", "wpa2": "wpa2_enable", "wpa3": "use-wpa3", "open": "[BLANK]"} if self.desired_add_sta_flags.__contains__(types[security]) and \ diff --git a/py-scripts/ghost_profile.py b/py-scripts/ghost_profile.py index 2b20b377..1dcb300d 100755 --- a/py-scripts/ghost_profile.py +++ b/py-scripts/ghost_profile.py @@ -14,6 +14,12 @@ EXAMPLE: ./ghost_profile.py --ghost_token TOKEN --ghost_host 192.168.100.147 --user_pull lanforge --password_pull lanforge --customer candela --testbed heather --test_run test-run-6 --user_push matt --password_push PASSWORD +EXAMPLE 2: ./ghost_profile.py --ghost_token TOKEN +--ghost_host 192.168.100.147 --server 192.168.93.51 --user_pull lanforge --password_pull lanforge --customer candela +--testbed heather --user_push matt --password_push "amount%coverage;Online" --wifi_capacity app +--folders /home/lanforge/html-reports/wifi-capacity-2021-06-14-10-42-29 --grafana_token TOKEN +--grafana_host 192.168.100.201 --grafana_dashboard 'Stidmatt-02' + Matthew Stidham Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. @@ -33,7 +39,7 @@ if 'py-json' not in sys.path: from GhostRequest import GhostRequest -class UseGhost: +class UseGhost(GhostRequest): def __init__(self, _ghost_token=None, host="localhost", @@ -42,29 +48,17 @@ class UseGhost: _exit_on_fail=False, _ghost_host="localhost", _ghost_port=2368, ): + super().__init__(_ghost_host, + str(_ghost_port), + _api_token=_ghost_token, + debug_=_debug_on) self.ghost_host = _ghost_host self.ghost_port = _ghost_port self.ghost_token = _ghost_token - self.GP = GhostRequest(self.ghost_host, - str(self.ghost_port), - _api_token=self.ghost_token, - debug_=_debug_on) - - def create_post(self, title, text, tags, authors): - return self.GP.create_post(title=title, text=text, tags=tags, authors=authors) def create_post_from_file(self, title, file, tags, authors): text = open(file).read() - return self.GP.create_post(title=title, text=text, tags=tags, authors=authors) - - def upload_image(self, image): - return self.GP.upload_image(image) - - def upload_images(self, folder): - return self.GP.upload_images(folder) - - def custom_post(self, folder, authors): - return self.GP.custom_post(folder, authors) + return self.create_post(title=title, text=text, tags=tags, authors=authors) def wifi_capacity(self, authors, @@ -85,24 +79,24 @@ class UseGhost: grafana_host, grafana_port): target_folders = list() - return self.GP.wifi_capacity_to_ghost(authors, - folders, - title, - server_pull, - ghost_host, - port, - user_pull, - password_pull, - user_push, - password_push, - customer, - testbed, - test_run, - target_folders, - grafana_dashboard, - grafana_token, - grafana_host, - grafana_port) + return self.wifi_capacity_to_ghost(authors, + folders, + title, + server_pull, + ghost_host, + port, + user_pull, + password_pull, + user_push, + password_push, + customer, + testbed, + test_run, + target_folders, + grafana_dashboard, + grafana_token, + grafana_host, + grafana_port) def main(): diff --git a/py-scripts/grafana_profile.py b/py-scripts/grafana_profile.py index a78bb987..5abc1767 100755 --- a/py-scripts/grafana_profile.py +++ b/py-scripts/grafana_profile.py @@ -19,40 +19,7 @@ if 'py-json' not in sys.path: from GrafanaRequest import GrafanaRequest from LANforge.lfcli_base import LFCliBase -import json import string -import random - - -#!/usr/bin/env python3 - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Class holds default settings for json requests to Grafana - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -import sys - -if sys.version_info[0] != 3: - print("This script requires Python 3") - exit() - -import requests - -import json - -#!/usr/bin/env python3 - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Class holds default settings for json requests to Grafana - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -import sys - -if sys.version_info[0] != 3: - print("This script requires Python 3") - exit() - -import requests - -import json class UseGrafana(GrafanaRequest): def groupby(self, params, grouptype): @@ -97,174 +64,6 @@ class UseGrafana(GrafanaRequest): targets['tags'] = list() return targets - def create_custom_dashboard(self, - scripts=None, - title=None, - bucket=None, - graph_groups=None, - graph_groups_file=None, - testbed=None, - datasource='InfluxDB', - from_date='now-1y', - graph_height=8, - graph__width=12): - options = string.ascii_lowercase + string.ascii_uppercase + string.digits - uid = ''.join(random.choice(options) for i in range(9)) - input1 = dict() - annotations = dict() - annotations['builtIn'] = 1 - annotations['datasource'] = '-- Grafana --' - annotations['enable'] = True - annotations['hide'] = True - annotations['iconColor'] = 'rgba(0, 211, 255, 1)' - annotations['name'] = 'Annotations & Alerts' - annotations['type'] = 'dashboard' - annot = dict() - annot['list'] = list() - annot['list'].append(annotations) - - templating = dict() - templating['list'] = list() - - timedict = dict() - timedict['from'] = from_date - timedict['to'] = 'now' - - panels = list() - index = 1 - if graph_groups_file: - print("graph_groups_file: %s" % graph_groups_file) - target_csvs = open(graph_groups_file).read().split('\n') - graph_groups = self.get_graph_groups(target_csvs) # Get the list of graph groups which are in the tests we ran - unit_dict = dict() - for csv in target_csvs: - if len(csv)>1: - print(csv) - unit_dict.update(self.get_units(csv)) - for scriptname in graph_groups.keys(): - for graph_group in graph_groups[scriptname]: - panel = dict() - - gridpos = dict() - gridpos['h'] = graph_height - gridpos['w'] = graph__width - gridpos['x'] = 0 - gridpos['y'] = 0 - - legend = dict() - legend['avg'] = False - legend['current'] = False - legend['max'] = False - legend['min'] = False - legend['show'] = True - legend['total'] = False - legend['values'] = False - - options = dict() - options['alertThreshold'] = True - - groupBy = list() - groupBy.append(self.groupby('$__interval', 'time')) - groupBy.append(self.groupby('null', 'fill')) - - targets = list() - counter = 0 - new_target = self.maketargets(bucket, scriptname, groupBy, counter, graph_group,testbed) - targets.append(new_target) - - fieldConfig = dict() - fieldConfig['defaults'] = dict() - fieldConfig['overrides'] = list() - - transformation = dict() - transformation['id'] = "renameByRegex" - transformation_options = dict() - transformation_options['regex'] = "(.*) value.*" - transformation_options['renamePattern'] = "$1" - transformation['options'] = transformation_options - - xaxis = dict() - xaxis['buckets'] = None - xaxis['mode'] = "time" - xaxis['name'] = None - xaxis['show'] = True - xaxis['values'] = list() - - yaxis = dict() - yaxis['format'] = 'short' - yaxis['label'] = unit_dict[graph_group] - yaxis['logBase'] = 1 - yaxis['max'] = None - yaxis['min'] = None - yaxis['show'] = True - - yaxis1 = dict() - yaxis1['align'] = False - yaxis1['alignLevel'] = None - - panel['aliasColors'] = dict() - panel['bars'] = False - panel['dashes'] = False - panel['dashLength'] = 10 - panel['datasource'] = datasource - panel['fieldConfig'] = fieldConfig - panel['fill'] = 0 - panel['fillGradient'] = 0 - panel['gridPos'] = gridpos - panel['hiddenSeries'] = False - panel['id'] = index - panel['legend'] = legend - panel['lines'] = True - panel['linewidth'] = 1 - panel['nullPointMode'] = 'null' - panel['options'] = options - panel['percentage'] = False - panel['pluginVersion'] = '7.5.4' - panel['pointradius'] = 2 - panel['points'] = True - panel['renderer'] = 'flot' - panel['seriesOverrides'] = list() - panel['spaceLength'] = 10 - panel['stack'] = False - panel['steppedLine'] = False - panel['targets'] = targets - panel['thresholds'] = list() - panel['timeFrom'] = None - panel['timeRegions'] = list() - panel['timeShift'] = None - if graph_group is not None: - panel['title'] = scriptname + ' ' + graph_group - else: - panel['title'] = scriptname - panel['transformations'] = list() - panel['transformations'].append(transformation) - panel['type'] = "graph" - panel['xaxis'] = xaxis - panel['yaxes'] = list() - panel['yaxes'].append(yaxis) - panel['yaxes'].append(yaxis) - panel['yaxis'] = yaxis1 - - panels.append(panel) - index = index + 1 - input1['annotations'] = annot - input1['editable'] = True - input1['gnetId'] = None - input1['graphTooltip'] = 0 - input1['links'] = list() - input1['panels'] = panels - input1['refresh'] = False - input1['schemaVersion'] = 27 - input1['style'] = 'dark' - input1['tags'] = list() - input1['templating'] = templating - input1['time'] = timedict - input1['timepicker'] = dict() - input1['timezone'] = '' - input1['title'] = ("Testbed: %s" % title) - input1['uid'] = uid - input1['version'] = 11 - return self.GR.create_dashboard_from_dict(dictionary=json.dumps(input1)) def read_csv(self, file): csv = open(file).read().split('\n') @@ -281,19 +80,6 @@ class UseGrafana(GrafanaRequest): results.append(row[value]) return results - def get_graph_groups(self,target_csvs): # Get the unique values in the Graph-Group column - dictionary = dict() - for target_csv in target_csvs: - if len(target_csv) > 1: - csv = self.read_csv(target_csv) - # Unique values in the test-id column - scripts = list(set(self.get_values(csv,'test-id'))) - # we need to make sure we match each Graph Group to the script it occurs in - for script in scripts: - # Unique Graph Groups for each script - dictionary[script] = list(set(self.get_values(csv,'Graph-Group'))) - print(dictionary) - return dictionary def get_units(self, target_csv): csv = self.read_csv(target_csv) @@ -324,6 +110,12 @@ def main(): --graph_groups 'Per Stations Rate DL' --graph_groups 'Per Stations Rate UL' --graph_groups 'Per Stations Rate UL+DL' + + Create a snapshot of a dashboard: + ./grafana_profile.py --grafana_token TOKEN + --grafana_host HOST + --create_snapshot + --title TITLE_OF_DASHBOARD ''') required = parser.add_argument_group('required arguments') required.add_argument('--grafana_token', help='token to access your Grafana database', required=True) diff --git a/py-scripts/wifi_cap_to_grafana.sh b/py-scripts/wifi_cap_to_grafana.sh index 34c25491..d9054061 100755 --- a/py-scripts/wifi_cap_to_grafana.sh +++ b/py-scripts/wifi_cap_to_grafana.sh @@ -5,11 +5,11 @@ # into influxdb. As final step, it builds a grafana dashboard for the KPI information. # Define some common variables. This will need to be changed to match your own testbed. -MGR=10.0.0.202 +MGR=192.168.93.51 INFLUX_MGR=192.168.100.201 #INFLUXTOKEN=Tdxwq5KRbj1oNbZ_ErPL5tw_HUH2wJ1VR4dwZNugJ-APz__mEFIwnqHZdoobmQpt2fa1VdWMlHQClR8XNotwbg== INFLUXTOKEN=31N9QDhjJHBu4eMUlMBwbK3sOjXLRAhZuCzZGeO8WVCj-xvR8gZWWvRHOcuw-5RHeB7xBFnLs7ZV023k4koR1A== -TESTBED=Stidmatt-01 +TESTBED=Heather INFLUXBUCKET=stidmatt #GRAFANATOKEN=eyJrIjoiZTJwZkZlemhLQVNpY3hiemRjUkNBZ3k2RWc3bWpQWEkiLCJuIjoibWFzdGVyIiwiaWQiOjF9 GRAFANATOKEN=eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== From 68b6ab3cd828e58bc5414f68f5e2bd703e51feb2 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 22 Jun 2021 14:47:22 -0700 Subject: [PATCH 014/152] Proper sized grafana snapshots in Ghost Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index 0b673495..993f8764 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -251,7 +251,7 @@ class GhostRequest: time.sleep(3) snapshot = grafana.list_snapshots()[-1] print(snapshot) - text = text + '' % (grafana_host, snapshot['key'], '%') + text = text + '' % (grafana_host, snapshot['key'], '%') now = date.now() From 9741c326bba999c5dfc36587efd6a73479333dbd Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 22 Jun 2021 14:48:03 -0700 Subject: [PATCH 015/152] Keep Grafana snapshots for a long time by default Signed-off-by: Matthew Stidham --- py-dashboard/GrafanaRequest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-dashboard/GrafanaRequest.py b/py-dashboard/GrafanaRequest.py index 5c873b2c..59ab188c 100644 --- a/py-dashboard/GrafanaRequest.py +++ b/py-dashboard/GrafanaRequest.py @@ -322,7 +322,7 @@ class GrafanaRequest: print('create snapshot') grafanajson_url = self.grafanajson_url + '/api/snapshots' data = self.get_dashboard(title) - data['expires'] = 3600 + data['expires'] = 360000 data['external'] = False data['timeout'] = 15 print(data) From 170ef3da94c643644bcf951d7d576dd6ab971c74 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 22 Jun 2021 17:11:13 -0700 Subject: [PATCH 016/152] lf_json_autogen.py: comments out imports that dont resolve; fixes some returns --- py-json/LANforge/lf_json_autogen.py | 32 +++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/py-json/LANforge/lf_json_autogen.py b/py-json/LANforge/lf_json_autogen.py index 3b687206..ba9795ee 100644 --- a/py-json/LANforge/lf_json_autogen.py +++ b/py-json/LANforge/lf_json_autogen.py @@ -1,16 +1,15 @@ #!/usr/bin/env python3 """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated by LANforge JsonApiPythonGenerator, Mon Jun 21 23:25:47 PDT 2021 + Generated by LANforge JsonApiPythonGenerator, Tue Jun 22 15:59:34 PDT 2021 This file expects to live in py-json/LANforge directory. ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" import sys import json import keyword from enum import Enum -from LANforge import LFRequest -from LANforge.lfcli_base import LFCliBase +# from LANforge import LFRequest +# from LANforge.lfcli_base import LFCliBase from lfcli_base import LFCliBase -from typing import NewType, Type class LFJsonGet(LFCliBase): def __init__(self, lfclient_host='localhost', @@ -87,6 +86,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="attenuator", plural_key="attenuators") + # @@ -139,6 +139,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="chamber", plural_key="chambers") + # @@ -185,6 +186,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="", plural_key="") + # @@ -256,6 +258,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="dut", plural_key="duts") + # @@ -342,6 +345,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="endpoint", plural_key="endpoint") + # @@ -381,6 +385,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="alert", plural_key="alerts") + # @@ -438,6 +443,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="endpoint", plural_key="endpoint") + # @@ -487,6 +493,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="endpoint", plural_key="endpoints") + # @@ -518,6 +525,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="", plural_key="") + # @@ -595,6 +603,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="endpoint", plural_key="endpoint") + # @@ -709,6 +718,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="interface", plural_key="interfaces") + # @@ -765,6 +775,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="radio", plural_key="radios") + # @@ -823,6 +834,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="resource", plural_key="resources") + # @@ -854,6 +866,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="scan-results", plural_key="scan-results") + # @@ -900,6 +913,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="station", plural_key="stations") + # @@ -931,6 +945,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="sessions/messages", plural_key="sessions/messages") + # @@ -966,6 +981,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="groups", plural_key="groups") + # @@ -1000,6 +1016,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="record", plural_key="records") + # @@ -1047,6 +1064,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="connection", plural_key="connections") + # @@ -1114,6 +1132,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="endpoint", plural_key="endpoints") + # @@ -1179,6 +1198,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="virtual-routers", plural_key="virtual-routers") + # @@ -1228,6 +1248,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="router-connections", plural_key="router-connections") + # @@ -1269,6 +1290,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="", plural_key="") + # @@ -1334,6 +1356,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="endpoint", plural_key="endpoint") + # @@ -1365,6 +1388,7 @@ class LFJsonGet(LFCliBase): return self.extractValues(response=response, singular_key="", plural_key="") + # """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- From 6db0c5721b978ec409b55288a768f4cef8b21055 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 23 Jun 2021 06:28:38 -0600 Subject: [PATCH 017/152] test_l3_longevity.py : On AP: No stations are currently associated. No stations are currently associated, causes an exception when reading the AP for the MAC address. There are timing conditions when reading an AP/DUT. The state of the DUT is read from serial, ssh, Telnet. The script expects the AP/DUT in a specific state. The DUT state is not guaranteed. What may help is for the customer API to interface to the Device Under Test So as to isolate these timing issues and do log scraping for the correct Response. --- py-scripts/test_l3_longevity.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 46ab2f1d..11611b84 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -594,14 +594,14 @@ class L3VariableTime(Realm): "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)) - # read from the AP else: + # read from the AP ap_stats = self.read_ap_stats() #ap_stats_rows = [] # Array of Arrays ap_stats_rows = ap_stats.splitlines() - print("ap_stats_rows {}".format(ap_stats_rows)) + print("From AP: ap_stats_rows {}".format(ap_stats_rows)) # Query all of our ports # Note: the endp eid is the shelf.resource.port.endp-id @@ -609,16 +609,18 @@ class L3VariableTime(Realm): 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("query-port: %s: incomplete response:"%(url)) pprint(response) else: # print("response".format(response)) - # pprint(response) + pprint(response) p = response['interface'] - #print("#### 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)) for row in ap_stats_rows: split_row = row.split() @@ -628,11 +630,16 @@ class L3VariableTime(Realm): if split_row[0].lower() != mac.lower(): ap_row = split_row else: - if split_row[0].lower() == mac.lower(): - ap_row = split_row + try: + # split_row[0].lower() , mac from AP + # mac.lower() , mac from LANforge + if split_row[0].lower() == mac.lower(): + ap_row = split_row + except: + print(" 'No stations are currently associated.'? from AP") + print(" since possibly no stations: excption on compare split_row[0].lower() ") print("selected ap_row (from split_row): {}".format(ap_row)) - # Find latency, jitter for connections using this port. latency, jitter, tput = self.get_endp_stats_for_port(p["port"], endps) From 85bc68b293ef6d789e9494e14ca023215c006e3e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 23 Jun 2021 14:23:17 -0600 Subject: [PATCH 018/152] lf_check.py : do not crash if cannot copy html to lf_check_latest.html Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index e167223c..95d8e739 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -164,6 +164,7 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. try: if self.production_run == True: msg = message_txt.format(ip=self.host_ip_production) + # 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, @@ -805,7 +806,10 @@ Example : #]) # copy one directory above - shutil.copyfile(html_report, lf_check_latest_html) + try: + shutil.copyfile(html_report, lf_check_latest_html) + except: + print("check permissions on {lf_check_latest_html}".format(lf_check_latest_html=lf_check_latest_html)) shutil.copyfile(html_report, lf_check_html_report) # copy banner and logo From 2fbfeb1f29854304293fa24b4cabd9642c3255b3 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 23 Jun 2021 14:45:59 -0600 Subject: [PATCH 019/152] lf_check.py : try except around writing the pdf There needs to be some testing around writing the pdf when on the VM, For now put in the try except code. 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 95d8e739..6a5551e8 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -775,7 +775,10 @@ Example : report.build_custom() html_report = report.write_html_with_timestamp() print("html report: {}".format(html_report)) - report.write_pdf_with_timestamp() + try: + report.write_pdf_with_timestamp() + except: + print("exception write_pdf_with_timestamp()") report_path = os.path.dirname(html_report) parent_report_dir = os.path.dirname(report_path) From d3d8b542dc7f2419508069b39e4a1404fc0729bc Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Thu, 24 Jun 2021 14:31:49 -0700 Subject: [PATCH 020/152] Removed comment --- 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 db3cca2c..1b9ba8a7 100755 --- a/py-scripts/test_l4.py +++ b/py-scripts/test_l4.py @@ -390,7 +390,7 @@ python3 ./test_l4.py print(ip_test.get_fail_message()) exit(1) time.sleep(30) - # ip_test.cleanup(station_list) + ip_test.cleanup(station_list) if ip_test.passes(): print("Full test passed") From a2464e62eefaae248b6acccaa1f3d53ff4a0778e Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Thu, 24 Jun 2021 15:24:33 -0700 Subject: [PATCH 021/152] Changed test type from urls/s to urls to prevent possible errors from '/' --- py-json/l4_cxprofile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-json/l4_cxprofile.py b/py-json/l4_cxprofile.py index 2834e990..bcc0606b 100644 --- a/py-json/l4_cxprofile.py +++ b/py-json/l4_cxprofile.py @@ -21,7 +21,7 @@ class L4CXProfile(LFCliBase): self.local_realm = local_realm self.created_cx = {} self.created_endp = [] - self.test_type = "urls/s" + self.test_type = "urls" self.lfclient_port = lfclient_port self.lfclient_host = lfclient_host @@ -225,7 +225,7 @@ class L4CXProfile(LFCliBase): passes = 0 expected_passes = 0 timestamps = [] - if self.test_type != 'urls/s': + if self.test_type != 'urls': old_rx_values = self.get_bytes() for test in range(1+iterations): @@ -249,7 +249,7 @@ class L4CXProfile(LFCliBase): timestamps.append(t) value_map[t] = response expected_passes += 1 - if self.test_type == 'urls/s': + if self.test_type == 'urls': if self.check_errors(self.debug): if self.check_request_rate(): passes += 1 From d196ba58f1aedb966ceafc00053635754573f768 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Thu, 24 Jun 2021 15:24:37 -0700 Subject: [PATCH 022/152] Changed test type from urls/s to urls to prevent possible errors from '/' --- py-scripts/test_l4.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/py-scripts/test_l4.py b/py-scripts/test_l4.py index 1b9ba8a7..53d94c4f 100755 --- a/py-scripts/test_l4.py +++ b/py-scripts/test_l4.py @@ -15,7 +15,7 @@ test_ipv4_l4_ftp_wifi.py, test_ipv4_l4_urls_per_ten.py, test_ipv4_l4_urls_per_te EXAMPLE (urls/s): ./test_l4.py --upstream_port eth1 --radio wiphy0 --num_stations 3 --security {open|wep|wpa|wpa2|wpa3} - --ssid netgear --passwd admin123 --requests_per_ten 600 --mode 1 --num_tests 1 --test_type 'urls/s' + --ssid netgear --passwd admin123 --requests_per_ten 600 --mode 1 --num_tests 1 --test_type 'urls' --url "dl http://10.40.0.1 /dev/null" --ap "00:0e:8e:78:e1:76" --target_per_ten 600 --output_format csv --report_file ~/Documents/results.csv --test_duration 2m --debug @@ -33,7 +33,7 @@ EXAMPLE (bytes-rd): EXAMPLE (ftp urls/s): ./test_l4.py --upstream_port eth1 --radio wiphy0 --num_stations 3 --security {open|wep|wpa|wpa2|wpa3} --ssid netgear --passwd admin123 --test_duration 2m --interval 1s --mode 1 --ap "00:0e:8e:78:e1:76" - --requests_per_ten 600 --num_tests 1 --ftp --test_type 'urls/s' + --requests_per_ten 600 --num_tests 1 --ftp --test_type 'urls' --url "ul ftp://lanforge:lanforge@10.40.0.1/example.txt /home/lanforge/example.txt" --debug EXAMPLE (ftp bytes-wr): @@ -148,9 +148,9 @@ class IPV4L4(LFCliBase): if self.ftp and 'ftp://' not in self.url: print("WARNING! FTP test chosen, but ftp:// not present in url!") - if self.test_type != 'urls/s' and self.test_type != 'bytes-wr' and self.test_type != 'bytes-rd': + if self.test_type != 'urls' and self.test_type != 'bytes-wr' and self.test_type != 'bytes-rd': raise ValueError( - "Unknown test type: %s\nValid test types are urls/s, bytes-rd, or bytes-wr" % self.test_type) + "Unknown test type: %s\nValid test types are urls, bytes-rd, or bytes-wr" % self.test_type) def build(self): # Build stations @@ -281,7 +281,7 @@ python3 ./test_l4.py 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 {url/s, bytes-rd, bytes-wr}', + 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) From af0b97d820aac0aa7d57a695e638b243925004a0 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Thu, 24 Jun 2021 15:50:45 -0700 Subject: [PATCH 023/152] changed test_type check --- py-scripts/test_l4.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-scripts/test_l4.py b/py-scripts/test_l4.py index 53d94c4f..f9430fe6 100755 --- a/py-scripts/test_l4.py +++ b/py-scripts/test_l4.py @@ -148,7 +148,8 @@ class IPV4L4(LFCliBase): if self.ftp and 'ftp://' not in self.url: print("WARNING! FTP test chosen, but ftp:// not present in url!") - if self.test_type != 'urls' and self.test_type != 'bytes-wr' and self.test_type != 'bytes-rd': + test_types = {'urls', 'bytes-wr', 'bytes-rd'} + if self.test_type not in test_types: raise ValueError( "Unknown test type: %s\nValid test types are urls, bytes-rd, or bytes-wr" % self.test_type) From 9fa735bf56b18bc8590ad93bdc92ac33f2fecac1 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Thu, 24 Jun 2021 15:53:05 -0700 Subject: [PATCH 024/152] commented unnecessary output and exit_fail() call causing the test to end prematurely when not using urls test type --- py-json/l4_cxprofile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-json/l4_cxprofile.py b/py-json/l4_cxprofile.py index bcc0606b..87e327ca 100644 --- a/py-json/l4_cxprofile.py +++ b/py-json/l4_cxprofile.py @@ -112,7 +112,7 @@ class L4CXProfile(LFCliBase): if name in self.created_cx.keys(): expected_passes += 1 if info['urls/s'] * self.requests_per_ten >= self.target_requests_per_ten * .9: - print(name, info['urls/s'], info['urls/s'] * self.requests_per_ten, self.target_requests_per_ten * .9) + # print(name, info['urls/s'], info['urls/s'] * self.requests_per_ten, self.target_requests_per_ten * .9) passes += 1 return passes == expected_passes @@ -262,14 +262,14 @@ class L4CXProfile(LFCliBase): else: new_rx_values = self.get_bytes() - expected_passes += 1 if self.compare_vals(old_rx_values, new_rx_values): passes += 1 else: self._fail("FAIL: Not all stations increased traffic") - self.exit_fail() + # self.exit_fail() time.sleep(monitor_interval) + print(value_map) #[further] post-processing data, after test completion From b3ddc59c9a39a954df7d3265fab237ebc1ee13b5 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Thu, 24 Jun 2021 16:30:30 -0700 Subject: [PATCH 025/152] Added name column for report generation --- 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 f9430fe6..93425489 100755 --- a/py-scripts/test_l4.py +++ b/py-scripts/test_l4.py @@ -378,7 +378,7 @@ python3 ./test_l4.py layer4traffic = ','.join([[*x.keys()][0] for x in ip_test.local_realm.json_get('layer4')['endpoint']]) except: pass - ip_test.cx_profile.monitor(col_names=['bytes-rd', 'urls/s', 'bytes-wr'], + 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(), created_cx=layer4traffic, From 385a3d2c21a4917307d13a1bd90e115c950175e2 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Thu, 24 Jun 2021 16:48:23 -0700 Subject: [PATCH 026/152] Changed default value for --source option --- 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 93425489..e2200500 100755 --- a/py-scripts/test_l4.py +++ b/py-scripts/test_l4.py @@ -291,7 +291,7 @@ python3 ./test_l4.py default="/dev/null") optional.add_argument('--source', help='--source specifies the source of the file, should be used when uploading', - default="/tmp/data_slug_4K.bin") + default="/var/www/html/data_slug_4K.bin") args = parser.parse_args() From d1e4351b70a7a140f2f0f2372c794a42e65b9c95 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 24 Jun 2021 16:53:22 -0700 Subject: [PATCH 027/152] test rig command and other improvements to automation Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 76 ++++++++++++++++++++++++++--- py-json/cv_test_reports.py | 2 +- py-scripts/lf_dataplane_test.py | 9 +++- py-scripts/lf_wifi_capacity_test.py | 9 +++- 4 files changed, 85 insertions(+), 11 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index 993f8764..8ebaf300 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -21,6 +21,7 @@ from scp import SCPClient import paramiko from GrafanaRequest import GrafanaRequest import time +from collections import Counter class CSVReader: @@ -45,6 +46,50 @@ class CSVReader: values.append(row[index]) return values + def get_columns(self, df, targets): + target_index = [] + for item in targets: + target_index.append(df[0].index(item)) + results = [] + for row in df: + row_data = [] + for x in target_index: + row_data.append(row[x]) + results.append(row_data) + return results + + def to_html(self, df): + html = '' + html = html + ('') + for row in df: + for item in row: + html = html + ('' % item) + html = html + ('\n') + html = html + ('
%s
') + return html + + def filter_df(self, df, column, expression, target): + target_index = df[0].index(column) + counter = 0 + targets = [0] + for row in df: + try: + if expression == 'less than': + if float(row[target_index]) <= target: + targets.append(counter) + counter += 1 + else: + counter += 1 + if expression == 'greater than': + if float(row[target_index]) >= target: + targets.append(counter) + counter += 1 + else: + counter += 1 + except: + counter += 1 + return list(map(df.__getitem__, targets)) + class GhostRequest: def __init__(self, @@ -176,6 +221,7 @@ class GhostRequest: ) if test_run is None: test_run = sorted(folders)[0].split('/')[-1].strip('/') + print(folders) for folder in folders: print(folder) ssh_pull = paramiko.SSHClient() @@ -196,6 +242,13 @@ class GhostRequest: print('target file %s' % target_file) df = csvreader.read_csv(file=target_file, sep='\t') csv_testbed = csvreader.get_column(df, 'test-rig')[0] + pass_fail = Counter(csvreader.get_column(df, 'pass/fail')) + if pass_fail['PASS'] + pass_fail['FAIL'] > 0: + text = text + 'Tests passed: %s
' % pass_fail['PASS'] + text = text + 'Tests failed: %s
' % pass_fail['FAIL'] + text = text + 'Percentage of tests passed: %s
' % ( + pass_fail['PASS'] / (pass_fail['PASS'] + pass_fail['FAIL'])) + print(csv_testbed) except: pass @@ -215,17 +268,17 @@ class GhostRequest: allow_agent=False, look_for_keys=False) scp_push = SCPClient(ssh_push.get_transport()) - local_path = '/home/%s/%s/%s/%s' % (user_push, customer, testbed, test_run) + local_path = '/home/%s/%s/%s' % (user_push, customer, testbed) transport = paramiko.Transport((ghost_host, port)) transport.connect(None, user_push, password_push) sftp = paramiko.sftp_client.SFTPClient.from_transport(transport) - print(local_path) + print('Local Path: %s' % local_path) try: sftp.mkdir(local_path) - scp_push.put(target_folder, recursive=True, remote_path=local_path) except: print('folder %s already exists' % local_path) - print(target_folder) + scp_push.put(target_folder, recursive=True, remote_path=local_path) + print(local_path + '/' + target_folder) files = sftp.listdir(local_path + '/' + target_folder) # print('Files: %s' % files) for file in files: @@ -251,7 +304,17 @@ class GhostRequest: time.sleep(3) snapshot = grafana.list_snapshots()[-1] print(snapshot) - text = text + '' % (grafana_host, snapshot['key'], '%') + text = text + '
' % ( + grafana_host, snapshot['key'], '%') + + results = csvreader.get_columns(df,['short-description','numeric-score','test details','test-priority']) + + low_priority = csvreader.to_html(csvreader.filter_df(results, 'test-priority', 'less than', 94)) + high_priority = csvreader.to_html(csvreader.filter_df(results, 'test-priority', 'greater than', 95)) + + text = text + 'High priority results: %s' % high_priority + + text = text + 'Low priority results: %s' % low_priority now = date.now() @@ -261,7 +324,8 @@ class GhostRequest: # create Grafana Dashboard target_files = [] for folder in folders: - target_files.append(folder.strip('/home/lanforge/html-reports/') + '/kpi.csv') + print(folder) + target_files.append(folder.split('/')[-1] + '/kpi.csv') grafana.create_custom_dashboard(target_csvs=target_files, title=title) diff --git a/py-json/cv_test_reports.py b/py-json/cv_test_reports.py index e385057d..4589b18b 100644 --- a/py-json/cv_test_reports.py +++ b/py-json/cv_test_reports.py @@ -9,7 +9,7 @@ class lanforge_reports: ssh = paramiko.SSHClient() ssh.load_system_host_keys() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - ssh.connect(hostname=hostname, username=username, password=password, port=port) + ssh.connect(hostname=hostname, username=username, password=password, port=port, allow_agent=False, look_for_keys=False) with SCPClient(ssh.get_transport()) as scp: scp.get(remote_path=report_location, local_path=local_path, recursive=True) diff --git a/py-scripts/lf_dataplane_test.py b/py-scripts/lf_dataplane_test.py index 40b44f1a..987f0f0f 100755 --- a/py-scripts/lf_dataplane_test.py +++ b/py-scripts/lf_dataplane_test.py @@ -138,7 +138,8 @@ class DataplaneTest(cv_test): raw_lines_file="", sets=[], graph_groups=None, - report_dir="" + report_dir="", + test_rig="" ): super().__init__(lfclient_host=lf_host, lfclient_port=lf_port) @@ -166,6 +167,7 @@ class DataplaneTest(cv_test): self.report_dir = report_dir self.ssh_port = ssh_port self.local_path = local_path + self.test_rig = test_rig def setup(self): # Nothing to do at this time. @@ -200,6 +202,8 @@ class DataplaneTest(cv_test): cfg_options.append("duration: " + self.duration) if self.dut != "": cfg_options.append("selected_dut: " + self.dut) + if self.test_rig != "": + cfg_options.append("test_rig: " + self.test_rig) # We deleted the scenario earlier, now re-build new one line at a time. @@ -386,7 +390,8 @@ def main(): raw_lines = args.raw_line, raw_lines_file = args.raw_lines_file, sets = args.set, - graph_groups = args.graph_groups + graph_groups = args.graph_groups, + test_rig=args.test_rig ) CV_Test.setup() CV_Test.run() diff --git a/py-scripts/lf_wifi_capacity_test.py b/py-scripts/lf_wifi_capacity_test.py index 24364cc6..cde82781 100755 --- a/py-scripts/lf_wifi_capacity_test.py +++ b/py-scripts/lf_wifi_capacity_test.py @@ -353,7 +353,8 @@ class WiFiCapacityTest(cv_test): influx_host="localhost", influx_port=8086, report_dir="", - graph_groups=None + graph_groups=None, + test_rig="" ): super().__init__(lfclient_host=lfclient_host, lfclient_port=lf_port) @@ -390,6 +391,7 @@ class WiFiCapacityTest(cv_test): self.influx_port = influx_port self.report_dir = report_dir self.graph_groups = graph_groups + self.test_rig = test_rig def setup(self): if self.create_stations and self.stations != "": @@ -445,6 +447,8 @@ class WiFiCapacityTest(cv_test): cfg_options.append("ul_rate: " + self.upload_rate) if self.download_rate != "": cfg_options.append("dl_rate: " + self.download_rate) + if self.test_rig != "": + cfg_options.append("test_rig: " + self.test_rig) cfg_options.append("save_csv: 1") @@ -550,7 +554,8 @@ def main(): raw_lines=args.raw_line, raw_lines_file=args.raw_lines_file, sets=args.set, - graph_groups=args.graph_groups + graph_groups=args.graph_groups, + test_rig=args.test_rig ) WFC_Test.setup() WFC_Test.run() From eaa75b84c8bedd131796eaa12132b0a2d0109501 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 24 Jun 2021 23:53:16 -0600 Subject: [PATCH 028/152] lf_check.py : updated paths in report so path does not have to be edited Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 6a5551e8..537c22b6 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -35,6 +35,7 @@ TO DO NOTES: 6/14/2021 : 1. add server (telnet localhost 4001) build info, GUI build sha, and Kernel version to the output. 2. add unique database prior to each run +3. note the symbolic link at 192.168.100.201:/var/www/html/html-reports is pointing to /home/lanforge/html-reports ''' import datetime @@ -141,6 +142,8 @@ class lf_check(): report_url = report_url[1:] # 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 #command = 'echo "$HOSTNAME mail system works!" | mail -s "Test: $HOSTNAME $(date)" chuck.rekiere@candelatech.com' hostname = socket.gethostname() ip = socket.gethostbyname(hostname) @@ -629,16 +632,17 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. self.logger.info("TIMEOUT FAILURE, Check LANforge Radios") self.test_result = "Time Out" background = self.background_purple - + # 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','') self.html_results += """ """ + str(test) + """""" + str(command) + """ """ + str(self.test_result) + """ - STDOUT""" + STDOUT""" if self.test_result == "Failure": - self.html_results += """STDERR""" + self.html_results += """STDERR""" elif self.test_result == "Time Out": - self.html_results += """STDERR""" - #self.html_results += """""" + self.html_results += """STDERR""" else: self.html_results += """""" self.html_results += """""" From 5ef8761d9ca654df6cfc728a21a5f426fd8dce01 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 25 Jun 2021 10:58:35 -0600 Subject: [PATCH 029/152] lf_dataplane_test.py : fir pull_report be able to select the local path Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_dataplane_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py-scripts/lf_dataplane_test.py b/py-scripts/lf_dataplane_test.py index 987f0f0f..851467d9 100755 --- a/py-scripts/lf_dataplane_test.py +++ b/py-scripts/lf_dataplane_test.py @@ -305,6 +305,8 @@ 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_path", help="--local_path default '' put where dataplane script run from",default="") + args = parser.parse_args() @@ -379,6 +381,7 @@ def main(): config_name = args.config_name, upstream = args.upstream, pull_report = args.pull_report, + local_path = args.local_path, load_old_cfg = args.load_old_cfg, download_speed = args.download_speed, upload_speed = args.upload_speed, From 3494dbed891b584fb8fe55c96d493022cd1a47f8 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 25 Jun 2021 13:08:44 -0600 Subject: [PATCH 030/152] lf_check.py : comment updates updated GENERIC NOTES: A. for build information on LANforgeGUI : /home/lanforge ./btserver --version B. for the kernel version uname -r (just verion ), uname -a build date Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 537c22b6..8fd1c884 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -31,10 +31,11 @@ Using .json: 1. copy lf_check.json to .json this will avoide .json being overwritten on git pull 2. update lf_check.json to enable (TRUE) tests to be run in the test suite, the default TEST_DICTIONARY -TO DO NOTES: -6/14/2021 : +GENERIC NOTES: 1. add server (telnet localhost 4001) build info, GUI build sha, and Kernel version to the output. -2. add unique database prior to each run + A. for build information on LANforgeGUI : /home/lanforge ./btserver --version + B. for the kernel version uname -r (just verion ), uname -a build date +2. Use json to pass in influx config and ghost config 3. note the symbolic link at 192.168.100.201:/var/www/html/html-reports is pointing to /home/lanforge/html-reports ''' From f95bcf3948a2926f75a1e152c4d738283f1b9c34 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 25 Jun 2021 13:52:57 -0700 Subject: [PATCH 031/152] correct csv file naming in csv_to_influx.py Signed-off-by: Matthew Stidham --- py-json/station_profile.py | 3 ++- py-scripts/csv_to_influx.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/py-json/station_profile.py b/py-json/station_profile.py index d42cedc1..e3046779 100644 --- a/py-json/station_profile.py +++ b/py-json/station_profile.py @@ -230,7 +230,8 @@ class StationProfile: # self.add_sta_data["key"] = passwd def station_mode_to_number(self,mode): - modes = ['a','b','g','abg','an','abgn','bgn','bg','abgn-AC','bgn-AC','an-AC'] + modes = ['a', 'b', 'g', 'abg', 'an', 'abgn', 'bgn', 'bg', 'abgn-AC', 'bgn-AC', 'an-AC'] + return modes.index(mode) + 1 def add_security_extra(self, security): types = {"wep": "wep_enable", "wpa": "wpa_enable", "wpa2": "wpa2_enable", "wpa3": "use-wpa3", "open": "[BLANK]"} diff --git a/py-scripts/csv_to_influx.py b/py-scripts/csv_to_influx.py index f710356f..10ad58ac 100755 --- a/py-scripts/csv_to_influx.py +++ b/py-scripts/csv_to_influx.py @@ -42,7 +42,7 @@ class CSVtoInflux(): target_csv=None, sep='\t'): self.influxdb = influxdb - self.target_csv = target_csv.replace('/home/lanforge/html-reports/', '') + self.target_csv = target_csv self.influx_tag = _influx_tag self.sep = sep From 04c7a4135b92e89a37b32232be10bf5e9046aa21 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 25 Jun 2021 14:20:52 -0600 Subject: [PATCH 032/152] lf_wif_capacity_test.py : set the report path location using local_path Added the arg for args parser. the local_path was already plumbed though cv_test_manager.py and cv_test_reports.py Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_wifi_capacity_test.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/py-scripts/lf_wifi_capacity_test.py b/py-scripts/lf_wifi_capacity_test.py index cde82781..fa3bb9dc 100755 --- a/py-scripts/lf_wifi_capacity_test.py +++ b/py-scripts/lf_wifi_capacity_test.py @@ -354,7 +354,8 @@ class WiFiCapacityTest(cv_test): influx_port=8086, report_dir="", graph_groups=None, - test_rig="" + test_rig="", + local_path="" ): super().__init__(lfclient_host=lfclient_host, lfclient_port=lf_port) @@ -392,6 +393,7 @@ class WiFiCapacityTest(cv_test): self.report_dir = report_dir self.graph_groups = graph_groups self.test_rig = test_rig + self.local_path = local_path def setup(self): if self.create_stations and self.stations != "": @@ -469,7 +471,7 @@ class WiFiCapacityTest(cv_test): self.create_and_run_test(self.load_old_cfg, self.test_name, self.instance_name, self.config_name, self.sets, self.pull_report, self.lfclient_host, self.lf_user, self.lf_password, - cv_cmds, graph_groups_file=self.graph_groups) + cv_cmds, graph_groups_file=self.graph_groups, local_path=self.local_path) self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name @@ -523,6 +525,8 @@ 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_path", help="--local_path default '' put where dataplane script run from",default="") + args = parser.parse_args() cv_base_adjust_parser(args) @@ -555,7 +559,8 @@ def main(): raw_lines_file=args.raw_lines_file, sets=args.set, graph_groups=args.graph_groups, - test_rig=args.test_rig + test_rig=args.test_rig, + local_path=args.local_path ) WFC_Test.setup() WFC_Test.run() From eca0e61e19ef580362e070bf237290b58bec53e6 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 29 Jun 2021 05:25:37 -0600 Subject: [PATCH 033/152] ap_ctl.py : fixed usage -b is for baud Signed-off-by: Chuck SmileyRekiere --- ap_ctl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ap_ctl.py b/ap_ctl.py index 0a67ea04..c562b302 100755 --- a/ap_ctl.py +++ b/ap_ctl.py @@ -79,7 +79,7 @@ def usage(): print("-s|--scheme (serial|telnet|ssh): connect to controller via serial, ssh or telnet") print("--tty Serial port for accessing AP") print("-l|--log file: log messages here") - print("-b|--band: a (5Ghz) or b (2.4Ghz) or abgn for dual-band 2.4Ghz AP") + print("-b|--baud: serial baud rate") print("-z|--action: action") print("-h|--help") From 99736ceaaafc6b5e15351b1af9a948d960cfd2f3 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 29 Jun 2021 06:03:50 -0600 Subject: [PATCH 034/152] lf_check.py : added the ability to use the lf_report path name to be passed in a report Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 8fd1c884..03fe47ad 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -80,12 +80,14 @@ class lf_check(): _test_suite, _production, _csv_results, - _outfile): + _outfile, + _report_path): self.use_json = _use_json self.json_data = _json_data self.config_ini = _config_ini self.test_suite = _test_suite self.production_run = _production + self.report_path = _report_path self.lf_mgr_ip = "" self.lf_mgr_port = "" self.radio_dict = {} @@ -552,6 +554,11 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. if 'UPSTREAM_PORT' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('UPSTREAM_PORT',self.col_names) + # 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) + if 'load_db' in self.test_dict[test]: 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": @@ -729,6 +736,7 @@ Example : csv_results = report.file_add_path(csv_results) outfile = "lf_check-{}-{}".format(args.outfile,current_time) outfile_path = report.file_add_path(outfile) + report_path = report.get_report_path() # lf_check() class created check = lf_check(_use_json = use_json, @@ -737,7 +745,8 @@ Example : _test_suite = test_suite, _production = production, _csv_results = csv_results, - _outfile = outfile_path) + _outfile = outfile_path, + _report_path = report_path) # get git sha process = subprocess.Popen(["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE) From 731883f5f7a960054218459b03f0c353cc30d30c Mon Sep 17 00:00:00 2001 From: jitendracandela Date: Tue, 29 Jun 2021 17:36:45 +0530 Subject: [PATCH 035/152] changes in lf bar graph(value shows on the top of the bar) --- py-scripts/lf_graph.py | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index df109b65..61aafe13 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -43,6 +43,8 @@ class lf_bar_graph(): _font_weight='bold', _color_name=['lightcoral', 'darkgrey', 'r', 'g', 'b', 'y'], _figsize=(10, 5), + _show_bar_value=False, + _xaxis_step=5, _dpi=96): self.data_set = _data_set @@ -57,6 +59,8 @@ class lf_bar_graph(): self.font_weight = _font_weight self.color_name = _color_name self.figsize = _figsize + self.show_bar_value = _show_bar_value + self.xaxis_step = _xaxis_step def build_bar_graph(self): if self.color is None: @@ -68,24 +72,39 @@ class lf_bar_graph(): fig = plt.subplots(figsize=self.figsize) i = 0 + + def show_value(rects): + for rect in rects: + h = rect.get_height() + plt.text(rect.get_x() + rect.get_width() / 2., h + 0.05, '%d' % int(h), + ha='center', va='bottom') + for data in self.data_set: if i > 0: br = br1 br2 = [x + self.bar_width for x in br] - plt.bar(br2, self.data_set[i], color=self.color[i], width=self.bar_width, - edgecolor=self.color_edge, label=self.label[i]) + rects = plt.bar(br2, self.data_set[i], color=self.color[i], width=self.bar_width, + edgecolor=self.color_edge, label=self.label[i]) + if self.show_bar_value: + show_value(rects) br1 = br2 i = i + 1 else: br1 = np.arange(len(self.data_set[i])) - plt.bar(br1, self.data_set[i], color=self.color[i], width=self.bar_width, - edgecolor=self.color_edge, label=self.label[i]) + rects = plt.bar(br1, self.data_set[i], color=self.color[i], width=self.bar_width, + edgecolor=self.color_edge, label=self.label[i]) + if self.show_bar_value: + show_value(rects) i = i + 1 plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15) plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15) - """plt.xticks([r + self.bar_width for r in range(len(self.data_set[0]))], - self.xaxis_categories)""" - plt.xticks(np.arange(0, len(self.xaxis_categories), step=5)) + + if isinstance(self.xaxis_categories[0], int): + plt.xticks(np.arange(0, len(self.xaxis_categories), step=self.xaxis_step)) + else: + plt.xticks(np.arange(0, len(self.xaxis_categories)),self.xaxis_categories) + + plt.legend() fig = plt.gcf() From 7d60fcfbb0fd024a6bbd1a5736478a69ebd7956a Mon Sep 17 00:00:00 2001 From: jitendracandela Date: Tue, 29 Jun 2021 20:09:15 +0530 Subject: [PATCH 036/152] changes in lf bar graph(value shows on the top of the bar) --- py-scripts/lf_graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index 61aafe13..bb5ce093 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -102,7 +102,7 @@ class lf_bar_graph(): if isinstance(self.xaxis_categories[0], int): plt.xticks(np.arange(0, len(self.xaxis_categories), step=self.xaxis_step)) else: - plt.xticks(np.arange(0, len(self.xaxis_categories)),self.xaxis_categories) + plt.xticks(np.arange(0, len(self.xaxis_categories)), self.xaxis_categories) plt.legend() From 335ef5859e96b2cdc5ddd22b6fab570a2419f328 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 29 Jun 2021 09:33:32 -0600 Subject: [PATCH 037/152] cv_test_manager.py : update for lf_wifi_capacity.py and lf_dataplane_test.py being run on a remote system from lanforge and needing to gather KPI Signed-off-by: Chuck SmileyRekiere --- py-json/cv_test_manager.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index f681d5a5..679a39dd 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -12,6 +12,7 @@ from pprint import pprint import argparse from cv_test_reports import lanforge_reports as lf_rpt from csv_to_influx import * +import os.path def cv_base_adjust_parser(args): @@ -407,8 +408,15 @@ class cv_test(Realm): _influx_token=args.influx_token, _influx_bucket=args.influx_bucket) - path = "%s/kpi.csv" % (self.report_dir) - + # lf_wifi_capacity_test.py may be run / initiated by a remote system against a lanforge + # the local_path is data is stored, if there is no local_path then the test is run directly on lanforge + if self.local_path == "": + path = "%s/kpi.csv" % (self.report_dir) + else: + kpi_location = self.local_path + "/" + os.path.basename(self.report_dir) + # the local_path is the parent directory, need to get the directory name + path = "%s/kpi.csv" % (kpi_location) + print("Attempt to submit kpi: ", path) csvtoinflux = CSVtoInflux(influxdb=influxdb, target_csv=path, From 9945e42f3c6875f52b30452cf7ad470b3645a8c2 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 29 Jun 2021 10:33:52 -0600 Subject: [PATCH 038/152] py-json: cv_test_manager.py , cv_test_reports.py py-scripts: lf_dataplane_test.py lf_wifi_capacity_test.py local_path updated to local_lf_report_dir Signed-off-by: Chuck SmileyRekiere --- py-json/cv_test_manager.py | 22 +++++++++++----------- py-json/cv_test_reports.py | 4 ++-- py-scripts/lf_dataplane_test.py | 10 +++++----- py-scripts/lf_wifi_capacity_test.py | 10 +++++----- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index 679a39dd..69cdc363 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -68,11 +68,11 @@ class cv_test(Realm): def __init__(self, lfclient_host="localhost", lfclient_port=8080, - report_dir="" + lf_report_dir="" ): super().__init__(lfclient_host=lfclient_host, lfclient_port=lfclient_port) - self.report_dir = report_dir + self.lf_report_dir = lf_report_dir self.report_name = None # Add a config line to a text blob. Will create new text blob @@ -287,7 +287,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_path="", ssh_port=22, + pull_report, lf_host, lf_user, lf_password, cv_cmds, local_lf_report_dir="", ssh_port=22, graph_groups_file=None): load_old = "false" if load_old_cfg: @@ -350,12 +350,12 @@ class cv_test(Realm): filelocation.write(location + '/kpi.csv\n') filelocation.close() print(location) - self.report_dir = location + self.lf_report_dir = location if pull_report: try: print(lf_host) report.pull_reports(hostname=lf_host, username=lf_user, password=lf_password, - port=ssh_port, local_path=local_path, + port=ssh_port, local_lf_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)) @@ -386,7 +386,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.report_dir == "": + if self.lf_report_dir == "": # Nothing to report on. print("Not submitting to influx, no report-dir.\n") return @@ -409,12 +409,12 @@ class cv_test(Realm): _influx_bucket=args.influx_bucket) # lf_wifi_capacity_test.py may be run / initiated by a remote system against a lanforge - # the local_path is data is stored, if there is no local_path then the test is run directly on lanforge - if self.local_path == "": - path = "%s/kpi.csv" % (self.report_dir) + # the local_lf_report_dir is 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 == "": + path = "%s/kpi.csv" % (self.lf_report_dir) else: - kpi_location = self.local_path + "/" + os.path.basename(self.report_dir) - # the local_path is the parent directory, need to get the directory name + 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 path = "%s/kpi.csv" % (kpi_location) print("Attempt to submit kpi: ", path) diff --git a/py-json/cv_test_reports.py b/py-json/cv_test_reports.py index 4589b18b..2a6a8df6 100644 --- a/py-json/cv_test_reports.py +++ b/py-json/cv_test_reports.py @@ -5,13 +5,13 @@ class lanforge_reports: def pull_reports(self, hostname="localhost", port=22, username="lanforge", password="lanforge", report_location="/home/lanforge/html-reports/", - local_path="../../../reports/"): + local_lf_report_dir="../../../reports/"): ssh = paramiko.SSHClient() ssh.load_system_host_keys() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname=hostname, username=username, password=password, port=port, allow_agent=False, look_for_keys=False) with SCPClient(ssh.get_transport()) as scp: - scp.get(remote_path=report_location, local_path=local_path, recursive=True) + scp.get(remote_path=report_location, local_lf_report_dir=local_lf_report_dir, recursive=True) scp.close() diff --git a/py-scripts/lf_dataplane_test.py b/py-scripts/lf_dataplane_test.py index 851467d9..e76d6bc0 100755 --- a/py-scripts/lf_dataplane_test.py +++ b/py-scripts/lf_dataplane_test.py @@ -121,7 +121,7 @@ class DataplaneTest(cv_test): lf_user="lanforge", lf_password="lanforge", ssh_port=22, - local_path="", + local_lf_report_dir="", instance_name="dpt_instance", config_name="dpt_config", upstream="1.1.eth2", @@ -166,7 +166,7 @@ class DataplaneTest(cv_test): self.graph_groups = graph_groups self.report_dir = report_dir self.ssh_port = ssh_port - self.local_path = local_path + self.local_lf_report_dir = local_lf_report_dir self.test_rig = test_rig def setup(self): @@ -213,7 +213,7 @@ class DataplaneTest(cv_test): 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_path=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 @@ -305,7 +305,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_path", help="--local_path 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() @@ -381,7 +381,7 @@ def main(): config_name = args.config_name, upstream = args.upstream, pull_report = args.pull_report, - local_path = args.local_path, + 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, diff --git a/py-scripts/lf_wifi_capacity_test.py b/py-scripts/lf_wifi_capacity_test.py index fa3bb9dc..2f932374 100755 --- a/py-scripts/lf_wifi_capacity_test.py +++ b/py-scripts/lf_wifi_capacity_test.py @@ -355,7 +355,7 @@ class WiFiCapacityTest(cv_test): report_dir="", graph_groups=None, test_rig="", - local_path="" + local_lf_report_dir="" ): super().__init__(lfclient_host=lfclient_host, lfclient_port=lf_port) @@ -393,7 +393,7 @@ class WiFiCapacityTest(cv_test): self.report_dir = report_dir self.graph_groups = graph_groups self.test_rig = test_rig - self.local_path = local_path + self.local_lf_report_dir = local_lf_report_dir def setup(self): if self.create_stations and self.stations != "": @@ -471,7 +471,7 @@ class WiFiCapacityTest(cv_test): self.create_and_run_test(self.load_old_cfg, self.test_name, self.instance_name, self.config_name, self.sets, self.pull_report, self.lfclient_host, self.lf_user, self.lf_password, - cv_cmds, graph_groups_file=self.graph_groups, local_path=self.local_path) + cv_cmds, graph_groups_file=self.graph_groups, local_lf_report_dir=self.local_lf_report_dir) self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name @@ -525,7 +525,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_path", help="--local_path 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() @@ -560,7 +560,7 @@ def main(): sets=args.set, graph_groups=args.graph_groups, test_rig=args.test_rig, - local_path=args.local_path + local_lf_report_dir=args.local_lf_report_dir ) WFC_Test.setup() WFC_Test.run() From 3408d5807890579e3d799b08e776e399234c918d Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 29 Jun 2021 14:09:21 -0600 Subject: [PATCH 039/152] cv_test_reports.py : bug fix Signed-off-by: Chuck SmileyRekiere --- py-json/cv_test_reports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/cv_test_reports.py b/py-json/cv_test_reports.py index 2a6a8df6..2b5fd918 100644 --- a/py-json/cv_test_reports.py +++ b/py-json/cv_test_reports.py @@ -12,6 +12,6 @@ class lanforge_reports: ssh.connect(hostname=hostname, username=username, password=password, port=port, allow_agent=False, look_for_keys=False) with SCPClient(ssh.get_transport()) as scp: - scp.get(remote_path=report_location, local_lf_report_dir=local_lf_report_dir, recursive=True) + scp.get(remote_path=report_location, report_dir=local_lf_report_dir, recursive=True) scp.close() From 7ca355c13dff1ed59070a08e109f6c08d1a5a59e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 29 Jun 2021 14:32:15 -0600 Subject: [PATCH 040/152] cv_test_manager.py , cv_test_reports.py : bug fix on report_dir Signed-off-by: Chuck SmileyRekiere --- py-json/cv_test_manager.py | 2 +- py-json/cv_test_reports.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index 69cdc363..324c194c 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -355,7 +355,7 @@ class cv_test(Realm): try: print(lf_host) report.pull_reports(hostname=lf_host, username=lf_user, password=lf_password, - port=ssh_port, local_lf_report_dir=local_lf_report_dir, + 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)) diff --git a/py-json/cv_test_reports.py b/py-json/cv_test_reports.py index 2b5fd918..a1db567a 100644 --- a/py-json/cv_test_reports.py +++ b/py-json/cv_test_reports.py @@ -5,13 +5,13 @@ class lanforge_reports: def pull_reports(self, hostname="localhost", port=22, username="lanforge", password="lanforge", report_location="/home/lanforge/html-reports/", - local_lf_report_dir="../../../reports/"): + report_dir="../../../reports/"): ssh = paramiko.SSHClient() ssh.load_system_host_keys() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname=hostname, username=username, password=password, port=port, allow_agent=False, look_for_keys=False) with SCPClient(ssh.get_transport()) as scp: - scp.get(remote_path=report_location, report_dir=local_lf_report_dir, recursive=True) + scp.get(remote_path=report_location, report_dir=report_dir, recursive=True) scp.close() From 4dbdf2eaad89c506012cfd2f29c082eb5ba923e4 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 29 Jun 2021 14:39:42 -0600 Subject: [PATCH 041/152] cv_test_reports.py : found that was clobbering the local_path Signed-off-by: Chuck SmileyRekiere --- py-json/cv_test_reports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/cv_test_reports.py b/py-json/cv_test_reports.py index a1db567a..325bb9d9 100644 --- a/py-json/cv_test_reports.py +++ b/py-json/cv_test_reports.py @@ -12,6 +12,6 @@ class lanforge_reports: ssh.connect(hostname=hostname, username=username, password=password, port=port, allow_agent=False, look_for_keys=False) with SCPClient(ssh.get_transport()) as scp: - scp.get(remote_path=report_location, report_dir=report_dir, recursive=True) + scp.get(remote_path=report_location, local_path=report_dir, recursive=True) scp.close() From 8014226b32b2de37a172b5553eead50aea0080cb Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 29 Jun 2021 14:56:31 -0700 Subject: [PATCH 042/152] Major Ghost script improvements and additions Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 215 +++++++++++++++++++-------------- py-dashboard/GrafanaRequest.py | 69 ++++++++--- py-scripts/ghost_profile.py | 124 ++++++++++--------- py-scripts/grafana_profile.py | 41 ------- 4 files changed, 241 insertions(+), 208 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index 8ebaf300..1b576389 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -61,7 +61,7 @@ class CSVReader: def to_html(self, df): html = '' html = html + ('') - for row in df: + for row in df[1:]: for item in row: html = html + ('' % item) html = html + ('\n') @@ -75,12 +75,18 @@ class CSVReader: for row in df: try: if expression == 'less than': - if float(row[target_index]) <= target: + if float(row[target_index]) < target: targets.append(counter) counter += 1 else: counter += 1 if expression == 'greater than': + if float(row[target_index]) > target: + targets.append(counter) + counter += 1 + else: + counter += 1 + if expression == 'greater than or equal to': if float(row[target_index]) >= target: targets.append(counter) counter += 1 @@ -90,6 +96,12 @@ class CSVReader: counter += 1 return list(map(df.__getitem__, targets)) + def concat(self, dfs): + final_df = dfs[0] + for df in dfs[1:]: + final_df = final_df + df[1:] + return final_df + class GhostRequest: def __init__(self, @@ -193,25 +205,26 @@ class GhostRequest: tags='custom', authors=authors) - def wifi_capacity_to_ghost(self, - authors, - folders, - title=None, - server_pull=None, - ghost_host=None, - port='22', - user_pull='lanforge', - password_pull='lanforge', - user_push=None, - password_push=None, - customer=None, - testbed='Unknown Testbed', - test_run=None, - target_folders=list(), - grafana_dashboard=None, - grafana_token=None, - grafana_host=None, - grafana_port=3000): + def kpi_to_ghost(self, + authors, + folders, + parent_folder=None, + title=None, + server_pull=None, + ghost_host=None, + port=22, + user_push=None, + password_push=None, + customer=None, + testbed='Unknown Testbed', + test_run=None, + target_folders=list(), + grafana_dashboard=None, + grafana_token=None, + grafana_host=None, + grafana_port=3000, + grafana_datasource='InfluxDB', + grafana_bucket=None): text = '' csvreader = CSVReader() if grafana_token is not None: @@ -219,27 +232,44 @@ class GhostRequest: grafana_host, grafanajson_port=grafana_port ) - if test_run is None: - test_run = sorted(folders)[0].split('/')[-1].strip('/') - print(folders) - for folder in folders: - print(folder) - ssh_pull = paramiko.SSHClient() - ssh_pull.set_missing_host_key_policy(paramiko.client.AutoAddPolicy) - ssh_pull.connect(server_pull, - port, - username=user_pull, - password=password_pull, - allow_agent=False, - look_for_keys=False) - scp_pull = SCPClient(ssh_pull.get_transport()) - scp_pull.get(folder, recursive=True) - target_folder = str(folder).rstrip('/').split('/')[-1] - target_folders.append(target_folder) - print('Target folder: %s' % target_folder) + #if parent_folder is None: + #test_run = sorted(folders)[0].split('/')[-1].strip('/') + print('Folders: %s' % folders) + + ssh_push = paramiko.SSHClient() + ssh_push.set_missing_host_key_policy(paramiko.client.AutoAddPolicy) + ssh_push.connect(ghost_host, + port, + username=user_push, + password=password_push, + allow_agent=False, + look_for_keys=False) + scp_push = SCPClient(ssh_push.get_transport()) + + if parent_folder is not None: + print("parent_folder %s" % parent_folder) + files = os.listdir(parent_folder) + print(files) + for file in files: + if os.path.isdir(parent_folder+'/'+file) is True: + import shutil + shutil.move(parent_folder+'/'+file, file) + target_folders.append(file) + print('Target folders: %s' % target_folders) + else: + for folder in folders: + print(folder) + target_folders.append(folder) + + testbeds = list() + pdfs = list() + high_priority_list = list() + low_priority_list = list() + images = list() + + for target_folder in target_folders: try: target_file = '%s/kpi.csv' % target_folder - print('target file %s' % target_file) df = csvreader.read_csv(file=target_file, sep='\t') csv_testbed = csvreader.get_column(df, 'test-rig')[0] pass_fail = Counter(csvreader.get_column(df, 'pass/fail')) @@ -249,87 +279,94 @@ class GhostRequest: text = text + 'Percentage of tests passed: %s
' % ( pass_fail['PASS'] / (pass_fail['PASS'] + pass_fail['FAIL'])) - print(csv_testbed) except: - pass + print("Failure") + target_folders.remove(target_folder) + break if len(csv_testbed) > 2: testbed = csv_testbed - text = text + 'Testbed: %s
' % testbed + testbeds.append(testbed) if testbed == 'Unknown Testbed': raise UserWarning('Please define your testbed') - print('testbed %s' % testbed) - ssh_push = paramiko.SSHClient() - ssh_push.set_missing_host_key_policy(paramiko.client.AutoAddPolicy) - ssh_push.connect(ghost_host, - port, - username=user_push, - password=password_push, - allow_agent=False, - look_for_keys=False) - scp_push = SCPClient(ssh_push.get_transport()) local_path = '/home/%s/%s/%s' % (user_push, customer, testbed) - transport = paramiko.Transport((ghost_host, port)) + + transport = paramiko.Transport(ghost_host, port) transport.connect(None, user_push, password_push) sftp = paramiko.sftp_client.SFTPClient.from_transport(transport) - print('Local Path: %s' % local_path) - try: - sftp.mkdir(local_path) - except: - print('folder %s already exists' % local_path) - scp_push.put(target_folder, recursive=True, remote_path=local_path) - print(local_path + '/' + target_folder) + + print(local_path) + print(target_folder) + scp_push.put(target_folder, local_path, recursive=True) files = sftp.listdir(local_path + '/' + target_folder) - # print('Files: %s' % files) for file in files: if 'pdf' in file: - url = 'http://%s/%s/%s/%s/%s/%s' % ( - ghost_host, customer.strip('/'), testbed, test_run, target_folder, file) - text = text + 'PDF of results: %s
' % (url, file) - print(url) - scp_pull.close() + url = 'http://%s/%s/%s/%s/%s' % ( + ghost_host, customer.strip('/'), testbed, test_run, file) + pdfs.append('PDF of results: %s
' % (url, file)) scp_push.close() self.upload_images(target_folder) for image in self.images: if 'kpi-' in image: if '-print' not in image: - text = text + '' % image + images.append('' % image) self.images = [] - if grafana_token is not None: - # get the details of the dashboard through the API, and set the end date to the youngest KPI - grafana.list_dashboards() + results = csvreader.get_columns(df, ['short-description', 'numeric-score', 'test details', 'test-priority']) - grafana.create_snapshot(title=grafana_dashboard) - time.sleep(3) - snapshot = grafana.list_snapshots()[-1] - print(snapshot) - text = text + '
' % ( - grafana_host, snapshot['key'], '%') + low_priority = csvreader.filter_df(results, 'test-priority', 'less than', 94) + high_priority = csvreader.filter_df(results, 'test-priority', 'greater than or equal to', 95) + high_priority_list.append(high_priority) - results = csvreader.get_columns(df,['short-description','numeric-score','test details','test-priority']) - - low_priority = csvreader.to_html(csvreader.filter_df(results, 'test-priority', 'less than', 94)) - high_priority = csvreader.to_html(csvreader.filter_df(results, 'test-priority', 'greater than', 95)) - - text = text + 'High priority results: %s' % high_priority - - text = text + 'Low priority results: %s' % low_priority + low_priority_list.append(low_priority) now = date.now() + high_priority = csvreader.concat(high_priority_list) + low_priority = csvreader.concat(low_priority_list) + + high_priority = csvreader.get_columns(high_priority, ['short-description', 'numeric-score', 'test details']) + low_priority = csvreader.get_columns(low_priority, ['short-description', 'numeric-score', 'test details']) + if title is None: title = "%s %s %s %s:%s report" % (now.day, now.month, now.year, now.hour, now.minute) # create Grafana Dashboard target_files = [] - for folder in folders: - print(folder) + for folder in target_folders: target_files.append(folder.split('/')[-1] + '/kpi.csv') + print('Target files: %s' % target_files) grafana.create_custom_dashboard(target_csvs=target_files, - title=title) + title=title, + datasource=grafana_datasource, + bucket=grafana_bucket) + + try: + text = 'Testbed: %s
' % testbeds[0] + except: + text = '' + + for pdf in pdfs: + text = text + pdf + + for image in images: + text = text + image + + text = text + 'High priority results: %s' % csvreader.to_html(high_priority) + + if grafana_token is not None: + # get the details of the dashboard through the API, and set the end date to the youngest KPI + grafana.list_dashboards() + + grafana.create_snapshot(title='Testbed: ' + title) + time.sleep(3) + snapshot = grafana.list_snapshots()[-1] + text = text + '
' % ( + grafana_host, snapshot['key'], '%') + + text = text + 'Low priority results: %s' % csvreader.to_html(low_priority) self.create_post(title=title, text=text, tags='custom', - authors=authors) + authors=authors) \ No newline at end of file diff --git a/py-dashboard/GrafanaRequest.py b/py-dashboard/GrafanaRequest.py index 59ab188c..5aba9248 100644 --- a/py-dashboard/GrafanaRequest.py +++ b/py-dashboard/GrafanaRequest.py @@ -132,6 +132,49 @@ class GrafanaRequest: print(dictionary) return dictionary + def maketargets(self, + bucket, + scriptname, + groupBy, + index, + graph_group, + testbed): + query = ( + 'from(bucket: "%s")\n ' + '|> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n ' + '|> filter(fn: (r) => r["script"] == "%s")\n ' + '|> group(columns: ["_measurement"])\n ' + % (bucket, scriptname)) + queryend = ('|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n ' + '|> yield(name: "mean")\n ') + if graph_group is not None: + graphgroup = ('|> filter(fn: (r) => r["Graph-Group"] == "%s")\n' % graph_group) + query += graphgroup + if testbed is not None: + query += ('|> filter(fn: (r) => r["testbed"] == "%s")\n' % testbed) + targets = dict() + targets['delimiter'] = ',' + targets['groupBy'] = groupBy + targets['header'] = True + targets['ignoreUnknown'] = False + targets['orderByTime'] = 'ASC' + targets['policy'] = 'default' + targets['query'] = query + queryend + targets['refId'] = dict(enumerate(string.ascii_uppercase, 1))[index + 1] + targets['resultFormat'] = "time_series" + targets['schema'] = list() + targets['skipRows'] = 0 + targets['tags'] = list() + return targets + + def groupby(self, params, grouptype): + dic = dict() + dic['params'] = list() + dic['params'].append(params) + dic['type'] = grouptype + return dic + + def create_custom_dashboard(self, scripts=None, title=None, @@ -174,20 +217,10 @@ class GrafanaRequest: target_csvs = open(graph_groups_file).read().split('\n') graph_groups = self.get_graph_groups( target_csvs) # Get the list of graph groups which are in the tests we ran - unit_dict = dict() - for csv in target_csvs: - if len(csv) > 1: - print(csv) - unit_dict.update(self.get_units(csv)) if target_csvs: print('Target CSVs: %s' % target_csvs) graph_groups = self.get_graph_groups( target_csvs) # Get the list of graph groups which are in the tests we ran - unit_dict = dict() - for csv in target_csvs: - if len(csv) > 1: - print(csv) - unit_dict.update(self.get_units(csv)) for scriptname in graph_groups.keys(): for graph_group in graph_groups[scriptname]: panel = dict() @@ -210,14 +243,14 @@ class GrafanaRequest: options = dict() options['alertThreshold'] = True - #groupBy = list() - #groupBy.append(self.groupby('$__interval', 'time')) - #groupBy.append(self.groupby('null', 'fill')) + groupBy = list() + groupBy.append(self.groupby('$__interval', 'time')) + groupBy.append(self.groupby('null', 'fill')) - #targets = list() - #counter = 0 - #new_target = self.maketargets(bucket, scriptname, groupBy, counter, graph_group, testbed) - #targets.append(new_target) + targets = list() + counter = 0 + new_target = self.maketargets(bucket, scriptname, groupBy, counter, graph_group, testbed) + targets.append(new_target) fieldConfig = dict() fieldConfig['defaults'] = dict() @@ -274,7 +307,7 @@ class GrafanaRequest: panel['spaceLength'] = 10 panel['stack'] = False panel['steppedLine'] = False - #panel['targets'] = targets + panel['targets'] = targets panel['thresholds'] = list() panel['timeFrom'] = None panel['timeRegions'] = list() diff --git a/py-scripts/ghost_profile.py b/py-scripts/ghost_profile.py index 1dcb300d..3411fd71 100755 --- a/py-scripts/ghost_profile.py +++ b/py-scripts/ghost_profile.py @@ -6,17 +6,17 @@ PURPOSE: modify ghost database from the command line. SETUP: A Ghost installation which the user has admin access to. EXAMPLE: ./ghost_profile.py --article_text_file text.txt --title Test --authors Matthew --ghost_token SECRET_KEY --host 192.168.1.1 -There is a specific class for uploading wifi capacity graphs called wifi_capacity. +There is a specific class for uploading kpi graphs called kpi_to_ghost. EXAMPLE: ./ghost_profile.py --ghost_token TOKEN --ghost_host 192.168.100.147 --folders /home/lanforge/html-reports/wifi-capacity-2021-06-04-02-51-07 ---wifi_capacity appl --authors Matthew --title 'wifi capacity 2021 06 04 02 51 07' --server 192.168.93.51 +--kpi_to_ghost appl --authors Matthew --title 'wifi capacity 2021 06 04 02 51 07' --server 192.168.93.51 --user_pull lanforge --password_pull lanforge --customer candela --testbed heather --test_run test-run-6 --user_push matt --password_push PASSWORD EXAMPLE 2: ./ghost_profile.py --ghost_token TOKEN --ghost_host 192.168.100.147 --server 192.168.93.51 --user_pull lanforge --password_pull lanforge --customer candela ---testbed heather --user_push matt --password_push "amount%coverage;Online" --wifi_capacity app +--testbed heather --user_push matt --password_push "amount%coverage;Online" --kpi_to_ghost app --folders /home/lanforge/html-reports/wifi-capacity-2021-06-14-10-42-29 --grafana_token TOKEN --grafana_host 192.168.100.201 --grafana_dashboard 'Stidmatt-02' @@ -60,43 +60,45 @@ class UseGhost(GhostRequest): text = open(file).read() return self.create_post(title=title, text=text, tags=tags, authors=authors) - def wifi_capacity(self, - authors, - folders, - title, - server_pull, - ghost_host, - port, - user_pull, - password_pull, - user_push, - password_push, - customer, - testbed, - test_run, - grafana_dashboard, - grafana_token, - grafana_host, - grafana_port): + def kpi(self, + authors, + folders, + parent_folder, + title, + server_pull, + ghost_host, + port, + user_push, + password_push, + customer, + testbed, + test_run, + grafana_dashboard, + grafana_token, + grafana_host, + grafana_port, + datasource, + grafana_bucket): target_folders = list() - return self.wifi_capacity_to_ghost(authors, - folders, - title, - server_pull, - ghost_host, - port, - user_pull, - password_pull, - user_push, - password_push, - customer, - testbed, - test_run, - target_folders, - grafana_dashboard, - grafana_token, - grafana_host, - grafana_port) + return self.kpi_to_ghost(authors, + folders, + parent_folder, + title, + server_pull, + ghost_host, + port, + user_push, + password_push, + customer, + testbed, + test_run, + target_folders, + grafana_dashboard, + grafana_token, + grafana_host, + grafana_port, + datasource, + grafana_bucket) def main(): @@ -125,12 +127,10 @@ def main(): optional.add_argument('--image', default=None) optional.add_argument('--folder', default=None) optional.add_argument('--custom_post', default=None) - optional.add_argument('--wifi_capacity', default=None) + optional.add_argument('--kpi_to_ghost', help='Generate a Ghost report from KPI spreadsheets', action="store_true") optional.add_argument('--folders', action='append', default=None) optional.add_argument('--server_pull') optional.add_argument('--port', default=22) - optional.add_argument('--user_pull', default='lanforge') - optional.add_argument('--password_pull', default='lanforge') optional.add_argument('--user_push') optional.add_argument('--password_push') optional.add_argument('--customer') @@ -140,6 +140,9 @@ def main(): optional.add_argument('--grafana_token', default=None) optional.add_argument('--grafana_host', default=None) optional.add_argument('--grafana_port', default=3000) + optional.add_argument('--parent_folder', default=None) + optional.add_argument('--datasource', default='InfluxDB') + optional.add_argument('--grafana_bucket', default=None) optional.add_argument('--debug') args = parser.parse_args() @@ -165,24 +168,25 @@ def main(): if args.folder is not None: Ghost.upload_images(args.folder) - if args.wifi_capacity is not None: - Ghost.wifi_capacity(args.authors, - args.folders, - args.title, - args.server_pull, - args.ghost_host, - args.port, - args.user_pull, - args.password_pull, - args.user_push, - args.password_push, - args.customer, - args.testbed, - args.test_run, - args.grafana_dashboard, - args.grafana_token, - args.grafana_host, - args.grafana_port) + if args.kpi_to_ghost is True: + Ghost.kpi(args.authors, + args.folders, + args.parent_folder, + args.title, + args.server_pull, + args.ghost_host, + args.port, + args.user_push, + args.password_push, + args.customer, + args.testbed, + args.test_run, + args.grafana_dashboard, + args.grafana_token, + args.grafana_host, + args.grafana_port, + args.datasource, + args.grafana_bucket) if __name__ == "__main__": diff --git a/py-scripts/grafana_profile.py b/py-scripts/grafana_profile.py index 5abc1767..ad8bcc90 100755 --- a/py-scripts/grafana_profile.py +++ b/py-scripts/grafana_profile.py @@ -22,47 +22,6 @@ from LANforge.lfcli_base import LFCliBase import string class UseGrafana(GrafanaRequest): - def groupby(self, params, grouptype): - dic = dict() - dic['params'] = list() - dic['params'].append(params) - dic['type'] = grouptype - return dic - - def maketargets(self, - bucket, - scriptname, - groupBy, - index, - graph_group, - testbed): - query = ( - 'from(bucket: "%s")\n ' - '|> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n ' - '|> filter(fn: (r) => r["script"] == "%s")\n ' - '|> group(columns: ["_measurement"])\n ' - % (bucket, scriptname)) - queryend = ('|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n ' - '|> yield(name: "mean")\n ') - if graph_group is not None: - graphgroup = ('|> filter(fn: (r) => r["Graph-Group"] == "%s")\n' % graph_group) - query += graphgroup - if testbed is not None: - query += ('|> filter(fn: (r) => r["testbed"] == "%s")\n' % testbed) - targets = dict() - targets['delimiter'] = ',' - targets['groupBy'] = groupBy - targets['header'] = True - targets['ignoreUnknown'] = False - targets['orderByTime'] = 'ASC' - targets['policy'] = 'default' - targets['query'] = query + queryend - targets['refId'] = dict(enumerate(string.ascii_uppercase, 1))[index + 1] - targets['resultFormat'] = "time_series" - targets['schema'] = list() - targets['skipRows'] = 0 - targets['tags'] = list() - return targets def read_csv(self, file): From 419322bd6f4a9dd362ef2bdd9c228fe249f06658 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 29 Jun 2021 15:16:12 -0700 Subject: [PATCH 043/152] GhostRequest Copy instead of moving the folders with data Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index 1b576389..2a3c3807 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -22,6 +22,7 @@ import paramiko from GrafanaRequest import GrafanaRequest import time from collections import Counter +import shutil class CSVReader: @@ -232,8 +233,6 @@ class GhostRequest: grafana_host, grafanajson_port=grafana_port ) - #if parent_folder is None: - #test_run = sorted(folders)[0].split('/')[-1].strip('/') print('Folders: %s' % folders) ssh_push = paramiko.SSHClient() @@ -251,9 +250,8 @@ class GhostRequest: files = os.listdir(parent_folder) print(files) for file in files: - if os.path.isdir(parent_folder+'/'+file) is True: - import shutil - shutil.move(parent_folder+'/'+file, file) + if os.path.isdir(parent_folder + '/' + file) is True: + shutil.copytree(parent_folder + '/' + file, file) target_folders.append(file) print('Target folders: %s' % target_folders) else: @@ -369,4 +367,7 @@ class GhostRequest: self.create_post(title=title, text=text, tags='custom', - authors=authors) \ No newline at end of file + authors=authors) + + for folder in target_folders: + shutil.rmtree(folder) From e100a38c2227de50d3927d50b79cb5945e9805b6 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 29 Jun 2021 16:28:43 -0700 Subject: [PATCH 044/152] Clean up redundant directories and add library to update_dependencies Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 3 ++- py-scripts/ghost_profile.py | 7 ++----- py-scripts/update_dependencies.py | 5 +++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index 2a3c3807..b9047bb4 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -220,7 +220,6 @@ class GhostRequest: testbed='Unknown Testbed', test_run=None, target_folders=list(), - grafana_dashboard=None, grafana_token=None, grafana_host=None, grafana_port=3000, @@ -251,6 +250,8 @@ class GhostRequest: print(files) for file in files: if os.path.isdir(parent_folder + '/' + file) is True: + if os.path.exists(file): + shutil.rmtree(file) shutil.copytree(parent_folder + '/' + file, file) target_folders.append(file) print('Target folders: %s' % target_folders) diff --git a/py-scripts/ghost_profile.py b/py-scripts/ghost_profile.py index 3411fd71..0325ccd9 100755 --- a/py-scripts/ghost_profile.py +++ b/py-scripts/ghost_profile.py @@ -18,8 +18,9 @@ EXAMPLE 2: ./ghost_profile.py --ghost_token TOKEN --ghost_host 192.168.100.147 --server 192.168.93.51 --user_pull lanforge --password_pull lanforge --customer candela --testbed heather --user_push matt --password_push "amount%coverage;Online" --kpi_to_ghost app --folders /home/lanforge/html-reports/wifi-capacity-2021-06-14-10-42-29 --grafana_token TOKEN ---grafana_host 192.168.100.201 --grafana_dashboard 'Stidmatt-02' +--grafana_host 192.168.100.201 +this scripts uses pyjwt. If you get the issue module 'jwt' has no attribute 'encode', run this: pip3 uninstall jwt pyjwt && pip install pyjwt Matthew Stidham Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. @@ -73,7 +74,6 @@ class UseGhost(GhostRequest): customer, testbed, test_run, - grafana_dashboard, grafana_token, grafana_host, grafana_port, @@ -93,7 +93,6 @@ class UseGhost(GhostRequest): testbed, test_run, target_folders, - grafana_dashboard, grafana_token, grafana_host, grafana_port, @@ -136,7 +135,6 @@ def main(): optional.add_argument('--customer') optional.add_argument('--testbed') optional.add_argument('--test_run', default=None) - optional.add_argument('--grafana_dashboard') optional.add_argument('--grafana_token', default=None) optional.add_argument('--grafana_host', default=None) optional.add_argument('--grafana_port', default=3000) @@ -181,7 +179,6 @@ def main(): args.customer, args.testbed, args.test_run, - args.grafana_dashboard, args.grafana_token, args.grafana_host, args.grafana_port, diff --git a/py-scripts/update_dependencies.py b/py-scripts/update_dependencies.py index 63d2865c..0de0bc56 100755 --- a/py-scripts/update_dependencies.py +++ b/py-scripts/update_dependencies.py @@ -14,12 +14,13 @@ import subprocess def main(): 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'] + 'pyshark', 'influxdb', 'influxdb-client', 'matplotlib', 'pdfkit', 'pip-search', 'pyserial', 'pexpect-serial' ,'scp', 'pyjwt'] packages_installed = [] packages_failed =[] + subprocess.call("pip3 uninstall jwt", shell=True) for package in packages: command = "pip3 install {} >/tmp/pip3-stdout 2>/tmp/pip3-stderr".format(package) - res = subprocess.call(command, shell = True) + res = subprocess.call(command, shell=True) if res == 0: #print("Package {} install SUCCESS Returned Value: {} ".format(package, res)) packages_installed.append(package) From 45133a827617280043e73ab45463a274dc583bad Mon Sep 17 00:00:00 2001 From: Nikita Yadav Date: Wed, 30 Jun 2021 13:19:02 +0530 Subject: [PATCH 045/152] adding changed banner style and adding setup table --- py-scripts/lf_report.py | 82 ++++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 25 deletions(-) diff --git a/py-scripts/lf_report.py b/py-scripts/lf_report.py index e23bc70b..ee2e2004 100755 --- a/py-scripts/lf_report.py +++ b/py-scripts/lf_report.py @@ -28,6 +28,7 @@ INCLUDE_IN_README import datetime import os import shutil +import datetime import pandas as pd import pdfkit @@ -278,36 +279,40 @@ class lf_report(): def build_banner(self): # NOTE: {{ }} are the ESCAPED curly braces self.banner_html = """ - - - - - - - - {title} - - -
- -
-""".format( + + + + + + + + {title} + + +
+ +
+ """.format( title=self.title, date=self.date, ) self.html += self.banner_html def build_table_title(self): - self.table_title_html = "

{title}

".format(title=self.table_title) + self.table_title_html = """ + +

{title}

+ """.format(title=self.table_title) self.html += self.table_title_html def start_content_div(self): @@ -335,9 +340,35 @@ class lf_report(): 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='left') # have the index be able to be passed in. self.html += self.dataframe_html + def test_setup_table(self,test_setup_data, value): + if test_setup_data is None: + return None + else: + var = "" + for i in test_setup_data: + var = var + "
" + + setup_information = """ + +
%s
" + i + "" + str(test_setup_data[i]) + "
+ + + + + +
"""+ str(value) + """ + + """ + var + """ +
+
+ +
+ """ + self.html += setup_information + def build_custom(self): self.html += self.custom_html @@ -410,3 +441,4 @@ if __name__ == "__main__": report.write_pdf() print("report path {}".format(report.get_path())) + From c43820da3f3b95b439201decb3d8a3ea2362b2bc Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 30 Jun 2021 06:12:00 -0600 Subject: [PATCH 046/152] test_ip_variable_time.py : changed permissions Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_ip_variable_time.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 py-scripts/test_ip_variable_time.py diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py old mode 100644 new mode 100755 From 651dd74422a0ef7ce75aa07013c738aff01a0313 Mon Sep 17 00:00:00 2001 From: karthikaeyetea Date: Wed, 30 Jun 2021 21:13:18 +0530 Subject: [PATCH 047/152] font-size of x-axis, graph title, alignment of x-values are added --- py-scripts/lf_graph.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index bb5ce093..10b60881 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -45,6 +45,8 @@ class lf_bar_graph(): _figsize=(10, 5), _show_bar_value=False, _xaxis_step=5, + _xticks_font = None, + _grp_title = "", _dpi=96): self.data_set = _data_set @@ -61,6 +63,8 @@ class lf_bar_graph(): self.figsize = _figsize self.show_bar_value = _show_bar_value self.xaxis_step = _xaxis_step + self.xticks_font = _xticks_font + self.grp_title = _grp_title def build_bar_graph(self): if self.color is None: @@ -99,14 +103,14 @@ class lf_bar_graph(): plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15) plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15) - if isinstance(self.xaxis_categories[0], int): - plt.xticks(np.arange(0, len(self.xaxis_categories), step=self.xaxis_step)) + if self.xaxis_categories[0] == 0: + plt.xticks(np.arange(0, len(self.xaxis_categories), step=self.xaxis_step),fontsize = self.xticks_font) else: - plt.xticks(np.arange(0, len(self.xaxis_categories)), self.xaxis_categories) - + plt.xticks(np.arange(0, len(self.data_set[0]), step=self.xaxis_step), self.xaxis_categories, + fontsize = self.xticks_font) plt.legend() - + plt.title(self.grp_title) fig = plt.gcf() plt.savefig("%s.png" % self.graph_image_name, dpi=96) plt.close() From c1e805e826e54bde0ad6c424d9001d18a6f9269d Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 30 Jun 2021 13:54:43 -0700 Subject: [PATCH 048/152] lf_json_autogen: updated method headers, some parameters for methods are wrong Signed-off-by: Jed Reynolds --- py-json/LANforge/lf_json_autogen.py | 8209 ++++++++++++++++++--------- 1 file changed, 5593 insertions(+), 2616 deletions(-) diff --git a/py-json/LANforge/lf_json_autogen.py b/py-json/LANforge/lf_json_autogen.py index ba9795ee..524f5965 100644 --- a/py-json/LANforge/lf_json_autogen.py +++ b/py-json/LANforge/lf_json_autogen.py @@ -1,12 +1,11 @@ #!/usr/bin/env python3 """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated by LANforge JsonApiPythonGenerator, Tue Jun 22 15:59:34 PDT 2021 + Generated by LANforge JsonApiPythonGenerator, Wed Jun 30 13:53:58 PDT 2021 This file expects to live in py-json/LANforge directory. ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" -import sys -import json import keyword from enum import Enum +from enum import IntFlag # from LANforge import LFRequest # from LANforge.lfcli_base import LFCliBase from lfcli_base import LFCliBase @@ -47,39 +46,58 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /attenuator + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - entity+id entity id - module+1 module 1 - module+2 module 2 - module+3 module 3 - module+4 module 4 - module+5 module 5 - module+6 module 6 - module+7 module 7 - module+8 module 8 - name name - script script - state state - temperature temperature + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'entity id': X + 'module 1': X + 'module 2': X + 'module 3': X + 'module 4': X + 'module 5': X + 'module 6': X + 'module 7': X + 'module 8': X + 'name': X + 'script': X + 'state': X + 'temperature': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_attenuator(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/attenuator" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -91,48 +109,63 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /chamber + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - chamber chamber - chamber+connections chamber connections - chamber+resources chamber resources - chamber+type chamber type - duts duts - entity+id entity id - flags flags - hide hide - isolation isolation - marked marked - open open - reported+rotation+%28deg%29 reported rotation (deg) - reported+rpm reported rpm - reported+tilt+%28deg%29 reported tilt (deg) - resource resource - rotation+%28deg%29 rotation (deg) - rpm rpm - smas smas - tilt+%28deg%29 tilt (deg) - turntable turntable - turntable+type turntable type - virtual virtual + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'chamber': X + 'chamber connections': X + 'chamber resources': X + 'chamber type': X + 'duts': X + 'entity id': X + 'flags': X + 'hide': X + 'isolation': X + 'marked': X + 'open': X + 'reported rotation (deg)': X + 'reported rpm ': X + 'reported tilt (deg)': X + 'resource': X + 'rotation (deg)': X + 'rpm': X + 'smas': X + 'tilt (deg)': X + 'turntable': X + 'turntable type': X + 'virtual': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_chamber(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/chamber" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -144,42 +177,56 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cx + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - avg+rtt avg rtt - bps+rx+a bps rx a - bps+rx+b bps rx b - drop+pkts+a drop pkts a - drop+pkts+b drop pkts b - eid eid - endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29 endpoints (a ↔ b) - entity+id entity id - name name - pkt+rx+a pkt rx a - pkt+rx+b pkt rx b - rpt+timer rpt timer - rx+drop+%25+a rx drop % a - rx+drop+%25+b rx drop % b - state state - type type + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'avg rtt': X + 'bps rx a': X + 'bps rx b': X + 'drop pkts a': X + 'drop pkts b': X + 'eid': X + 'endpoints (a ↔ b)': X + 'entity id': X + 'name': X + 'pkt rx a': X + 'pkt rx b': X + 'rpt timer': X + 'rx drop % a': X + 'rx drop % b': X + 'state': X + 'type': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_cx(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/cx" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -191,67 +238,84 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /dut + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - api+version api version - bssid-1 bssid-1 - bssid-2 bssid-2 - bssid-3 bssid-3 - bssid-4 bssid-4 - bssid-5 bssid-5 - bssid-6 bssid-6 - bssid-7 bssid-7 - bssid-8 bssid-8 - dut dut - eap-id eap-id - entity+id entity id - hw+info hw info - image+file image file - lan lan - mgt+ip mgt ip - model+number model number - notes notes - num+ant+radio+1 num ant radio 1 - num+ant+radio+2 num ant radio 2 - num+ant+radio+3 num ant radio 3 - password-1 password-1 - password-2 password-2 - password-3 password-3 - password-4 password-4 - password-5 password-5 - password-6 password-6 - password-7 password-7 - password-8 password-8 - serial+number serial number - serial+port serial port - ssid-1 ssid-1 - ssid-2 ssid-2 - ssid-3 ssid-3 - ssid-4 ssid-4 - ssid-5 ssid-5 - ssid-6 ssid-6 - ssid-7 ssid-7 - ssid-8 ssid-8 - sw+info sw info - wan wan + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'api version': X + 'bssid-1': X + 'bssid-2': X + 'bssid-3': X + 'bssid-4': X + 'bssid-5': X + 'bssid-6': X + 'bssid-7': X + 'bssid-8': X + 'dut': X + 'eap-id': X + 'entity id': X + 'hw info': X + 'image file': X + 'lan': X + 'mgt ip': X + 'model number': X + 'notes': X + 'num ant radio 1': X + 'num ant radio 2': X + 'num ant radio 3': X + 'password-1': X + 'password-2': X + 'password-3': X + 'password-4': X + 'password-5': X + 'password-6': X + 'password-7': X + 'password-8': X + 'serial number': X + 'serial port': X + 'ssid-1': X + 'ssid-2': X + 'ssid-3': X + 'ssid-4': X + 'ssid-5': X + 'ssid-6': X + 'ssid-7': X + 'ssid-8': X + 'sw info': X + 'wan': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_dut(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/dut" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -263,82 +327,101 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /endp + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - 1st+rx 1st rx - a%2Fb a/b - bursty bursty - crc+fail crc fail - cwnd cwnd - cx+active cx active - cx+estab cx estab - cx+estab%2Fs cx estab/s - cx+to cx to - delay delay - destination+addr destination addr - dropped dropped - dup+pkts dup pkts - eid eid - elapsed elapsed - entity+id entity id - jitter jitter - max+pdu max pdu - max+rate max rate - min+pdu min pdu - min+rate min rate - mng mng - name name - ooo+pkts ooo pkts - pattern pattern - pdu%2Fs+rx pdu/s rx - pdu%2Fs+tx pdu/s tx - pps+rx+ll pps rx ll - pps+tx+ll pps tx ll - rcv+buf rcv buf - replays replays - run run - rx+ber rx ber - rx+bytes rx bytes - rx+drop+%25 rx drop % - rx+dup+%25 rx dup % - rx+ooo+%25 rx ooo % - rx+pdus rx pdus - rx+pkts+ll rx pkts ll - rx+rate rx rate - rx+rate+%281%C2%A0min%29 rx rate (1 min) - rx+rate+%28last%29 rx rate (last) - rx+rate+ll rx rate ll - rx+wrong+dev rx wrong dev - script script - send+buf send buf - source+addr source addr - tcp+mss tcp mss - tcp+rtx tcp rtx - tx+bytes tx bytes - tx+pdus tx pdus - tx+pkts+ll tx pkts ll - tx+rate tx rate - tx+rate+%281%C2%A0min%29 tx rate (1 min) - tx+rate+%28last%29 tx rate (last) - tx+rate+ll tx rate ll + ...examples how to call method(s) here... + 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 + Example URL: /endp?fields=1st+rx,a%2Fb + + The data returned is going to look like: + { + '1st rx': X + 'a/b': X + 'bursty': X + 'crc fail': X + 'cwnd': X + 'cx active': X + 'cx estab': X + 'cx estab/s': X + 'cx to': X + 'delay': X + 'destination addr': X + 'dropped': X + 'dup pkts': X + 'eid': X + 'elapsed': X + 'entity id': X + 'jitter': X + 'max pdu': X + 'max rate': X + 'min pdu': X + 'min rate': X + 'mng': X + 'name': X + 'ooo pkts': X + 'pattern': X + 'pdu/s rx': X + 'pdu/s tx': X + 'pps rx ll': X + 'pps tx ll': X + 'rcv buf': X + 'replays': X + 'run': X + 'rx ber': X + 'rx bytes': X + 'rx drop %': X + 'rx dup %': X + 'rx ooo %': X + 'rx pdus': X + 'rx pkts ll': X + 'rx rate': X + 'rx rate (1 min)': X + 'rx rate (last)': X + 'rx rate ll': X + 'rx wrong dev': X + 'script': X + 'send buf': X + 'source addr': X + 'tcp mss': X + 'tcp rtx': X + 'tx bytes': X + 'tx pdus': X + 'tx pkts ll': X + 'tx rate': X + 'tx rate (1 min)': X + 'tx rate (last)': X + 'tx rate ll': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_endp(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/endp" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -350,35 +433,52 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /events + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - eid eid - entity+id entity id - event event - event+description event description - id id - name name - priority priority - time-stamp time-stamp - type type + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'eid': X + 'entity id': X + 'event': X + 'event description': X + 'id': X + 'name': X + 'priority': X + 'time-stamp': X + 'type': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_events(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/events" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -390,53 +490,68 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /fileio + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - buf-rd buf-rd - buf-wr buf-wr - bytes-rd bytes-rd - bytes-wr bytes-wr - crc+fail crc fail - eid eid - entity+id entity id - files+%23 files # - files-read files-read - files-wr files-wr - io+fail io fail - max-file-sz max-file-sz - max-rd-bps max-rd-bps - max-rw-sz max-rw-sz - max-wr-bps max-wr-bps - min-file-sz min-file-sz - min-rd-bps min-rd-bps - min-rw-sz min-rw-sz - min-wr-bps min-wr-bps - name name - read-bps read-bps - rpt+timer rpt timer - rx-bps-20s rx-bps-20s - status status - tx-bps-20s tx-bps-20s - type type - write-bps write-bps + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'buf-rd': X + 'buf-wr': X + 'bytes-rd': X + 'bytes-wr': X + 'crc fail': X + 'eid': X + 'entity id': X + 'files #': X + 'files-read': X + 'files-wr': X + 'io fail': X + 'max-file-sz': X + 'max-rd-bps': X + 'max-rw-sz': X + 'max-wr-bps': X + 'min-file-sz': X + 'min-rd-bps': X + 'min-rw-sz': X + 'min-wr-bps': X + 'name': X + 'read-bps': X + 'rpt timer': X + 'rx-bps-20s': X + 'status': X + 'tx-bps-20s': X + 'type': X + 'write-bps': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_fileio(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/fileio" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -448,45 +563,59 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /generic + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - bps+rx bps rx - bps+tx bps tx - command command - dropped dropped - eid eid - elapsed elapsed - entity+id entity id - last+results last results - name name - pdu%2Fs+rx pdu/s rx - pdu%2Fs+tx pdu/s tx - rpt+timer rpt timer - rpt%23 rpt# - rx+bytes rx bytes - rx+pkts rx pkts - status status - tx+bytes tx bytes - tx+pkts tx pkts - type type + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'bps rx': X + 'bps tx': X + 'command': X + 'dropped': X + 'eid': X + 'elapsed': X + 'entity id': X + 'last results': X + 'name': X + 'pdu/s rx': X + 'pdu/s tx': X + 'rpt timer': X + 'rpt#': X + 'rx bytes': X + 'rx pkts': X + 'status': X + 'tx bytes': X + 'tx pkts': X + 'type': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_generic(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/generic" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -498,27 +627,37 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /gui-cli + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - na na + ...examples how to call method(s) here... + Request one of these URLs: + /gui-cli + + When requesting specific column names, they need to be URL Encoded. + na + + The data returned is going to look like: + { + 'na': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_gui_cli(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/gui-cli" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -530,73 +669,89 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /layer4 + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - %21conn !conn - acc.+denied acc. denied - bad-proto bad-proto - bad-url bad-url - bytes-rd bytes-rd - bytes-wr bytes-wr - dns-avg dns-avg - dns-max dns-max - dns-min dns-min - eid eid - elapsed elapsed - entity+id entity id - fb-avg fb-avg - fb-max fb-max - fb-min fb-min - ftp-host ftp-host - ftp-port ftp-port - ftp-stor ftp-stor - http-p http-p - http-r http-r - http-t http-t - login-denied login-denied - name name - nf+%284xx%29 nf (4xx) - other-err other-err - read read - redir redir - rpt+timer rpt timer - rslv-h rslv-h - rslv-p rslv-p - rx+rate rx rate - rx+rate+%281%C2%A0min%29 rx rate (1 min) - status status - timeout timeout - total-err total-err - total-urls total-urls - tx+rate tx rate - tx+rate+%281%C2%A0min%29 tx rate (1 min) - type type - uc-avg uc-avg - uc-max uc-max - uc-min uc-min - urls%2Fs urls/s - write write + ...examples how to call method(s) here... + Request one of these URLs: + /layer4/ + /layer4/$endp_id - # hidden columns: - rpt-time rpt-time + 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 + + The data returned is going to look like: + { + '!conn': X + 'acc. denied': X + 'bad-proto': X + 'bad-url': X + 'bytes-rd': X + 'bytes-wr': X + 'dns-avg': X + 'dns-max': X + 'dns-min': X + 'eid': X + 'elapsed': X + 'entity id': X + 'fb-avg': X + 'fb-max': X + 'fb-min': X + 'ftp-host': X + 'ftp-port': X + 'ftp-stor': X + 'http-p': X + 'http-r': X + 'http-t': X + 'login-denied': X + 'name': X + 'nf (4xx)': X + 'other-err': X + 'read': X + 'redir': X + 'rpt timer': X + 'rslv-h': X + 'rslv-p': X + 'rx rate': X + 'rx rate (1 min)': X + 'status': X + 'timeout': X + 'total-err': X + 'total-urls': X + 'tx rate': X + 'tx rate (1 min)': X + 'type': X + 'uc-avg': X + 'uc-max': X + 'uc-min': X + 'urls/s': X + 'write': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_layer4(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/layer4" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -608,110 +763,130 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /port + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - 4way+time+%28us%29 4way time (us) - activity activity - alias alias - anqp+time+%28us%29 anqp time (us) - ap ap - beacon beacon - bps+rx bps rx - bps+rx+ll bps rx ll - bps+tx bps tx - bps+tx+ll bps tx ll - bytes+rx+ll bytes rx ll - bytes+tx+ll bytes tx ll - channel channel - collisions collisions - connections connections - crypt crypt - cx+ago cx ago - cx+time+%28us%29 cx time (us) - device device - dhcp+%28ms%29 dhcp (ms) - down down - entity+id entity id - gateway+ip gateway ip - ip ip - ipv6+address ipv6 address - ipv6+gateway ipv6 gateway - key%2Fphrase key/phrase - login-fail login-fail - login-ok login-ok - logout-fail logout-fail - logout-ok logout-ok - mac mac - mask mask - misc misc - mode mode - mtu mtu - no+cx+%28us%29 no cx (us) - noise noise - parent+dev parent dev - phantom phantom - port port - port+type port type - pps+rx pps rx - pps+tx pps tx - qlen qlen - reset reset - retry+failed retry failed - rx+bytes rx bytes - rx+crc rx crc - rx+drop rx drop - rx+errors rx errors - rx+fifo rx fifo - rx+frame rx frame - rx+length rx length - rx+miss rx miss - rx+over rx over - rx+pkts rx pkts - rx-rate rx-rate - sec sec - signal signal - ssid ssid - status status - time-stamp time-stamp - tx+abort tx abort - tx+bytes tx bytes - tx+crr tx crr - tx+errors tx errors - tx+fifo tx fifo - tx+hb tx hb - tx+pkts tx pkts - tx+wind tx wind - tx-failed+%25 tx-failed % - tx-rate tx-rate - wifi+retries wifi retries + ...examples how to call method(s) here... + Request one of these URLs: + /port/ + /port/$shelf_id + /port/$shelf_id/$resource_id + /port/$shelf_id/$resource_id/$port_id + /ports/ + /ports/$shelf_id + /ports/$shelf_id/$resource_id + /ports/$shelf_id/$resource_id/$port_id - # hidden columns: - beacon_rx_signal beacon_rx_signal - port_cur_flags_h port_cur_flags_h - port_cur_flags_l port_cur_flags_l - port_supported_flags_h port_supported_flags_h - port_supported_flags_l port_supported_flags_l - resource resource - rx_multicast rx_multicast - tx_dropped tx_dropped + 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 + + The data returned is going to look like: + { + '4way time (us)': X + 'activity': X + 'alias': X + 'anqp time (us)': X + 'ap': X + 'beacon': X + 'bps rx': X + 'bps rx ll': X + 'bps tx': X + 'bps tx ll': X + 'bytes rx ll': X + 'bytes tx ll': X + 'channel': X + 'collisions': X + 'connections': X + 'crypt': X + 'cx ago': X + 'cx time (us)': X + 'device': X + 'dhcp (ms)': X + 'down': X + 'entity id': X + 'gateway ip': X + 'ip': X + 'ipv6 address': X + 'ipv6 gateway': X + 'key/phrase': X + 'login-fail': X + 'login-ok': X + 'logout-fail': X + 'logout-ok': X + 'mac': X + 'mask': X + 'misc': X + 'mode': X + 'mtu': X + 'no cx (us)': X + 'noise': X + 'parent dev': X + 'phantom': X + 'port': X + 'port type': X + 'pps rx': X + 'pps tx': X + 'qlen': X + 'reset': X + 'retry failed': X + 'rx bytes': X + 'rx crc': X + 'rx drop': X + 'rx errors': X + 'rx fifo': X + 'rx frame': X + 'rx length': X + 'rx miss': X + 'rx over': X + 'rx pkts': X + 'rx-rate': X + 'sec': X + 'signal': X + 'ssid': X + 'status': X + 'time-stamp': X + 'tx abort': X + 'tx bytes': X + 'tx crr': X + 'tx errors': X + 'tx fifo': X + 'tx hb': X + 'tx pkts': X + 'tx wind': X + 'tx-failed %': X + 'tx-rate': X + 'wifi retries': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_port(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/port" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -723,52 +898,68 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /radiostatus + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - _links _links - antenna antenna - ap ap - capabilities capabilities - channel channel - country country - driver driver - entity+id entity id - entity+id entity id - frag frag - frequency frequency - max_sta max_sta - max_vap max_vap - max_vifs max_vifs - monitors_up monitors_up - monitors_up monitors_up - phantom phantom - port port - resource resource - rts rts - stations_down stations_down - stations_up stations_up - tx-power tx-power - vaps_down vaps_down - vaps_up vaps_up - verbose+debug verbose debug + ...examples how to call method(s) here... + 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, entity+id, + frag, frequency, max_sta, max_vap, max_vifs, monitors_up, monitors_up, phantom, + port, resource, rts, stations_down, stations_up, tx-power, vaps_down, vaps_up, + verbose+debug + Example URL: /radiostatus?fields=_links,antenna + + The data returned is going to look like: + { + '_links': X + 'antenna': X + 'ap': X + 'capabilities': X + 'channel': X + 'country': X + 'driver': X + 'entity id': X + 'entity id': X + 'frag': X + 'frequency': X + 'max_sta': X + 'max_vap': X + 'max_vifs': X + 'monitors_up': X + 'monitors_up': X + 'phantom': X + 'port': X + 'resource': X + 'rts': X + 'stations_down': X + 'stations_up': X + 'tx-power': X + 'vaps_down': X + 'vaps_up': X + 'verbose debug': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_radiostatus(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/radiostatus" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -780,54 +971,69 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /resource + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - bps-rx-3s bps-rx-3s - bps-tx-3s bps-tx-3s - cli-port cli-port - cpu cpu - ctrl-ip ctrl-ip - ctrl-port ctrl-port - eid eid - entity+id entity id - free+mem free mem - free+swap free swap - gps gps - hostname hostname - hw+version hw version - load load - max+if-up max if-up - max+staged max staged - mem mem - phantom phantom - ports ports - rx+bytes rx bytes - shelf shelf - sta+up sta up - sw+version sw version - swap swap - tx+bytes tx bytes + ...examples how to call method(s) here... + Request one of these URLs: + /resource/ + /resource/$shelf_id + /resource/$shelf_id/$resource_id - # hidden columns: - timestamp timestamp + 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 + + The data returned is going to look like: + { + 'bps-rx-3s': X + 'bps-tx-3s': X + 'cli-port': X + 'cpu': X + 'ctrl-ip': X + 'ctrl-port': X + 'eid': X + 'entity id': X + 'free mem': X + 'free swap': X + 'gps': X + 'hostname': X + 'hw version': X + 'load': X + 'max if-up': X + 'max staged': X + 'mem': X + 'phantom': X + 'ports': X + 'rx bytes': X + 'shelf': X + 'sta up': X + 'sw version': X + 'swap': X + 'tx bytes': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_resource(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/resource" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -839,27 +1045,45 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /scan + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - na na + ...examples how to call method(s) here... + 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 + + When requesting specific column names, they need to be URL Encoded. + na + + The data returned is going to look like: + { + 'na': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_scan(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/scan" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -871,42 +1095,56 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /stations + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - ap ap - auth-for auth-for - capabilities capabilities - entity+id entity id - idle idle - roam-duration roam-duration - rx+bytes rx bytes - rx+pkts rx pkts - rx+rate rx rate - signal signal - station+bssid station bssid - tx+bytes tx bytes - tx+pkts tx pkts - tx+rate tx rate - tx+retries tx retries - tx-failed tx-failed + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'ap': X + 'auth-for': X + 'capabilities': X + 'entity id': X + 'idle': X + 'roam-duration': X + 'rx bytes': X + 'rx pkts': X + 'rx rate': X + 'signal': X + 'station bssid': X + 'tx bytes': X + 'tx pkts': X + 'tx rate': X + 'tx retries': X + 'tx-failed': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_stations(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/stations" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -918,27 +1156,43 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /status-msg + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - na na + ...examples how to call method(s) here... + 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 + + When requesting specific column names, they need to be URL Encoded. + na + + The data returned is going to look like: + { + 'na': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_status_msg(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/status-msg" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -950,31 +1204,45 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /test-group + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - cross+connects cross connects - entity+id entity id - name name - run run - script script + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'cross connects': X + 'entity id': X + 'name': X + 'run': X + 'script': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_test_group(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/test-group" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -986,30 +1254,44 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /text + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - eid eid - name name - text text - type type + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'eid': X + 'name': X + 'text': X + 'type': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_text(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/text" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -1021,43 +1303,66 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /voip + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - bps+rx+a bps rx a - bps+rx+b bps rx b - delay+a+%E2%86%90+b delay a ← b - delay+a+%E2%86%92+b delay a → b - eid eid - endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29 endpoints (a ↔ b) - entity+id entity id - jitter+a+%E2%86%90+b jitter a ← b - jitter+a+%E2%86%92+b jitter a → b - name name - pkt+tx+a%C2%A0%E2%86%90%C2%A0b pkt tx a ← b - pkt+tx+a%C2%A0%E2%86%92%C2%A0b pkt tx a → b - rpt+timer rpt timer - rx+drop+%25+a rx drop % a - rx+drop+%25+b rx drop % b - state state - type type + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'bps rx a': X + 'bps rx b': X + 'delay a ← b': X + 'delay a → b': X + 'eid': X + 'endpoints (a ↔ b)': X + 'entity id': X + 'jitter a ← b': X + 'jitter a → b': X + 'name': X + 'pkt tx a ← b': X + 'pkt tx a → b': X + 'rpt timer': X + 'rx drop % a': X + 'rx drop % b': X + 'state': X + 'type': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_voip(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/voip" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -1069,63 +1374,79 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /voip-endp + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - calls+answered calls answered - calls+attempted calls attempted - calls+completed calls completed - calls+failed calls failed - cf+404 cf 404 - cf+408 cf 408 - cf+busy cf busy - cf+canceled cf canceled - delay delay - destination+addr destination addr - dropped dropped - dup+pkts dup pkts - eid eid - elapsed elapsed - entity+id entity id - jb+cur jb cur - jb+over jb over - jb+silence jb silence - jb+under jb under - jitter jitter - mng mng - name name - ooo+pkts ooo pkts - pesq pesq - pesq+bklg pesq bklg - pesq%23 pesq# - reg+state reg state - rst rst - rtp+rtt rtp rtt - run run - rx+bytes rx bytes - rx+pkts rx pkts - source+addr source addr - state state - tx+bytes tx bytes - tx+pkts tx pkts - vad+pkts vad pkts + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'calls answered': X + 'calls attempted': X + 'calls completed': X + 'calls failed': X + 'cf 404': X + 'cf 408': X + 'cf busy': X + 'cf canceled': X + 'delay': X + 'destination addr': X + 'dropped': X + 'dup pkts': X + 'eid': X + 'elapsed': X + 'entity id': X + 'jb cur': X + 'jb over': X + 'jb silence': X + 'jb under': X + 'jitter': X + 'mng': X + 'name': X + 'ooo pkts': X + 'pesq': X + 'pesq bklg': X + 'pesq#': X + 'reg state': X + 'rst': X + 'rtp rtt': X + 'run': X + 'rx bytes': X + 'rx pkts': X + 'source addr': X + 'state': X + 'tx bytes': X + 'tx pkts': X + 'vad pkts': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_voip_endp(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/voip-endp" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -1137,61 +1458,82 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /vr + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - active+ipv6+router active ipv6 router - bgp+4byte+as bgp 4byte as - bgp+damping bgp damping - bgp+peers bgp peers - cluster+id cluster id - collision+domain+id collision domain id - confederation+id confederation id - damping+half+life damping half life - damping+max+suppress damping max suppress - damping+reuse damping reuse - damping+suppress damping suppress - entity+id entity id - height height - ipv6+radv ipv6 radv - is+bgp+reflector is bgp reflector - local+as local as - multicast+routing multicast routing - name name - netsmith-state netsmith-state - notes notes - pad pad - ripv2 ripv2 - router+connections router connections - router+id router id - router+id router id - use+confederation use confederation - use+existing+cfg use existing cfg - use+ospf use ospf - use+rip+dft+route use rip dft route - using+bgp using bgp - using+olsr using olsr - width width - x x - xorp+sha xorp sha - y y + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'active ipv6 router': X + 'bgp 4byte as': X + 'bgp damping': X + 'bgp peers': X + 'cluster id': X + 'collision domain id': X + 'confederation id': X + 'damping half life': X + 'damping max suppress': X + 'damping reuse': X + 'damping suppress': X + 'entity id': X + 'height': X + 'ipv6 radv': X + 'is bgp reflector': X + 'local as': X + 'multicast routing': X + 'name': X + 'netsmith-state': X + 'notes': X + 'pad': X + 'ripv2': X + 'router connections': X + 'router id': X + 'router id': X + 'use confederation ': X + 'use existing cfg': X + 'use ospf': X + 'use rip dft route': X + 'using bgp': X + 'using olsr': X + 'width': X + 'x': X + 'xorp sha': X + 'y': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_vr(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/vr" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -1203,45 +1545,59 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /vrcx + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - entity+id entity id - height height - interface+cost interface cost - local-a local-a - local-b local-b - netsmith-state netsmith-state - remote-a remote-a - remote-b remote-b - resource resource - rip+metric rip metric - vrrp+id vrrp id - vrrp+interval vrrp interval - vrrp+ip vrrp ip - vrrp+ip-prefix vrrp ip-prefix - vrrp+priority vrrp priority - wan+link wan link - width width - x x - y y + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'entity id': X + 'height': X + 'interface cost': X + 'local-a': X + 'local-b': X + 'netsmith-state': X + 'remote-a': X + 'remote-b': X + 'resource': X + 'rip metric': X + 'vrrp id': X + 'vrrp interval': X + 'vrrp ip': X + 'vrrp ip-prefix': X + 'vrrp priority': X + 'wan link': X + 'width': X + 'x': X + 'y': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_vrcx(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/vrcx" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -1253,37 +1609,60 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /wl + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - bps+rx+a bps rx a - bps+rx+b bps rx b - eid eid - endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29 endpoints (a ↔ b) - entity+id entity id - k-m k-m - name name - pkt+tx+a%C2%A0%E2%86%90%C2%A0b pkt tx a ← b - pkt+tx+a%C2%A0%E2%86%92%C2%A0b pkt tx a → b - rpt+timer rpt timer - state state + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'bps rx a': X + 'bps rx b': X + 'eid': X + 'endpoints (a ↔ b)': X + 'entity id': X + 'k-m': X + 'name': X + 'pkt tx a ← b': X + 'pkt tx a → b': X + 'rpt timer': X + 'state': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_wl(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/wl" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -1295,61 +1674,77 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /wl-endp + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - buffer buffer - corrupt+1 corrupt 1 - corrupt+2 corrupt 2 - corrupt+3 corrupt 3 - corrupt+4 corrupt 4 - corrupt+5 corrupt 5 - corrupt+6 corrupt 6 - delay delay - dropfreq+%25 dropfreq % - dropped dropped - dup+pkts dup pkts - dupfreq+%25 dupfreq % - eid eid - elapsed elapsed - extrabuf extrabuf - failed-late failed-late - jitfreq+%25 jitfreq % - max+rate max rate - maxjitter maxjitter - maxlate maxlate - name name - ooo+pkts ooo pkts - qdisc qdisc - reordfrq+%25 reordfrq % - run run - rx+bytes rx bytes - rx+pkts rx pkts - script script - serdelay serdelay - tx+bytes tx bytes - tx+drop+%25 tx drop % - tx+pkts tx pkts - tx+rate tx rate - tx-failed tx-failed - wps wps + ...examples how to call method(s) here... + 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 + + The data returned is going to look like: + { + 'buffer': X + 'corrupt 1': X + 'corrupt 2': X + 'corrupt 3': X + 'corrupt 4': X + 'corrupt 5': X + 'corrupt 6': X + 'delay': X + 'dropfreq %': X + 'dropped': X + 'dup pkts': X + 'dupfreq %': X + 'eid': X + 'elapsed': X + 'extrabuf': X + 'failed-late': X + 'jitfreq %': X + 'max rate': X + 'maxjitter': X + 'maxlate': X + 'name': X + 'ooo pkts': X + 'qdisc': X + 'reordfrq %': X + 'run': X + 'rx bytes': X + 'rx pkts': X + 'script': X + 'serdelay': X + 'tx bytes': X + 'tx drop %': X + 'tx pkts': X + 'tx rate': X + 'tx-failed': X + 'wps': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_wl_endp(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/wl-endp" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -1361,27 +1756,38 @@ class LFJsonGet(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /ws-msg + Notes for type requests - URL Encoded Column Names JSON keys - use these in a URL use these to get value - ------------------ ---------------------- - na na + ...examples how to call method(s) here... + Request one of these URLs: + /ws-msg/ + /ws-msg/$sessionid + + When requesting specific column names, they need to be URL Encoded. + na + + The data returned is going to look like: + { + 'na': X + } ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def get_ws_msg(self, - fields=[], + shelf=1, + resource=None, + name=None, + requested_col_names=[], debug_=False): debug_ |= self.debug url = "/ws-msg" - if (fields is not None) and (type(fields) is not list): - raise ValueError("fields must be a None or a list") + if (requested_col_names is not None) and (type(requested_col_names) is not list): + raise ValueError("requested_col_names must be a None or a list") - if (fields is not None) and (len(fields) > 0): - for field in fields: + if (requested_col_names is not None) and (len(requested_col_names) > 0): + for field in requested_col_names: if field.index(" ") > -1 : raise ValueError("field should be URL encoded: [%s]" % (field)) - url += "?fields=%s" % (",".join(fields)) + url += "?requested_col_names=%s" % (",".join(requested_col_names)) response = self.json_get(url, debug_=debug_) if response is None: return None @@ -1415,23 +1821,28 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_arm_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_arm_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_arm_endp(self, - alias=None, - cpu_id=None, - mx_pkt_sz=None, - pkt_sz=None, - port=None, - pps=None, - resource=None, - shelf=None, - tos=None, - type=None, + alias=None, + cpu_id=None, + mx_pkt_sz=None, + pkt_sz=None, + port=None, + pps=None, + resource=None, + shelf=None, + tos=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_arm_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -1454,12 +1865,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_bgp_peer + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_bgp_peer ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_bgp_peer_flags(Enum): + class add_bgp_peer_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -1468,36 +1882,67 @@ class LFJsonPost(LFCliBase): PEER_CONFED_MEMBER = 0x4 # Sets corresponding Xorp flag in BGP Peer section. PEER_UNICAST_V4 = 0x8 # Sets corresponding Xorp flag in BGP Peer section. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_bgp_peer_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_bgp_peer_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_bgp_peer_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_bgp_peer_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_add_bgp_peer(self, - p_as=None, - delay_open_time=None, - flags=None, - holdtime=None, - local_dev=None, - nexthop=None, - nexthop6=None, - peer_id=None, - peer_index=None, - resource=None, - shelf=None, - vr_id=None, + p_as=None, + delay_open_time=None, + flags=None, + holdtime=None, + local_dev=None, + nexthop=None, + nexthop6=None, + peer_id=None, + peer_index=None, + resource=None, + shelf=None, + vr_id=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_bgp_peer(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "as" : p_as, @@ -1522,17 +1967,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_bond + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_bond ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_bond(self, - network_devs=None, - port=None, - resource=None, - shelf=None, + network_devs=None, + port=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_bond(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "network_devs" : network_devs, @@ -1549,28 +1999,38 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_br + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_br ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_br_br_flags(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_br_br_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_br_br_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" none = 0 # no features stp_enabled = 1 # Enable Spanning Tree Protocol (STP) def post_add_br(self, - br_aging_time=None, - br_flags=None, - br_forwarding_delay=None, - br_hello_time=None, - br_max_age=None, - br_priority=None, - network_devs=None, - port=None, - resource=None, - shelf=None, + br_aging_time=None, + br_flags=None, + br_forwarding_delay=None, + br_hello_time=None, + br_max_age=None, + br_priority=None, + network_devs=None, + port=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_br(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "br_aging_time" : br_aging_time, @@ -1593,26 +2053,36 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_cd + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_cd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_cd_flags(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_cd_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_cd_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" ERR = 2 # Set to kernel mode. RUNNING = 1 # Set to running state. def post_add_cd(self, - alias=None, - bps=None, - flags=None, - report_timer=None, - resource=None, - shelf=None, - state=None, - type=None, + alias=None, + bps=None, + flags=None, + report_timer=None, + resource=None, + shelf=None, + state=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_cd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -1633,15 +2103,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_cd_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_cd_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_cd_endp(self, - cd=None, - endp=None, + cd=None, + endp=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_cd_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cd" : cd, @@ -1656,15 +2131,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_cd_vr + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_cd_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_cd_vr(self, - cd=None, - vr=None, + cd=None, + vr=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_cd_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cd" : cd, @@ -1679,12 +2159,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_chamber + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_chamber ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_chamber_chamber_flags(Enum): + class add_chamber_chamber_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -1692,44 +2175,75 @@ class LFJsonPost(LFCliBase): PHANTOM = 0x1 # (1) Chamber is not actually here right now. VIRTUAL = 0x2 # (2) No real chamber, open-air grouping of equipment. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_chamber_chamber_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_chamber_chamber_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_chamber_chamber_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_chamber_chamber_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_add_chamber(self, - chamber_type=None, - dut_name1=None, - dut_name2=None, - dut_name3=None, - dut_name4=None, - flags=None, - flags_mask=None, - height=None, - isolation=None, - lanforge1=None, - lanforge2=None, - lanforge3=None, - lanforge4=None, - name=None, - resource=None, - sma_count=None, - turntable_type=None, - width=None, - x=None, - y=None, + chamber_type=None, + dut_name1=None, + dut_name2=None, + dut_name3=None, + dut_name4=None, + flags=None, + flags_mask=None, + height=None, + isolation=None, + lanforge1=None, + lanforge2=None, + lanforge3=None, + lanforge4=None, + name=None, + resource=None, + sma_count=None, + turntable_type=None, + width=None, + x=None, + y=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_chamber(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "chamber_type" : chamber_type, @@ -1762,29 +2276,39 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_chamber_cx + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_chamber_cx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_chamber_cx_chamber_cx_flags(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_chamber_cx_chamber_cx_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_chamber_cx_chamber_cx_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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=None, - atten_id=None, - b_id=None, - connection_idx=None, - flags=None, - flags_mask=None, - internal=None, - min_atten=None, - name=None, - zrssi2=None, - zrssi5=None, + a_id=None, + atten_id=None, + b_id=None, + connection_idx=None, + flags=None, + flags_mask=None, + internal=None, + min_atten=None, + name=None, + zrssi2=None, + zrssi5=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_chamber_cx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "a_id" : a_id, @@ -1808,16 +2332,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_chamber_path + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_chamber_path ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_chamber_path(self, - chamber=None, - content=None, - path=None, + chamber=None, + content=None, + path=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_chamber_path(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "chamber" : chamber, @@ -1833,12 +2362,17 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_channel_group + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_channel_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_channel_group_types(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_channel_group_types.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_channel_group_types.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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 @@ -1855,15 +2389,20 @@ class LFJsonPost(LFCliBase): def post_add_channel_group(self, - alias=None, - channels=None, - idle_flag=None, - mtu=None, - resource=None, - shelf=None, - span_num=None, - type=None, + alias=None, + channels=None, + idle_flag=None, + mtu=None, + resource=None, + shelf=None, + span_num=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_channel_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -1884,17 +2423,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_cx + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_cx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_cx(self, - alias=None, - rx_endp=None, - test_mgr=None, - tx_endp=None, + alias=None, + rx_endp=None, + test_mgr=None, + tx_endp=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_cx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -1911,12 +2455,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_dut + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_dut ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_dut_dut_flags(Enum): + class add_dut_dut_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -1934,52 +2481,83 @@ class LFJsonPost(LFCliBase): 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. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_dut_dut_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_dut_dut_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_dut_dut_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_dut_dut_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_add_dut(self, - antenna_count1=None, - antenna_count2=None, - antenna_count3=None, - api_id=None, - bssid1=None, - bssid2=None, - bssid3=None, - eap_id=None, - flags=None, - flags_mask=None, - hw_version=None, - img_file=None, - lan_port=None, - mgt_ip=None, - model_num=None, - name=None, - passwd1=None, - passwd2=None, - passwd3=None, - serial_num=None, - serial_port=None, - ssid1=None, - ssid2=None, - ssid3=None, - sw_version=None, - top_left_x=None, - top_left_y=None, - wan_port=None, + antenna_count1=None, + antenna_count2=None, + antenna_count3=None, + api_id=None, + bssid1=None, + bssid2=None, + bssid3=None, + eap_id=None, + flags=None, + flags_mask=None, + hw_version=None, + img_file=None, + lan_port=None, + mgt_ip=None, + model_num=None, + name=None, + passwd1=None, + passwd2=None, + passwd3=None, + serial_num=None, + serial_port=None, + ssid1=None, + ssid2=None, + ssid3=None, + sw_version=None, + top_left_x=None, + top_left_y=None, + wan_port=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_dut(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "antenna_count1" : antenna_count1, @@ -2020,15 +2598,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_dut_notes + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_dut_notes ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_dut_notes(self, - dut=None, - text=None, + dut=None, + text=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_dut_notes(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "dut" : dut, @@ -2043,12 +2626,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_dut_ssid + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_dut_ssid ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_dut_ssid_dut_flags(Enum): + class add_dut_ssid_dut_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -2060,31 +2646,62 @@ class LFJsonPost(LFCliBase): WPA2 = 0x20 # Use WPA2 encryption WPA3 = 0x100 # Use WPA3 encryption + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_dut_ssid_dut_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_dut_ssid_dut_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_dut_ssid_dut_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_dut_ssid_dut_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_add_dut_ssid(self, - bssid=None, - name=None, - passwd=None, - ssid=None, - ssid_flags=None, - ssid_flags_mask=None, - ssid_idx=None, + bssid=None, + name=None, + passwd=None, + ssid=None, + ssid_flags=None, + ssid_flags_mask=None, + ssid_idx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_dut_ssid(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "bssid" : bssid, @@ -2104,12 +2721,17 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_endp_payload_pattern(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_endp_payload_pattern.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_endp_payload_pattern.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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. @@ -2123,6 +2745,11 @@ class LFJsonPost(LFCliBase): zeros = "zeros" # payload is all zeros (00) class add_endp_type(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_endp_type.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_endp_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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 @@ -2138,24 +2765,29 @@ class LFJsonPost(LFCliBase): def post_add_endp(self, - alias=None, - ip_port=None, - is_pkt_sz_random=None, - is_rate_bursty=None, - max_pkt=None, - max_rate=None, - min_pkt=None, - min_rate=None, - multi_conn=None, - payload_pattern=None, - port=None, - resource=None, - send_bad_crc_per_million=None, - shelf=None, - ttl=None, - type=None, - use_checksum=None, + alias=None, + ip_port=None, + is_pkt_sz_random=None, + is_rate_bursty=None, + max_pkt=None, + max_rate=None, + min_pkt=None, + min_rate=None, + multi_conn=None, + payload_pattern=None, + port=None, + resource=None, + send_bad_crc_per_million=None, + shelf=None, + ttl=None, + type=None, + use_checksum=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -2185,17 +2817,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_event + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_event ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_event(self, - details=None, - event_id=None, - name=None, - priority=None, + details=None, + event_id=None, + name=None, + priority=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_event(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "details" : details, @@ -2212,12 +2849,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_file_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_file_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_file_endp_fio_flags(Enum): + class add_file_endp_fio_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -2232,22 +2872,53 @@ class LFJsonPost(LFCliBase): 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. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_file_endp_fio_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_file_endp_fio_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_file_endp_fio_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_file_endp_fio_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value class add_file_endp_payload_pattern(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_file_endp_payload_pattern.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_file_endp_payload_pattern.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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. @@ -2262,25 +2933,30 @@ class LFJsonPost(LFCliBase): def post_add_file_endp(self, - alias=None, - directory=None, - fio_flags=None, - max_read_rate=None, - max_write_rate=None, - min_read_rate=None, - min_write_rate=None, - mount_dir=None, - mount_options=None, - payload_pattern=None, - port=None, - prefix=None, - resource=None, - retry_timer=None, - server_mount=None, - shelf=None, - type=None, - volume=None, + alias=None, + directory=None, + fio_flags=None, + max_read_rate=None, + max_write_rate=None, + min_read_rate=None, + min_write_rate=None, + mount_dir=None, + mount_options=None, + payload_pattern=None, + port=None, + prefix=None, + resource=None, + retry_timer=None, + server_mount=None, + shelf=None, + type=None, + volume=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_file_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -2311,18 +2987,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_gen_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_gen_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_gen_endp(self, - alias=None, - port=None, - resource=None, - shelf=None, - type=None, + alias=None, + port=None, + resource=None, + shelf=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_gen_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -2340,19 +3021,24 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_gre + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_gre ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_gre(self, - local_lower_ip=None, - port=None, - remote_lower_ip=None, - report_timer=None, - resource=None, - shelf=None, + local_lower_ip=None, + port=None, + remote_lower_ip=None, + report_timer=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_gre(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "local_lower_ip" : local_lower_ip, @@ -2371,38 +3057,72 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_group + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_group_flags(Enum): + class add_group_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 group_total_rates = 0x4 # Set rates as total for group. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_group_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_group_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_group_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_group_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_add_group(self, - flags=None, - flags_mask=None, - name=None, + flags=None, + flags_mask=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "flags" : flags, @@ -2418,12 +3138,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_l4_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_l4_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_l4_endp_http_auth_type(Enum): + class add_l4_endp_http_auth_type(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -2432,22 +3155,51 @@ class LFJsonPost(LFCliBase): GSSNEGOTIATE = 0x4 # GSS authentication NTLM = 0x8 # NTLM authentication + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_l4_endp_http_auth_type.add_flags('bridge', 'dhcp') + print('value now: '+add_l4_endp_http_auth_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_l4_endp_http_auth_type.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_l4_endp_http_auth_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value - class add_l4_endp_proxy_auth_type(Enum): + class add_l4_endp_proxy_auth_type(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -2464,66 +3216,126 @@ class LFJsonPost(LFCliBase): USE_IPV6 = 0x400 # 1024 Resolve URL is IPv6. Will use IPv4 if not selected. USE_PROXY_CACHE = 0x20 # 32 Use proxy cache + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_l4_endp_proxy_auth_type.add_flags('bridge', 'dhcp') + print('value now: '+add_l4_endp_proxy_auth_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_l4_endp_proxy_auth_type.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_l4_endp_proxy_auth_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value - class add_l4_endp_type(Enum): + class add_l4_endp_type(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 l4_generic = 0x0 # Layer 4 type + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_l4_endp_type.add_flags('bridge', 'dhcp') + print('value now: '+add_l4_endp_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_l4_endp_type.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_l4_endp_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_add_l4_endp(self, - alias=None, - block_size=None, - dns_cache_timeout=None, - http_auth_type=None, - ip_addr=None, - max_speed=None, - port=None, - proxy_auth_type=None, - proxy_port=None, - proxy_server=None, - proxy_userpwd=None, - quiesce_after=None, - resource=None, - shelf=None, - smtp_from=None, - ssl_cert_fname=None, - timeout=None, - type=None, - url=None, - url_rate=None, - user_agent=None, + alias=None, + block_size=None, + dns_cache_timeout=None, + http_auth_type=None, + ip_addr=None, + max_speed=None, + port=None, + proxy_auth_type=None, + proxy_port=None, + proxy_server=None, + proxy_userpwd=None, + quiesce_after=None, + resource=None, + shelf=None, + smtp_from=None, + ssl_cert_fname=None, + timeout=None, + type=None, + url=None, + url_rate=None, + user_agent=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_l4_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -2557,12 +3369,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_monitor + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_monitor ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_monitor_flags(Enum): + class add_monitor_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -2570,32 +3385,63 @@ class LFJsonPost(LFCliBase): disable_ht80 = 0x8000000 # Disable HT80 (for AC chipset NICs only) ht160_enable = 0x100000000 # Enable HT160 mode. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_monitor_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_monitor_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_monitor_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_monitor_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_add_monitor(self, - aid=None, - ap_name=None, - bssid=None, - flags=None, - flags_mask=None, - radio=None, - resource=None, - shelf=None, + aid=None, + ap_name=None, + bssid=None, + flags=None, + flags_mask=None, + radio=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_monitor(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aid" : aid, @@ -2616,21 +3462,26 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_mvlan + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_mvlan ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_mvlan(self, - flags=None, - index=None, - mac=None, - old_name=None, - port=None, - report_timer=None, - resource=None, - shelf=None, + flags=None, + index=None, + mac=None, + old_name=None, + port=None, + report_timer=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_mvlan(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "flags" : flags, @@ -2651,34 +3502,39 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_ppp_link + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_ppp_link(self, - auth=None, - channel_groups=None, - debug=None, - down_time_max_ms=None, - down_time_min_ms=None, - dst_ip=None, - extra_args=None, - holdoff=None, - lcp_echo_failure=None, - lcp_echo_interval=None, - mlppp_descriptor=None, - persist=None, - pppoe_transport_port=None, - resource=None, - run_time_max_ms=None, - run_time_min_ms=None, - shelf=None, - src_ip=None, - transport_type=None, - tty_transport_device=None, - unit=None, + auth=None, + channel_groups=None, + debug=None, + down_time_max_ms=None, + down_time_min_ms=None, + dst_ip=None, + extra_args=None, + holdoff=None, + lcp_echo_failure=None, + lcp_echo_interval=None, + mlppp_descriptor=None, + persist=None, + pppoe_transport_port=None, + resource=None, + run_time_max_ms=None, + run_time_min_ms=None, + shelf=None, + src_ip=None, + transport_type=None, + tty_transport_device=None, + unit=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_ppp_link(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "auth" : auth, @@ -2712,12 +3568,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_profile + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_profile_profile_flags(Enum): + class add_profile_profile_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -2733,22 +3592,53 @@ class LFJsonPost(LFCliBase): WPA2 = 0x8 # Use WPA2 encryption WPA3 = 0x20 # Use WPA3 encryption + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_profile_profile_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_profile_profile_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_profile_profile_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_profile_profile_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value class add_profile_wifi_mode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_profile_wifi_mode.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_profile_wifi_mode.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_802_11a = "802.11a" # 802.11a AUTO = "AUTO" # 802.11g abg = "abg" # 802.11abg @@ -2780,22 +3670,27 @@ class LFJsonPost(LFCliBase): def post_add_profile(self, - alias_prefix=None, - antenna=None, - bandwidth=None, - eap_id=None, - flags_mask=None, - freq=None, - instance_count=None, - mac_pattern=None, - name=None, - passwd=None, - profile_flags=None, - profile_type=None, - ssid=None, - vid=None, - wifi_mode=None, + alias_prefix=None, + antenna=None, + bandwidth=None, + eap_id=None, + flags_mask=None, + freq=None, + instance_count=None, + mac_pattern=None, + name=None, + passwd=None, + profile_flags=None, + profile_type=None, + ssid=None, + vid=None, + wifi_mode=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias_prefix" : alias_prefix, @@ -2823,15 +3718,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_profile_notes + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_profile_notes ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_profile_notes(self, - dut=None, - text=None, + dut=None, + text=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_profile_notes(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "dut" : dut, @@ -2846,18 +3746,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_rdd + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_rdd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_rdd(self, - peer_ifname=None, - port=None, - report_timer=None, - resource=None, - shelf=None, + peer_ifname=None, + port=None, + report_timer=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_rdd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "peer_ifname" : peer_ifname, @@ -2875,17 +3780,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_sec_ip + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_sec_ip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_sec_ip(self, - ip_list=None, - port=None, - resource=None, - shelf=None, + ip_list=None, + port=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_sec_ip(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "ip_list" : ip_list, @@ -2902,12 +3812,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_sta + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_sta ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_sta_flags(Enum): + class add_sta_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -2947,22 +3860,53 @@ class LFJsonPost(LFCliBase): wpa2_enable = 0x400 # Use wpa_supplicant configured for WPA2 encryption. wpa_enable = 0x10 # Enable WPA + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_sta_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_sta_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_sta_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_sta_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value class add_sta_mode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_sta_mode.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_sta_mode.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_802_11a = 1 # 802.11a AUTO = 0 # 802.11g abg = 4 # 802.11abg @@ -2980,6 +3924,11 @@ class LFJsonPost(LFCliBase): g = 3 # 802.11g class add_sta_rate(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_sta_rate.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_sta_rate.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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 @@ -2988,29 +3937,34 @@ class LFJsonPost(LFCliBase): def post_add_sta(self, - ampdu_density=None, - ampdu_factor=None, - ap=None, - flags=None, - flags_mask=None, - ieee80211w=None, - key=None, - mac=None, - max_amsdu=None, - mode=None, - nickname=None, - radio=None, - rate=None, - resource=None, - shelf=None, - ssid=None, - sta_br_ip=None, - sta_name=None, - wpa_cfg_file=None, - x_coord=None, - y_coord=None, - z_coord=None, + ampdu_density=None, + ampdu_factor=None, + ap=None, + flags=None, + flags_mask=None, + ieee80211w=None, + key=None, + mac=None, + max_amsdu=None, + mode=None, + nickname=None, + radio=None, + rate=None, + resource=None, + shelf=None, + ssid=None, + sta_br_ip=None, + sta_name=None, + wpa_cfg_file=None, + x_coord=None, + y_coord=None, + z_coord=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_sta(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "ampdu_density" : ampdu_density, @@ -3045,12 +3999,17 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_t1_span + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_t1_span ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_t1_span_buildout(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_t1_span_buildout.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_t1_span_buildout.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_15db = 6 # -15db (CSU) p_22_5db = 7 # -22.5db (CSU) p_7_5db = 5 # -7.5db (CSU) @@ -3063,20 +4022,25 @@ class LFJsonPost(LFCliBase): def post_add_t1_span(self, - buildout=None, - coding=None, - cpu_id=None, - first_channel=None, - framing=None, - mtu=None, - pci_bus=None, - pci_slot=None, - resource=None, - shelf=None, - span_num=None, - timing=None, - type=None, + buildout=None, + coding=None, + cpu_id=None, + first_channel=None, + framing=None, + mtu=None, + pci_bus=None, + pci_slot=None, + resource=None, + shelf=None, + span_num=None, + timing=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_t1_span(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "buildout" : buildout, @@ -3102,16 +4066,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_text_blob + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_text_blob ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_text_blob(self, - name=None, - text=None, - type=None, + name=None, + text=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_text_blob(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -3127,15 +4096,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_tgcx + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_tgcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_tgcx(self, - cxname=None, - tgname=None, + cxname=None, + tgname=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_tgcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cxname" : cxname, @@ -3150,16 +4124,26 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_threshold + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_threshold ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_threshold_thresh_id(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_threshold_thresh_id.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_threshold_thresh_id.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" Delete_Marked = -3 # Delete any marked. Mark_All = -2 # Mark all class add_threshold_thresh_type(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_threshold_thresh_type.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_threshold_thresh_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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. @@ -3172,12 +4156,17 @@ class LFJsonPost(LFCliBase): def post_add_threshold(self, - endp=None, - thresh_id=None, - thresh_max=None, - thresh_min=None, - thresh_type=None, + endp=None, + thresh_id=None, + thresh_max=None, + thresh_min=None, + thresh_type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_threshold(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp" : endp, @@ -3195,14 +4184,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_tm + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_tm ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_tm(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_tm(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -3216,12 +4210,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_traffic_profile + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_traffic_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_traffic_profile_traffic_profile_flags(Enum): + class add_traffic_profile_traffic_profile_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -3229,22 +4226,53 @@ class LFJsonPost(LFCliBase): IPERF_UDP = 0x4 # If Iperf, should use UDP. If not set, then will use TCP. UP = 0x1 # Upload direction (this not set means download) + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_traffic_profile_traffic_profile_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_traffic_profile_traffic_profile_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_traffic_profile_traffic_profile_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_traffic_profile_traffic_profile_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value class add_traffic_profile_wifi_mode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_traffic_profile_wifi_mode.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_traffic_profile_wifi_mode.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" Iperf3_Client = "Iperf3-Client" # iperf3 client Iperf3_Server = "Iperf3-Server" # iperf3 server as_is = "as_is" # Make no changes to current configuration @@ -3255,17 +4283,22 @@ class LFJsonPost(LFCliBase): def post_add_traffic_profile(self, - instance_count=None, - max_pdu=None, - max_speed=None, - min_pdu=None, - min_speed=None, - name=None, - tos=None, - traffic_profile_flags=None, - traffic_profile_flags_mask=None, - type=None, + instance_count=None, + max_pdu=None, + max_speed=None, + min_pdu=None, + min_speed=None, + name=None, + tos=None, + traffic_profile_flags=None, + traffic_profile_flags_mask=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_traffic_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "instance_count" : instance_count, @@ -3288,15 +4321,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_traffic_profile_notes + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_traffic_profile_notes ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_traffic_profile_notes(self, - dut=None, - text=None, + dut=None, + text=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_traffic_profile_notes(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "dut" : dut, @@ -3311,12 +4349,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_vap + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_vap ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_vap_flags(Enum): + class add_vap_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -3349,22 +4390,53 @@ class LFJsonPost(LFCliBase): wep_enable = 0x200 # Enable WEP Encryption wpa2_enable = 0x400 # Enable WPA2 Encryption + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_vap_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_vap_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_vap_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_vap_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value class add_vap_mode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_vap_mode.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_vap_mode.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_802_11a = 1 # 802.11a AUTO = 0 # 802.11g abg = 4 # 802.11abg @@ -3383,27 +4455,32 @@ class LFJsonPost(LFCliBase): def post_add_vap(self, - ap_name=None, - beacon=None, - custom_cfg=None, - dtim_period=None, - flags=None, - flags_mask=None, - frag_thresh=None, - ieee80211w=None, - key=None, - mac=None, - max_sta=None, - mode=None, - radio=None, - rate=None, - resource=None, - shelf=None, - ssid=None, - x_coord=None, - y_coord=None, - z_coord=None, + ap_name=None, + beacon=None, + custom_cfg=None, + dtim_period=None, + flags=None, + flags_mask=None, + frag_thresh=None, + ieee80211w=None, + key=None, + mac=None, + max_sta=None, + mode=None, + radio=None, + rate=None, + resource=None, + shelf=None, + ssid=None, + x_coord=None, + y_coord=None, + z_coord=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vap(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "ap_name" : ap_name, @@ -3436,12 +4513,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_venue + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_venue ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_venue_freq_24(Enum): + class add_venue_freq_24(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -3450,22 +4530,51 @@ class LFJsonPost(LFCliBase): Ch_2 = 0x2 # Channel 2 Ch_3 = 0x4 # Channel 3 + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_venue_freq_24.add_flags('bridge', 'dhcp') + print('value now: '+add_venue_freq_24.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_venue_freq_24.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_venue_freq_24.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value - class add_venue_freq_5(Enum): + class add_venue_freq_5(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -3497,34 +4606,65 @@ class LFJsonPost(LFCliBase): Ch_60 = 0x200 # Channel 60 5300 Ch_64 = 0x400 # Channel 64 5320 + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_venue_freq_5.add_flags('bridge', 'dhcp') + print('value now: '+add_venue_freq_5.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_venue_freq_5.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_venue_freq_5.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_add_venue(self, - description=None, - freq_24=None, - freq_5=None, - resource=None, - shelf=None, - venu_id=None, - x1=None, - x2=None, - y1=None, - y2=None, + description=None, + freq_24=None, + freq_5=None, + resource=None, + shelf=None, + venu_id=None, + x1=None, + x2=None, + y1=None, + y2=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_venue(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "description" : description, @@ -3547,19 +4687,24 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_vlan + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_vlan ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_vlan(self, - old_name=None, - port=None, - report_timer=None, - resource=None, - shelf=None, - vid=None, + old_name=None, + port=None, + report_timer=None, + resource=None, + shelf=None, + vid=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vlan(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "old_name" : old_name, @@ -3578,30 +4723,35 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_voip_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_voip_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_voip_endp(self, - alias=None, - auth_user_name=None, - display_name=None, - gateway_port=None, - ip_addr=None, - peer_phone_num=None, - phone_num=None, - port=None, - proxy_passwd=None, - resource=None, - rtp_port=None, - rx_sound_file=None, - shelf=None, - sip_gateway=None, - tx_sound_file=None, - vad_max_timer=None, - vad_timer=None, + alias=None, + auth_user_name=None, + display_name=None, + gateway_port=None, + ip_addr=None, + peer_phone_num=None, + phone_num=None, + port=None, + proxy_passwd=None, + resource=None, + rtp_port=None, + rx_sound_file=None, + shelf=None, + sip_gateway=None, + tx_sound_file=None, + vad_max_timer=None, + vad_timer=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_voip_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -3631,12 +4781,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_vr + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_vr_flags(Enum): + class add_vr_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -3654,34 +4807,65 @@ class LFJsonPost(LFCliBase): 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) + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_vr_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_vr_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_vr_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_vr_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_add_vr(self, - alias=None, - flags=None, - height=None, - notes=None, - resource=None, - shelf=None, - vr_id=None, - width=None, - x=None, - y=None, + alias=None, + flags=None, + height=None, + notes=None, + resource=None, + shelf=None, + vr_id=None, + width=None, + x=None, + y=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -3704,12 +4888,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_vr_bgp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_vr_bgp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_vr_bgp_flags(Enum): + class add_vr_bgp_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -3719,36 +4906,67 @@ class LFJsonPost(LFCliBase): ENABLE_BGP = 0x20 # Set this to zero if you don't want BGP on this VR. ROUTE_REFLECTOR = 0x80 # Act as BGP Route Reflector. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_vr_bgp_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_vr_bgp_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_vr_bgp_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_vr_bgp_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_add_vr_bgp(self, - bgp_id=None, - cluster_id=None, - confed_id=None, - flags=None, - half_life=None, - local_as=None, - max_suppress=None, - resource=None, - reuse=None, - shelf=None, - suppress=None, - vr_id=None, + bgp_id=None, + cluster_id=None, + confed_id=None, + flags=None, + half_life=None, + local_as=None, + max_suppress=None, + resource=None, + reuse=None, + shelf=None, + suppress=None, + vr_id=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vr_bgp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "bgp_id" : bgp_id, @@ -3773,12 +4991,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_vrcx + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_vrcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_vrcx_flags(Enum): + class add_vrcx_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -3797,55 +5018,86 @@ class LFJsonPost(LFCliBase): use_multicast = 0x800 # Use this interface for multicast and-rp use_vrrp = 0x1000 # Use this interface for VRRP + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_vrcx_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_vrcx_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_vrcx_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_vrcx_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_add_vrcx(self, - dhcp_dns=None, - dhcp_dns6=None, - dhcp_domain=None, - dhcp_lease_time=None, - dhcp_max=None, - dhcp_max6=None, - dhcp_min=None, - dhcp_min6=None, - flags=None, - height=None, - interface_cost=None, - local_dev=None, - local_dev_b=None, - nexthop=None, - ospf_area=None, - remote_dev=None, - remote_dev_b=None, - resource=None, - rip_metric=None, - shelf=None, - subnets=None, - vr_name=None, - vrrp_id=None, - vrrp_interval=None, - vrrp_ip=None, - vrrp_ip_prefix=None, - vrrp_priority=None, - wanlink=None, - width=None, - x=None, - y=None, + dhcp_dns=None, + dhcp_dns6=None, + dhcp_domain=None, + dhcp_lease_time=None, + dhcp_max=None, + dhcp_max6=None, + dhcp_min=None, + dhcp_min6=None, + flags=None, + height=None, + interface_cost=None, + local_dev=None, + local_dev_b=None, + nexthop=None, + ospf_area=None, + remote_dev=None, + remote_dev_b=None, + resource=None, + rip_metric=None, + shelf=None, + subnets=None, + vr_name=None, + vrrp_id=None, + vrrp_interval=None, + vrrp_ip=None, + vrrp_ip_prefix=None, + vrrp_priority=None, + wanlink=None, + width=None, + x=None, + y=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vrcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "dhcp_dns" : dhcp_dns, @@ -3889,19 +5141,24 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_vrcx2 + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_vrcx2 ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_vrcx2(self, - local_dev=None, - nexthop6=None, - resource=None, - shelf=None, - subnets6=None, - vr_name=None, + local_dev=None, + nexthop6=None, + resource=None, + shelf=None, + subnets6=None, + vr_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vrcx2(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "local_dev" : local_dev, @@ -3920,12 +5177,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_vsta + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_sta ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class add_sta_flags(Enum): + class add_sta_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -3965,22 +5225,53 @@ class LFJsonPost(LFCliBase): wpa2_enable = 0x400 # Use wpa_supplicant configured for WPA2 encryption. wpa_enable = 0x10 # Enable WPA + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_sta_flags.add_flags('bridge', 'dhcp') + print('value now: '+add_sta_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_sta_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_sta_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value class add_sta_mode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_sta_mode.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_sta_mode.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_802_11a = 1 # 802.11a AUTO = 0 # 802.11g abg = 4 # 802.11abg @@ -3998,6 +5289,11 @@ class LFJsonPost(LFCliBase): g = 3 # 802.11g class add_sta_rate(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_sta_rate.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_sta_rate.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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 @@ -4006,29 +5302,34 @@ class LFJsonPost(LFCliBase): def post_add_vsta(self, - ampdu_density=None, - ampdu_factor=None, - ap=None, - flags=None, - flags_mask=None, - ieee80211w=None, - key=None, - mac=None, - max_amsdu=None, - mode=None, - nickname=None, - radio=None, - rate=None, - resource=None, - shelf=None, - ssid=None, - sta_br_ip=None, - sta_name=None, - wpa_cfg_file=None, - x_coord=None, - y_coord=None, - z_coord=None, + ampdu_density=None, + ampdu_factor=None, + ap=None, + flags=None, + flags_mask=None, + ieee80211w=None, + key=None, + mac=None, + max_amsdu=None, + mode=None, + nickname=None, + radio=None, + rate=None, + resource=None, + shelf=None, + ssid=None, + sta_br_ip=None, + sta_name=None, + wpa_cfg_file=None, + x_coord=None, + y_coord=None, + z_coord=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_vsta(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "ampdu_density" : ampdu_density, @@ -4063,54 +5364,64 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/add_wl_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_wl_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class add_wl_endp_wle_flags(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + add_wl_endp_wle_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+add_wl_endp_wle_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" SHOW_WP = 1 # Show WanPaths in wanlink endpoint table in GUI def post_add_wl_endp(self, - alias=None, - cpu_id=None, - description=None, - dest_ip=None, - dest_ip_mask=None, - drop_every_xth_pkt=None, - drop_freq=None, - dup_every_xth_pkt=None, - dup_freq=None, - extra_buffer=None, - ignore_bandwidth=None, - ignore_dup=None, - ignore_latency=None, - ignore_loss=None, - jitter_freq=None, - latency=None, - max_drop_amt=None, - max_jitter=None, - max_lateness=None, - max_rate=None, - max_reorder_amt=None, - min_drop_amt=None, - min_reorder_amt=None, - playback_capture=None, - playback_capture_file=None, - playback_loop=None, - port=None, - reorder_every_xth_pkt=None, - reorder_freq=None, - resource=None, - shelf=None, - source_ip=None, - source_ip_mask=None, - speed=None, - test_mgr=None, - wanlink=None, - wle_flags=None, + alias=None, + cpu_id=None, + description=None, + dest_ip=None, + dest_ip_mask=None, + drop_every_xth_pkt=None, + drop_freq=None, + dup_every_xth_pkt=None, + dup_freq=None, + extra_buffer=None, + ignore_bandwidth=None, + ignore_dup=None, + ignore_latency=None, + ignore_loss=None, + jitter_freq=None, + latency=None, + max_drop_amt=None, + max_jitter=None, + max_lateness=None, + max_rate=None, + max_reorder_amt=None, + min_drop_amt=None, + min_reorder_amt=None, + playback_capture=None, + playback_capture_file=None, + playback_loop=None, + port=None, + reorder_every_xth_pkt=None, + reorder_freq=None, + resource=None, + shelf=None, + source_ip=None, + source_ip_mask=None, + speed=None, + test_mgr=None, + wanlink=None, + wle_flags=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_add_wl_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -4160,18 +5471,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/admin + Notes for type requests https://www.candelatech.com/lfcli_ug.php#admin ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_admin(self, - arg1=None, - arg2=None, - arg3=None, - arg5=None, - cmd=None, + arg1=None, + arg2=None, + arg3=None, + arg5=None, + cmd=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_admin(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "arg1" : arg1, @@ -4189,15 +5505,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/apply_vr_cfg + Notes for type requests https://www.candelatech.com/lfcli_ug.php#apply_vr_cfg ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_apply_vr_cfg(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_apply_vr_cfg(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -4212,16 +5533,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/blink_attenuator + Notes for type requests https://www.candelatech.com/lfcli_ug.php#blink_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_blink_attenuator(self, - resource=None, - serno=None, - shelf=None, + resource=None, + serno=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_blink_attenuator(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -4237,12 +5563,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/c_show_ports + Notes for type requests https://www.candelatech.com/lfcli_ug.php#c_show_ports ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class c_show_ports_probe_flags(Enum): + class c_show_ports_probe_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -4254,28 +5583,59 @@ class LFJsonPost(LFCliBase): MII = 0x2 # 2 include MII WIFI = 0x1 # 1 include wifi stations + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + c_show_ports_probe_flags.add_flags('bridge', 'dhcp') + print('value now: '+c_show_ports_probe_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + c_show_ports_probe_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+c_show_ports_probe_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_c_show_ports(self, - port=None, - probe_flags=None, - resource=None, - shelf=None, + port=None, + probe_flags=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_c_show_ports(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "port" : port, @@ -4292,15 +5652,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/cancel_vr_cfg + Notes for type requests https://www.candelatech.com/lfcli_ug.php#cancel_vr_cfg ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_cancel_vr_cfg(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_cancel_vr_cfg(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -4315,15 +5680,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/clear_card_counters + Notes for type requests https://www.candelatech.com/lfcli_ug.php#clear_resource_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_card_counters(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_card_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -4338,14 +5708,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/clear_cd_counters + Notes for type requests https://www.candelatech.com/lfcli_ug.php#clear_cd_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_cd_counters(self, - cd_name=None, + cd_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_cd_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cd_name" : cd_name, @@ -4359,14 +5734,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/clear_cx_counters + Notes for type requests https://www.candelatech.com/lfcli_ug.php#clear_cx_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_cx_counters(self, - cx_name=None, + cx_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_cx_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cx_name" : cx_name, @@ -4380,16 +5760,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/clear_endp_counters + Notes for type requests https://www.candelatech.com/lfcli_ug.php#clear_endp_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_endp_counters(self, - endp_name=None, - incr_seqno=None, - just_latency=None, + endp_name=None, + incr_seqno=None, + just_latency=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_endp_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp_name" : endp_name, @@ -4405,14 +5790,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/clear_group + Notes for type requests https://www.candelatech.com/lfcli_ug.php#clear_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_group(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -4426,23 +5816,33 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/clear_port_counters + Notes for type requests https://www.candelatech.com/lfcli_ug.php#clear_port_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class clear_port_counters_extra(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + clear_port_counters_extra.clear_flags('bridge', 'dhcp') + print( 'value now: '+clear_port_counters_extra.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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=None, - port=None, - resource=None, - shelf=None, + extra=None, + port=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_port_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "extra" : extra, @@ -4459,15 +5859,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/clear_resource_counters + Notes for type requests https://www.candelatech.com/lfcli_ug.php#clear_resource_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_resource_counters(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_resource_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -4482,15 +5887,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/clear_wp_counters + Notes for type requests https://www.candelatech.com/lfcli_ug.php#clear_wp_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_wp_counters(self, - endp_name=None, - wp_name=None, + endp_name=None, + wp_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_clear_wp_counters(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp_name" : endp_name, @@ -4505,16 +5915,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/create_client + Notes for type requests https://www.candelatech.com/lfcli_ug.php#create_client ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_create_client(self, - name=None, - password=None, - super_user=None, + name=None, + password=None, + super_user=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_create_client(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -4530,15 +5945,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/diag + Notes for type requests https://www.candelatech.com/lfcli_ug.php#diag ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_diag(self, - arg1=None, - type=None, + arg1=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_diag(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "arg1" : arg1, @@ -4553,16 +5973,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/discover + Notes for type requests https://www.candelatech.com/lfcli_ug.php#discover ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_discover(self, - disconnect=None, - resource=None, - shelf=None, + disconnect=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_discover(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "disconnect" : disconnect, @@ -4578,15 +6003,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/do_pesq + Notes for type requests https://www.candelatech.com/lfcli_ug.php#do_pesq ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_do_pesq(self, - endp_name=None, - result_file_name=None, + endp_name=None, + result_file_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_do_pesq(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp_name" : endp_name, @@ -4601,13 +6031,18 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/exit + Notes for type requests https://www.candelatech.com/lfcli_ug.php#quit ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_exit(self, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_exit(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { } @@ -4620,17 +6055,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/file + Notes for type requests https://www.candelatech.com/lfcli_ug.php#file ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_file(self, - card=None, - cmd=None, - filename=None, - shelf=None, + card=None, + cmd=None, + filename=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_file(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "card" : card, @@ -4647,17 +6087,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/flash_attenuator + Notes for type requests https://www.candelatech.com/lfcli_ug.php#flash_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_flash_attenuator(self, - filename=None, - resource=None, - serno=None, - shelf=None, + filename=None, + resource=None, + serno=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_flash_attenuator(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "filename" : filename, @@ -4674,15 +6119,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/getavglatency + Notes for type requests https://www.candelatech.com/lfcli_ug.php#getavglatency ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getavglatency(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getavglatency(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4697,15 +6147,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/getinrxbps + Notes for type requests https://www.candelatech.com/lfcli_ug.php#getinrxbps ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getinrxbps(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getinrxbps(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4720,15 +6175,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/getinrxrate + Notes for type requests https://www.candelatech.com/lfcli_ug.php#getinrxrate ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getinrxrate(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getinrxrate(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4743,15 +6203,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/getintxrate + Notes for type requests https://www.candelatech.com/lfcli_ug.php#getintxrate ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getintxrate(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getintxrate(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4766,15 +6231,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/getipadd + Notes for type requests https://www.candelatech.com/lfcli_ug.php#getipadd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getipadd(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getipadd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4789,15 +6259,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/getmac + Notes for type requests https://www.candelatech.com/lfcli_ug.php#getmac ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getmac(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getmac(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4812,15 +6287,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/getmask + Notes for type requests https://www.candelatech.com/lfcli_ug.php#getmask ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getmask(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getmask(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4835,15 +6315,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/getpktdrops + Notes for type requests https://www.candelatech.com/lfcli_ug.php#getpktdrops ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getpktdrops(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getpktdrops(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4858,15 +6343,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/getrxendperrpkts + Notes for type requests https://www.candelatech.com/lfcli_ug.php#getrxendperrpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getrxendperrpkts(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getrxendperrpkts(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4881,15 +6371,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/getrxpkts + Notes for type requests https://www.candelatech.com/lfcli_ug.php#getrxpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getrxpkts(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getrxpkts(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4904,15 +6399,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/getrxporterrpkts + Notes for type requests https://www.candelatech.com/lfcli_ug.php#getrxporterrpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getrxporterrpkts(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_getrxporterrpkts(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4927,15 +6427,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/gettxpkts + Notes for type requests https://www.candelatech.com/lfcli_ug.php#gettxpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_gettxpkts(self, - aorb=None, - cx=None, + aorb=None, + cx=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_gettxpkts(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "aorb" : aorb, @@ -4950,14 +6455,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/gossip + Notes for type requests https://www.candelatech.com/lfcli_ug.php#gossip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_gossip(self, - message=None, + message=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_gossip(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "message" : message, @@ -4971,14 +6481,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/help + Notes for type requests https://www.candelatech.com/lfcli_ug.php#help ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_help(self, - command=None, + command=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_help(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "command" : command, @@ -4992,17 +6507,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/init_wiser + Notes for type requests https://www.candelatech.com/lfcli_ug.php#init_wiser ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_init_wiser(self, - file_name=None, - node_count=None, - resource=None, - shelf=None, + file_name=None, + node_count=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_init_wiser(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "file_name" : file_name, @@ -5019,15 +6539,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/licenses + Notes for type requests https://www.candelatech.com/lfcli_ug.php#licenses ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_licenses(self, - popup=None, - show_file=None, + popup=None, + show_file=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_licenses(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "popup" : popup, @@ -5042,18 +6567,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/load + Notes for type requests https://www.candelatech.com/lfcli_ug.php#load ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_load(self, - action=None, - clean_chambers=None, - clean_dut=None, - clean_profiles=None, - name=None, + action=None, + clean_chambers=None, + clean_dut=None, + clean_profiles=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_load(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "action" : action, @@ -5071,12 +6601,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/log_level + Notes for type requests https://www.candelatech.com/lfcli_ug.php#log_level ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class log_level_level(Enum): + class log_level_level(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -5098,26 +6631,57 @@ class LFJsonPost(LFCliBase): WRN = 0x4 # warnings (4) XMT = 0x100 # Output going to clients (256) + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + log_level_level.add_flags('bridge', 'dhcp') + print('value now: '+log_level_level.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + log_level_level.clear_flags('bridge', 'dhcp') + print( 'value now: '+log_level_level.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_log_level(self, - level=None, - target=None, + level=None, + target=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_log_level(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "level" : level, @@ -5132,14 +6696,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/log_msg + Notes for type requests https://www.candelatech.com/lfcli_ug.php#log_msg ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_log_msg(self, - message=None, + message=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_log_msg(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "message" : message, @@ -5153,15 +6722,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/login + Notes for type requests https://www.candelatech.com/lfcli_ug.php#login ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_login(self, - name=None, - password=None, + name=None, + password=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_login(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -5176,13 +6750,18 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/logout + Notes for type requests https://www.candelatech.com/lfcli_ug.php#quit ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_logout(self, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_logout(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { } @@ -5195,13 +6774,18 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/motd + 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 data = { } @@ -5214,16 +6798,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/nc_show_cd + Notes for type requests https://www.candelatech.com/lfcli_ug.php#nc_show_cd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_cd(self, - collision_domain=None, - resource=None, - shelf=None, + collision_domain=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_cd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "collision_domain" : collision_domain, @@ -5239,16 +6828,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/nc_show_channel_groups + Notes for type requests https://www.candelatech.com/lfcli_ug.php#nc_show_channel_groups ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_channel_groups(self, - channel_name=None, - resource=None, - shelf=None, + channel_name=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_channel_groups(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "channel_name" : channel_name, @@ -5264,15 +6858,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/nc_show_endpoints + Notes for type requests https://www.candelatech.com/lfcli_ug.php#nc_show_endpoints ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_endpoints(self, - endpoint=None, - extra=None, + endpoint=None, + extra=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_endpoints(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endpoint" : endpoint, @@ -5287,14 +6886,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/nc_show_pesq + Notes for type requests https://www.candelatech.com/lfcli_ug.php#nc_show_pesq ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_pesq(self, - endpoint=None, + endpoint=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_pesq(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endpoint" : endpoint, @@ -5308,12 +6912,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/nc_show_ports + Notes for type requests https://www.candelatech.com/lfcli_ug.php#nc_show_ports ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class nc_show_ports_probe_flags(Enum): + class nc_show_ports_probe_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -5325,28 +6932,59 @@ class LFJsonPost(LFCliBase): MII = 0x2 # 2 include MII WIFI = 0x1 # 1 include wifi stations + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + nc_show_ports_probe_flags.add_flags('bridge', 'dhcp') + print('value now: '+nc_show_ports_probe_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + nc_show_ports_probe_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+nc_show_ports_probe_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_nc_show_ports(self, - port=None, - probe_flags=None, - resource=None, - shelf=None, + port=None, + probe_flags=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_ports(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "port" : port, @@ -5363,16 +7001,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/nc_show_ppp_links + Notes for type requests https://www.candelatech.com/lfcli_ug.php#nc_show_ppp_links ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_ppp_links(self, - link_num=None, - resource=None, - shelf=None, + link_num=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_ppp_links(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "link_num" : link_num, @@ -5388,16 +7031,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/nc_show_spans + Notes for type requests https://www.candelatech.com/lfcli_ug.php#nc_show_spans ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_spans(self, - resource=None, - shelf=None, - span_number=None, + resource=None, + shelf=None, + span_number=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_spans(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -5413,16 +7061,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/nc_show_vr + Notes for type requests https://www.candelatech.com/lfcli_ug.php#nc_show_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_vr(self, - resource=None, - router=None, - shelf=None, + resource=None, + router=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -5438,16 +7091,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/nc_show_vrcx + Notes for type requests https://www.candelatech.com/lfcli_ug.php#nc_show_vrcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_vrcx(self, - cx_name=None, - resource=None, - shelf=None, + cx_name=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_nc_show_vrcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cx_name" : cx_name, @@ -5463,22 +7121,27 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/notify_dhcp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#notify_dhcp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_notify_dhcp(self, - cmd=None, - netmask=None, - new_dns=None, - new_ip=None, - new_ip6=None, - new_mtu=None, - new_router=None, - port=None, - reason=None, + cmd=None, + netmask=None, + new_dns=None, + new_ip=None, + new_ip6=None, + new_mtu=None, + new_router=None, + port=None, + reason=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_notify_dhcp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cmd" : cmd, @@ -5500,16 +7163,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/port_reset_completed + Notes for type requests https://www.candelatech.com/lfcli_ug.php#port_reset_completed ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_port_reset_completed(self, - extra=None, - port=None, - type=None, + extra=None, + port=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_port_reset_completed(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "extra" : extra, @@ -5525,17 +7193,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/probe_port + Notes for type requests https://www.candelatech.com/lfcli_ug.php#probe_port ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_probe_port(self, - key=None, - port=None, - resource=None, - shelf=None, + key=None, + port=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_probe_port(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "key" : key, @@ -5552,15 +7225,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/probe_ports + Notes for type requests https://www.candelatech.com/lfcli_ug.php#probe_ports ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_probe_ports(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_probe_ports(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -5575,14 +7253,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/quiesce_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#quiesce_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_quiesce_endp(self, - endp_name=None, + endp_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_quiesce_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp_name" : endp_name, @@ -5596,14 +7279,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/quiesce_group + Notes for type requests https://www.candelatech.com/lfcli_ug.php#quiesce_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_quiesce_group(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_quiesce_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -5617,13 +7305,18 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/quit + 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 data = { } @@ -5636,15 +7329,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/reboot_os + Notes for type requests https://www.candelatech.com/lfcli_ug.php#reboot_os ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_reboot_os(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_reboot_os(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -5659,18 +7357,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/report + Notes for type requests https://www.candelatech.com/lfcli_ug.php#report ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_report(self, - reporting_on=None, - rpt_dir=None, - save_endps=None, - save_ports=None, - save_resource=None, + reporting_on=None, + rpt_dir=None, + save_endps=None, + save_ports=None, + save_resource=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_report(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "reporting_on" : reporting_on, @@ -5688,24 +7391,34 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/reset_port + Notes for type requests https://www.candelatech.com/lfcli_ug.php#reset_port ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class reset_port_pre_ifdown(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + reset_port_pre_ifdown.clear_flags('bridge', 'dhcp') + print( 'value now: '+reset_port_pre_ifdown.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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=None, - pre_ifdown=None, - reset_ospf=None, - resource=None, - shelf=None, + port=None, + pre_ifdown=None, + reset_ospf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_reset_port(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "port" : port, @@ -5723,16 +7436,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/reset_serial_span + Notes for type requests https://www.candelatech.com/lfcli_ug.php#reset_serial_span ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_reset_serial_span(self, - resource=None, - shelf=None, - span=None, + resource=None, + shelf=None, + span=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_reset_serial_span(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -5748,16 +7466,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_attenuator + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_attenuator(self, - resource=None, - serno=None, - shelf=None, + resource=None, + serno=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_attenuator(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -5773,14 +7496,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_cd + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_cd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cd(self, - cd=None, + cd=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_cd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cd" : cd, @@ -5794,15 +7522,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_cd_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_cd_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cd_endp(self, - cd=None, - endp=None, + cd=None, + endp=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_cd_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cd" : cd, @@ -5817,15 +7550,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_cd_vr + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_cd_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cd_vr(self, - cd=None, - endp=None, + cd=None, + endp=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_cd_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cd" : cd, @@ -5840,14 +7578,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_chamber + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_chamber ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_chamber(self, - chamber=None, + chamber=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_chamber(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "chamber" : chamber, @@ -5861,15 +7604,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_chamber_path + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_chamber_path ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_chamber_path(self, - chamber=None, - path=None, + chamber=None, + path=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_chamber_path(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "chamber" : chamber, @@ -5884,16 +7632,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_channel_group + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_channel_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_channel_group(self, - channel_name=None, - resource=None, - shelf=None, + channel_name=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_channel_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "channel_name" : channel_name, @@ -5909,15 +7662,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_client + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_client ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_client(self, - client_name=None, - client_password=None, + client_name=None, + client_password=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_client(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "client_name" : client_name, @@ -5932,15 +7690,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_cx + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_cx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cx(self, - cx_name=None, - test_mgr=None, + cx_name=None, + test_mgr=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_cx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cx_name" : cx_name, @@ -5955,14 +7718,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_db + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_db ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_db(self, - db_name=None, + db_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_db(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "db_name" : db_name, @@ -5976,14 +7744,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_dut + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_dut ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_dut(self, - shelf=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_dut(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "shelf" : shelf, @@ -5997,14 +7770,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_endp(self, - endp_name=None, + endp_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp_name" : endp_name, @@ -6018,14 +7796,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_event + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_event ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_event(self, - event_id=None, + event_id=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_event(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "event_id" : event_id, @@ -6039,14 +7822,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_group + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_group(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -6060,16 +7848,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_ppp_link + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_ppp_link(self, - resource=None, - shelf=None, - unit_num=None, + resource=None, + shelf=None, + unit_num=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_ppp_link(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -6085,14 +7878,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_profile + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_profile(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -6106,15 +7904,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_resource + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_resource ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_resource(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_resource(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -6129,15 +7932,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_rfgen + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_rfgen ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_rfgen(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_rfgen(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -6152,17 +7960,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_sec_ip + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_sec_ip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_sec_ip(self, - ip_list=None, - port=None, - resource=None, - shelf=None, + ip_list=None, + port=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_sec_ip(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "ip_list" : ip_list, @@ -6179,16 +7992,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_span + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_span ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_span(self, - resource=None, - shelf=None, - span_num=None, + resource=None, + shelf=None, + span_num=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_span(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -6204,14 +8022,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_test_mgr + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_test_mgr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_test_mgr(self, - test_mgr=None, + test_mgr=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_test_mgr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "test_mgr" : test_mgr, @@ -6225,15 +8048,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_text_blob + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_text_blob ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_text_blob(self, - name=None, - type=None, + name=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_text_blob(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -6248,15 +8076,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_tgcx + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_tgcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_tgcx(self, - cxname=None, - tgname=None, + cxname=None, + tgname=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_tgcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cxname" : cxname, @@ -6271,15 +8104,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_threshold + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_threshold ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_threshold(self, - endp=None, - thresh_id=None, + endp=None, + thresh_id=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_threshold(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp" : endp, @@ -6294,14 +8132,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_traffic_profile + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_traffic_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_traffic_profile(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_traffic_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -6315,16 +8158,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_venue + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_venue ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_venue(self, - resource=None, - shelf=None, - venu_id=None, + resource=None, + shelf=None, + venu_id=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_venue(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -6340,16 +8188,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_vlan + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_vlan ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vlan(self, - port=None, - resource=None, - shelf=None, + port=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_vlan(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "port" : port, @@ -6365,16 +8218,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_vr + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vr(self, - resource=None, - router_name=None, - shelf=None, + resource=None, + router_name=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -6390,18 +8248,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_vrcx + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_vrcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vrcx(self, - connection_name=None, - resource=None, - shelf=None, - vr_id=None, - vrcx_only=None, + connection_name=None, + resource=None, + shelf=None, + vr_id=None, + vrcx_only=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_vrcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "connection_name" : connection_name, @@ -6419,15 +8282,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rm_wanpath + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rm_wanpath ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_wanpath(self, - endp_name=None, - wp_name=None, + endp_name=None, + wp_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rm_wanpath(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp_name" : endp_name, @@ -6442,20 +8310,25 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/rpt_script + Notes for type requests https://www.candelatech.com/lfcli_ug.php#rpt_script ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rpt_script(self, - endp=None, - flags=None, - group_action=None, - loop_count=None, - name=None, - private=None, - type=None, + endp=None, + flags=None, + group_action=None, + loop_count=None, + name=None, + private=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_rpt_script(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp" : endp, @@ -6475,14 +8348,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/save + Notes for type requests https://www.candelatech.com/lfcli_ug.php#write ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_save(self, - db_name=None, + db_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_save(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "db_name" : db_name, @@ -6496,24 +8374,34 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/scan_wifi + Notes for type requests https://www.candelatech.com/lfcli_ug.php#scan_wifi ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class scan_wifi_extra(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + scan_wifi_extra.clear_flags('bridge', 'dhcp') + print( 'value now: '+scan_wifi_extra.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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=None, - key=None, - port=None, - resource=None, - shelf=None, + extra=None, + key=None, + port=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_scan_wifi(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "extra" : extra, @@ -6531,12 +8419,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_arm_info + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_arm_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class set_arm_info_arm_flags(Enum): + class set_arm_info_arm_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -6547,43 +8438,74 @@ class LFJsonPost(LFCliBase): 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!) + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_arm_info_arm_flags.add_flags('bridge', 'dhcp') + print('value now: '+set_arm_info_arm_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_arm_info_arm_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_arm_info_arm_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_set_arm_info(self, - arm_flags=None, - burst=None, - dst_mac=None, - dst_mac_count=None, - ip_dst_max=None, - ip_dst_min=None, - ip_src_max=None, - ip_src_min=None, - max_pkt_size=None, - min_pkt_size=None, - multi_pkts=None, - name=None, - pkts_to_send=None, - src_mac=None, - src_mac_count=None, - udp_dst_max=None, - udp_dst_min=None, - udp_src_max=None, - udp_src_min=None, + arm_flags=None, + burst=None, + dst_mac=None, + dst_mac_count=None, + ip_dst_max=None, + ip_dst_min=None, + ip_src_max=None, + ip_src_min=None, + max_pkt_size=None, + min_pkt_size=None, + multi_pkts=None, + name=None, + pkts_to_send=None, + src_mac=None, + src_mac_count=None, + udp_dst_max=None, + udp_dst_min=None, + udp_src_max=None, + udp_src_min=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_arm_info(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "arm_flags" : arm_flags, @@ -6615,23 +8537,28 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_attenuator + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_attenuator(self, - atten_idx=None, - mode=None, - pulse_count=None, - pulse_interval_ms=None, - pulse_time_ms=None, - pulse_width_us5=None, - resource=None, - serno=None, - shelf=None, - val=None, + atten_idx=None, + mode=None, + pulse_count=None, + pulse_interval_ms=None, + pulse_time_ms=None, + pulse_width_us5=None, + resource=None, + serno=None, + shelf=None, + val=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_attenuator(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "atten_idx" : atten_idx, @@ -6654,19 +8581,24 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_chamber + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_chamber ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_chamber(self, - chamber=None, - cur_rotation=None, - position=None, - speed_rpm=None, - tilt=None, - turntable=None, + chamber=None, + cur_rotation=None, + position=None, + speed_rpm=None, + tilt=None, + turntable=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_chamber(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "chamber" : chamber, @@ -6685,17 +8617,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_cx_report_timer + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_cx_report_timer ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_cx_report_timer(self, - cx_name=None, - cxonly=None, - milliseconds=None, - test_mgr=None, + cx_name=None, + cxonly=None, + milliseconds=None, + test_mgr=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_cx_report_timer(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cx_name" : cx_name, @@ -6712,12 +8649,17 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_cx_state + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_cx_state ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_cx_state_cx_state(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_cx_state_cx_state.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_cx_state_cx_state.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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. @@ -6726,10 +8668,15 @@ class LFJsonPost(LFCliBase): def post_set_cx_state(self, - cx_name=None, - cx_state=None, - test_mgr=None, + cx_name=None, + cx_state=None, + test_mgr=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_cx_state(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cx_name" : cx_name, @@ -6745,18 +8692,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_endp_addr + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_endp_addr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_addr(self, - ip=None, - mac=None, - max_port=None, - min_port=None, - name=None, + ip=None, + mac=None, + max_port=None, + min_port=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_addr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "ip" : ip, @@ -6774,30 +8726,35 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_endp_details + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_endp_details ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_details(self, - conn_timeout=None, - dst_mac=None, - max_conn_timer=None, - max_ip_port=None, - max_reconn_pause=None, - mcast_src_ip=None, - mcast_src_port=None, - min_conn_timer=None, - min_reconn_pause=None, - name=None, - pkts_to_send=None, - rcvbuf_size=None, - sndbuf_size=None, - tcp_delack_segs=None, - tcp_max_delack=None, - tcp_min_delack=None, - tcp_mss=None, + conn_timeout=None, + dst_mac=None, + max_conn_timer=None, + max_ip_port=None, + max_reconn_pause=None, + mcast_src_ip=None, + mcast_src_port=None, + min_conn_timer=None, + min_reconn_pause=None, + name=None, + pkts_to_send=None, + rcvbuf_size=None, + sndbuf_size=None, + tcp_delack_segs=None, + tcp_max_delack=None, + tcp_min_delack=None, + tcp_mss=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_details(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "conn_timeout" : conn_timeout, @@ -6827,16 +8784,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_endp_file + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_endp_file ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_file(self, - file=None, - name=None, - playback=None, + file=None, + name=None, + playback=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_file(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "file" : file, @@ -6852,12 +8814,17 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_endp_flag + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_endp_flag ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_endp_flag_flag(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_endp_flag_flag.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_endp_flag_flag.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" AutoHelper = "AutoHelper" # Automatically run on helper process ClearPortOnStart = "ClearPortOnStart" # clear stats on start DoChecksum = "DoChecksum" # Enable checksumming @@ -6873,10 +8840,15 @@ class LFJsonPost(LFCliBase): def post_set_endp_flag(self, - flag=None, - name=None, - val=None, + flag=None, + name=None, + val=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_flag(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "flag" : flag, @@ -6892,12 +8864,17 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_endp_payload + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_endp_payload ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_endp_payload_payload_type(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_endp_payload_payload_type.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_endp_payload_payload_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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. @@ -6912,10 +8889,15 @@ class LFJsonPost(LFCliBase): def post_set_endp_payload(self, - name=None, - payload=None, - payload_type=None, + name=None, + payload=None, + payload_type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_payload(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -6931,18 +8913,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_endp_pld_bounds + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_endp_pld_bounds ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_pld_bounds(self, - is_random=None, - max_pld_size=None, - min_pld_size=None, - name=None, - use_checksum=None, + is_random=None, + max_pld_size=None, + min_pld_size=None, + name=None, + use_checksum=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_pld_bounds(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "is_random" : is_random, @@ -6960,17 +8947,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_endp_proxy + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_endp_proxy ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_proxy(self, - enabled=None, - endp_name=None, - proxy_ip=None, - proxy_ip_port=None, + enabled=None, + endp_name=None, + proxy_ip=None, + proxy_ip_port=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_proxy(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "enabled" : enabled, @@ -6987,15 +8979,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_endp_quiesce + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_endp_quiesce ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_quiesce(self, - name=None, - quiesce=None, + name=None, + quiesce=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_quiesce(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -7010,15 +9007,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_endp_report_timer + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_endp_report_timer ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_report_timer(self, - endp_name=None, - milliseconds=None, + endp_name=None, + milliseconds=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_report_timer(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp_name" : endp_name, @@ -7033,12 +9035,17 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_endp_tos + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_endp_tos ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_endp_tos_tos(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_endp_tos_tos.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_endp_tos_tos.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" LOWCOST = "LOWCOST" LOWDELAY = "LOWDELAY" RELIABILITY = "RELIABILITY" @@ -7046,10 +9053,15 @@ class LFJsonPost(LFCliBase): def post_set_endp_tos(self, - name=None, - priority=None, - tos=None, + name=None, + priority=None, + tos=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_tos(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -7065,17 +9077,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_endp_tx_bounds + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_endp_tx_bounds ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_tx_bounds(self, - is_bursty=None, - max_tx_rate=None, - min_tx_rate=None, - name=None, + is_bursty=None, + max_tx_rate=None, + min_tx_rate=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_endp_tx_bounds(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "is_bursty" : is_bursty, @@ -7092,34 +9109,66 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_event_interest + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_event_interest ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class set_event_interest_ei_flags(Enum): + class set_event_interest_ei_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 CLEAR = 0x0 # will clear interest SET = 0x1 # set interest flag + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_event_interest_ei_flags.add_flags('bridge', 'dhcp') + print('value now: '+set_event_interest_ei_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_event_interest_ei_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_event_interest_ei_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value - class set_event_interest_events1(Enum): + class set_event_interest_events1(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -7156,22 +9205,51 @@ class LFJsonPost(LFCliBase): TX_BPS_OOR_3S = 0x80000000 # Endpoint threshold alert. WiFi_Config = 0x80000 # WiFi Configuration Error. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_event_interest_events1.add_flags('bridge', 'dhcp') + print('value now: '+set_event_interest_events1.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_event_interest_events1.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_event_interest_events1.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value - class set_event_interest_events2(Enum): + class set_event_interest_events2(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -7193,31 +9271,62 @@ class LFJsonPost(LFCliBase): TX_BPS_OOR_30S_CLEARED = 0x4 # Endpoint threshold alert cleared. TX_BPS_OOR_3S_CLEARED = 0x1 # Endpoint threshold alert cleared. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_event_interest_events2.add_flags('bridge', 'dhcp') + print('value now: '+set_event_interest_events2.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_event_interest_events2.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_event_interest_events2.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_set_event_interest(self, - ei_flags=None, - event_cnt=None, - events1=None, - events2=None, - events3=None, - events4=None, - var1=None, + ei_flags=None, + event_cnt=None, + events1=None, + events2=None, + events3=None, + events4=None, + var1=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_event_interest(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "ei_flags" : ei_flags, @@ -7237,12 +9346,17 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_event_priority + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_event_priority ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_event_priority_event(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_event_priority_event.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_event_priority_event.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" Bad_MAC = 20 # Invalid MAC address configured. Cleared = 13 # Counters were cleared for some entity. Connect = 8 # WiFi interface connected to AP. @@ -7267,6 +9381,11 @@ class LFJsonPost(LFCliBase): WiFi_Config = 19 # WiFi Configuration Error. class set_event_priority_priority(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_event_priority_priority.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_event_priority_priority.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" AUTO = "AUTO" # Let event creator decide the priority. CRITICAL = "CRITICAL" DEBUG = "DEBUG" @@ -7276,9 +9395,14 @@ class LFJsonPost(LFCliBase): def post_set_event_priority(self, - event=None, - priority=None, + event=None, + priority=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_event_priority(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "event" : event, @@ -7293,23 +9417,28 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_fe_info + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_fe_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_fe_info(self, - directory=None, - io_direction=None, - max_file_size=None, - max_rw_sz=None, - min_file_size=None, - min_rw_sz=None, - name=None, - num_files=None, - prefix=None, - quiesce_after_files=None, + directory=None, + io_direction=None, + max_file_size=None, + max_rw_sz=None, + min_file_size=None, + min_rw_sz=None, + name=None, + num_files=None, + prefix=None, + quiesce_after_files=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_fe_info(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "directory" : directory, @@ -7332,12 +9461,17 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_flag + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_flag ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_flag_flag(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_flag_flag.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_flag_flag.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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 @@ -7347,10 +9481,15 @@ class LFJsonPost(LFCliBase): def post_set_flag(self, - client=None, - flag=None, - val=None, + client=None, + flag=None, + val=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_flag(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "client" : client, @@ -7366,15 +9505,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_gen_cmd + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_gen_cmd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_gen_cmd(self, - command=None, - name=None, + command=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_gen_cmd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "command" : command, @@ -7389,20 +9533,25 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_gps_info + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_gps_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_gps_info(self, - altitude=None, - ew=None, - lattitude=None, - longitude=None, - ns=None, - resource=None, - shelf=None, + altitude=None, + ew=None, + lattitude=None, + longitude=None, + ns=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_gps_info(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "altitude" : altitude, @@ -7422,18 +9571,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_ifup_script + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_ifup_script ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_ifup_script(self, - flags=None, - port=None, - post_ifup_script=None, - resource=None, - shelf=None, + flags=None, + port=None, + post_ifup_script=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_ifup_script(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "flags" : flags, @@ -7451,14 +9605,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_license + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_license ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_license(self, - licenses=None, + licenses=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_license(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "licenses" : licenses, @@ -7472,18 +9631,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_mc_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_mc_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_mc_endp(self, - mcast_dest_port=None, - mcast_group=None, - name=None, - rcv_mcast=None, - ttl=None, + mcast_dest_port=None, + mcast_group=None, + name=None, + rcv_mcast=None, + ttl=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_mc_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "mcast_dest_port" : mcast_dest_port, @@ -7501,16 +9665,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_password + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_password ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_password(self, - client=None, - new_password=None, - old_password=None, + client=None, + new_password=None, + old_password=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_password(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "client" : client, @@ -7526,14 +9695,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_poll_mode + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_poll_mode ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_poll_mode(self, - mode=None, + mode=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_poll_mode(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "mode" : mode, @@ -7547,12 +9721,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_port + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_port ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class set_port_cmd_flags(Enum): + class set_port_cmd_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -7569,22 +9746,51 @@ class LFJsonPost(LFCliBase): skip_port_bounce = 0x100 # skip-port-bounce (Don't ifdown/up use_pre_ifdown = 0x800 # Call pre-ifdown script before bringing interface down. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_port_cmd_flags.add_flags('bridge', 'dhcp') + print('value now: '+set_port_cmd_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_port_cmd_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_port_cmd_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value - class set_port_current_flags(Enum): + class set_port_current_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -7624,22 +9830,53 @@ class LFJsonPost(LFCliBase): use_dhcp = 0x80000000 # USE-DHCP use_dhcpv6 = 0x20000000000 # USE-DHCPv6 + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_port_current_flags.add_flags('bridge', 'dhcp') + print('value now: '+set_port_current_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_port_current_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_port_current_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value class set_port_dhcp_client_id(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_port_dhcp_client_id.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_port_dhcp_client_id.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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. @@ -7647,6 +9884,11 @@ class LFJsonPost(LFCliBase): p__MAC = "__MAC" # Use interface's MAC address for the client ID. class set_port_dhcp_hostname(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_port_dhcp_hostname.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_port_dhcp_hostname.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" NA = "NA" # Do not change from current value. NONE = "NONE" # Do not use dhcp Hostname p_string_ = "[string]" # Use the string for the Hostname. @@ -7654,11 +9896,19 @@ class LFJsonPost(LFCliBase): p__EID__ = "__EID__" # Use hostname 'CT-[resource-id].[port-name]' class set_port_dhcp_vendor_id(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_port_dhcp_vendor_id.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_port_dhcp_vendor_id.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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 set_port_flags2(Enum): + class set_port_flags2(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -7669,22 +9919,51 @@ class LFJsonPost(LFCliBase): supports_bypass = 0x2 # Support Bypass Devices use_stp = 0x1 # Use Spanning Tree Protocol + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_port_flags2.add_flags('bridge', 'dhcp') + print('value now: '+set_port_flags2.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_port_flags2.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_port_flags2.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value - class set_port_interest(Enum): + class set_port_interest(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -7722,61 +10001,92 @@ class LFJsonPost(LFCliBase): svc_httpd = 0x8000000 # Enable/disable HTTP Service for a port tx_queue_length = 0x200 # TX Queue Length + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_port_interest.add_flags('bridge', 'dhcp') + print('value now: '+set_port_interest.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_port_interest.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_port_interest.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_set_port(self, - alias=None, - br_aging_time=None, - br_forwarding_delay=None, - br_hello_time=None, - br_max_age=None, - br_port_cost=None, - br_port_priority=None, - br_priority=None, - bypass_wdt=None, - cmd_flags=None, - cpu_mask=None, - current_flags=None, - current_flags_msk=None, - dhcp_client_id=None, - dhcp_hostname=None, - dhcp_vendor_id=None, - dns_servers=None, - flags2=None, - gateway=None, - interest=None, - ip_addr=None, - ipsec_concentrator=None, - ipsec_local_id=None, - ipsec_passwd=None, - ipsec_remote_id=None, - ipv6_addr_global=None, - ipv6_addr_link=None, - ipv6_dflt_gw=None, - mac=None, - mtu=None, - netmask=None, - port=None, - report_timer=None, - resource=None, - shelf=None, - sta_br_id=None, - tx_queue_len=None, + alias=None, + br_aging_time=None, + br_forwarding_delay=None, + br_hello_time=None, + br_max_age=None, + br_port_cost=None, + br_port_priority=None, + br_priority=None, + bypass_wdt=None, + cmd_flags=None, + cpu_mask=None, + current_flags=None, + current_flags_msk=None, + dhcp_client_id=None, + dhcp_hostname=None, + dhcp_vendor_id=None, + dns_servers=None, + flags2=None, + gateway=None, + interest=None, + ip_addr=None, + ipsec_concentrator=None, + ipsec_local_id=None, + ipsec_passwd=None, + ipsec_remote_id=None, + ipv6_addr_global=None, + ipv6_addr_link=None, + ipv6_dflt_gw=None, + mac=None, + mtu=None, + netmask=None, + port=None, + report_timer=None, + resource=None, + shelf=None, + sta_br_id=None, + tx_queue_len=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_port(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -7826,18 +10136,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_port_alias + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_port_alias ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_port_alias(self, - alias=None, - port=None, - resource=None, - shelf=None, - vport=None, + alias=None, + port=None, + resource=None, + shelf=None, + vport=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_port_alias(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "alias" : alias, @@ -7855,17 +10170,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_ppp_link_state + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_ppp_link_state ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_ppp_link_state(self, - link=None, - ppp_state=None, - resource=None, - shelf=None, + link=None, + ppp_state=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_ppp_link_state(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "link" : link, @@ -7882,28 +10202,38 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_resource + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_resource ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_resource_resource_flags(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_resource_resource_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_resource_resource_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" skip_load_db_on_start = 1 # Should we skip loading the DB on start? def post_set_resource(self, - device_profiles=None, - max_helper_count=None, - max_staged_bringup=None, - max_station_bringup=None, - max_trying_ifup=None, - resource=None, - resource_flags=None, - resource_flags_mask=None, - shelf=None, - top_left_x=None, - top_left_y=None, + device_profiles=None, + max_helper_count=None, + max_staged_bringup=None, + max_station_bringup=None, + max_trying_ifup=None, + resource=None, + resource_flags=None, + resource_flags_mask=None, + shelf=None, + top_left_x=None, + top_left_y=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_resource(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "device_profiles" : device_profiles, @@ -7927,49 +10257,83 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_rfgen + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_rfgen ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class set_rfgen_rfgen_flags(Enum): + class set_rfgen_rfgen_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 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? + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_rfgen_rfgen_flags.add_flags('bridge', 'dhcp') + print('value now: '+set_rfgen_rfgen_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_rfgen_rfgen_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_rfgen_rfgen_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_set_rfgen(self, - bb_gain=None, - freq_khz=None, - gain=None, - id=None, - if_gain=None, - pulse_count=None, - pulse_interval_us=None, - pulse_width_us=None, - resource=None, - rfgen_flags=None, - rfgen_flags_mask=None, - shelf=None, - sweep_time_ms=None, + bb_gain=None, + freq_khz=None, + gain=None, + id=None, + if_gain=None, + pulse_count=None, + pulse_interval_us=None, + pulse_width_us=None, + resource=None, + rfgen_flags=None, + rfgen_flags_mask=None, + shelf=None, + sweep_time_ms=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_rfgen(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "bb_gain" : bb_gain, @@ -7995,12 +10359,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_script + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_script ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class set_script_flags(Enum): + class set_script_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -8023,22 +10390,53 @@ class LFJsonPost(LFCliBase): 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. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_script_flags.add_flags('bridge', 'dhcp') + print('value now: '+set_script_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_script_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_script_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value class set_script_type(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_script_type.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_script_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" NONE = "NONE" # Delete any existing script. Script2544 = "Script2544" # For RFC 2544 type testing. ScriptAtten = "ScriptAtten" # For Attenuators only. @@ -8047,14 +10445,19 @@ class LFJsonPost(LFCliBase): def post_set_script(self, - endp=None, - flags=None, - group_action=None, - loop_count=None, - name=None, - private=None, - type=None, + endp=None, + flags=None, + group_action=None, + loop_count=None, + name=None, + private=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_script(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp" : endp, @@ -8074,17 +10477,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_sec_ip + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_sec_ip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_sec_ip(self, - ip_list=None, - port=None, - resource=None, - shelf=None, + ip_list=None, + port=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_sec_ip(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "ip_list" : ip_list, @@ -8101,31 +10509,36 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_voip_info + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_voip_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_voip_info(self, - codec=None, - first_call_delay=None, - jitter_buffer_sz=None, - local_sip_port=None, - loop_call_count=None, - loop_wavefile_count=None, - max_call_duration=None, - max_inter_call_gap=None, - messaging_protocol=None, - min_call_duration=None, - min_inter_call_gap=None, - name=None, - pesq_server_ip=None, - pesq_server_passwd=None, - pesq_server_port=None, - reg_expire_timer=None, - ringing_timer=None, - sound_dev=None, + codec=None, + first_call_delay=None, + jitter_buffer_sz=None, + local_sip_port=None, + loop_call_count=None, + loop_wavefile_count=None, + max_call_duration=None, + max_inter_call_gap=None, + messaging_protocol=None, + min_call_duration=None, + min_inter_call_gap=None, + name=None, + pesq_server_ip=None, + pesq_server_passwd=None, + pesq_server_port=None, + reg_expire_timer=None, + ringing_timer=None, + sound_dev=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_voip_info(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "codec" : codec, @@ -8156,22 +10569,27 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_vrcx_cost + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_vrcx_cost ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_vrcx_cost(self, - interface_cost=None, - local_dev=None, - local_dev_b=None, - remote_dev=None, - remote_dev_b=None, - resource=None, - shelf=None, - vr_name=None, - wanlink=None, + interface_cost=None, + local_dev=None, + local_dev_b=None, + remote_dev=None, + remote_dev_b=None, + resource=None, + shelf=None, + vr_name=None, + wanlink=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_vrcx_cost(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "interface_cost" : interface_cost, @@ -8193,28 +10611,33 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wanlink_info + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wanlink_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wanlink_info(self, - drop_freq=None, - dup_freq=None, - extra_buffer=None, - jitter_freq=None, - latency=None, - max_drop_amt=None, - max_jitter=None, - max_lateness=None, - max_reorder_amt=None, - min_drop_amt=None, - min_reorder_amt=None, - name=None, - playback_capture_file=None, - reorder_freq=None, - speed=None, + drop_freq=None, + dup_freq=None, + extra_buffer=None, + jitter_freq=None, + latency=None, + max_drop_amt=None, + max_jitter=None, + max_lateness=None, + max_reorder_amt=None, + min_drop_amt=None, + min_reorder_amt=None, + name=None, + playback_capture_file=None, + reorder_freq=None, + speed=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wanlink_info(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "drop_freq" : drop_freq, @@ -8242,16 +10665,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wanlink_pcap + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wanlink_pcap ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wanlink_pcap(self, - capture=None, - directory=None, - name=None, + capture=None, + directory=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wanlink_pcap(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "capture" : capture, @@ -8267,12 +10695,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wanpath_corruption + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wanpath_corruption ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class set_wanpath_corruption_flags(Enum): + class set_wanpath_corruption_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -8283,32 +10714,63 @@ class LFJsonPost(LFCliBase): OVERWRITE_RANDOM = 0x1 # Write a random value to a byte. RECALC_CSUMS = 0x20 # Attempt to re-calculate UDP and TCP checksums. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wanpath_corruption_flags.add_flags('bridge', 'dhcp') + print('value now: '+set_wanpath_corruption_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wanpath_corruption_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_wanpath_corruption_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_set_wanpath_corruption(self, - byte=None, - flags=None, - index=None, - max_offset=None, - min_offset=None, - name=None, - path=None, - rate=None, + byte=None, + flags=None, + index=None, + max_offset=None, + min_offset=None, + name=None, + path=None, + rate=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wanpath_corruption(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "byte" : byte, @@ -8329,21 +10791,26 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wanpath_filter + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wanpath_filter ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wanpath_filter(self, - defer_flush=None, - dst_filter=None, - filter_type=None, - passive=None, - reverse=None, - src_filter=None, - wl_name=None, - wp_name=None, + defer_flush=None, + dst_filter=None, + filter_type=None, + passive=None, + reverse=None, + src_filter=None, + wl_name=None, + wp_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wanpath_filter(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "defer_flush" : defer_flush, @@ -8364,22 +10831,32 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wanpath_running + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wanpath_running ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wanpath_running_running(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wanpath_running_running.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_wanpath_running_running.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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=None, - wl_name=None, - wp_name=None, + running=None, + wl_name=None, + wp_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wanpath_running(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "running" : running, @@ -8395,12 +10872,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wifi_corruptions + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wifi_corruptions ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class set_wifi_corruptions_corrupt_flags(Enum): + class set_wifi_corruptions_corrupt_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -8419,37 +10899,68 @@ class LFJsonPost(LFCliBase): 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. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wifi_corruptions_corrupt_flags.add_flags('bridge', 'dhcp') + print('value now: '+set_wifi_corruptions_corrupt_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wifi_corruptions_corrupt_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_wifi_corruptions_corrupt_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_set_wifi_corruptions(self, - corrupt_flags=None, - corrupt_per_mil=None, - delay_flags=None, - delay_max=None, - delay_min=None, - dup_flags=None, - dup_per_65535=None, - ignore_flags=None, - ignore_per_mil=None, - port=None, - req_flush=None, - resource=None, - shelf=None, + corrupt_flags=None, + corrupt_per_mil=None, + delay_flags=None, + delay_max=None, + delay_min=None, + dup_flags=None, + dup_per_65535=None, + ignore_flags=None, + ignore_per_mil=None, + port=None, + req_flush=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_corruptions(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "corrupt_flags" : corrupt_flags, @@ -8475,18 +10986,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wifi_custom + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wifi_custom ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_custom(self, - port=None, - resource=None, - shelf=None, - text=None, - type=None, + port=None, + resource=None, + shelf=None, + text=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_custom(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "port" : port, @@ -8504,45 +11020,50 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wifi_extra + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wifi_extra ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_extra(self, - anonymous_identity=None, - anqp_3gpp_cell_net=None, - ca_cert=None, - client_cert=None, - domain=None, - eap=None, - group=None, - hessid=None, - identity=None, - imsi=None, - ipaddr_type_avail=None, - key=None, - key_mgmt=None, - milenage=None, - network_auth_type=None, - network_type=None, - pac_file=None, - pairwise=None, - password=None, - phase1=None, - phase2=None, - pin=None, - pk_passwd=None, - port=None, - private_key=None, - psk=None, - realm=None, - resource=None, - roaming_consortium=None, - shelf=None, - venue_group=None, - venue_type=None, + anonymous_identity=None, + anqp_3gpp_cell_net=None, + ca_cert=None, + client_cert=None, + domain=None, + eap=None, + group=None, + hessid=None, + identity=None, + imsi=None, + ipaddr_type_avail=None, + key=None, + key_mgmt=None, + milenage=None, + network_auth_type=None, + network_type=None, + pac_file=None, + pairwise=None, + password=None, + phase1=None, + phase2=None, + pin=None, + pk_passwd=None, + port=None, + private_key=None, + psk=None, + realm=None, + resource=None, + roaming_consortium=None, + shelf=None, + venue_group=None, + venue_type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_extra(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "anonymous_identity" : anonymous_identity, @@ -8587,29 +11108,34 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wifi_extra2 + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wifi_extra2 ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_extra2(self, - corrupt_gtk_rekey_mic=None, - freq_24=None, - freq_5=None, - ignore_assoc=None, - ignore_auth=None, - ignore_probe=None, - ignore_reassoc=None, - ocsp=None, - port=None, - post_ifup_script=None, - radius_ip=None, - radius_port=None, - req_flush=None, - resource=None, - shelf=None, - venue_id=None, + corrupt_gtk_rekey_mic=None, + freq_24=None, + freq_5=None, + ignore_assoc=None, + ignore_auth=None, + ignore_probe=None, + ignore_reassoc=None, + ocsp=None, + port=None, + post_ifup_script=None, + radius_ip=None, + radius_port=None, + req_flush=None, + resource=None, + shelf=None, + venue_id=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_extra2(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "corrupt_gtk_rekey_mic" : corrupt_gtk_rekey_mic, @@ -8638,12 +11164,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wifi_radio + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wifi_radio ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class set_wifi_radio_flags(Enum): + class set_wifi_radio_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -8656,22 +11185,53 @@ class LFJsonPost(LFCliBase): 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. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wifi_radio_flags.add_flags('bridge', 'dhcp') + print('value now: '+set_wifi_radio_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wifi_radio_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_wifi_radio_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value class set_wifi_radio_mode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wifi_radio_mode.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_wifi_radio_mode.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_802_11a = 1 # 802.11a AUTO = 0 # 802.11g abg = 4 # 802.11abg @@ -8690,40 +11250,45 @@ class LFJsonPost(LFCliBase): def post_set_wifi_radio(self, - active_peer_count=None, - ampdu_factor=None, - antenna=None, - channel=None, - const_tx=None, - country=None, - flags=None, - flags_mask=None, - frag_thresh=None, - frequency=None, - fwname=None, - fwver=None, - mac=None, - max_amsdu=None, - mode=None, - peer_count=None, - pref_ap=None, - pulse2_interval_us=None, - pulse_interval=None, - pulse_width=None, - radio=None, - rate=None, - rate_ctrl_count=None, - resource=None, - rts=None, - shelf=None, - skid_limit=None, - stations_count=None, - tids_count=None, - tx_pulses=None, - txdesc_count=None, - txpower=None, - vdev_count=None, + active_peer_count=None, + ampdu_factor=None, + antenna=None, + channel=None, + const_tx=None, + country=None, + flags=None, + flags_mask=None, + frag_thresh=None, + frequency=None, + fwname=None, + fwver=None, + mac=None, + max_amsdu=None, + mode=None, + peer_count=None, + pref_ap=None, + pulse2_interval_us=None, + pulse_interval=None, + pulse_width=None, + radio=None, + rate=None, + rate_ctrl_count=None, + resource=None, + rts=None, + shelf=None, + skid_limit=None, + stations_count=None, + tids_count=None, + tx_pulses=None, + txdesc_count=None, + txpower=None, + vdev_count=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_radio(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "active_peer_count" : active_peer_count, @@ -8769,24 +11334,29 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wifi_txo + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wifi_txo ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_txo(self, - port=None, - resource=None, - shelf=None, - txo_bw=None, - txo_enable=None, - txo_mcs=None, - txo_nss=None, - txo_pream=None, - txo_retries=None, - txo_sgi=None, - txo_txpower=None, + port=None, + resource=None, + shelf=None, + txo_bw=None, + txo_enable=None, + txo_mcs=None, + txo_nss=None, + txo_pream=None, + txo_retries=None, + txo_sgi=None, + txo_txpower=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wifi_txo(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "port" : port, @@ -8810,12 +11380,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wl_corruption + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wl_corruption ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class set_wl_corruption_flags(Enum): + class set_wl_corruption_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -8826,31 +11399,62 @@ class LFJsonPost(LFCliBase): OVERWRITE_RANDOM = 0x1 # Write a random value to a byte. RECALC_CSUMS = 0x20 # Attempt to re-calculate UDP and TCP checksums. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wl_corruption_flags.add_flags('bridge', 'dhcp') + print('value now: '+set_wl_corruption_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wl_corruption_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_wl_corruption_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_set_wl_corruption(self, - byte=None, - flags=None, - index=None, - max_offset=None, - min_offset=None, - name=None, - rate=None, + byte=None, + flags=None, + index=None, + max_offset=None, + min_offset=None, + name=None, + rate=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wl_corruption(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "byte" : byte, @@ -8870,20 +11474,30 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wl_qdisc + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wl_qdisc ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wl_qdisc_qdisc(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wl_qdisc_qdisc.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_wl_qdisc_qdisc.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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=None, - qdisc=None, + name=None, + qdisc=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wl_qdisc(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -8898,12 +11512,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wp_corruption + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wanpath_corruption ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class set_wanpath_corruption_flags(Enum): + class set_wanpath_corruption_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -8914,32 +11531,63 @@ class LFJsonPost(LFCliBase): OVERWRITE_RANDOM = 0x1 # Write a random value to a byte. RECALC_CSUMS = 0x20 # Attempt to re-calculate UDP and TCP checksums. + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wanpath_corruption_flags.add_flags('bridge', 'dhcp') + print('value now: '+set_wanpath_corruption_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wanpath_corruption_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_wanpath_corruption_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_set_wp_corruption(self, - byte=None, - flags=None, - index=None, - max_offset=None, - min_offset=None, - name=None, - path=None, - rate=None, + byte=None, + flags=None, + index=None, + max_offset=None, + min_offset=None, + name=None, + path=None, + rate=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wp_corruption(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "byte" : byte, @@ -8960,21 +11608,26 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wp_filter + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wanpath_filter ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wp_filter(self, - defer_flush=None, - dst_filter=None, - filter_type=None, - passive=None, - reverse=None, - src_filter=None, - wl_name=None, - wp_name=None, + defer_flush=None, + dst_filter=None, + filter_type=None, + passive=None, + reverse=None, + src_filter=None, + wl_name=None, + wp_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wp_filter(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "defer_flush" : defer_flush, @@ -8995,22 +11648,32 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/set_wp_running + Notes for type requests https://www.candelatech.com/lfcli_ug.php#set_wanpath_running ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class set_wanpath_running_running(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + set_wanpath_running_running.clear_flags('bridge', 'dhcp') + print( 'value now: '+set_wanpath_running_running.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" 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_wp_running(self, - running=None, - wl_name=None, - wp_name=None, + running=None, + wl_name=None, + wp_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_set_wp_running(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "running" : running, @@ -9026,12 +11689,17 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_alerts + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_alerts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class show_alerts_type(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + show_alerts_type.clear_flags('bridge', 'dhcp') + print( 'value now: '+show_alerts_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" All = "All" CX = "CX" Card = "Card" @@ -9047,13 +11715,18 @@ class LFJsonPost(LFCliBase): def post_show_alerts(self, - card=None, - endp=None, - extra=None, - port=None, - shelf=None, - type=None, + card=None, + endp=None, + extra=None, + port=None, + shelf=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_alerts(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "card" : card, @@ -9072,16 +11745,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_attenuators + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_attenuators ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_attenuators(self, - resource=None, - serno=None, - shelf=None, + resource=None, + serno=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_attenuators(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -9097,15 +11775,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_cards + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_resources ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_cards(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_cards(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -9120,16 +11803,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_cd + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_cd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_cd(self, - collision_domain=None, - resource=None, - shelf=None, + collision_domain=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_cd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "collision_domain" : collision_domain, @@ -9145,14 +11833,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_chamber + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_chamber ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_chamber(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_chamber(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -9166,16 +11859,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_channel_groups + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_channel_groups ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_channel_groups(self, - channel_name=None, - resource=None, - shelf=None, + channel_name=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_channel_groups(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "channel_name" : channel_name, @@ -9191,13 +11889,18 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_clients + 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 data = { } @@ -9210,15 +11913,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_cx + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_cx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_cx(self, - cross_connect=None, - test_mgr=None, + cross_connect=None, + test_mgr=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_cx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cross_connect" : cross_connect, @@ -9233,15 +11941,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_cxe + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_cxe ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_cxe(self, - cross_connect=None, - test_mgr=None, + cross_connect=None, + test_mgr=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_cxe(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cross_connect" : cross_connect, @@ -9256,13 +11969,18 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_dbs + 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 data = { } @@ -9275,14 +11993,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_dut + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_dut ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_dut(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_dut(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -9296,15 +12019,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_endp_payload + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_endp_payload ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_endp_payload(self, - max_bytes=None, - name=None, + max_bytes=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_endp_payload(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "max_bytes" : max_bytes, @@ -9319,15 +12047,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_endpoints + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_endpoints ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_endpoints(self, - endpoint=None, - extra=None, + endpoint=None, + extra=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_endpoints(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endpoint" : endpoint, @@ -9342,14 +12075,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_err + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_err ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_err(self, - message=None, + message=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_err(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "message" : message, @@ -9363,13 +12101,18 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_event_interest + 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 data = { } @@ -9382,12 +12125,17 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_events + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_events ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" class show_events_type(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + show_events_type.clear_flags('bridge', 'dhcp') + print( 'value now: '+show_events_type.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" All = "All" CX = "CX" Card = "Card" @@ -9403,13 +12151,18 @@ class LFJsonPost(LFCliBase): def post_show_events(self, - card=None, - endp=None, - extra=None, - port=None, - shelf=None, - type=None, + card=None, + endp=None, + extra=None, + port=None, + shelf=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_events(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "card" : card, @@ -9428,19 +12181,24 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_files + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_files ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_files(self, - dir_flags=None, - directory=None, - filter=None, - key=None, - resource=None, - shelf=None, + dir_flags=None, + directory=None, + filter=None, + key=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_files(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "dir_flags" : dir_flags, @@ -9459,14 +12217,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_group + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_group(self, - group=None, + group=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "group" : group, @@ -9480,14 +12243,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_pesq + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_pesq ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_pesq(self, - endpoint=None, + endpoint=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_pesq(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endpoint" : endpoint, @@ -9501,17 +12269,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_ports + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_ports ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_ports(self, - port=None, - probe_flags=None, - resource=None, - shelf=None, + port=None, + probe_flags=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_ports(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "port" : port, @@ -9528,16 +12301,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_ppp_links + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_ppp_links ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_ppp_links(self, - link_num=None, - resource=None, - shelf=None, + link_num=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_ppp_links(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "link_num" : link_num, @@ -9553,14 +12331,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_profile + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_profile(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -9574,15 +12357,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_resources + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_resources ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_resources(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_resources(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -9597,15 +12385,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_rfgen + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_rfgen ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_rfgen(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_rfgen(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -9620,17 +12413,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_rt + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_rt ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_rt(self, - key=None, - resource=None, - shelf=None, - virtual_router=None, + key=None, + resource=None, + shelf=None, + virtual_router=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_rt(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "key" : key, @@ -9647,15 +12445,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_script_results + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_script_results ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_script_results(self, - endpoint=None, - key=None, + endpoint=None, + key=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_script_results(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endpoint" : endpoint, @@ -9670,16 +12473,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_spans + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_spans ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_spans(self, - resource=None, - shelf=None, - span_number=None, + resource=None, + shelf=None, + span_number=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_spans(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -9695,16 +12503,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_text_blob + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_text_blob ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_text_blob(self, - brief=None, - name=None, - type=None, + brief=None, + name=None, + type=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_text_blob(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "brief" : brief, @@ -9720,14 +12533,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_tm + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_tm ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_tm(self, - test_mgr=None, + test_mgr=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_tm(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "test_mgr" : test_mgr, @@ -9741,14 +12559,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_traffic_profile + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_traffic_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_traffic_profile(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_traffic_profile(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -9762,16 +12585,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_venue + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_venue ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_venue(self, - resource=None, - shelf=None, - venu_id=None, + resource=None, + shelf=None, + venu_id=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_venue(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -9787,16 +12615,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_vr + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_vr(self, - resource=None, - router=None, - shelf=None, + resource=None, + router=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_vr(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -9812,16 +12645,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_vrcx + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_vrcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_vrcx(self, - cx_name=None, - resource=None, - shelf=None, + cx_name=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_vrcx(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cx_name" : cx_name, @@ -9837,15 +12675,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_wanpaths + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_wanpaths ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_wanpaths(self, - endpoint=None, - wanpath=None, + endpoint=None, + wanpath=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_wanpaths(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endpoint" : endpoint, @@ -9860,15 +12703,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/show_wps + Notes for type requests https://www.candelatech.com/lfcli_ug.php#show_wanpaths ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_wps(self, - endpoint=None, - wanpath=None, + endpoint=None, + wanpath=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_show_wps(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endpoint" : endpoint, @@ -9883,16 +12731,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/shutdown + Notes for type requests https://www.candelatech.com/lfcli_ug.php#shutdown ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown(self, - chdir=None, - really=None, - serverctl=None, + chdir=None, + really=None, + serverctl=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_shutdown(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "chdir" : chdir, @@ -9908,15 +12761,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/shutdown_card + Notes for type requests https://www.candelatech.com/lfcli_ug.php#shutdown_resource ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown_card(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_shutdown_card(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -9931,15 +12789,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/shutdown_os + Notes for type requests https://www.candelatech.com/lfcli_ug.php#shutdown_os ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown_os(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_shutdown_os(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -9954,15 +12817,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/shutdown_resource + Notes for type requests https://www.candelatech.com/lfcli_ug.php#shutdown_resource ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown_resource(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_shutdown_resource(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -9977,12 +12845,15 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/sniff_port + Notes for type requests https://www.candelatech.com/lfcli_ug.php#sniff_port ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - class sniff_port_flags(Enum): + class sniff_port_flags(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" selected_named_flag_map = {} temp_flag_value = 0x0 @@ -9991,31 +12862,62 @@ class LFJsonPost(LFCliBase): MATE_XTERM = 0x8 # Launch tshark/dumpcap in xterm TSHARK = 0x1 # Use command-line tshark instead of wireshark + # (internal method) call this from add_flags() or remove_flags() def update_flag_value(self): self.temp_flag_value = 0x0 for flag in self.selected_named_flag_map.keys(): self.temp_flag_value |= flag.value - def add_flag(self, flag_name): - self.selected_named_flag_map.put(flag_name, 0) + def add_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + sniff_port_flags.add_flags('bridge', 'dhcp') + print('value now: '+sniff_port_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + self.selected_named_flag_map.put(flag, 0) + elif flag_names is not None: + self.selected_named_flag_map.put(flag_names, 0) self.update_flag_value() - def clear_flag(self, flag_name): - if self.selected_named_flag_map.contains(flag_name): - self.selected_named_flag_map.remove(flag_name) - self.update_flag_value() + def clear_flags(self, flag_names=[]): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + sniff_port_flags.clear_flags('bridge', 'dhcp') + print( 'value now: '+sniff_port_flags.value()) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if type(flag_names) is list: + for flag in (flag_names): + if flag is None: + continue + if self.selected_named_flag_map.contains(flag): + self.selected_named_flag_map.remove(flag) + elif (flag_names is not None) and self.selected_named_flag_map.contains(flag_names): + self.selected_named_flag_map.remove(flag_names) + self.update_flag_value() + + def value(self, flag_names=[]): + return self.temp_flag_value def post_sniff_port(self, - display=None, - duration=None, - flags=None, - outfile=None, - port=None, - resource=None, - shelf=None, + display=None, + duration=None, + flags=None, + outfile=None, + port=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_sniff_port(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "display" : display, @@ -10035,14 +12937,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/start_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#start_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_start_endp(self, - endp_name=None, + endp_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_start_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp_name" : endp_name, @@ -10056,14 +12963,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/start_group + Notes for type requests https://www.candelatech.com/lfcli_ug.php#start_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_start_group(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_start_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -10077,16 +12989,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/start_ppp_link + Notes for type requests https://www.candelatech.com/lfcli_ug.php#start_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_start_ppp_link(self, - resource=None, - shelf=None, - unit_num=None, + resource=None, + shelf=None, + unit_num=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_start_ppp_link(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -10102,14 +13019,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/stop_endp + Notes for type requests https://www.candelatech.com/lfcli_ug.php#stop_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_stop_endp(self, - endp_name=None, + endp_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_stop_endp(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "endp_name" : endp_name, @@ -10123,14 +13045,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/stop_group + Notes for type requests https://www.candelatech.com/lfcli_ug.php#stop_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_stop_group(self, - name=None, + name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_stop_group(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "name" : name, @@ -10144,16 +13071,21 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/stop_ppp_link + Notes for type requests https://www.candelatech.com/lfcli_ug.php#stop_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_stop_ppp_link(self, - resource=None, - shelf=None, - unit_num=None, + resource=None, + shelf=None, + unit_num=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_stop_ppp_link(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -10169,18 +13101,23 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/tail + Notes for type requests https://www.candelatech.com/lfcli_ug.php#tail ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_tail(self, - cmd=None, - key=None, - message=None, - resource=None, - shelf=None, + cmd=None, + key=None, + message=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_tail(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "cmd" : cmd, @@ -10198,15 +13135,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/tm_register + Notes for type requests https://www.candelatech.com/lfcli_ug.php#tm_register ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_tm_register(self, - client_name=None, - test_mgr=None, + client_name=None, + test_mgr=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_tm_register(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "client_name" : client_name, @@ -10221,15 +13163,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/tm_unregister + Notes for type requests https://www.candelatech.com/lfcli_ug.php#tm_unregister ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_tm_unregister(self, - client_name=None, - test_mgr=None, + client_name=None, + test_mgr=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_tm_unregister(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "client_name" : client_name, @@ -10244,13 +13191,18 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/version + 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 data = { } @@ -10263,13 +13215,18 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/who + 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 data = { } @@ -10282,17 +13239,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/wifi_cli_cmd + Notes for type requests https://www.candelatech.com/lfcli_ug.php#wifi_cli_cmd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_wifi_cli_cmd(self, - port=None, - resource=None, - shelf=None, - wpa_cli_cmd=None, + port=None, + resource=None, + shelf=None, + wpa_cli_cmd=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_wifi_cli_cmd(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "port" : port, @@ -10309,17 +13271,22 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/wifi_event + Notes for type requests https://www.candelatech.com/lfcli_ug.php#wifi_event ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_wifi_event(self, - device=None, - event=None, - msg=None, - status=None, + device=None, + event=None, + msg=None, + status=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_wifi_event(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "device" : device, @@ -10336,15 +13303,20 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/wiser_reset + Notes for type requests https://www.candelatech.com/lfcli_ug.php#wiser_reset ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_wiser_reset(self, - resource=None, - shelf=None, + resource=None, + shelf=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_wiser_reset(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "resource" : resource, @@ -10359,14 +13331,19 @@ class LFJsonPost(LFCliBase): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated method for /cli-json/write + Notes for type requests https://www.candelatech.com/lfcli_ug.php#write ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_write(self, - db_name=None, + db_name=None, debug_=False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + result = post_write(param=value ...) + pprint.pprint( result ) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" debug_ |= self.debug data = { "db_name" : db_name, From 55fd6253b8a88bca575dc1b2b2af35cea95a95c9 Mon Sep 17 00:00:00 2001 From: Erin Grimes Date: Wed, 30 Jun 2021 15:30:57 -0700 Subject: [PATCH 049/152] py-scripts: Removed comments from end of wanlink file. These comments seemed useless to Ben. Signed-off-by: Erin Grimes --- py-json/create_wanlink.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/py-json/create_wanlink.py b/py-json/create_wanlink.py index 94a16ef5..e28e7390 100755 --- a/py-json/create_wanlink.py +++ b/py-json/create_wanlink.py @@ -231,5 +231,3 @@ def main(base_url="http://localhost:8080"): if __name__ == '__main__': main() -### -### \ No newline at end of file From 41b09a3458d4a938f84fa2eb9c2080eab2a02252 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 1 Jul 2021 14:30:26 -0600 Subject: [PATCH 050/152] lf_check.py : do not error on ghost push Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 03fe47ad..cd637101 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -103,6 +103,7 @@ class lf_check(): self.background_green = "background-color:green" self.background_red = "background-color:red" self.background_purple = "background-color:purple" + self.background_blue = "background-color:blue" self.http_test_ip = "" self.ftp_test_ip = "" @@ -640,6 +641,13 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. self.logger.info("TIMEOUT FAILURE, Check LANforge Radios") self.test_result = "Time Out" background = self.background_purple + + # Ghost will put data in stderr + if('ghost' in command): + if(self.test_result != "TIMEOUT"): + self.test_result = "Success" + background = self.background_blue + # 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 ded93a3d3348e3844d4e845b440323ed0ad29035 Mon Sep 17 00:00:00 2001 From: anjali Date: Fri, 2 Jul 2021 23:02:07 +0530 Subject: [PATCH 051/152] Add option to pass resource number eg for resource 2 [1.2.sta00] --- py-json/LANforge/LFUtils.py | 7 +++++-- py-json/gen_cxprofile.py | 12 ++++++------ py-json/mac_vlan_profile.py | 1 + py-json/realm.py | 4 ++-- py-json/station_profile.py | 5 +++-- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index 464c1e21..cca1ba05 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -549,8 +549,11 @@ 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): - rv = [1, 1, "", ""] +def name_to_eid(input, non_port=False, resource=None): + if resource is None: + rv = [1, 1, "", ""] + else: + rv = [1, resource, "", ""] info = [] if (input is None) or (input == ""): raise ValueError("name_to_eid wants eid like 1.1.sta0 but given[%s]" % input) diff --git a/py-json/gen_cxprofile.py b/py-json/gen_cxprofile.py index 811eccd6..0bea33a6 100644 --- a/py-json/gen_cxprofile.py +++ b/py-json/gen_cxprofile.py @@ -152,8 +152,8 @@ class GenCXProfile(LFCliBase): count = 40 for i in range(0, count): port_info = self.local_realm.name_to_eid(sta_port) - resource = port_info[0] - shelf = port_info[1] + resource = port_info[1] + shelf = port_info[0] name = port_info[2] gen_name_a = "%s-%s" % (self.name_prefix, name) + "_" + str(i) + add @@ -167,8 +167,8 @@ class GenCXProfile(LFCliBase): for i in range(0, 5): port_info = self.local_realm.name_to_eid(port_name) try: - resource = port_info[0] - shelf = port_info[1] + resource = port_info[1] + shelf = port_info[0] name = port_info[2] except: raise ValueError("Unexpected name for port_name %s" % port_name) @@ -279,8 +279,8 @@ class GenCXProfile(LFCliBase): endp_tpls = [] for port_name in ports: port_info = self.local_realm.name_to_eid(port_name) - resource = port_info[0] - shelf = port_info[1] + resource = port_info[1] + shelf = port_info[0] name = port_info[2] # this naming convention follows what you see when you use diff --git a/py-json/mac_vlan_profile.py b/py-json/mac_vlan_profile.py index edfbdc82..ebc23549 100644 --- a/py-json/mac_vlan_profile.py +++ b/py-json/mac_vlan_profile.py @@ -136,6 +136,7 @@ class MACVLANProfile(LFCliBase): set_port.set_port_current_flags) self.set_port_data["interest"] = self.add_named_flags(self.desired_set_port_interest_flags, set_port.set_port_interest_flags) + self.set_port_data["resource"] = self.resource set_port_r = LFRequest.LFRequest(self.lfclient_url + "/cli-json/set_port") for i in range(len(self.desired_macvlans)): diff --git a/py-json/realm.py b/py-json/realm.py index 02f825b3..a01bf92b 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -582,12 +582,12 @@ class Realm(LFCliBase): return matched_map - def name_to_eid(self, eid, debug=False, non_port=False): + def name_to_eid(self, eid, debug=False, non_port=False, resource=None): if debug: 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) + return LFUtils.name_to_eid(eid, non_port=non_port, resource=None) def wait_for_ip(self, station_list=None, ipv4=True, ipv6=False, timeout_sec=360, debug=False): if not (ipv4 or ipv6): diff --git a/py-json/station_profile.py b/py-json/station_profile.py index e3046779..e3fae52b 100644 --- a/py-json/station_profile.py +++ b/py-json/station_profile.py @@ -373,10 +373,11 @@ class StationProfile: suppress_related_commands_=True, use_radius=False, hs20_enable=False, - sleep_time=0.02): + sleep_time=0.02, + resource=None): if (radio is None) or (radio == ""): raise ValueError("station_profile.create: will not create stations without radio") - radio_eid = self.local_realm.name_to_eid(radio) + radio_eid = self.local_realm.name_to_eid(radio, resource=resource) radio_shelf = radio_eid[0] radio_resource = radio_eid[1] radio_port = radio_eid[2] From 130dac16eb3f8d47aca6d6a68c1b14c9865d4560 Mon Sep 17 00:00:00 2001 From: anjali Date: Fri, 2 Jul 2021 23:19:46 +0530 Subject: [PATCH 052/152] Add option to pass resource number eg for resource 2 [1.2.sta00] --- py-json/LANforge/LFUtils.py | 4 ++-- py-json/realm.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index cca1ba05..a1f6d615 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -270,7 +270,7 @@ def portNameSeries(prefix_="sta", start_id_=0, end_id_=1, padding_number_=10000, 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): +def port_name_series(prefix="sta", start_id=0, end_id=1, padding_number=10000, radio=None, resource=None): """ This produces a named series similar to "sta000, sta001, sta002...sta0(end_id)" the padding_number is added to the start and end numbers and the resulting sum @@ -285,7 +285,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) + eid = name_to_eid(radio, resource=resource) name_list = [] for i in range((padding_number + start_id), (padding_number + end_id + 1)): diff --git a/py-json/realm.py b/py-json/realm.py index a01bf92b..11e1eb22 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -587,7 +587,7 @@ class Realm(LFCliBase): 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, resource=None) + return LFUtils.name_to_eid(eid, non_port=non_port, resource=resource) def wait_for_ip(self, station_list=None, ipv4=True, ipv6=False, timeout_sec=360, debug=False): if not (ipv4 or ipv6): From 534b584b72daeb4209e8627f2f78d8a3a9e1e9db Mon Sep 17 00:00:00 2001 From: anjali Date: Sat, 3 Jul 2021 00:18:19 +0530 Subject: [PATCH 053/152] removing changes --- py-json/LANforge/LFUtils.py | 11 ++++------- py-json/mac_vlan_profile.py | 1 - py-json/realm.py | 4 ++-- py-json/station_profile.py | 5 ++--- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index a1f6d615..464c1e21 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -270,7 +270,7 @@ def portNameSeries(prefix_="sta", start_id_=0, end_id_=1, padding_number_=10000, 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, resource=None): +def port_name_series(prefix="sta", start_id=0, end_id=1, padding_number=10000, radio=None): """ This produces a named series similar to "sta000, sta001, sta002...sta0(end_id)" the padding_number is added to the start and end numbers and the resulting sum @@ -285,7 +285,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, resource=resource) + eid = name_to_eid(radio) name_list = [] for i in range((padding_number + start_id), (padding_number + end_id + 1)): @@ -549,11 +549,8 @@ 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, resource=None): - if resource is None: - rv = [1, 1, "", ""] - else: - rv = [1, resource, "", ""] +def name_to_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) diff --git a/py-json/mac_vlan_profile.py b/py-json/mac_vlan_profile.py index ebc23549..edfbdc82 100644 --- a/py-json/mac_vlan_profile.py +++ b/py-json/mac_vlan_profile.py @@ -136,7 +136,6 @@ class MACVLANProfile(LFCliBase): set_port.set_port_current_flags) self.set_port_data["interest"] = self.add_named_flags(self.desired_set_port_interest_flags, set_port.set_port_interest_flags) - self.set_port_data["resource"] = self.resource set_port_r = LFRequest.LFRequest(self.lfclient_url + "/cli-json/set_port") for i in range(len(self.desired_macvlans)): diff --git a/py-json/realm.py b/py-json/realm.py index 11e1eb22..02f825b3 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -582,12 +582,12 @@ class Realm(LFCliBase): return matched_map - def name_to_eid(self, eid, debug=False, non_port=False, resource=None): + def name_to_eid(self, eid, debug=False, non_port=False): if debug: 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, resource=resource) + return LFUtils.name_to_eid(eid, non_port=non_port) def wait_for_ip(self, station_list=None, ipv4=True, ipv6=False, timeout_sec=360, debug=False): if not (ipv4 or ipv6): diff --git a/py-json/station_profile.py b/py-json/station_profile.py index e3fae52b..e3046779 100644 --- a/py-json/station_profile.py +++ b/py-json/station_profile.py @@ -373,11 +373,10 @@ class StationProfile: suppress_related_commands_=True, use_radius=False, hs20_enable=False, - sleep_time=0.02, - resource=None): + sleep_time=0.02): if (radio is None) or (radio == ""): raise ValueError("station_profile.create: will not create stations without radio") - radio_eid = self.local_realm.name_to_eid(radio, resource=resource) + radio_eid = self.local_realm.name_to_eid(radio) radio_shelf = radio_eid[0] radio_resource = radio_eid[1] radio_port = radio_eid[2] From 864878b3e653d731c9804ba63c529729cb29fd75 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 2 Jul 2021 13:26:14 -0700 Subject: [PATCH 054/152] Fix instructions to set DUT in lf_wifi_capacity_test Signed-off-by: Matthew Stidham --- py-scripts/ghost_profile.py | 4 ++-- py-scripts/lf_wifi_capacity_test.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/py-scripts/ghost_profile.py b/py-scripts/ghost_profile.py index 0325ccd9..aee274d2 100755 --- a/py-scripts/ghost_profile.py +++ b/py-scripts/ghost_profile.py @@ -15,12 +15,12 @@ EXAMPLE: ./ghost_profile.py --ghost_token TOKEN --ghost_host 192.168.100.147 --user_push matt --password_push PASSWORD EXAMPLE 2: ./ghost_profile.py --ghost_token TOKEN ---ghost_host 192.168.100.147 --server 192.168.93.51 --user_pull lanforge --password_pull lanforge --customer candela +--ghost_host 192.168.100.147 --server 192.168.93.51 --customer candela --testbed heather --user_push matt --password_push "amount%coverage;Online" --kpi_to_ghost app --folders /home/lanforge/html-reports/wifi-capacity-2021-06-14-10-42-29 --grafana_token TOKEN --grafana_host 192.168.100.201 -this scripts uses pyjwt. If you get the issue module 'jwt' has no attribute 'encode', run this: pip3 uninstall jwt pyjwt && pip install pyjwt +this script uses pyjwt. If you get the issue module 'jwt' has no attribute 'encode', run this: pip3 uninstall jwt pyjwt && pip install pyjwt Matthew Stidham Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. diff --git a/py-scripts/lf_wifi_capacity_test.py b/py-scripts/lf_wifi_capacity_test.py index 2f932374..3e207317 100755 --- a/py-scripts/lf_wifi_capacity_test.py +++ b/py-scripts/lf_wifi_capacity_test.py @@ -25,7 +25,7 @@ Note: This is a test file which will run a wifi capacity test. --instance_name wct_instance --config_name wifi_config --upstream 1.1.eth1 --batch_size 1,5,25 --loop_iter 1 \ --protocol UDP-IPv4 --duration 6000 --pull_report --stations 1.1.sta0000,1.1.sta0001 \ --create_stations --radio wiphy0 --ssid test-ssid --security open --paswd [BLANK] \ - --test_rig Testbed-01 + --test_rig Testbed-01 --set DUT_NAME linksys-8450 Note: @@ -34,6 +34,8 @@ Note: --stations == Enter stations to use for wifi capacity + --set DUT_NAME XXXX == Determines which DUT the wifi capacity test should use to get details on + Example of raw text config for Capacity, to show other possible options: sel_port-0: 1.1.eth1 From 9bce9c2dccbd87f9d84061bd4615e74382ae2f6e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 2 Jul 2021 13:33:22 -0700 Subject: [PATCH 055/152] Enables the user to set the number_template argument Signed-off-by: Matthew Stidham --- py-scripts/create_l3.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py-scripts/create_l3.py b/py-scripts/create_l3.py index 98602f34..3b51dbe8 100755 --- a/py-scripts/create_l3.py +++ b/py-scripts/create_l3.py @@ -3,6 +3,8 @@ """ This script will create a variable number of layer3 stations each with their own set of cross-connects and endpoints. + If you want to + Use './create_l3.py --help' to see command line usage and options """ @@ -164,7 +166,7 @@ python3 ./test_ipv4_variable_time.py 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, + 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, From fd4872a689b33a64d042e8de5c60b492984e5be7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 2 Jul 2021 15:03:57 -0700 Subject: [PATCH 056/152] DUT information from KPI files Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index b9047bb4..dc919ec1 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -206,6 +206,9 @@ class GhostRequest: tags='custom', authors=authors) + def list_append(self, list_1, value): + list_1.append(value) + def kpi_to_ghost(self, authors, folders, @@ -272,6 +275,10 @@ class GhostRequest: df = csvreader.read_csv(file=target_file, sep='\t') csv_testbed = csvreader.get_column(df, 'test-rig')[0] pass_fail = Counter(csvreader.get_column(df, 'pass/fail')) + dut_hw = csvreader.get_column(df, 'dut-hw-version')[0] + dut_sw = csvreader.get_column(df, 'dut-sw-version')[0] + dut_model = csvreader.get_column(df, 'dut-model-num')[0] + dut_serial = csvreader.get_column(df, 'dut-serial-num')[0] if pass_fail['PASS'] + pass_fail['FAIL'] > 0: text = text + 'Tests passed: %s
' % pass_fail['PASS'] text = text + 'Tests failed: %s
' % pass_fail['FAIL'] @@ -282,9 +289,7 @@ class GhostRequest: print("Failure") target_folders.remove(target_folder) break - if len(csv_testbed) > 2: - testbed = csv_testbed - testbeds.append(testbed) + testbeds.append(csv_testbed) if testbed == 'Unknown Testbed': raise UserWarning('Please define your testbed') @@ -340,10 +345,10 @@ class GhostRequest: datasource=grafana_datasource, bucket=grafana_bucket) - try: - text = 'Testbed: %s
' % testbeds[0] - except: - text = '' + text = 'Testbed: %s
' % testbeds[0] + dut_table = '' \ + '%s
DUT_HWDUT_SWDUT modelDUT Serial
%s%s%s
' % (dut_hw, dut_sw, dut_model, dut_serial) + text = text + dut_table for pdf in pdfs: text = text + pdf @@ -370,5 +375,3 @@ class GhostRequest: tags='custom', authors=authors) - for folder in target_folders: - shutil.rmtree(folder) From 71815a15cbb3840ec8b04410616a0e311868f036 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 3 Jul 2021 06:48:42 -0600 Subject: [PATCH 057/152] test_l3_longevity.py : added channel utilization Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 64 ++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 11611b84..d38fd554 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -109,6 +109,7 @@ class L3VariableTime(Realm): ap_port='/dev/ttyUSB0', ap_baud='115200', ap_cmd='wl -i wl1 bs_data', + ap_chanim_cmd='wl -i wl1 chanim_stats', ap_test_mode=False, _exit_on_error=False, _exit_on_fail=False, @@ -190,6 +191,7 @@ class L3VariableTime(Realm): self.ap_port = ap_port self.ap_baud = ap_baud self.ap_cmd = ap_cmd + self.ap_chanim_cmd = ap_chanim_cmd self.ap_test_mode = ap_test_mode self.ap_umsched = "" self.ap_msched = "" @@ -465,6 +467,23 @@ class L3VariableTime(Realm): return ap_stats + def read_ap_chanim_stats(self): + # 5ghz: wl -i wl1 chanim_stats 2.4ghz# wl -i wl0 chanim_stats + ap_chanim_stats = "" + 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)) + ss.expect([pexpect.TIMEOUT], timeout=1) # do not detete line, waits for output + ap_chanim_stats = ss.before.decode('utf-8','ignore') + print("ap_stats {}".format(ap_chanim_stats)) + + except: + print("WARNING unable to read AP") + + return ap_chanim_stats + # Run the main body of the test logic. def start(self, print_pass=False, print_fail=False): print("Bringing up stations") @@ -594,14 +613,23 @@ class L3VariableTime(Realm): "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)) + + # Create the test data as a continuous string + ap_chanim_stats = "{}{}{}{}".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") else: # read from the AP ap_stats = self.read_ap_stats() - - #ap_stats_rows = [] # Array of Arrays + ap_chanim_stats = self.read_ap_chanim_stats() ap_stats_rows = ap_stats.splitlines() print("From AP: ap_stats_rows {}".format(ap_stats_rows)) + + ap_chanim_stats_rows = ap_chanim_stats.splitlines() + print("From AP: ap_chanim_stats_rows {}".format(ap_chanim_stats_rows)) + channel_utilization = 0 # Query all of our ports # Note: the endp eid is the shelf.resource.port.endp-id @@ -622,6 +650,7 @@ class L3VariableTime(Realm): 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_rows: split_row = row.split() #print("split_row {}".format(split_row)) @@ -639,11 +668,32 @@ class L3VariableTime(Realm): print(" 'No stations are currently associated.'? from AP") print(" since possibly no stations: excption on compare split_row[0].lower() ") print("selected ap_row (from split_row): {}".format(ap_row)) - + # Find latency, jitter for connections using this port. latency, jitter, tput = self.get_endp_stats_for_port(p["port"], endps) + + # now report the ap_chanim_stats along side of the ap_stats + xtop_reported = False + for row in ap_chanim_stats_rows: + split_row = row.split() + if xtop_reported: + try: + xtop = split_row[7] + channel_utilization = 100 - int(xtop) + except: + print("detected chanspec with reading chanim_stats, failed reading xtop") + # should be only one channel utilization + break + else: + try: + if split_row[0].lower() == 'chanspec': + xtop_reported = True + except: + print("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)) - ap_stats_col_titles = ['Station Address','PHY Mbps','Data Mbps','Air Use','Data Use','Retries','bw','mcs','Nss','ofdma','mu-mimo'] + ap_stats_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, tput, ap_row, ap_stats_col_titles) #ap_stats_col_titles used as a length @@ -952,6 +1002,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m 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_cmd', help='ap_cmd \'wl -i wl1 bs_data\'', default="wl -i wl1 bs_data") + parser.add_argument('--ap_chanim_cmd', help='ap_chanim_cmd \'wl -i wl1 chanim_stats\'', default="wl -i wl1 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 on ap', action='store_true') @@ -1012,6 +1063,9 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m if args.ap_cmd: ap_cmd = args.ap_cmd + if args.ap_chanim_cmd: + ap_chanim_cmd = args.ap_chanim_cmd + if args.test_duration: test_duration = args.test_duration @@ -1032,7 +1086,6 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m else: side_a = None - if args.radio: radios = args.radio else: @@ -1180,6 +1233,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m ap_port=ap_port, ap_baud=ap_baud, ap_cmd=ap_cmd, + ap_chanim_cmd=ap_chanim_cmd, ap_test_mode=ap_test_mode) ip_var_test.pre_cleanup() From 9d5f78e70fd57e77516f92676705951fbbb3347f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 3 Jul 2021 08:51:32 -0600 Subject: [PATCH 058/152] test_l3_longevity.py: turn off some of the print statements Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index d38fd554..cf55b8cd 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -625,10 +625,10 @@ class L3VariableTime(Realm): ap_chanim_stats = self.read_ap_chanim_stats() ap_stats_rows = ap_stats.splitlines() - print("From AP: ap_stats_rows {}".format(ap_stats_rows)) + print("From AP stats: ap_stats_rows {}".format(ap_stats_rows)) ap_chanim_stats_rows = ap_chanim_stats.splitlines() - print("From AP: ap_chanim_stats_rows {}".format(ap_chanim_stats_rows)) + print("From AP chanim: ap_chanim_stats_rows {}".format(ap_chanim_stats_rows)) channel_utilization = 0 # Query all of our ports @@ -644,11 +644,11 @@ class L3VariableTime(Realm): pprint(response) else: # print("response".format(response)) - pprint(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_rows: From 617bac679c4684461cc96eb81ee3da00e98bb324 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 3 Jul 2021 08:58:09 -0600 Subject: [PATCH 059/152] test_l3_longevity.py : added debugging for channel_utilization Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index cf55b8cd..ca76adb5 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -692,6 +692,8 @@ class L3VariableTime(Realm): print("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)) ap_stats_col_titles = ['Station Address','PHY Mbps','Data Mbps','Air Use','Data Use','Retries','bw','mcs','Nss','ofdma','mu-mimo','channel_utilization'] From 45cab513bc7763f8ea12a84aa24e0896280f04dd Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 3 Jul 2021 09:04:33 -0600 Subject: [PATCH 060/152] test_l3_longevity.py : add channel utilization to the statistics Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index ca76adb5..fd2debc2 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -202,7 +202,7 @@ class L3VariableTime(Realm): # TODO: cmd-line arg to enable/disable these stats. self.ap_stats_col_titles = ["Station Address", "PHY Mbps", "Data Mbps", "Air Use", "Data Use", - "Retries", "bw", "mcs", "Nss", "ofdma", "mu-mimo"] + "Retries", "bw", "mcs", "Nss", "ofdma", "mu-mimo", "channel utilization"] dur = self.duration_time_to_seconds(self.test_duration) From d99857b4cee541644ea740b6a3a461eacc8a8b14 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 28 Jun 2021 16:43:03 -0600 Subject: [PATCH 061/152] lf_check.py : support for influx json and ghost json to be passed in Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 77 +++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index cd637101..c5050a17 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -134,7 +134,33 @@ class lf_check(): self.email_title_txt = "" self.email_txt = "" self.lf_mgr = "" # lanforge tests are run against if passed in - + + # influx database configuration + self.influx_json = "" + self.influx_config = False + self.influx_host = "" + self.influx_port = "" + self.influx_org = "" + self.influx_token = "" + self.influx_bucket = "" + self.influx_tag = "" + + # ghost configuration + self.ghost_json = "" + self.ghost_config = False + self.ghost_token = "" + self.ghost_host = "" + self.grafana_host = "" + self.grafana_token = "" + self.parent_folder = "" + self.server = "" + self.user_push = "" + self.password_push = "" + self.customer = "" + self.user_pull = "" + self.password_pull = "" + self.grafana_dashboard = "" + self.test_run = "" # NOT complete : will send the email results def send_results_email(self, report_file=None): @@ -231,6 +257,55 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path.
""" + def read_influx_json(self): + # use influx json config file + if self.influx_json == "": + self.influx_config = False + else: + self.influx_config = True + try: + with open(self.influx_json, 'r') as influx_json_config: + influx_json_data = json.load(influx_json_config) + except: + print("Error reading {}".format(self.influx_json)) + # json configuation takes presidence to command line + # influx DB configuration + if "influx_host" in influx_json_data: + self.influx_host = influx_json_data["influx_host"] + else: + self.logger.info("WARNING influx_host not in json {}".format(influx_json_data)) + self.influx_config = False + if "influx_port" in influx_json_data: + self.influx_port = influx_json_data["influx_port"] + else: + self.logger.info("WARNING influx_port not in json {}".format(influx_json_data)) + self.influx_config = False + if "influx_org" in influx_json_data: + self.influx_org = influx_json_data["influx_org"] + else: + self.logger.info("WARNING influx_org not in json {}".format(influx_json_data)) + self.influx_config = False + if "influx_token" in influx_json_data: + self.influx_token = influx_json_data["influx_token"] + else: + self.logger.info("WARNING influx_token not in json {}".format(influx_json_data)) + self.influx_config = False + if "influx_bucket" in influx_json_data: + self.influx_bucket = influx_json_data["influx_bucket"] + else: + self.logger.info("WARNING influx_bucket not in json {}".format(influx_json_data)) + self.influx_config = False + if "influx_tag" in influx_json_data: + self.influx_tag = influx_json_data["influx_tag"] + else: + self.logger.info("WARNING influx_tag not in json {}".format(influx_json_data)) + self.influx_config = False + + #def read_ghost_json(self): + + + + def read_config(self): if self.use_json: self.read_config_json() From e9eda09d5ba247eaa4a020d363e3f7e09956414b Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 5 Jul 2021 06:24:16 -0600 Subject: [PATCH 062/152] test_l3_longevity.py : check ap_ofdma 5g stats : wl -i wl1 muinfo -v and ap_ofdma 2.4g stats : wl -i wl0 muinfo -v and sor to a file Signed-off-by: Chuck SmileyRekiere # Conflicts: # py-scripts/test_l3_longevity.py --- py-scripts/test_l3_longevity.py | 48 +++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index fd2debc2..4ae5caad 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -105,6 +105,7 @@ class L3VariableTime(Realm): debug=False, influxdb=None, ap_scheduler_stats=False, + ap_ofdma_stats=False, ap_read=False, ap_port='/dev/ttyUSB0', ap_baud='115200', @@ -187,6 +188,7 @@ class L3VariableTime(Realm): self.cx_profile.side_b_max_bps = side_b_max_rate[0] self.ap_scheduler_stats = ap_scheduler_stats + self.ap_ofdma_stats = ap_ofdma_stats self.ap_read = ap_read self.ap_port = ap_port self.ap_baud = ap_baud @@ -195,6 +197,8 @@ class L3VariableTime(Realm): self.ap_test_mode = ap_test_mode self.ap_umsched = "" self.ap_msched = "" + self.ap_ofdma_5g = "" + self.ap_ofdma_24g = "" # Lookup key is port-eid name self.port_csv_files = {} @@ -249,6 +253,13 @@ class L3VariableTime(Realm): def get_ap_msched(self): return self.ap_msched + def get_ap_ofdma_5g(self): + return self.ap_ofdma_5g + + 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 @@ -555,8 +566,9 @@ class L3VariableTime(Realm): # Update connections with the new rate and pdu size config. self.build(rebuild=True) - if self.ap_scheduler_stats: + if self.ap_scheduler_stats or self.ap_ofdma_stats: self.ap_custom_cmd('wl -i wl1 dump_clear') + self.ap_custom_cmd('wl -i wl0 dump_clear') for atten_val in self.atten_vals: if atten_val != -1: @@ -729,6 +741,12 @@ class L3VariableTime(Realm): # get the (DL) Download schduler staticstics self.ap_msched += self.ap_custom_cmd('wl -i wl1 dump msched') + if self.ap_ofdma_stats: + # provide OFDMA stats 5GHz + 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') # Stop connections. self.cx_profile.stop_cx(); @@ -1006,6 +1024,8 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m parser.add_argument('--ap_cmd', help='ap_cmd \'wl -i wl1 bs_data\'', default="wl -i wl1 bs_data") parser.add_argument('--ap_chanim_cmd', help='ap_chanim_cmd \'wl -i wl1 chanim_stats\'', default="wl -i wl1 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 on ap', 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') @@ -1050,6 +1070,10 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m else: ap_scheduler_stats = False + if args.ap_ofdma_stats: + ap_ofdma_stats = args.ap_ofdma_stats + else: + ap_ofdma_stats = False if args.ap_test_mode: ap_test_mode = args.ap_test_mode @@ -1231,6 +1255,7 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m debug=debug, influxdb=influxdb, ap_scheduler_stats=ap_scheduler_stats, + ap_ofdma_stats=ap_ofdma_stats, ap_read=ap_read, ap_port=ap_port, ap_baud=ap_baud, @@ -1288,9 +1313,28 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m ap_msched_file.write(str(ap_msched_data)) ap_msched_file.close() + # ap scheduler results and write to a file + if ap_ofdma_stats: + print("getting ofdma ap data and writing to a file") + file_date = report.get_date() + + 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() + + 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") + ap_ofdma_24g_data.write(str(ap_ofdma_24g_data)) + ap_ofdma_24g_data.close() + + #for csv_file in csv_list: # print("Ouptput reports CSV list value: {}".format(str(csv_file))) - if __name__ == "__main__": main() From 3b774cc2ea2741395e4a3e31ff3e1921371596a3 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 5 Jul 2021 06:34:28 -0600 Subject: [PATCH 063/152] test_l3_longevity.py : capture the 5 and 2.4 umsched and msched Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 59 +++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 4ae5caad..7dc4a32b 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -195,8 +195,10 @@ class L3VariableTime(Realm): self.ap_cmd = ap_cmd self.ap_chanim_cmd = ap_chanim_cmd self.ap_test_mode = ap_test_mode - self.ap_umsched = "" - self.ap_msched = "" + self.ap_5g_umsched = "" + self.ap_5g_msched = "" + self.ap_24g_umsched = "" + self.ap_24g_msched = "" self.ap_ofdma_5g = "" self.ap_ofdma_24g = "" @@ -247,11 +249,17 @@ class L3VariableTime(Realm): self.cx_profile.port = self.lfclient_port self.cx_profile.name_prefix = self.name_prefix - def get_ap_umsched(self): - return self.ap_umsched + def get_ap_5g_umsched(self): + return self.ap_5g_umsched - def get_ap_msched(self): - return self.ap_msched + def get_ap_5g_msched(self): + return self.ap_5g_msched + + def get_ap_24g_umsched(self): + return self.ap_5g_umsched + + def get_ap_24g_msched(self): + return self.ap_5g_msched def get_ap_ofdma_5g(self): return self.ap_ofdma_5g @@ -1299,19 +1307,34 @@ 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_umsched_data = ip_var_test.get_ap_umsched() - ap_umsched = "{}-{}".format(file_date,"ap_umsched.txt") - ap_umsched = report.file_add_path(ap_umsched) - ap_umsched_file = open(ap_umsched, "w") - ap_umsched_file.write(str(ap_umsched_data)) - ap_umsched_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) + ap_5g_umsched_file = open(ap_5g_umsched, "w") + ap_5g_umsched_file.write(str(ap_5g_umsched_data)) + ap_5g_umsched_file.close() + + ap_5g_msched_data = ip_var_test.get_ap_5g_msched() + ap_5g_msched = "{}-{}".format(file_date,"ap_5g_msched.txt") + ap_5g_msched = report.file_add_path(ap_5g_msched) + ap_5g_msched_file = open(ap_5g_msched, "w") + ap_5g_msched_file.write(str(ap_5g_msched_data)) + ap_5g_msched_file.close() + + ap_24g_umsched_data = ip_var_test.get_ap_24g_umsched() + ap_24g_umsched = "{}-{}".format(file_date,"ap_24g_umsched.txt") + ap_24g_umsched = report.file_add_path(ap_24g_umsched) + ap_24g_umsched_file = open(ap_24g_umsched, "w") + ap_24g_umsched_file.write(str(ap_24g_umsched_data)) + ap_24g_umsched_file.close() + + ap_24g_msched_data = ip_var_test.get_ap_24g_msched() + ap_24g_msched = "{}-{}".format(file_date,"ap_24g_msched.txt") + ap_24g_msched = report.file_add_path(ap_24g_msched) + ap_24g_msched_file = open(ap_24g_msched, "w") + ap_24g_msched_file.write(str(ap_24g_msched_data)) + ap_24g_msched_file.close() - ap_msched_data = ip_var_test.get_ap_msched() - ap_msched = "{}-{}".format(file_date,"ap_msched.txt") - ap_msched = report.file_add_path(ap_msched) - ap_msched_file = open(ap_msched, "w") - ap_msched_file.write(str(ap_msched_data)) - ap_msched_file.close() # ap scheduler results and write to a file if ap_ofdma_stats: From 48102aca66af9a21728efd54d8979cac405c9b68 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 5 Jul 2021 07:04:46 -0600 Subject: [PATCH 064/152] test_l3_longevity.py : bug fix extra command left in Signed-off-by: Chuck SmileyRekiere --- 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 7dc4a32b..e3d31fac 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -1031,7 +1031,6 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m parser.add_argument('--ap_baud', help='--ap_baud \'115200\'',default='115200') parser.add_argument('--ap_cmd', help='ap_cmd \'wl -i wl1 bs_data\'', default="wl -i wl1 bs_data") parser.add_argument('--ap_chanim_cmd', help='ap_chanim_cmd \'wl -i wl1 chanim_stats\'', default="wl -i wl1 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 on ap', 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') From 4b8965a1f2b722a6fdf50171b111d45f46bb0a86 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 5 Jul 2021 07:26:21 -0600 Subject: [PATCH 065/152] test_l3_longevity.py : updated example for using --ap_ofdma_stats Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index e3d31fac..ceeaee76 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -1,5 +1,9 @@ #!/usr/bin/env python3 ''' +NAME: test_l3_longevity.py + +PURPOSE: + Supports creating user-specified amount stations on multiple radios Supports configuring upload and download requested rates and PDU sizes. Supports generating KPI data for storing in influxdb (used by Graphana) @@ -10,7 +14,7 @@ Supports iterating over attenuation values. Supports testing connection between two ethernet connection - L3 dataplane - Example config +EXAMPLE: 10 stations on wiphy0, 1 station on wiphy2. open-auth to ASUS_70 SSID Configured to submit KPI info to influxdb-version2. @@ -22,20 +26,25 @@ --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 \ --influx_tag testbed ath11k --influx_tag DUT ROG -o longevity.csv - Sample command using attenuator +Example command using attenuator ./test_l3_longevity.py --test_duration 5m --polling_interval 1s --upstream_port eth2 \ --radio 'radio==wiphy1,stations==1,ssid==TCH-XB7,ssid_pw==comcast123,security==wpa2' \ --radio 'radio==wiphy2,stations==1,ssid==TCH-XB7,ssid_pw==comcast123,security==wpa2' \ --radio 'radio==wiphy3,stations==1,ssid==TCH-XB7,ssid_pw==comcast123,security==wpa2' \ --radio 'radio==wiphy4,stations==1,ssid==TCH-XB7,ssid_pw==comcast123,security==wpa2' \ - --endp_type lf_udp --ap_read --ap_stats --side_a_min_bps=20000 --side_b_min_bps=400000000 \ + --endp_type lf_udp --ap_read --ap_scheduler_stats --ap_ofdma_stats --side_a_min_bps=20000 --side_b_min_bps=400000000 \ --attenuators 1.1..1 \ --atten_vals 20,21,40,41 -Sample using upsteam eth1 downstream 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: +Copyright 2021 Candela Technologies Inc + +INCLUDE_IN_README + ''' import sys @@ -1033,7 +1042,6 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m parser.add_argument('--ap_chanim_cmd', help='ap_chanim_cmd \'wl -i wl1 chanim_stats\'', default="wl -i wl1 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_test_mode', help='ap_test_mode flag present use ap canned data', action='store_true') From 2c87df6ec30477ea42478287c2b5b22cf22c7fc4 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 5 Jul 2021 08:59:31 -0600 Subject: [PATCH 066/152] test_l3_longevity.py : when running a test suite put the results with the other results from the test suite Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index ceeaee76..b91ce872 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -1016,8 +1016,11 @@ 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') - parser.add_argument('--baud', help='--baud \"9600\" baud rate for the serial interface',default="9600") + 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('--amount_ports_to_reset', help='--amount_ports_to_reset \" \" ', default=None) parser.add_argument('--port_reset_seconds', help='--ports_reset_seconds \" \" ', default="10 30") @@ -1029,7 +1032,6 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m 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('-o','--csv_outfile', help="--csv_outfile ", default="") parser.add_argument('--polling_interval', help="--polling_interval ", default='60s') parser.add_argument('-r','--radio', action='append', nargs=1, help='--radio \ @@ -1045,9 +1047,6 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m parser.add_argument('--ap_test_mode', help='ap_test_mode flag present use ap canned data', action='store_true') - parser.add_argument('-tty', help='-tty serial interface to AP -tty \"/dev/ttyUSB2\"',default="") - parser.add_argument('-baud', help='-baud serial interface baud rate to AP -baud ',default='9600') - 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', @@ -1075,6 +1074,11 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m #print("args: {}".format(args)) debug = args.debug + if args.local_lf_report_dir != "": + local_lf_report_dir = args.local_lf_report_dir + else: + local_lf_report_dir = "" + if args.ap_read: ap_read = args.ap_read else: @@ -1132,8 +1136,13 @@ python3 .\\test_l3_longevity.py --test_duration 4m --endp_type \"lf_tcp lf_udp m else: radios = None - # Create report, instanciate a reporting class - report = lf_report(_results_dir_name = "test_l3_longevity",_output_html="test_l3_longevity.html",_output_pdf="test_l3_longevity.pdf") + # Create report, when running with the test framework (lf_check.py) results need to be in the same directory + if local_lf_report_dir != "": + report = lf_report(_path=local_lf_report_dir, _results_dir_name = "test_l3_longevity",_output_html="test_l3_longevity.html",_output_pdf="test_l3_longevity.pdf") + else: + report = lf_report(_results_dir_name = "test_l3_longevity",_output_html="test_l3_longevity.html",_output_pdf="test_l3_longevity.pdf") + + if args.csv_outfile != None: current_time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime()) From 7558e9db6a659a466233ba671543c93af6ee3ebd Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 5 Jul 2021 15:45:29 -0600 Subject: [PATCH 067/152] candela_swirl_small-72h.png add image Signed-off-by: Chuck SmileyRekiere --- .../artifacts/candela_swirl_small-72h.png | Bin 0 -> 12989 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 py-scripts/artifacts/candela_swirl_small-72h.png diff --git a/py-scripts/artifacts/candela_swirl_small-72h.png b/py-scripts/artifacts/candela_swirl_small-72h.png new file mode 100644 index 0000000000000000000000000000000000000000..e288f8c96f53e311e57a020aa52d7e1f053c4b00 GIT binary patch literal 12989 zcmV;uGD6LXP)Px#32;bRa{vGf5&!@T5&_cPe*6Fc00(qQO+^RW0uu)eD*ga{0ssIY07*naRCwC$ zy?3}=Wz{x*-|N|X&&=s3y^ux%A%qqcK~O0QB8Up2AYl2xjw0%70UKB-wpT$xI*477 zW<;b(N2#F(LK4#Z$?0ci_I}p-{qgLXGbahYmb~B3?~=K=!Z~Nkp1s$z*0a{V?t5*j zDxd&C!VLL?fC1rGsr>-JYEOl~E5NPZ!iLw_w%%TU{r{b}V_ToL#oHS{|8KqB%t$u8 zzVTZTu-a9m!8rWf7Hw{G$)6 znJWAoeyLq_nB|5iz_327_7o`%>v9`w+JNvDnt=J+VBw98-yk>Y%eLH}b_Jm70ig(C zW=7D+26rOiUxW5JLBO__~p8vFW=afg7@46&IANzm}Jr*7ZSn_o%;GSv;{ z2h!>$UtOu?#g(CDX?az(vbhjfBTEH|eJ}jq%u)ab6$8PrObjL<9YHno-c%4} z=F3@A)96Fm$Gs~m%q5BhUN-9X_EbQ%uhRcu|HeDh$`Wc{B$-%drfQKHgkqK;YIAXm zNVB>G6g3!P0bo_}RakE|>sH@K-{&wStWsbARX{3I2}{688qF(o$i{b0`bf*@cc{e# zBR~Q7vQhrkM}4={v@-Alh887J;tD%U)XrpdoJ^2-q9mi7YZ56z3P1u#?aE8T((r%> zs-}Z!Wo24fQ5jn72cAWFG0`o|2zpb{JH`OaVxbhde$$E{M1@g>=0gBdH6vd(>UQ&1 z(^RvyA{ks0P=qCv7$(Sf$9x4?_}w(mfNKSaF)vokRD^j7jRDJ6ZC-a{W%K+ZyF48X zj%u0$DH(x@X;w+*O`82fvr+Z%Yg-jbqu}f(w=?s8Xz(|2g6%*!M$-=$?Kxiy@x0Ru9 zS!?5^Ui=?XuQZm7Y(PIu0Rs&Xk;v-xCDlS2+)!`^w8zv36E@%sc@;}IQbe4H6Oe#e zt%X$|fKu2$;;!{75)9|7s@_Zk(l-p$ z=1`ypU)Zi&IBLggYHHs#MGT05;yqOzEh)^Bcm`n6-&&iwIbqOhmJU`12GW79-tMK# zmrR~CWla0%)?!<8p;U0iuyq*!%}QRQ!75qBwv3a2A&C=5XMZ=|9sJEq0q+f|uZI0k zkZ*aU6T&g7RVns&1;W4o=(#z|i-l6L*xb_8Jg#-zsqg$aj0|0` z?N?LOwhRwML^e3MGI3^vsfR=$D3gnA2ZUtjC5=j>(Uz=VeB$Sh-#D--Zi+-%Y%YaO z3WU+pwDRKmr5E3{=(@YFzv|4ZXHA?{U-vcZjyNmZRz7BV**5&*EmD$y^wdLisfWXj zgPUI1uq1&%#fu4)WF$#ah-;N00u;B6Bi1(Fkge7?HgA5(`elq@7CI&-j3}JkIr-Fg zp4w1}0x)iwivBZ}4m&y}!1o*ayB>`Nih@Zh@TnE!QE!iuS%8?Syp)@QSlYGZxKAD1 zUFnO8u~(RpDik%zjGl0&G*iah*w_8e(~fy!*@DKTskXi3DV6t&>aMIh59I2U@7+^+KU(KqOO7*2rFf>}X zVbQ-Q70+v0gPKuOBtxC?E?e#&G+)A^;7YJ;hfW_83n zm@x;zgRdBrYJ|{))NQPofZ%{uL(gj|sMTDP4JH|0o^IG1!waMVDXKZBjqH$fy||Y5hDx=WKaP* zN^P&&{Z)T`R%Mi(^B0%#%5C!1v$$;LVRb^=P>=Fk^=qhragkS>tAy08knXvQ3D^YCY-{m4_BR z^w=|xy|{8&r99N!(z^4Gv-h66_imGR+xilFQ?E)2Y6J$;Vfz_K%agFh8(;X#(|=j` z!otlxn+a=gZQpt3>^*1iwfp2fm;*~8ul`%vNNBg4Rfaa+RVTy z*VWsVG$$neJ=yoKI{%1+-`rd71)v0J+q5XjRb4B8eElW2+etJu$ zUgyl1ed6KodH12mJ2-=pP@nBMapuffJO26pKWDJad<2TQIxa}Uh`XM;^ZcLv;PGb` zm{_40QQ$%I^z$?Gy2IqDA9&XX-+90>O|E3y&cf@6ME*;){P@7S-zM}Pk;zbMot@K8 zaiw|r)>2zi+w@cd);HKIpaB}7FY|<`N$2P>09rfSGpfMVs%8!N=9AAo{*G544db#+ zFMi_ekH4_y1#!~S-ULEnFbc#)h?1DJ1&bDZ^y?ox{ljM*cffHlNaWf_cX*c(4uBV! zd8d((-@M{%FV@u3OezgYYr)LUy69`=wDSHpy`Pku{&M5jE7r7MlHKv} zpFwdHrKcI_wzMnp;M4bi;@hVVR0lvdw>J~a0E0#1;+DiCTefkS)`evP`|80S^4XiojL#R`6+x;d(mi6O4w-VlIFxj zH}tRj_T}gP< z-?;p1Tki`by(&nx&>Y{mVaa(>sy5~iedms5`(6u$k}iNNI|(g1mNN4|9amOcdNjRX6nNp@6ldp(JW*dN|?e@^QF$x zPp-Q<(^O1oQb)`HK&gObzFA64&7f@PiDc%x2Dv`~ ze>B@hqIT6yS1sGPOw~vOO#v~9JlhK$mO?~QzKYBclOG-dBlPt{kq1sfZQQ7vQJrK34% zv5{b(1I;j)R?@8EE!&E}VNJzSWN{oPFlyM)N4i7LK=0bk>mt%>z-pv0qO)_ncoqvu zs9s4SoRG1L7A}2es5$^hfHyX7TL1j=ML+rFmG6K1`@Vk4*VHS3Rcls66p*G66+)nF zPMV5Zm^ywM2ygXPkJ3a<`^)_exNMya?9DGML^TOUa6@?!v55lpkUWGKIFf%oXfusZ| zJtrfBVlp%|SglsM6(~l)Oavro7QW6ffmvW)v!0>;aV;H<1#zvfL>D=dg*XNkCR-JQ z+Bejvkw(ZN6(OB!=FHP4u3*kFFMD(NM2vmqfy_L^77?-xGl|^+dmXs@%sqa8>+cP= zd9a(Lm&`+4&IE>61q9-2OkEmHDBhIf`Um?%ansOvw=7-Qwer%a{1AkxCTM!?*l8c4 zOfeJFinyeq+hczt`!&?sYJt^+EgID_0ueX`yv0paV5z zr-X{F>RJVWCIJw!njpY?pGQs+Gc&7XgAcAZ_!S4O>Dh&(1L&f-6faq~Xu%7QAAiQXH}!0g z7#esTrlB?F)l`)))tk?asHpR5YY2}}XgQ~6tKMT?-Gyv!3)(_>SrSEn7(Ku`TIi@f z1APxZ{tzP&E(a0-7{t_P>A=7M8?YlIOw62lWE2Q6Z~DBxSN2kbfO9S?#_P-LpL=fM z$Ikoc<4->t#iAJ@=FKD|IJBx}wM%T^VDF|IvvoIgu)9KEb(7mCoKS3g12htGHGs{l znuu)Ed|R;zhYd-~-%xXJ(ot+nX#lsbm_K*Y=R+~=k^SY_htIp}oP~>@j*0~m5+PGn zI2t8nQUdh~qmAs!W6KUa1NU_}ovM8WZUMYCmfH;-f`&7fVLWx1Ym_^lcq#?4xmvT> zU^F8Q5*Z;P1_dEj5BLmgjtYQpf8E=Tdi_yhw_4M+=4+RpdGBNQL~-2H*UPxp%{2u< zvz#iSVaclLhRv&gmG#{kMQKGNOXiK8a% z`K1q?I7FZTxb?wXHw|ufp^I9(B4|Az-|T(Nd#p;SnUiKjUu zs6sjuGgSnX&CFCyCBHsOV-B4WVpa>nG{9RP*+HvuonfGn2G77hsFeg^|Mw8mJm_Gg zH0*0!Yn1gOv1H@2>ju}`Bz1tR1am-`>)BC}m8; z0z@t9N-g$oBfZ?psKbefia>Mx%0MX8EHm+d{_&xk=ifKqMb4Bp>>l1%=gpnB&u;r> zs2=grH?8X3K#@XQ(V*Up=28$6tHA{bA-`S{Nt8>4JV6)04uC4==tC71cs@`GNO>N0 z!=`BvgTiU3GwWC|1b{#SgbWDQ(IeT4p-4y~g3k)L%@v&lX(`|#R`&&@;eoSHXo0>--3XURO zjsP^^KMh;nOLljnt@=Bm;;^9LF`v8kTZ>nYn zIEy-)Mw$6Sb82jBZ5!3nX#kaQ zP!08#S5Pb|b8Knc+Y4>4r;IYw027GFOAyEZhsTzlS}y~CfA9RC-}+O5L@q8R1qG;x z#2tIs@h2R5{BLgg?R`((>zoq{`Yi$JQ~$2R-?i)1U4MGRPuKRX7DNg}js|mxUbFkY zyG)&ZXK!AuKqT6@(*QgaZv^Eu6vTC)^QMhNpp8=tnGcjk5>R<}<<_%D& z5Sgl(MTng_nwYPOXa-7P1*kwM#xY~xTI_gxApHj3y@+clL-7wWzoM6LXzo0H*2Hm> zym_c;@Cvh-?Ap9hp__X)MFrhvaZ3djpeS`#AgB8gwL$2zstj~ z*|2)~=H-OaBd{j`6r@;Q0L*NwaozV#KNcVfAT&Vb{kWgGk3)P zZynt>X8xaUE?dQg6xQfX&2*n#UVY3VN8NPmbqim79;5=MMiYn@qr#!DK5TO54p(1u zWk35>(@>s-i2ABs_C9+5qvqc+|H}DS#?B2BBupo_PkrltM=n{lC zy|2=@Wc}ihbdPBp^NF)QHf#FKcO3q%)6f3=-B;fGou7aE@*A%}Od%ECOq@AK_nDJV zyW{@bA9>~xgD4H~kxE8!-p)Sd?64q3=D|t4A(~1|TW3*<*IP=NI>#_RY`S_3-VHa{&x+A}Sh7e9d`3-)omWkNV)z z8>$!Suz16gI$N(MiuVahv&PR_ z-LqyO9b|w54Ap9-npR+#IcZjFp><`~^0k{cQ1Z574G&Sx6=X0dt)^Nb#W;8Bu1!fZ zfaRN)tz5T)5){07rJI9U>T_P4!Iaa-Pup?aOu#k{bUm{8AsQXT(~N#>^XMT<&p79d zyDqzHdH1rnpLTSA)=x5m3zbKZ{HvykMD#T0l`19*6EA0!nar0$gzhtNJJHs%wbJ{b{Kl6h_{c;lHL`aiGU>yY2x^6NESYy12AiiOgY@l%dD z{FtYod}`_1)6FSH3J$LW$4PAgj45`;* zQ~*$P$#=f+?MrXE^sc|&)iczarG8A?n7!ugdCIXL`{B)< zpEvLKiv54~$Dcm(%%f{JtnM!l4weTCNnA>bNd4j@h2dgsqk2!<~>CAqYUGY3kEzmX&>VpxoVDDmA&5B#I&|>soe2Tz#snh0^G^ zwv9WS9Ay@R9*DeUnNPjGHLGMkGca;d;$ng$n|ifG&=`)G|B|Dj%q+`%=GCjJkRlSfIF<-C{V!_`1vPJB zm1Z>Unse z`+kQ(BvX>sSG9NS1GMLOs%1n(aD=pS1kz{QWj@)KMy)rw$RSuCsDR}mI=8LQTLkHv z4J)s*>Jy12DDBue?SsG+gQvNW&cSMs9CTQKLD^C%V+JZL!U)nBhKGISrH!IdSdV)D zJG`I)E*`;&58p%@#26d(0~^~|+A#1gf_C?BeqgBgiNy8OHJ3*1 z8<+L~T89s9(!k=h;jfyXT@Y(D8{3Kh1*57~oGX+E9$E49my2Qw2d07;1~OGJqFJ`i zTTdiu#-@m!;yTL~0bW#rC?uL8v;l;4-bT-gK5o+rIwSjPH45-M8KMgMsmV#eHr9V zAq{m~qqHYeGtdaf;XgKxuM7tYoErin@MhhW-pA6Rm1dH$y?xB9B$^0FPH3Xk<;Q63 zI^`c8fauH&WW;>ZPRZCw2<)Ge{Jr#^8W1>w&#zwmqu*Rya7@55#iiNlCm)`z`%RoJ zd}h7;^uY}+Eql-=nPurfdd`1+s}PlfUx=``+Iz*dS3UZ|W97lVF{8)7YVO|edGiS| zVynSDzq#`_4?Xe7r{43aiKE5?_~ZS5xc%NcKK`ChOq(z*80os(uR~-JbOL<-k1;w0dl=?G=N5@TWIj^VkcI zZ|d6A+1fFC`oyCS+<9~Y$i!mP%s3gJ8qfUxm-l(~>)!U-BSUhKT6V_wzrcu4BPGlH zVXr;xkXIiPd~J?!#}Rd^Y(dF1GthebH$S`d ziHaZW?%6zPQhQV13+t9WJvJW9*t}UM-SX%QJ5F8Wd^ZIf*KABROUwhH$djuUy#I6W zuV(3PyYAlH*1T-plH31!+x53yd&OB-jAR$1heKd6>p$hZk3PKMk?GT?j~+F4 z)w-2mzxb<{{^sJ}eD~L*TgIA!P}S_==O2Dy<)Y8vlYkFR;kq9@x%`QDf9lw#w&q=C z&MveRA9~^8>u>+vQ3t*KoYT&88ioEi!L_|>PWZyR*L1C%HhJRM_Tq-_wfEn2_vP0P zTy*Beuix$Ussx>~eD~A$G>>Y3+iQ;uODEOp%@6&tqqDuO*ycp4<#hj7?H3Z3vacL| z(qT;}Ea z*0)FKOS8`A$?t8`HY@+}muLTMbTXl_HAHg2_nmRU8A)^L@-wd3Yx=wpTJL)Lt}Cv+ zvb(o?Ov~6jJyKJnxVT1flZvI8YMnBknYRd^{?4br|GDoSvgaX$m|12Dy3pIrkezbQ z#~*wCiSK{;{Db#6ILM^#e){fDoO|kL{`<3+eCd(|2_U3EE$oY=8+JjWx7vN`d7qfN z!?a7!x^!~K6aWLh|I+I&x#;H?9kB1gN9=P%SYa8mFPwk+=H7LeeDzCv>@cIL&}nhU zlC?eGzvd#MO@kW6%!mvlq>>~o)pxz_*i(-?bqmGQrk)L%%XXi;=jETh{H_J}G!2L&!tfFy-1SNpEG<;tWKIYfV5`jC#u zFXO!fiJs zetN^t7A=2n?zG)=A!(z~pspDv?|kTvB`aQ>|D*ZAqGs0YT249UW4GRa+wX3@?udQg zBIZpikH7fPJrDo+o1Z)F6*J}~ZX#W)S56-{;eyXykomM`KO;g)HR9of_dR>hx=UA^ zszQ%C;OKpJ*^jWvqb9%m@ONK%!!_^Ilg>Nk>t`*`+!PY^iug+Kq{2fp%wAD?w;6p2FXL%@1^dtf@QeXQiY zDuSS5!l-c-P1pBtoZAr0ww%vG0JdoL;+E#-aihmIqAf9s<42EQzG@lJS0376+P7}~ zbH;SWxK}n6b~VV#u2r8r_fr-bh=RHwed(f6O{4RaZ)>e2xpDIbpL!UxwA%fOo*Jf( zFP(hm+&O!k^}{pY^ZDa1`tn7yChW3(VZtrsw+;qU)9S)COV35+$&@;zJB;1&!>(zc zfGv3VtZG+&T>qkgp?u=dg2Kt{|xZn-1IHW$kylZIv(v^#Moi($ZZB)}F znY{b#16q^z`yYR7pINUXkhsFM$y1T&BhNn6%;uKn7S<@kL4nYCJ$*j|G_WE&$0=zaRs`Xyg$_Dda{SaatN zC$hAUSycPdLb3j=FGHn_YT3#)Z31>3Kj)DB4>4b!(%j_(-%->3ce5eFXG z*E_V&UayG}H;Pzf#4rPr5@?GVs#R2L;|B4Yn}2=uX-7Z4?9sUscHeXEUj6-j{r$c5 zxmDZ8Q*$WLjG#wmLr<+)a(2Nz@2mwL1B1TQJljcPmPaX3cyDj{@DU_Dq-Rav(mS3{ zSO5@9@}-l{`s6o1`MK|W_M2nAF=5R3wd>by+OX-(uY1d`JI)ESFG!@B`k_o~X@&YM z9jMfmA*$-VW|cHtoYq3yg`dCpJ!hO)tz@{t!#!8s*U{VoAYtL$Q@-`db3Xpw(@&T% zc|x&JT)k>dDQ-UHxKm%Z+aV1}20nE3hnB5ga`wgFyzm!495ZoTPjC0e)f@JjGw)L; z{1@r!6JDx)X_gI-2%sUYRxiBn#}{39iBPgMJL3aqyzkBL6Yv##%)9&#IPUYuPnbMm z?Xp$JA9}**wy~;NPQb7CRsNNJs)3Tvh!wNN8y9}H;Fo4ng*C0`K`RDc^ZI!Q6rxfc z3*Fqm`LEADEJ87+(6pKz@tQXUa!|l?hti?vS3bXB(Sp_MR?VIv9cJx2ckdY!rb}%HF%yMU?8He-oKYXSYHBsjZ9Sk%7*d=C*r(yCFfvf;AYR_9X-G3jZXv*^5mjv~K~N}X z9N?i^)741Bps>dJKvgrU_kPe@C6bs@lBgLBedP>VLmEdUkG0DztR2YeYOP_wNC>Sf zM1}=v!*_hK5t<){>tiVbLq|$v>%ZQo2}bon6)Do+z2bZ9ov#MffpU4{pl^jt@~T46 zoaJg^nm3RlB#G#A#@fb$^II+wOrB}_~>pVm8UpHzL z=)$B9ZvNvy&-{Xaszt#eR;E5)L;)SySetKK31o z`goa~4Wp*v_ALr?b=rG_4ly6HRvUmRwT!}o*rk4dpPabCIs?s{Rbds?Dik8INl7FL z6!Ch)E9hXX9)yPT$6zyU9Q4&N6SgLa-DW$G!=iN?z9~>H*%_wR1$iFS3{f;LFBkvy zM9EA5HC@`h_E)V;t74LJNSivR98)Om|8F_2dstLrxps^gaaSi*t7tZmr4?f)PU5&p z*esH4#|e=CD<@{#=XOsKX=K*D?$>elV#Zk1d#bq|ip_ic``uG2-<&LO+T{0Pf+-pIXJLFd$O%#g>`in4lTu zzv=1IOi3k8t?aA4X{8%bad8~Cx@0t^$)H4#(dE;s_@8l~fC#8`ue({Wxk?AsAe&7J zqYMf}tReOPmuJ4#4_BWbZ4J@`GV^{g^Zi-6x$67Ovcz>Hg)xz9r3*1O%0-L~AN8Me z--pPwU;Cem#0;sBCQ;;FWw5&isRcDBvHdMNJj0bQ;fbu>9)dxG6mG4g+LxBsRLUDN zUxCCf>S!)aisI2^5pd*Ip&I`w-Z{dks;SR5MbMN&i;YI{<^E??*NaTs4(6;$+R-?W zJRfz+VcK*~Ty$X#8G`1^!v?anD;-*!r5iKt$$XYXZBb!jscBYJ7)>T*yzTVoKlp|$ z5gEZn;x+Oy#8JHwiC;dr>E`A!Cz=(^M8tWYia6H0k^g{4Hb`So*U!>etHenfDc+1k zrdlP+(C%`1#Zd3!YSyLjlv0vRE;a97DDEKA0>%b5mL)IWRA;17rC`af<^Dyn04R$U z6^O+TZuoT-N#~fO4DA4%iyMozzdNC+|C`^(r7pW39=C}M=ua!FeRW;6yvA2H`E-N# z6-3Q(abio`Zc$-M6i<+-1?IxY7?==^sqD)Z9eLHgW?Ff4&7vF>F&d)Xz;QBO|rwE`I^m#(U% zsI*I5niH4il$v*vxE*K$;=k!1K@k-0`#O-Oy_)r8)hLr4frf2qqsC7 zYML4)Q=?>3T$m`XJ>1-G1dDsCNhJS}vid*HsNQ=}iEOC%j@}iQCALno+4{E;5kLRKgwRyjUm=)hshrVCyqj2mV~DA4Dt%Ln@xRQebC@*1z*F3MQ-k(gOZB^W_ORp11S46!mX zLKz3^L~%3qUAhhDb=DXikN z9HOKfpl zlE!4(w)z?W@>{k@+5b0=xP8Acw{_>1{NMi%O5nLtIq>Ta00000NkvXXu0mjfcd)g* literal 0 HcmV?d00001 From 28515ab8335f37bf1f5daaf353660d3bd83858d9 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 5 Jul 2021 16:25:25 -0600 Subject: [PATCH 068/152] lf_report.py : added footer text and link Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_report.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/py-scripts/lf_report.py b/py-scripts/lf_report.py index ee2e2004..a87c8b33 100755 --- a/py-scripts/lf_report.py +++ b/py-scripts/lf_report.py @@ -79,6 +79,7 @@ class lf_report(): self.output_pdf=_output_pdf self.write_output_pdf = "" self.banner_html = "" + self.footer_html = "" self.graph_titles="" self.graph_image="" self.html = "" @@ -369,6 +370,29 @@ class lf_report(): """ self.html += setup_information + def build_footer(self): + self.footer_html = """ + +
+ + + + + + {title} +
+ +
+

Generate by Candela Technologies LANforge network testing tool

+

www.candelatech.com

+

+ + + """ + self.html += self.footer_html + def build_custom(self): self.html += self.custom_html @@ -434,6 +458,7 @@ if __name__ == "__main__": report.build_table() #report.build_all() + report.build_footer() html_file = report.write_html() print("returned file ") From 35f06b96df6c037253a6700c5fc814321fb07afe Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 5 Jul 2021 17:57:12 -0600 Subject: [PATCH 069/152] report.css lf_report.py : updated images for footer Signed-off-by: Chuck SmileyRekiere --- py-scripts/artifacts/report.css | 7 +++++++ py-scripts/lf_report.py | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/py-scripts/artifacts/report.css b/py-scripts/artifacts/report.css index 734a0423..42bbf520 100644 --- a/py-scripts/artifacts/report.css +++ b/py-scripts/artifacts/report.css @@ -188,6 +188,13 @@ li { width: 200px; border: none; } +#BannerLogoFooter { + text-align: right; + padding: 5px; + margin: 5px; + width: 200px; + border: none; +} .TitleFontScreen { margin-left: auto; margin-right: auto; diff --git a/py-scripts/lf_report.py b/py-scripts/lf_report.py index a87c8b33..9827c06b 100755 --- a/py-scripts/lf_report.py +++ b/py-scripts/lf_report.py @@ -25,7 +25,6 @@ LICENSE: INCLUDE_IN_README ''' -import datetime import os import shutil import datetime @@ -92,6 +91,7 @@ class lf_report(): 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 # pass in _date to allow to change after construction @@ -103,6 +103,7 @@ class lf_report(): 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) @@ -132,6 +133,13 @@ class lf_report(): #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)) + shutil.copy(logo_footer_src_file, logo_footer_dst_file) + def move_graph_image(self,): graph_src_file = str(self.graph_image) graph_dst_file = str(self.path_date_time)+'/'+ str(self.graph_image) @@ -385,6 +393,7 @@ class lf_report():
+

Generate by Candela Technologies LANforge network testing tool

www.candelatech.com

From 7bffaf2cee9170e4422a6a03d89516f527ef0446 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 5 Jul 2021 18:02:52 -0600 Subject: [PATCH 070/152] report.css : update to the pixel margin from 5 to 1 Signed-off-by: Chuck SmileyRekiere --- py-scripts/artifacts/report.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/artifacts/report.css b/py-scripts/artifacts/report.css index 42bbf520..420a5265 100644 --- a/py-scripts/artifacts/report.css +++ b/py-scripts/artifacts/report.css @@ -190,8 +190,8 @@ li { } #BannerLogoFooter { text-align: right; - padding: 5px; - margin: 5px; + padding: 1px; + margin: 1px; width: 200px; border: none; } From ee23dff7536e65aa67d876d492db708ee0f767c2 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 5 Jul 2021 18:13:35 -0600 Subject: [PATCH 071/152] lf_report.py : fixed link on html and pdf. Link on image works in html , not pdf (needs fixing). Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_report.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/lf_report.py b/py-scripts/lf_report.py index 9827c06b..5bd239f2 100755 --- a/py-scripts/lf_report.py +++ b/py-scripts/lf_report.py @@ -389,13 +389,13 @@ class lf_report(): - {title} From ddc4697bb9ac38bd05f3181675798b01f0d8fd7b Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 6 Jul 2021 07:55:42 -0600 Subject: [PATCH 072/152] lf_check.py: updated to pass in lf_mgr with json lf_check_config_template.ini removed comment Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 19 ++++++++++++------- py-scripts/tools/lf_check_config_template.ini | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index c5050a17..2391e56b 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -88,8 +88,6 @@ class lf_check(): self.test_suite = _test_suite self.production_run = _production self.report_path = _report_path - self.lf_mgr_ip = "" - self.lf_mgr_port = "" self.radio_dict = {} self.test_dict = {} path_parent = os.path.dirname(os.getcwd()) @@ -133,7 +131,9 @@ class lf_check(): self.host_ip_test = None self.email_title_txt = "" self.email_txt = "" - self.lf_mgr = "" # lanforge tests are run against if passed in + self.lf_mgr = "" + self.lf_mgr_port = "" + # influx database configuration self.influx_json = "" @@ -256,7 +256,7 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path.

""" - + # inprogress def read_influx_json(self): # use influx json config file if self.influx_json == "": @@ -418,7 +418,7 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. else: self.logger.info("email_txt not in test_parameters json") if "lf_mgr" in self.json_data["test_parameters"]: - self.lf_mgr_port = self.json_data["test_parameters"]["lf_mgr"] + self.lf_mgr = self.json_data["test_parameters"]["lf_mgr"] else: self.logger.info("lf_mgr not in test_parameters json") @@ -489,9 +489,9 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. # LF_MGR parameters not used yet if 'LF_MGR' in config_file.sections(): section = config_file['LF_MGR'] - self.lf_mgr_ip = section['LF_MGR_IP'] + self.lf_mgr = section['LF_MGR_IP'] self.lf_mgr_port = section['LF_MGR_PORT'] - self.logger.info("lf_mgr_ip {}".format(self.lf_mgr_ip)) + self.logger.info("lf_mgr {}".format(self.lf_mgr)) self.logger.info("lf_mgr_port {}".format(self.lf_mgr_port)) if 'TEST_PARAMETERS' in config_file.sections(): @@ -615,6 +615,11 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. 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) + if 'LF_MGR' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('LF_MGR',self.lf_mgr) + 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) + if 'RADIO_USED' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('RADIO_USED',self.radio_lf) if 'SSID_USED' in self.test_dict[test]['args']: diff --git a/py-scripts/tools/lf_check_config_template.ini b/py-scripts/tools/lf_check_config_template.ini index 0e4da4d5..52450833 100755 --- a/py-scripts/tools/lf_check_config_template.ini +++ b/py-scripts/tools/lf_check_config_template.ini @@ -54,7 +54,7 @@ RADIO_DICT: { "RADIO_1_CFG":{"KEY":"RADIO_1_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"ct523c-vap","PASSWD":"ct523c-vap","SECURITY":"wpa2"} } -# Not used + [LF_MGR] LF_MGR_IP= localhost LF_MGR_PORT=8080 From 8044fc351a266c01e36add7e14847546746840be Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 6 Jul 2021 13:31:40 -0700 Subject: [PATCH 073/152] Correct link in Ghost post to PDFs Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index dc919ec1..523525f7 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -306,7 +306,7 @@ class GhostRequest: for file in files: if 'pdf' in file: url = 'http://%s/%s/%s/%s/%s' % ( - ghost_host, customer.strip('/'), testbed, test_run, file) + ghost_host, customer.strip('/'), testbed, target_folder, file) pdfs.append('PDF of results: %s
' % (url, file)) scp_push.close() self.upload_images(target_folder) From 883fdc9b3bfca4058165964c3728f3baa3764266 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 6 Jul 2021 14:39:36 -0700 Subject: [PATCH 074/152] Fix table Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index 523525f7..aaefdf94 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -347,7 +347,7 @@ class GhostRequest: text = 'Testbed: %s
' % testbeds[0] dut_table = '' \ - '%s
DUT_HWDUT_SWDUT modelDUT Serial
%s%s%s
' % (dut_hw, dut_sw, dut_model, dut_serial) + '%s%s%s%s' % (dut_hw, dut_sw, dut_model, dut_serial) text = text + dut_table for pdf in pdfs: From 64f243aa10067b09d537105105832c2ed33b9713 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 6 Jul 2021 16:40:16 -0700 Subject: [PATCH 075/152] LFUtils.py: adds client function that can produce more detailed histogram from a Layer 3 DistributionPayload Signed-off-by: Jed Reynolds --- py-json/LANforge/LFUtils.py | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index 464c1e21..7005425e 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -746,4 +746,58 @@ def exec_wrap(cmd): print("\nError with '" + cmd + "', bye\n") exit(1) + +def expand_endp_histogram(distribution_payload=None): + """ + Layer 3 endpoints can contain DistributionPayloads that appear like + "rx-silence-5m" : { + # "histo_category_width" : 1, + # "histogram" : [ + # 221, + # 113, + # 266, + # 615, + # 16309, + # 56853, + # 7954, + # 1894, + # 29246, + # 118, + # 12, + # 2, + # 0, + # 0, + # 0, + # 0 + # ], + # "time window ms" : 300000, + # "window avg" : 210.285, + # "window max" : 228, + # "window min" : 193 + + These histogbrams are a set of linear categorys roughly power-of-two categories. + :param distribution_payload: dictionary requiring histo_category_width and histogram + :return: dictionary containing expanded category ranges and values for categories + """ + if distribution_payload is None: + return None + if ("histogram" not in distribution_payload) \ + or ("histo_category_width" not in distribution_payload): + raise ValueError("Unexpected histogram format.") + multiplier = int(distribution_payload["histo_category_width"]) + formatted_dict = { + #"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 + if bucket_index == 0: + category_name = "00000 <= x <= {:-05.0f}".format(pow2) + else: + category_name = "{:-05.0f} < x <= {:-05.0f}".format(pow1, pow2) + formatted_dict[category_name] = distribution_payload["histogram"][bucket_index] + + pprint.pprint([("historgram", distribution_payload["histogram"]), + ("formatted", formatted_dict)]) + return formatted_dict ### From 0f1c703cb3ff84bf5a5568c28e492e294840812e Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 6 Jul 2021 16:40:58 -0700 Subject: [PATCH 076/152] test_histogram.py example of how to use expand_endp_histogram Signed-off-by: Jed Reynolds --- py-json/test_histogram.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 py-json/test_histogram.py diff --git a/py-json/test_histogram.py b/py-json/test_histogram.py new file mode 100755 index 00000000..b6bf3cd0 --- /dev/null +++ b/py-json/test_histogram.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +""" ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + internal test driving LFUtils.expand_endp_histogram +----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- """ +import LANforge +from LANforge import LFUtils +import pprint + +distrib_load = { + "histo_category_width" : 3, + "histogram" : [ + 221, + 113, + 266, + 615, + 16309, + 56853, + 7954, + 1894, + 29246, + 118, + 12, + 2, + 0, + 0, + 0, + 0 + ], + "time window ms" : 300000, + "window avg" : 210.285, + "window max" : 228, + "window min" : 193 +} + +if __name__ == '__main__': + LFUtils.expand_endp_histogram(distrib_load) + + From 5332c55f3c3742c180a780a9f6d5b3ff045e856d Mon Sep 17 00:00:00 2001 From: jitendracandela Date: Wed, 7 Jul 2021 16:02:44 +0530 Subject: [PATCH 077/152] rx sensitivity test for chamber view added --- py-scripts/lf_rx_sensitivity_config.json | 19 ++ py-scripts/lf_rx_sensitivity_test.py | 387 +++++++++++++++++++++++ 2 files changed, 406 insertions(+) create mode 100644 py-scripts/lf_rx_sensitivity_config.json create mode 100644 py-scripts/lf_rx_sensitivity_test.py diff --git a/py-scripts/lf_rx_sensitivity_config.json b/py-scripts/lf_rx_sensitivity_config.json new file mode 100644 index 00000000..81c370bc --- /dev/null +++ b/py-scripts/lf_rx_sensitivity_config.json @@ -0,0 +1,19 @@ +{ + "mgr":"192.168.0.101", + "port":"8080", + "lf_user":"lanforge", + "lf_password":"lanforge", + "instance_name":"rx-sensitivity-instance", + "config_name":"test_con", + "upstream":"1.1.eth1", + "dut":"asus_5g", + "duration":"15s", + "station":"1.1.eth2", + "download_speed":"85%", + "upload_speed":"0", + "pull_report": true, + "raw_line": ["txo_preamble: VHT", "txo_mcs: 4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT", "spatial_streams: 3", "bandw_options: 80", "txo_sgi: ON", "txo_retries: No Retry", "txo_txpower: 17"] +} + + + diff --git a/py-scripts/lf_rx_sensitivity_test.py b/py-scripts/lf_rx_sensitivity_test.py new file mode 100644 index 00000000..7ca8e212 --- /dev/null +++ b/py-scripts/lf_rx_sensitivity_test.py @@ -0,0 +1,387 @@ +#!/usr/bin/env python3 + +""" +Note: To Run this script gui should be opened with + + path: cd LANforgeGUI_5.4.3 (5.4.3 can be changed with GUI version) + pwd (Output : /home/lanforge/LANforgeGUI_5.4.3) + ./lfclient.bash -cli-socket 3990 + +This script is used to automate running RX Sensitivity tests. You +may need to view a RX Sensitivity test configured through the GUI to understand +the options and how best to input data. + + ./lf_rx_sensitivity_test.py --mgr localhost --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 + +Note: + --raw_line 'line contents' will add any setting to the test config. This is + useful way to support any options not specifically enabled by the + command options. + --set modifications will be applied after the other config has happened, + so it can be used to override any other config. + +Example of raw text config for RX Sensitivity, to show other possible options: + +show_events: 1 +show_log: 0 +port_sorting: 2 +kpi_id: RX Sensitivity +bg: 0xE0ECF8 +test_rig: +show_scan: 1 +auto_helper: 0 +skip_ac: 0 +skip_ax: 0 +skip_2: 0 +skip_5: 0 +skip_5b: 1 +skip_dual: 0 +skip_tri: 1 +selected_dut: ea8300 +duration: 15000 +settle_time: 1000 +sndbuf: 0 +rcvbuf: 0 +traffic_port: 1.1.157 sta01500 +upstream_port: 1.1.1 eth1 +path_loss: 10 +speed: 85% +speed2: 0Kbps +min_rssi_bound: -150 +max_rssi_bound: 0 +channels: AUTO +modes: Auto +pkts: 1024 +spatial_streams: 1 +security_options: AUTO +bandw_options: 20 +traffic_types: TCP +directions: DUT Transmit +txo_preamble: OFDM +txo_mcs: 0 CCK, OFDM, HT, VHT;1 CCK, OFDM, HT, VHT;2 CCK, OFDM, HT, VHT;3 CCK, OFDM, HT, VHT +txo_retries: No Retry +txo_sgi: ON +txo_txpower: 15 +attenuator: 0 +attenuator2: 0 +attenuator_mod: 255 +attenuator_mod2: 255 +attenuations: 0..+50..100 +attenuations2: 0..+50..950 +chamber: 0 +tt_deg: 0..+45..359 +cust_pkt_sz: +show_bar_labels: 1 +show_prcnt_tput: 0 +show_3s: 0 +show_ll_graphs: 0 +show_gp_graphs: 1 +show_1m: 1 +pause_iter: 0 +outer_loop_atten: 0 +show_realtime: 1 +operator: +mconn: 1 +mpkt: 1000 +tos: 0 +loop_iterations: 1 + +""" + +import sys +import os +import argparse +import time +import json +from os import path + +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 cv_test_manager import cv_test +from cv_test_manager import * + + +class RxSensitivityTest(cv_test): + def __init__(self, + lf_host="localhost", + lf_port=8080, + lf_user="lanforge", + lf_password="lanforge", + ssh_port=22, + local_path="", + instance_name="dpt_instance", + config_name="dpt_config", + upstream="1.1.eth2", + pull_report=False, + load_old_cfg=False, + upload_speed="0", + download_speed="85%", + duration="15s", + station="1.1.sta01500", + dut="NA", + enables=[], + disables=[], + raw_lines=[], + raw_lines_file="", + sets=[], + graph_groups=None, + report_dir="" + ): + super().__init__(lfclient_host=lf_host, lfclient_port=lf_port) + + self.lf_host = lf_host + self.lf_port = lf_port + self.lf_user = lf_user + self.lf_password = lf_password + self.instance_name = instance_name + self.config_name = config_name + self.dut = dut + self.duration = duration + self.upstream = upstream + self.station = station + self.pull_report = pull_report + self.load_old_cfg = load_old_cfg + self.test_name = "RX Sensitivity" + self.upload_speed = upload_speed + self.download_speed = download_speed + self.enables = enables + self.disables = disables + self.raw_lines = raw_lines + 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_path = local_path + + def setup(self): + # Nothing to do at this time. + return + + def run(self): + self.sync_cv() + time.sleep(2) + self.sync_cv() + + blob_test = "rxsens-test-latest-" + + self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name + self.show_text_blob(None, None, False) + + # Test related settings + cfg_options = [] + + ### HERE### + self.apply_cfg_options(cfg_options, self.enables, self.disables, self.raw_lines, self.raw_lines_file) + + # cmd line args take precedence and so come last in the cfg array. + if self.upstream != "": + cfg_options.append("upstream_port: " + self.upstream) + if self.station != "": + cfg_options.append("traffic_port: " + self.station) + if self.download_speed != "": + cfg_options.append("speed: " + self.download_speed) + if self.upload_speed != "": + cfg_options.append("speed2: " + self.upload_speed) + if self.duration != "": + cfg_options.append("duration: " + self.duration) + if self.dut != "": + cfg_options.append("selected_dut: " + self.dut) + + # We deleted the scenario earlier, now re-build new one line at a time. + + self.build_cfg(self.config_name, blob_test, cfg_options) + + cv_cmds = [] + 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_path=self.local_path, + graph_groups_file=self.graph_groups) + self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name + + +def main(): + parser = argparse.ArgumentParser(description=""" + + IMPORTANT: Start lanforge with socket 3990 : ./lfclient.bash -cli-socket 3990 + lfclient.bash is located in the LANforgeGUI_X.X.X directory + + On local or remote system: ./lfclient.bash -cli-socket 3990 -s LF_MGR + On local system the -s LF_MGR will be local_host if not provided + + Open this file in an editor and read the top notes for more details. + Example: + ./lf_rx_sensitivity_test.py --mgr localhost --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 + + + Example 2: + ./lf_dataplane_test.py --json .json + + see sample json file: lf_dataplane_config.json + + 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": ["txo_preamble: VHT", "txo_mcs: 4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT", "spatial_streams: 3", "bandw_options: 80", "txo_sgi: ON", "txo_retries: No Retry", "txo_txpower: 17"] + } + + 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": ["txo_preamble: VHT", "txo_mcs: 4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT", "spatial_streams: 3", "bandw_options: 80", "txo_sgi: ON", "txo_retries: No Retry", "txo_txpower: 17"] + } + + """ + ) + + cv_add_base_parser(parser) # see cv_test_manager.py + + parser.add_argument('--json', help="--json json input file", default="") + parser.add_argument("-u", "--upstream", type=str, default="", + help="Upstream port for wifi capacity test ex. 1.1.eth2") + parser.add_argument("--station", type=str, default="", + help="Station to be used in this test, example: 1.1.sta01500") + + 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%%.") + parser.add_argument("--upload_speed", default="", + help="Specify requested upload speed. Percentage of theoretical is also supported. Default: 0") + parser.add_argument("--duration", default="", + 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="") + + args = parser.parse_args() + + # use json config file + if args.json != "": + try: + with open(args.json, 'r') as json_config: + json_data = json.load(json_config) + except: + print("Error reading {}".format(args.json)) + # json configuation takes presidence to command line + # TODO see if there is easier way to search presence, look at parser args + if "mgr" in json_data: + args.mgr = json_data["mgr"] + if "port" in json_data: + args.port = json_data["port"] + if "lf_user" in json_data: + args.lf_user = json_data["lf_user"] + if "lf_password" in json_data: + args.lf_password = json_data["lf_password"] + if "instance_name" in json_data: + args.instance_name = json_data["instance_name"] + if "config_name" in json_data: + args.config_name = json_data["config_name"] + if "upstream" in json_data: + args.upstream = json_data["upstream"] + if "dut" in json_data: + args.dut = json_data["dut"] + if "duration" in json_data: + args.duration = json_data["duration"] + if "station" in json_data: + args.station = json_data["station"] + if "download_speed" in json_data: + args.download_speed = json_data["download_speed"] + if "upload_speed" in json_data: + args.upload_speed = json_data["upload_speed"] + if "pull_report" in json_data: + args.pull_report = json_data["pull_report"] + if "raw_line" in json_data: + # the json_data is a list , need to make into a list of lists, to match command line raw_line paramaters + # https://www.tutorialspoint.com/convert-list-into-list-of-lists-in-python + json_data_tmp = [[x] for x in json_data["raw_line"]] + args.raw_line = json_data_tmp + + cv_base_adjust_parser(args) + + CV_Test = RxSensitivityTest(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, + load_old_cfg=args.load_old_cfg, + download_speed=args.download_speed, + upload_speed=args.upload_speed, + duration=args.duration, + dut=args.dut, + station=args.station, + enables=args.enable, + disables=args.disable, + raw_lines=args.raw_line, + raw_lines_file=args.raw_lines_file, + sets=args.set, + graph_groups=args.graph_groups + ) + CV_Test.setup() + CV_Test.run() + + CV_Test.check_influx_kpi(args) + + +if __name__ == "__main__": + main() From 32a6fc354cb59bac3bc5b7b1020b622016214e86 Mon Sep 17 00:00:00 2001 From: Nikita Yadav Date: Thu, 8 Jul 2021 18:23:42 +0530 Subject: [PATCH 078/152] adding local path, ssh_port and graph groups --- py-scripts/lf_rvr_test.py | 69 +++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/py-scripts/lf_rvr_test.py b/py-scripts/lf_rvr_test.py index 41e7543c..12d2f1f8 100755 --- a/py-scripts/lf_rvr_test.py +++ b/py-scripts/lf_rvr_test.py @@ -10,7 +10,7 @@ Note: To Run this script gui should be opened with This script is used to automate running Rate-vs-Range tests. You may need to view a Rate-vs-Range test configured through the GUI to understand the options and how best to input data. - + ./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 \ @@ -30,7 +30,7 @@ the options and how best to input data. Note: attenuator_mod: selects the attenuator modules, bit-field. This example uses 3, which is first two attenuator modules on Attenuator ID 1040. - + --raw_line 'line contents' will add any setting to the test config. This is useful way to support any options not specifically enabled by the command options. @@ -45,7 +45,7 @@ show_log: 0 port_sorting: 0 kpi_id: Rate vs Range bg: 0xE0ECF8 -test_rig: +test_rig: show_scan: 1 auto_helper: 0 skip_2: 0 @@ -83,7 +83,7 @@ attenuations: 0..+50..950 attenuations2: 0..+50..950 chamber: 0 tt_deg: 0..+45..359 -cust_pkt_sz: +cust_pkt_sz: show_bar_labels: 1 show_prcnt_tput: 0 show_3s: 0 @@ -93,7 +93,7 @@ show_1m: 1 pause_iter: 0 outer_loop_atten: 0 show_realtime: 1 -operator: +operator: mconn: 1 mpkt: 1000 tos: 0 @@ -118,10 +118,14 @@ if 'py-json' not in sys.path: from cv_test_manager import cv_test as cvtest from cv_test_manager import * + class RvrTest(cvtest): def __init__(self, lf_host="localhost", lf_port=8080, + ssh_port=22, + local_path="", + graph_groups=None, lf_user="lanforge", lf_password="lanforge", instance_name="rvr_instance", @@ -145,7 +149,7 @@ class RvrTest(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.dut = dut @@ -162,12 +166,14 @@ class RvrTest(cvtest): self.raw_lines = raw_lines 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 def setup(self): # Nothing to do at this time. return - def run(self): self.sync_cv() time.sleep(2) @@ -206,18 +212,18 @@ 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) + cv_cmds, ssh_port=self.ssh_port, local_path=self.local_path, + graph_groups_file=self.graph_groups) self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name def main(): - parser = argparse.ArgumentParser(""" Open this file in an editor and read the top notes for more details. Example: - + """ ) @@ -236,35 +242,40 @@ def main(): help="Specify requested upload speed. Percentage of theoretical is also supported. Default: 0") parser.add_argument("--duration", default="", 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="") args = parser.parse_args() cv_base_adjust_parser(args) - CV_Test = RvrTest(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, - load_old_cfg = args.load_old_cfg, - download_speed = args.download_speed, - upload_speed = args.upload_speed, - duration = args.duration, - dut = args.dut, - station = args.station, - enables = args.enable, - disables = args.disable, - raw_lines = args.raw_line, - raw_lines_file = args.raw_lines_file, - sets = args.set + CV_Test = RvrTest(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, + load_old_cfg=args.load_old_cfg, + download_speed=args.download_speed, + upload_speed=args.upload_speed, + duration=args.duration, + dut=args.dut, + station=args.station, + enables=args.enable, + disables=args.disable, + raw_lines=args.raw_line, + raw_lines_file=args.raw_lines_file, + sets=args.set, + graph_groups=args.graph_groups ) CV_Test.setup() CV_Test.run() CV_Test.check_influx_kpi(args) + if __name__ == "__main__": main() + From 7e3575b481496790668f38b3230443697668b5b7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 8 Jul 2021 11:45:40 -0700 Subject: [PATCH 079/152] Removing LFClibase from influx2 script Signed-off-by: Matthew Stidham --- py-json/cv_test_manager.py | 4 +--- py-scripts/csv_to_influx.py | 4 +--- py-scripts/test_ip_variable_time.py | 11 ++++++----- py-scripts/test_l3_longevity.py | 4 +--- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index 324c194c..cb764e35 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -400,9 +400,7 @@ class cv_test(Realm): (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. - influxdb = RecordInflux(_lfjson_host="", - _lfjson_port="", - _influx_host=args.influx_host, + influxdb = RecordInflux(_influx_host=args.influx_host, _influx_port=args.influx_port, _influx_org=args.influx_org, _influx_token=args.influx_token, diff --git a/py-scripts/csv_to_influx.py b/py-scripts/csv_to_influx.py index 10ad58ac..8ae2fdb4 100755 --- a/py-scripts/csv_to_influx.py +++ b/py-scripts/csv_to_influx.py @@ -146,9 +146,7 @@ python3 csv_to_influx.py --influx_host localhost --influx_org Candela --influx_t args = parser.parse_args() - influxdb = RecordInflux(_lfjson_host=lfjson_host, - _lfjson_port=lfjson_port, - _influx_host=args.influx_host, + influxdb = RecordInflux(_influx_host=args.influx_host, _influx_port=args.influx_port, _influx_org=args.influx_org, _influx_token=args.influx_token, diff --git a/py-scripts/test_ip_variable_time.py b/py-scripts/test_ip_variable_time.py index 179cf74b..6507dfb5 100755 --- a/py-scripts/test_ip_variable_time.py +++ b/py-scripts/test_ip_variable_time.py @@ -305,6 +305,7 @@ python3 ./test_ip_variable_time.py 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') parser.add_argument('--influx_token', help='Username for your Influx database') parser.add_argument('--influx_bucket', help='Password for your Influx database') parser.add_argument('--influx_org', help='Name of your Influx database') @@ -471,11 +472,11 @@ python3 ./test_ip_variable_time.py if args.influx_org is not None: from influx2 import RecordInflux - grapher = RecordInflux( # _influx_host=manager, - _influx_port=args.influx_port, - _influx_org=args.influx_org, - _influx_token=args.influx_token, - _influx_bucket=args.influx_bucket) + 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' diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index b91ce872..38c2b365 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -1154,9 +1154,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 influx2 import RecordInflux - influxdb = RecordInflux(_lfjson_host=lfjson_host, - _lfjson_port=lfjson_port, - _influx_host=args.influx_host, + influxdb = RecordInflux(_influx_host=args.influx_host, _influx_port=args.influx_port, _influx_org=args.influx_org, _influx_token=args.influx_token, From 87d7e1a8eb6ed55f0ec620d6192e825f04936fb2 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 8 Jul 2021 11:46:17 -0700 Subject: [PATCH 080/152] Grafana and Ghost improvements, fixing table columns,fixing title of ghost articles, and pass/fail kpi Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 79 +++++++++++++++++++++++++++++----- py-dashboard/GrafanaRequest.py | 9 +++- py-scripts/ghost_profile.py | 32 +++++++++++++- py-scripts/influx2.py | 13 +----- 4 files changed, 109 insertions(+), 24 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index aaefdf94..522b664a 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -3,7 +3,7 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Class holds default settings for json requests to Ghost - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -import ast + import os import sys @@ -14,12 +14,13 @@ if sys.version_info[0] != 3: import requests import jwt -from datetime import datetime as date +from datetime import datetime import json import subprocess from scp import SCPClient import paramiko from GrafanaRequest import GrafanaRequest +from influx2 import RecordInflux import time from collections import Counter import shutil @@ -111,7 +112,12 @@ class GhostRequest: _api_token=None, _overwrite='false', debug_=False, - die_on_error_=False): + die_on_error_=False, + influx_host=None, + influx_port=8086, + influx_org=None, + influx_token=None, + influx_bucket=None): self.debug = debug_ self.die_on_error = die_on_error_ self.ghost_json_host = _ghost_json_host @@ -123,6 +129,11 @@ class GhostRequest: self.api_token = _api_token self.images = list() self.pdfs = list() + 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 def encode_token(self): @@ -130,7 +141,7 @@ class GhostRequest: key_id, secret = self.api_token.split(':') # Prepare header and payload - iat = int(date.now().timestamp()) + iat = int(datetime.now().timestamp()) header = {'alg': 'HS256', 'typ': 'JWT', 'kid': key_id} payload = { @@ -228,6 +239,7 @@ class GhostRequest: grafana_port=3000, grafana_datasource='InfluxDB', grafana_bucket=None): + global dut_hw, dut_sw, dut_model, dut_serial text = '' csvreader = CSVReader() if grafana_token is not None: @@ -268,6 +280,8 @@ class GhostRequest: high_priority_list = list() low_priority_list = list() images = list() + times = list() + test_pass_fail = list() for target_folder in target_folders: try: @@ -275,15 +289,23 @@ class GhostRequest: df = csvreader.read_csv(file=target_file, sep='\t') csv_testbed = csvreader.get_column(df, 'test-rig')[0] pass_fail = Counter(csvreader.get_column(df, 'pass/fail')) + test_pass_fail.append(pass_fail) dut_hw = csvreader.get_column(df, 'dut-hw-version')[0] dut_sw = csvreader.get_column(df, 'dut-sw-version')[0] dut_model = csvreader.get_column(df, 'dut-model-num')[0] dut_serial = csvreader.get_column(df, 'dut-serial-num')[0] + times_append = csvreader.get_column(df, 'Date') + for target_time in times_append: + times.append(float(target_time)/1000) if pass_fail['PASS'] + pass_fail['FAIL'] > 0: text = text + 'Tests passed: %s
' % pass_fail['PASS'] text = text + 'Tests failed: %s
' % pass_fail['FAIL'] text = text + 'Percentage of tests passed: %s
' % ( - pass_fail['PASS'] / (pass_fail['PASS'] + pass_fail['FAIL'])) + pass_fail['PASS'] / (pass_fail['PASS'] + pass_fail['FAIL'])) + else: + text = text + 'Tests passed: 0
' \ + 'Tests failed : 0
' \ + 'Percentage of tests passed: Not Applicable
' except: print("Failure") @@ -324,7 +346,13 @@ class GhostRequest: low_priority_list.append(low_priority) - now = date.now() + now = datetime.now() + + print(times) + + end_time = max(times) + start_time = '2021-07-01' + end_time = datetime.utcfromtimestamp(end_time).strftime('%Y-%m-%d %H:%M:%S') high_priority = csvreader.concat(high_priority_list) low_priority = csvreader.concat(low_priority_list) @@ -333,7 +361,7 @@ class GhostRequest: low_priority = csvreader.get_columns(low_priority, ['short-description', 'numeric-score', 'test details']) if title is None: - title = "%s %s %s %s:%s report" % (now.day, now.month, now.year, now.hour, now.minute) + title = now.strftime('%B %d, %Y %I:%M %p report') # create Grafana Dashboard target_files = [] @@ -343,11 +371,42 @@ class GhostRequest: grafana.create_custom_dashboard(target_csvs=target_files, title=title, datasource=grafana_datasource, - bucket=grafana_bucket) + bucket=grafana_bucket, + from_date=start_time, + to_date=end_time, + pass_fail='GhostRequest') + + + test_pass_fail_results = sum((Counter(test) for test in test_pass_fail), Counter()) + if self.influx_token is not None: + influxdb = 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) + short_description = 'Ghost Post Tests passed'#variable name + numeric_score = test_pass_fail_results['PASS'] #value + print(numeric_score) + tags = dict() + tags['testbed'] = csv_testbed + tags['script'] = 'GhostRequest' + tags['Graph-Group'] = 'PASS' + date = now.isoformat() #date + influxdb.post_to_influx(short_description, numeric_score, tags, date) + + short_description = 'Ghost Post Tests failed'#variable name + numeric_score = test_pass_fail_results['FAIL'] #value + print(numeric_score) + tags = dict() + tags['testbed'] = csv_testbed + tags['script'] = 'GhostRequest' + tags['Graph-Group'] = 'FAIL' + date = now.isoformat() #date + influxdb.post_to_influx(short_description, numeric_score, tags, date) text = 'Testbed: %s
' % testbeds[0] - dut_table = '' \ - '
DUT_HWDUT_SWDUT modelDUT Serial
%s%s%s%s
' % (dut_hw, dut_sw, dut_model, dut_serial) + dut_table = '' \ + '
DUT_HWDUT_SWDUT modelDUT SerialTests passedTests failed
%s%s%s%s%s%s
' % (dut_hw, dut_sw, dut_model, dut_serial, test_pass_fail_results['PASS'], test_pass_fail_results['FAIL']) text = text + dut_table for pdf in pdfs: diff --git a/py-dashboard/GrafanaRequest.py b/py-dashboard/GrafanaRequest.py index 5aba9248..b00bfe7e 100644 --- a/py-dashboard/GrafanaRequest.py +++ b/py-dashboard/GrafanaRequest.py @@ -187,7 +187,8 @@ class GrafanaRequest: from_date='now-1y', to_date='now', graph_height=8, - graph__width=12): + graph__width=12, + pass_fail=None): options = string.ascii_lowercase + string.ascii_uppercase + string.digits uid = ''.join(random.choice(options) for i in range(9)) input1 = dict() @@ -221,6 +222,9 @@ class GrafanaRequest: print('Target CSVs: %s' % target_csvs) graph_groups = self.get_graph_groups( target_csvs) # Get the list of graph groups which are in the tests we ran + if pass_fail is not None: + graph_groups[pass_fail] = ['PASS', 'FAIL'] + for scriptname in graph_groups.keys(): for graph_group in graph_groups[scriptname]: panel = dict() @@ -358,7 +362,8 @@ class GrafanaRequest: data['expires'] = 360000 data['external'] = False data['timeout'] = 15 - print(data) + if self.debug: + print(data) return requests.post(grafanajson_url, headers=self.headers, json=data, verify=False).text def list_snapshots(self): diff --git a/py-scripts/ghost_profile.py b/py-scripts/ghost_profile.py index aee274d2..3abe00df 100755 --- a/py-scripts/ghost_profile.py +++ b/py-scripts/ghost_profile.py @@ -48,14 +48,29 @@ class UseGhost(GhostRequest): _debug_on=False, _exit_on_fail=False, _ghost_host="localhost", - _ghost_port=2368, ): + _ghost_port=2368, + influx_host=None, + influx_port=None, + influx_org=None, + influx_token=None, + influx_bucket=None): super().__init__(_ghost_host, str(_ghost_port), _api_token=_ghost_token, + influx_host=influx_host, + influx_port=influx_port, + influx_org=influx_org, + influx_token=influx_token, + influx_bucket=influx_bucket, debug_=_debug_on) self.ghost_host = _ghost_host self.ghost_port = _ghost_port self.ghost_token = _ghost_token + 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 def create_post_from_file(self, title, file, tags, authors): text = open(file).read() @@ -141,12 +156,27 @@ def main(): optional.add_argument('--parent_folder', default=None) optional.add_argument('--datasource', default='InfluxDB') optional.add_argument('--grafana_bucket', default=None) + optional.add_argument('--influx_host') + optional.add_argument('--influx_token', help='Username for your Influx database') + optional.add_argument('--influx_bucket', help='Password for your Influx database') + optional.add_argument('--influx_org', help='Name of your Influx database') + optional.add_argument('--influx_port', help='Port where your influx database is located', default=8086) + optional.add_argument('--influx_tag', action='append', nargs=2, + help='--influx_tag Can add more than one of these.') + optional.add_argument('--influx_mgr', + help='IP address of the server your Influx database is hosted if different from your LANforge Manager', + default=None) optional.add_argument('--debug') args = parser.parse_args() Ghost = UseGhost(_ghost_token=args.ghost_token, _ghost_port=args.ghost_port, _ghost_host=args.ghost_host, + 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, _debug_on=args.debug) if args.create_post is not None: diff --git a/py-scripts/influx2.py b/py-scripts/influx2.py index 0e561945..48ead535 100755 --- a/py-scripts/influx2.py +++ b/py-scripts/influx2.py @@ -21,13 +21,11 @@ import json import influxdb_client from influxdb_client.client.write_api import SYNCHRONOUS import datetime -from LANforge.lfcli_base import LFCliBase +#from LANforge.lfcli_base import LFCliBase import time -class RecordInflux(LFCliBase): +class RecordInflux: def __init__(self, - _lfjson_host="lanforge", - _lfjson_port=8080, _influx_host="localhost", _influx_port=8086, _influx_org=None, @@ -35,9 +33,6 @@ class RecordInflux(LFCliBase): _influx_bucket=None, _debug_on=False, _exit_on_fail=False): - super().__init__(_lfjson_host, _lfjson_port, - _debug=_debug_on, - _exit_on_fail=_exit_on_fail) self.influx_host = _influx_host self.influx_port = _influx_port self.influx_org = _influx_org @@ -49,10 +44,6 @@ class RecordInflux(LFCliBase): org=self.influx_org, debug=_debug_on) self.write_api = self.client.write_api(write_options=SYNCHRONOUS) - #print("org: ", self.influx_org) - #print("token: ", self.influx_token) - #print("bucket: ", self.influx_bucket) - #exit(0) def post_to_influx(self, key, value, tags, time): p = influxdb_client.Point(key) From 12536de98d61a49b23d055ee991eaf4081590c7e Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 8 Jul 2021 12:45:57 -0700 Subject: [PATCH 081/152] Grafana times need to be formatted as timezone in order to work properly. Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index 522b664a..126d956b 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -321,8 +321,9 @@ class GhostRequest: transport.connect(None, user_push, password_push) sftp = paramiko.sftp_client.SFTPClient.from_transport(transport) - print(local_path) - print(target_folder) + if self.debug: + print(local_path) + print(target_folder) scp_push.put(target_folder, local_path, recursive=True) files = sftp.listdir(local_path + '/' + target_folder) for file in files: @@ -348,8 +349,6 @@ class GhostRequest: now = datetime.now() - print(times) - end_time = max(times) start_time = '2021-07-01' end_time = datetime.utcfromtimestamp(end_time).strftime('%Y-%m-%d %H:%M:%S') @@ -367,7 +366,8 @@ class GhostRequest: target_files = [] for folder in target_folders: target_files.append(folder.split('/')[-1] + '/kpi.csv') - print('Target files: %s' % target_files) + if self.debug: + print('Target files: %s' % target_files) grafana.create_custom_dashboard(target_csvs=target_files, title=title, datasource=grafana_datasource, @@ -386,22 +386,20 @@ class GhostRequest: _influx_bucket=self.influx_bucket) short_description = 'Ghost Post Tests passed'#variable name numeric_score = test_pass_fail_results['PASS'] #value - print(numeric_score) tags = dict() tags['testbed'] = csv_testbed tags['script'] = 'GhostRequest' tags['Graph-Group'] = 'PASS' - date = now.isoformat() #date + date = now.astimezone().isoformat() #date influxdb.post_to_influx(short_description, numeric_score, tags, date) short_description = 'Ghost Post Tests failed'#variable name numeric_score = test_pass_fail_results['FAIL'] #value - print(numeric_score) tags = dict() tags['testbed'] = csv_testbed tags['script'] = 'GhostRequest' tags['Graph-Group'] = 'FAIL' - date = now.isoformat() #date + date = now.astimezone().isoformat() #date influxdb.post_to_influx(short_description, numeric_score, tags, date) text = 'Testbed: %s
' % testbeds[0] From 10d51764dc4b710cb29cda8a29546280e4e6bd48 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 8 Jul 2021 13:32:17 -0700 Subject: [PATCH 082/152] Grafana dashboard needs to filter Influx by testbed Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index 126d956b..32f25a57 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -374,7 +374,8 @@ class GhostRequest: bucket=grafana_bucket, from_date=start_time, to_date=end_time, - pass_fail='GhostRequest') + pass_fail='GhostRequest', + testbed=testbeds[0]) test_pass_fail_results = sum((Counter(test) for test in test_pass_fail), Counter()) @@ -387,7 +388,7 @@ class GhostRequest: short_description = 'Ghost Post Tests passed'#variable name numeric_score = test_pass_fail_results['PASS'] #value tags = dict() - tags['testbed'] = csv_testbed + tags['testbed'] = testbeds[0] tags['script'] = 'GhostRequest' tags['Graph-Group'] = 'PASS' date = now.astimezone().isoformat() #date @@ -396,7 +397,7 @@ class GhostRequest: short_description = 'Ghost Post Tests failed'#variable name numeric_score = test_pass_fail_results['FAIL'] #value tags = dict() - tags['testbed'] = csv_testbed + tags['testbed'] = testbeds[0] tags['script'] = 'GhostRequest' tags['Graph-Group'] = 'FAIL' date = now.astimezone().isoformat() #date From b857d695b9c2a99db688ec4698ebe171e886123f Mon Sep 17 00:00:00 2001 From: Erin Grimes Date: Wed, 7 Jul 2021 14:03:31 -0700 Subject: [PATCH 083/152] - test_wanlink.py may now run with optional latency arguments: * as together endpoints: --latency, the value of wanlink delay of both endpoints in ms. * as separate endpoints: --latency_A and/or --latency_B which default to the value of --latency. * the value of --latency is 20 (ms) by default. - Arguments passed from the command line into LANtoWAN are simplified into a single container args. - Several arguments of LANtoWAN are instead initialized as data members. - create_wanlink.py no longer attempts to alter the wanlink after creating it. - create_wanlink.py outputs less to the terminal. Signed-off-by: Erin Grimes --- py-json/create_wanlink.py | 58 ++++++----------- py-scripts/test_wanlink.py | 130 +++++++++++++++---------------------- 2 files changed, 73 insertions(+), 115 deletions(-) diff --git a/py-json/create_wanlink.py b/py-json/create_wanlink.py index e28e7390..2b0e82c2 100755 --- a/py-json/create_wanlink.py +++ b/py-json/create_wanlink.py @@ -1,17 +1,12 @@ #!/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: - +# Updated by: Erin Grimes import sys import urllib - if sys.version_info[0] != 3: print("This script requires Python 3") exit() - import time from time import sleep from urllib import error @@ -25,16 +20,19 @@ j_printer = pprint.PrettyPrinter(indent=2) # typically you're using resource 1 in stand alone realm resource_id = 1 -def main(base_url="http://localhost:8080"): +def main(base_url="http://localhost:8080", args={}): json_post = "" json_response = "" num_wanlinks = -1 + # see if there are old wanlinks to remove lf_r = LFRequest.LFRequest(base_url+"/wl/list") print(lf_r.get_as_json()) + # ports to set as endpoints port_a ="rd0a" port_b ="rd1a" + try: json_response = lf_r.getAsJson() LFUtils.debug_printer.pprint(json_response) @@ -75,7 +73,7 @@ def main(base_url="http://localhost:8080"): 'shelf': 1, 'resource': '1', 'port': port_a, - 'latency': '75', + 'latency': args['latency_A'], 'max_rate': '128000', 'description': 'cookbook-example' }) @@ -89,7 +87,7 @@ def main(base_url="http://localhost:8080"): 'shelf': 1, 'resource': '1', 'port': port_b, - 'latency': '95', + 'latency': args['latency_B'], 'max_rate': '256000', 'description': 'cookbook-example' }) @@ -134,6 +132,7 @@ def main(base_url="http://localhost:8080"): 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', @@ -163,25 +162,7 @@ def main(base_url="http://localhost:8080"): print("Error code "+error.code) continue - print("Wanlink is running, wait one sec...") - sleep(1) - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Now we can alter the delay and speed of the wanlink by - # updating its endpoints see https://www.candelatech.com/lfcli_ug.php#set_wanlink_info - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - print("Updating Wanlink...") - lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_wanlink_info") - lf_r.addPostData({ - 'name': 'wl_eg1-A', - 'speed': 265333, - 'latency': 30, - 'reorder_freq': 3200, # thats 3200/1000000 - 'drop_freq': 2000, # 2000/1000000 - 'dup_freq': 1325, # 1325/1000000 - 'jitter_freq': 25125, # 25125/1000000 - }) - lf_r.jsonPost() - sleep(1) + print("Wanlink is running") # stop wanlink lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state") @@ -214,20 +195,19 @@ def main(base_url="http://localhost:8080"): 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) + # 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-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) + # 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() - diff --git a/py-scripts/test_wanlink.py b/py-scripts/test_wanlink.py index dbd2c62d..ea359021 100755 --- a/py-scripts/test_wanlink.py +++ b/py-scripts/test_wanlink.py @@ -1,14 +1,13 @@ #!/usr/bin/env python3 - +# Create and modify WAN Links from the command line. +# 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) - if 'py-json' not in sys.path: sys.path.append('../py-json') - import argparse from LANforge.lfcli_base import LFCliBase from LANforge.LFUtils import * @@ -17,50 +16,33 @@ import time import create_wanlink class LANtoWAN(Realm): - def __init__(self, host, port, ssid, security, password, - lan_port="eth2", - wan_port="eth3", - prefix='sta', - number_template="00000", - radio="wiphy0", - sta_list = [], - side_a_min_rate=56, side_a_max_rate=0, - side_b_min_rate=56, side_b_max_rate=0, - upstream = None, - _debug_on=False, - _exit_on_error=False, - _exit_on_fail=False): - super().__init__(host, port) - self.upstream = upstream - self.host = host - self.port = port - self.ssid = ssid - self.radio = radio - self.sta_list = sta_list - self.security = security - self.password = password - self.timeout = 120 - self.lan_port = lan_port - self.wan_port = wan_port - self.prefix = prefix - self.number_template = number_template - self.station_profile = self.new_station_profile() - self.cx_profile = self.new_l3_cx_profile() + def __init__(self, args): + super().__init__(args['host'], args['port']) + self.args = args + self.lan_port="eth2" + self.wan_port="eth3" + self.prefix='sta' + self.number_template="00000" + self.radio="wiphy0" + self.sta_list = [] + self.side_a_min_rate=0 + self.side_a_max_rate=56 + self.side_b_min_rate=0 + self.side_b_max_rate=56 + self._debug_on=False + self._exit_on_error=False + self._exit_on_fail=False - - 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 - - def create_wanlinks(self, shelf=1, resource=1, latency=20, max_rate=1544000): + def create_wanlinks(self, shelf=1, resource=1, max_rate=1544000): print("Creating wanlinks") + # print("the latency is {laten}\n".format(laten=self.latency)) + # create redirects for wanlink url = "/cli-json/add_rdd" data = { "shelf": shelf, "resource": resource, - "port": "rd0a", + "port": "rd0a", "peer_ifname": "rd1a" } self.json_post(url, data) @@ -69,7 +51,7 @@ class LANtoWAN(Realm): data = { "shelf": shelf, "resource": resource, - "port": "rd1a", + "port": "rd1a", "peer_ifname": "rd0a" } self.json_post(url, data) @@ -78,35 +60,29 @@ class LANtoWAN(Realm): # create wanlink endpoints url = "/cli-json/add_wl_endp" data = { - "alias": "wlan0", + "alias": "wlan1", "shelf": shelf, "resource": resource, "port": "rd0a", - "latency": latency, + "latency": self.args['latency_A'], "max_rate": max_rate } self.json_post(url, data) url = "/cli-json/add_wl_endp" data = { - "alias": "wlan1", + "alias": "wlan2", "shelf": shelf, "resource": resource, "port": "rd1a", - "latency": latency, + "latency": self.args['latency_B'], "max_rate": max_rate } self.json_post(url, data) - create_wanlink.main(base_url='http://'+self.host+':8080') - time.sleep(.05) - - def run(self): - #self.cx_profile.use_wpa2(True, self.ssid, self.password) - self.station_profile.create(radio="wiphy0", num_stations=3, debug=False) - + create_wanlink.main('http://'+self.args['host']+':8080', self.args) + def cleanup(self): pass - def main(): parser = LFCliBase.create_basic_argparse( prog='test_wanlink.py', @@ -115,7 +91,6 @@ def main(): if group.title == "required arguments": required_args=group break - #if required_args is not None: optional_args=None for group in parser._action_groups: @@ -123,28 +98,31 @@ def main(): optional_args=group break if optional_args is not None: - optional_args.add_argument('--lanport', help='Select the port you want for lanport', default='wiphy0') - optional_args.add_argument('--wanport', help='Select the port you want for wanport', default='wiphy1') - for group in parser._action_groups: - if group.title == "optional arguments": - optional_args=group - break - #if optional_args is not None: - args = parser.parse_args() - num_sta=4 - station_list = portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, - radio=args.radio) - ltw=LANtoWAN(host=args.mgr, - port=args.mgr_port, - ssid=args.ssid, - sta_list=station_list, - security=args.security, - password=args.passwd, - lan_port=args.lanport, - wan_port=args.wanport) + # optional_args.add_argument('--lanport', help='Select the port you want for lanport', default='wiphy0') + # optional_args.add_argument('--wanport', help='Select the port you want for wanport', default='wiphy1' + 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) + # todo: bandwidth + # todo: packet loss + 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, + "ssid": parseargs.ssid, + "security": parseargs.security, + "password": parseargs.passwd, + "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) + } + ltw=LANtoWAN(args) ltw.create_wanlinks() - #ltw.run() ltw.cleanup() if __name__ == "__main__": - main() \ No newline at end of file + main() From 2f8c033ce8431677908385436f17adeaeb4ce984 Mon Sep 17 00:00:00 2001 From: Erin Grimes Date: Thu, 8 Jul 2021 14:43:18 -0700 Subject: [PATCH 084/152] - test_wanlink.py may now run with optional transfer-rate arguments: * as together endpoints: --rate, the value of wanlink transfer rate of both endpoints in bits/sec. * as separate endpoints: --rate_A and/or --rate_B which default to the value of --rate. * the default value of --rate is 1000000 (1Gbps) Signed-off-by: Erin Grimes --- py-json/create_wanlink.py | 26 ++++++++++++-------------- py-scripts/test_wanlink.py | 32 +++++++++++++++++++------------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/py-json/create_wanlink.py b/py-json/create_wanlink.py index 2b0e82c2..fe9839df 100755 --- a/py-json/create_wanlink.py +++ b/py-json/create_wanlink.py @@ -17,7 +17,7 @@ from LANforge import LFUtils from LANforge.LFUtils import NA j_printer = pprint.PrettyPrinter(indent=2) -# typically you're using resource 1 in stand alone realm +# todo: this needs to change resource_id = 1 def main(base_url="http://localhost:8080", args={}): @@ -69,13 +69,12 @@ def main(base_url="http://localhost:8080", args={}): # create wanlink 1a lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_wl_endp") lf_r.addPostData({ - 'alias': 'wl_eg1-A', - 'shelf': 1, - 'resource': '1', - 'port': port_a, - 'latency': args['latency_A'], - 'max_rate': '128000', - 'description': 'cookbook-example' + 'alias': 'wl_eg1-A', + 'shelf': 1, + 'resource': '1', + 'port': port_a, + 'latency': args['latency_A'], + 'max_rate': args['rate_A'] }) lf_r.jsonPost() sleep(0.05) @@ -83,13 +82,12 @@ def main(base_url="http://localhost:8080", args={}): # create wanlink 1b lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_wl_endp") lf_r.addPostData({ - 'alias': 'wl_eg1-B', - 'shelf': 1, - 'resource': '1', - 'port': port_b, + 'alias': 'wl_eg1-B', + 'shelf': 1, + 'resource': '1', + 'port': port_b, 'latency': args['latency_B'], - 'max_rate': '256000', - 'description': 'cookbook-example' + 'max_rate': args['rate_B'] }) lf_r.jsonPost() sleep(0.05) diff --git a/py-scripts/test_wanlink.py b/py-scripts/test_wanlink.py index ea359021..17cc9cfd 100755 --- a/py-scripts/test_wanlink.py +++ b/py-scripts/test_wanlink.py @@ -21,14 +21,14 @@ class LANtoWAN(Realm): self.args = args self.lan_port="eth2" self.wan_port="eth3" - self.prefix='sta' - self.number_template="00000" + # self.prefix='sta' + # self.number_template="00000" self.radio="wiphy0" - self.sta_list = [] - self.side_a_min_rate=0 - self.side_a_max_rate=56 - self.side_b_min_rate=0 - self.side_b_max_rate=56 + # self.sta_list = [] + # self.side_a_min_rate=0 + # self.side_a_max_rate=56 + # self.side_b_min_rate=0 + # self.side_b_max_rate=56 self._debug_on=False self._exit_on_error=False self._exit_on_fail=False @@ -65,7 +65,7 @@ class LANtoWAN(Realm): "resource": resource, "port": "rd0a", "latency": self.args['latency_A'], - "max_rate": max_rate + "max_rate": self.args['rate_A'] } self.json_post(url, data) @@ -76,7 +76,7 @@ class LANtoWAN(Realm): "resource": resource, "port": "rd1a", "latency": self.args['latency_B'], - "max_rate": max_rate + "max_rate": self.args['rate_B'] } self.json_post(url, data) create_wanlink.main('http://'+self.args['host']+':8080', self.args) @@ -100,11 +100,14 @@ def main(): if optional_args is not None: # optional_args.add_argument('--lanport', help='Select the port you want for lanport', default='wiphy0') # optional_args.add_argument('--wanport', help='Select the port you want for wanport', default='wiphy1' + 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) - # todo: bandwidth - # todo: packet loss + optional_args.add_argument('--latency_B', help='The delay 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 @@ -118,7 +121,10 @@ def main(): "password": parseargs.passwd, "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) + "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) } ltw=LANtoWAN(args) ltw.create_wanlinks() From 97dff76e8b77d17d47e53fc0750259d442cbd6d9 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 8 Jul 2021 15:08:04 -0700 Subject: [PATCH 085/152] ghost column name improvement Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index 32f25a57..3e8f6e85 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -62,12 +62,20 @@ class CSVReader: def to_html(self, df): html = '' - html = html + ('') - for row in df[1:]: + html = html + ('
' + '' + '' + '' + '' + '' + '' + '') + for row in df: for item in row: html = html + ('' % item) html = html + ('\n') - html = html + ('
%s
') + html = html + ('' + '') return html def filter_df(self, df, column, expression, target): @@ -341,6 +349,8 @@ class GhostRequest: results = csvreader.get_columns(df, ['short-description', 'numeric-score', 'test details', 'test-priority']) + results[0] = ['Short Description', 'Score', 'Test Details', 'test-priority'] + low_priority = csvreader.filter_df(results, 'test-priority', 'less than', 94) high_priority = csvreader.filter_df(results, 'test-priority', 'greater than or equal to', 95) high_priority_list.append(high_priority) @@ -356,8 +366,8 @@ class GhostRequest: high_priority = csvreader.concat(high_priority_list) low_priority = csvreader.concat(low_priority_list) - high_priority = csvreader.get_columns(high_priority, ['short-description', 'numeric-score', 'test details']) - low_priority = csvreader.get_columns(low_priority, ['short-description', 'numeric-score', 'test details']) + high_priority = csvreader.get_columns(high_priority, ['Short Description', 'Score', 'Test Details']) + low_priority = csvreader.get_columns(low_priority, ['Short Description', 'Score', 'Test Details']) if title is None: title = now.strftime('%B %d, %Y %I:%M %p report') From 588c66f7c45f4488e5a2300a10f8796d3743b7b7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 8 Jul 2021 17:20:43 -0700 Subject: [PATCH 086/152] Mostly Ghost table fixes Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 45 ++++++++++++++++++++-------------- py-dashboard/GrafanaRequest.py | 4 +++ 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index 3e8f6e85..a0579afb 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -255,7 +255,8 @@ class GhostRequest: grafana_host, grafanajson_port=grafana_port ) - print('Folders: %s' % folders) + if self.debug: + print('Folders: %s' % folders) ssh_push = paramiko.SSHClient() ssh_push.set_missing_host_key_policy(paramiko.client.AutoAddPolicy) @@ -280,7 +281,8 @@ class GhostRequest: print('Target folders: %s' % target_folders) else: for folder in folders: - print(folder) + if self.debug: + print(folder) target_folders.append(folder) testbeds = list() @@ -304,12 +306,12 @@ class GhostRequest: dut_serial = csvreader.get_column(df, 'dut-serial-num')[0] times_append = csvreader.get_column(df, 'Date') for target_time in times_append: - times.append(float(target_time)/1000) + times.append(float(target_time) / 1000) if pass_fail['PASS'] + pass_fail['FAIL'] > 0: text = text + 'Tests passed: %s
' % pass_fail['PASS'] text = text + 'Tests failed: %s
' % pass_fail['FAIL'] text = text + 'Percentage of tests passed: %s
' % ( - pass_fail['PASS'] / (pass_fail['PASS'] + pass_fail['FAIL'])) + pass_fail['PASS'] / (pass_fail['PASS'] + pass_fail['FAIL'])) else: text = text + 'Tests passed: 0
' \ 'Tests failed : 0
' \ @@ -347,9 +349,10 @@ class GhostRequest: images.append('' % image) self.images = [] - results = csvreader.get_columns(df, ['short-description', 'numeric-score', 'test details', 'test-priority']) + results = csvreader.get_columns(df, ['short-description', 'numeric-score', 'test details', 'pass/fail', + 'test-priority']) - results[0] = ['Short Description', 'Score', 'Test Details', 'test-priority'] + results[0] = ['Short Description', 'Score', 'Test Details', 'Pass or Fail', 'test-priority'] low_priority = csvreader.filter_df(results, 'test-priority', 'less than', 94) high_priority = csvreader.filter_df(results, 'test-priority', 'greater than or equal to', 95) @@ -359,6 +362,8 @@ class GhostRequest: now = datetime.now() + test_pass_fail_results = sum((Counter(test) for test in test_pass_fail), Counter()) + end_time = max(times) start_time = '2021-07-01' end_time = datetime.utcfromtimestamp(end_time).strftime('%Y-%m-%d %H:%M:%S') @@ -366,8 +371,12 @@ class GhostRequest: high_priority = csvreader.concat(high_priority_list) low_priority = csvreader.concat(low_priority_list) - high_priority = csvreader.get_columns(high_priority, ['Short Description', 'Score', 'Test Details']) - low_priority = csvreader.get_columns(low_priority, ['Short Description', 'Score', 'Test Details']) + high_priority = csvreader.get_columns(high_priority, + ['Short Description', 'Score', 'Test Details']) + low_priority = csvreader.get_columns(low_priority, + ['Short Description', 'Score', 'Test Details']) + high_priority.append(['Total Passed', test_pass_fail_results['PASS'], 'Total subtests passed during this run']) + high_priority.append(['Total Failed', test_pass_fail_results['FAIL'], 'Total subtests failed during this run']) if title is None: title = now.strftime('%B %d, %Y %I:%M %p report') @@ -387,35 +396,36 @@ class GhostRequest: pass_fail='GhostRequest', testbed=testbeds[0]) - - test_pass_fail_results = sum((Counter(test) for test in test_pass_fail), Counter()) if self.influx_token is not None: influxdb = 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) - short_description = 'Ghost Post Tests passed'#variable name - numeric_score = test_pass_fail_results['PASS'] #value + short_description = 'Ghost Post Tests passed' # variable name + numeric_score = test_pass_fail_results['PASS'] # value tags = dict() + print(datetime.utcfromtimestamp(max(times))) tags['testbed'] = testbeds[0] tags['script'] = 'GhostRequest' tags['Graph-Group'] = 'PASS' - date = now.astimezone().isoformat() #date + date = datetime.utcfromtimestamp(max(times)).isoformat() influxdb.post_to_influx(short_description, numeric_score, tags, date) - short_description = 'Ghost Post Tests failed'#variable name - numeric_score = test_pass_fail_results['FAIL'] #value + short_description = 'Ghost Post Tests failed' # variable name + numeric_score = test_pass_fail_results['FAIL'] # value tags = dict() tags['testbed'] = testbeds[0] tags['script'] = 'GhostRequest' tags['Graph-Group'] = 'FAIL' - date = now.astimezone().isoformat() #date + date = datetime.utcfromtimestamp(max(times)).isoformat() influxdb.post_to_influx(short_description, numeric_score, tags, date) text = 'Testbed: %s
' % testbeds[0] dut_table = '' \ - '
DUT_HWDUT_SWDUT modelDUT SerialTests passedTests failed
%s%s%s%s%s%s
' % (dut_hw, dut_sw, dut_model, dut_serial, test_pass_fail_results['PASS'], test_pass_fail_results['FAIL']) + '%s%s%s%s%s%s' % ( + dut_hw, dut_sw, dut_model, dut_serial, test_pass_fail_results['PASS'], + test_pass_fail_results['FAIL']) text = text + dut_table for pdf in pdfs: @@ -442,4 +452,3 @@ class GhostRequest: text=text, tags='custom', authors=authors) - diff --git a/py-dashboard/GrafanaRequest.py b/py-dashboard/GrafanaRequest.py index b00bfe7e..a831904f 100644 --- a/py-dashboard/GrafanaRequest.py +++ b/py-dashboard/GrafanaRequest.py @@ -320,6 +320,10 @@ class GrafanaRequest: panel['title'] = scriptname + ' ' + graph_group else: panel['title'] = scriptname + if 'PASS' in panel['title']: + panel['title'] = 'Total Passed' + if 'FAIL' in panel['title']: + panel['title'] = 'Total Failed' panel['transformations'] = list() panel['transformations'].append(transformation) panel['type'] = "graph" From 1d639b22fa7912ed04f174cbf395563f0fd60b91 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Thu, 8 Jul 2021 17:38:21 -0700 Subject: [PATCH 087/152] Nicer table at the top of the report, including support for multiple devices Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index a0579afb..58ceefa4 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -292,6 +292,7 @@ class GhostRequest: images = list() times = list() test_pass_fail = list() + devices = dict() for target_folder in target_folders: try: @@ -304,6 +305,7 @@ class GhostRequest: dut_sw = csvreader.get_column(df, 'dut-sw-version')[0] dut_model = csvreader.get_column(df, 'dut-model-num')[0] dut_serial = csvreader.get_column(df, 'dut-serial-num')[0] + devices[csv_testbed] = [dut_hw, dut_sw, dut_model, dut_serial] times_append = csvreader.get_column(df, 'Date') for target_time in times_append: times.append(float(target_time) / 1000) @@ -422,9 +424,23 @@ class GhostRequest: influxdb.post_to_influx(short_description, numeric_score, tags, date) text = 'Testbed: %s
' % testbeds[0] - dut_table = '' \ - '
DUT_HWDUT_SWDUT modelDUT SerialTests passedTests failed
%s%s%s%s%s%s
' % ( - dut_hw, dut_sw, dut_model, dut_serial, test_pass_fail_results['PASS'], + dut_table = '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' + for device, data in devices.items(): + dut_table = dut_table + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '
DeviceDUT_HWDUT_SWDUT modelDUT SerialTests passedTests failed
%s%s%s%s%s%s%s
' % ( + device, data[0], data[1], data[2], data[3], test_pass_fail_results['PASS'], test_pass_fail_results['FAIL']) text = text + dut_table From 8fe74f69bcb9eca852a98a631713cb3ddbcafb60 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 05:28:46 -0600 Subject: [PATCH 088/152] ct_us_001.json , ct_us_002.json , ct_us_003.json :testbed test suites, avoid copy paste errors. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 67 ++++++++++++++++++++++++++++++ py-scripts/tools/ct_us_002.json | 62 ++++++++++++++++++++++++++++ py-scripts/tools/ct_us_003.json | 72 +++++++++++++++++++++++++++++++++ 3 files changed, 201 insertions(+) create mode 100644 py-scripts/tools/ct_us_001.json create mode 100644 py-scripts/tools/ct_us_002.json create mode 100644 py-scripts/tools/ct_us_003.json diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json new file mode 100644 index 00000000..11b98447 --- /dev/null +++ b/py-scripts/tools/ct_us_001.json @@ -0,0 +1,67 @@ +{ + "test_parameters":{ + "test_timeout": 200, + "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,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,jreynolds@candelatech.com", + "host_ip_production": "192.168.100.201", + "email_list_test": "chuck.rekiere@candelatech.com,logan.lipke@candelatech.com", + "host_ip_test": "192.168.100.201", + "lf_mgr": "192.168.100.116", + "email_title_txt": "Lanforge QA Testing CT-US-001", + "email_txt": "Lanforge QA Testing CT-US-001 " + }, + "test_network":{ + "http_test_ip": "10.40.0.10", + "ftp_test_ip": "10.40.0.10", + "test_ip": "192.168.0.104" + }, + "test_generic":{ + "radio_used": "wiphy1", + "ssid_used": "asus11ax-5", + "ssid_pw_used": "hello123", + "security_used": "wpa2", + "num_sta": 4, + "col_names": "name,tx_byptes,rx_bytes,dropped", + "upstream_port": "eth2" + }, + "radio_dict":{ + "RADIO_0_CFG":{"KEY":"RADIO_0_CFG","RADIO":"wiphy0","STATIONS":"4","SSID":"asus11ax-5","PASSWD":"hello123","SECURITY":"wpa2"}, + "RADIO_1_CFG":{"KEY":"RADIO_1_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"asus11ax-5","PASSWD":"hello123","SECURITY":"wpa2"} + }, + "test_suites":{ + "suite_one":{ + "create_l3":{"enabled":"TRUE","command":"create_l4.py","args":"--radio RADIO_USED --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"}, + "create_l4":{"enabled":"TRUE","command":"create_l4.py","args":"RADIO_1_CFG --debug"}, + "create_l4_2":{"enabled":"TRUE","command":"create_l4.py","args":"--radio wiphy1 --ssid ct523c-vap --passwd ct523c-vap --security wpa2 --debug"} + }, + "suite_two":{ + "test_l3_longevity":{"enabled":"TRUE","load_db":"skip","command":"test_l3_longevity.py","args":"--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"} + }, + "suite_wc_dp_ig_dut":{ + "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid asus11ax-5 --security wpa2 --paswd hello123 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --raw_line 'dut-model-num: ASUS RT-AX88U'"}, + "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors LANForge --grafana_host 192.168.100.201 --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --parent_folder REPORT_PATH --user_push lanforge --password_push lanforge --customer candela --grafana_bucket lanforge_qa_testing --kpi_to_ghost"} + }, + "suite_wc_dp":{ + "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, + "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, + "CT-US-001_wifi_capacity_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan3 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, + "CT-US-001_dataplane_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.wlan3 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} + }, + "suite_wc_dp_old":{ + "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid asus11ax-5 --security wpa2 --paswd hello123 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "CT-US-001_wifi_capacity_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.sta2000 --create_stations --radio wiphy2 --ssid asus11ax-5 --security wpa2 --paswd hello123 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "CT-US-001_dataplane_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.sta2000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} + } + } +} + + + + \ No newline at end of file diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json new file mode 100644 index 00000000..2fe9e871 --- /dev/null +++ b/py-scripts/tools/ct_us_002.json @@ -0,0 +1,62 @@ +{ + "test_parameters":{ + "test_timeout": 200, + "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,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,jreynolds@candelatech.com", + "host_ip_production": "192.168.100.201", + "email_list_test": "chuck.rekiere@candelatech.com,logan.lipke@candelatech.com", + "host_ip_test": "192.168.100.201", + "lf_mgr": "192.168.100.200", + "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" + }, + "test_generic":{ + "radio_used": "wiphy1", + "ssid_used": "ruckus-r750-5g", + "ssid_pw_used": "hello123", + "security_used": "wpa2", + "num_sta": 4, + "col_names": "name,tx_byptes,rx_bytes,dropped", + "upstream_port": "eth2" + }, + "radio_dict":{ + "RADIO_0_CFG":{"KEY":"RADIO_0_CFG","RADIO":"wiphy0","STATIONS":"4","SSID":"ruckus-r750-5g","PASSWD":"hello123","SECURITY":"wpa2"}, + "RADIO_1_CFG":{"KEY":"RADIO_1_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"ruckus-r750-5g","PASSWD":"hello123","SECURITY":"wpa2"} + }, + "test_suites":{ + "suite_two":{ + "test_l3_longevity":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"--test_duration 15s --polling_interval 5s --upstream_port eth2 --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"} + }, + "suite_wc_dp_no_influx":{ + "wifi_capacity_0":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002"}, + "dataplane_0":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus-r750-5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH"} + }, + "suite_wc_dp":{ + "CT-US-002_wifi_capacity_ATH10k(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "CT-US-002_wifi_capacity_AX200 CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta4000 --create_stations --radio wiphy4 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "CT-US-002_dataplane_AX200":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta4000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 2' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "} + }, + "suite_wc_dp_old":{ + "CT-US-002_wifi_capacity_ATH10k(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "CT-US-002_wifi_capacity_AX200 CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta4000 --create_stations --radio wiphy4 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "CT-US-002_dataplane_AX200":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta4000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 2' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors LANForge --grafana_host 192.168.100.201 --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --parent_folder REPORT_PATH --user_push lanforge --password_push lanforge --customer candela --grafana_bucket lanforge_qa_testing --kpi_to_ghost"} + } + + } +} + + + + \ No newline at end of file diff --git a/py-scripts/tools/ct_us_003.json b/py-scripts/tools/ct_us_003.json new file mode 100644 index 00000000..0aa25421 --- /dev/null +++ b/py-scripts/tools/ct_us_003.json @@ -0,0 +1,72 @@ +{ + "test_parameters":{ + "test_timeout": 200, + "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,logan.lipke@candelatech.com,chuck.rekiere@candelatech.com,", + "host_ip_production": "192.168.95.6", + "email_list_test": "chuck.rekiere@candelatech.com,chuck.rekiere@gmail.com", + "host_ip_test": "192.168.95.6", + "lf_mgr": "192.168.100.116", + "email_title_txt": "Lanforge QA Testing CT-US-001", + "email_txt": "Lanforge QA Testing CT-US-001 " + }, + "test_network":{ + "http_test_ip": "10.40.0.10", + "ftp_test_ip": "10.40.0.10", + "test_ip": "192.168.0.104" + }, + "test_generic":{ + "radio_used": "wiphy1", + "ssid_used": "asus11ax-5", + "ssid_pw_used": "hello123", + "security_used": "wpa2", + "num_sta": 4, + "col_names": "name,tx_byptes,rx_bytes,dropped", + "upstream_port": "eth1" + }, + "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"} + }, + "test_suites":{ + "suite_one":{ + "create_l3":{"enabled":"TRUE","command":"create_l4.py","args":"--radio RADIO_USED --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"}, + "create_l4":{"enabled":"TRUE","command":"create_l4.py","args":"RADIO_1_CFG --debug"}, + "create_l4_2":{"enabled":"TRUE","command":"create_l4.py","args":"--radio wiphy1 --ssid ct523c-vap --passwd ct523c-vap --security wpa2 --debug"} + }, + "suite_two":{ + "test_l3_longevity":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"--test_duration 15s --polling_interval 5s --upstream_port eth1 --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"} + }, + "suite_dp_short":{ + "dataplane_0":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} + }, + "suite_dp_cmd":{ + "dataplane_0":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} + }, + "suite_dp_long":{ + "dataplane_00":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "dataplane_01":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "dataplane_02":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "dataplane_03":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "dataplane_04":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "dataplane_05":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "dataplane_06":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "dataplane_07":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "dataplane_08":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "dataplane_09":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, + "dataplane_10":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth2 --dut asus_5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} + }, + "TEST_DICTIONARY":{ + "dataplane_0":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"}, + "dataplane_1":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"}, + "dataplane_2":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"} + } + } +} + + + + \ No newline at end of file From b1392fc9c84ee4f0a00aef27d7448451afadd52c Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 06:33:37 -0600 Subject: [PATCH 089/152] lf_check_96_6.json : sample json for test configuration Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check_95_6.json | 89 +++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 py-scripts/tools/lf_check_95_6.json diff --git a/py-scripts/tools/lf_check_95_6.json b/py-scripts/tools/lf_check_95_6.json new file mode 100644 index 00000000..261a19c0 --- /dev/null +++ b/py-scripts/tools/lf_check_95_6.json @@ -0,0 +1,89 @@ +{ + "test_parameters":{ + "test_timeout": 200, + "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,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,jreynolds@candelatech.com", + "host_ip_production": "192.168.95.6", + "email_list_test": "chuck.rekiere@candelatech.com,logan.lipke@candelatech.com", + "host_ip_test": "192.168.95.6", + "lf_mgr": "192.168.100.116", + "email_title_txt": "Lanforge QA Testing CT-US-001 - Scripts", + "email_txt": "Lanforge QA Testing CT-US-001 - Scripts" + }, + "test_network":{ + "http_test_ip": "10.40.0.10", + "ftp_test_ip": "10.40.0.10", + "test_ip": "192.168.0.104" + }, + "test_generic":{ + "radio_used": "wiphy1", + "ssid_used": "asus11ax-5", + "ssid_pw_used": "hello123", + "security_used": "wpa2", + "num_sta": 4, + "col_names": "name,tx_byptes,rx_bytes,dropped", + "upstream_port": "eth1" + }, + "radio_dict":{ + "RADIO_0_CFG":{"KEY":"RADIO_0_CFG","RADIO":"wiphy0","STATIONS":"4","SSID":"asus11ax-5","PASSWD":"hello123","SECURITY":"wpa2"}, + "RADIO_1_CFG":{"KEY":"RADIO_1_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"asus11ax-5","PASSWD":"hello123","SECURITY":"wpa2"} + }, + "test_suites":{ + "suite_short":{ + "create_l3":{"enabled":"TRUE","command":"create_l4.py","args":"--radio RADIO_USED --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"}, + "test_l3_longevity":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"--test_duration 15s --polling_interval 5s --upstream_port eth1 --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"} + }, + "suite_l3":{ + "test_l3_longevity":{"enabled":"TRUE","load_db":"NONE","command":"test_l3_longevity.py","args":"--test_duration 15s --polling_interval 5s --upstream_port eth1 --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"} + }, + "suite_daily":{ + "test_l3_longevity":{"enabled":"TRUE","load_db":"NONE","command":"test_l3_longevity.py","args":"--test_duration 15s --polling_interval 5s --upstream_port eth1 --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":"--num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"}, + "example_security_connection1":{"enabled":"TRUE","command":"example_security_connection.py","args":"--num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"}, + "example_security_connection2":{"enabled":"TRUE","command":"example_security_connection.py","args":"--num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"}, + "example_security_connection3":{"enabled":"TRUE","command":"example_security_connection.py","args":"--num_stations 4 --ssid asus11ax-5 --passwd hello123 --radio wiphy1 --security wpa2 --debug"}, + "sta_connect2":{"enabled":"TRUE","command":"sta_connect2.py","args":"--dut_ssid asus11ax-5 --dut_passwd hello123 --dut_security wpa2"}, + "sta_connect_example":{"enabled":"FALSE","command":"sta_connect_example.py","args":""}, + "test_fileio":{"enabled":"TRUE","command":"test_fileio.py","args":"--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":"--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":"--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":"--radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --num_stations 4 --type iperf3 --debug"}, + "test_generic3":{"enabled":"FALSE","command":"test_generic.py","args":"--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":"--group_name group1 --add_group --list_groups --debug"}, + "testgroup5":{"enabled":"FALSE","command":"testgroup.py","args":"--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":"--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":"--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":"--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":"--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":"--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":"--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":"--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":"--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":"--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":"--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":"--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":"--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":"--test_duration 15s --polling_interval 5s --upstream_port eth1 --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":"TRUE","command":"test_l3_powersave_traffic.py","args":"--radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"}, + "test_status_msg":{"enabled":"TRUE","command":"test_status_msg.py","args":"--action run_test"}, + "test_wanlink":{"enabled":"TRUE","command":"test_wanlink.py","args":"--debug"}, + "create_bridge":{"enabled":"TRUE","command":"create_bridge.py","args":"--radio wiphy1 --upstream_port eth1 --target_device sta0000 --debug"}, + "create_l3":{"enabled":"TRUE","command":"create_l3.py","args":"--radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"}, + "create_l4":{"enabled":"TRUE","command":"create_l4.py","args":"--radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"}, + "create_macvlan":{"enabled":"TRUE","command":"create_macvlan.py","args":"--radio wiphy1 --macvlan_parent eth1 --debug"}, + "create_station":{"enabled":"TRUE","command":"create_station.py","args":"--radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"}, + "create_vap":{"enabled":"TRUE","command":"create_vap.py","args":"--radio wiphy1 --ssid asus11ax-5 --passwd hello123 --security wpa2 --debug"}, + "create_qvlan":{"enabled":"TRUE","command":"create_qvlan.py","args":"--radio wiphy1 --qvlan_parent eth1"}, + "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"} + } + } +} + + + + \ No newline at end of file From d01796f921d8b5775fc0d17f047b269762167258 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 07:26:27 -0600 Subject: [PATCH 090/152] lf_check.py: update support for database, dashboard, blog ct_us_001.json : update to configuration Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 11 ++-- py-scripts/tools/lf_check.py | 92 ++++++++++++++++++++++++--------- 2 files changed, 74 insertions(+), 29 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 11b98447..8cf0ca56 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -40,10 +40,13 @@ "suite_two":{ "test_l3_longevity":{"enabled":"TRUE","load_db":"skip","command":"test_l3_longevity.py","args":"--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"} }, - "suite_wc_dp_ig_dut":{ - "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid asus11ax-5 --security wpa2 --paswd hello123 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --raw_line 'dut-model-num: ASUS RT-AX88U'"}, - "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors LANForge --grafana_host 192.168.100.201 --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --parent_folder REPORT_PATH --user_push lanforge --password_push lanforge --customer candela --grafana_bucket lanforge_qa_testing --kpi_to_ghost"} + "suite_wc_dp_0":{ + "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", + "args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig TEST_BED --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_NAME"}, + "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", + "args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", + "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWROD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DASHBOARD_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORT --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} }, "suite_wc_dp":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 2391e56b..dc5ad122 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -134,32 +134,36 @@ class lf_check(): self.lf_mgr = "" self.lf_mgr_port = "" + #NOTE: My influx token is unlucky and starts with a '-', but using the syntax below # with '=' right after the argument keyword works as hoped. + # --influx_token= - # influx database configuration - self.influx_json = "" - self.influx_config = False - self.influx_host = "" - self.influx_port = "" - self.influx_org = "" - self.influx_token = "" - self.influx_bucket = "" - self.influx_tag = "" + # database configuration # database + self.database_json = "" + self.database_config = False + self.database_host = "c7-grafana.candelatech.com" # influx and grafana have the same host "192.168.100.201" + self.database_port = "8086" + self.database_token = "-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ==" + self.database_org = "Candela" + self.database_bucket = "lanforge_qa_testing" + self.database_tag = 'testbed CT-US-001' # due to the space will need to single quote below + self.dut_name = 'DUT_NAME ASUSRT-AX88U' # note the name will be set as --set DUT_NAME ASUSRT-AX88U + + # grafana configuration #dashboard + self.dashboard_json = "" + self.dashboard_host = "c7-grafana.candelatech.com" # 192.168.100.201 + self.dashboard_token = "eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ==" + + # ghost configuration + self.blog_json = "" + self.blog_config = False + self.blog_host = "192.168.100.153" + self.blog_token = "60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742" + self.blog_authors = "Matthew" + self.blog_customer = "candela" + self.blog_user_push = "lanforge" + self.blog_password_push = "lanforge" + self.blog_flag = "--kpi_to_ghost" - # ghost configuration - self.ghost_json = "" - self.ghost_config = False - self.ghost_token = "" - self.ghost_host = "" - self.grafana_host = "" - self.grafana_token = "" - self.parent_folder = "" - self.server = "" - self.user_push = "" - self.password_push = "" - self.customer = "" - self.user_pull = "" - self.password_pull = "" - self.grafana_dashboard = "" self.test_run = "" # NOT complete : will send the email results @@ -598,7 +602,7 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. self.logger.info("test: {} skipped".format(test)) # load the default database elif self.test_dict[test]['enabled'] == "TRUE": - # make the command replace ment a separate method call. + # Configure Tests # loop through radios for radio in self.radio_dict: # replace RADIO, SSID, PASSWD, SECURITY with actual config values (e.g. RADIO_0_CFG to values) @@ -640,6 +644,44 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. 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) + # database configuration + if 'DATABASE_HOST' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_HOST',self.database_host) + if 'DATABASE_PORT' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_PORT',self.database_port) + if 'DATABASE_TOKEN' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_TOKEN',self.database_token) + if 'DATABASE_ORG' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_ORG',self.database_org) + if 'DATABASE_BUCKET' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_BUCKET',self.database_org) + if 'DATABASE_TAG' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_TAG',self.database_tag) + if 'DUT_NAME' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_NAME',self.dut_name) + + # dashboard configuration + if 'DASHBOARD_HOST' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DASHBOARD_HOST',self.dashboard_host) + if 'DASHBOARD_TOKEN' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DASHBOARD_TOKEN',self.dashboard_token) + + # blog configuration + if 'BLOG_HOST' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('BLOG_HOST',self.blog_host) + if 'BLOG_TOKEN' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('BLOG_TOKEN',self.blog_token) + if 'BLOG_AUTHORS' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('BLOG_AUTHORS',self.blog_authors) + if 'BLOG_CUSTOMER' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('BLOG_CUSTOMER',self.blog_customer) + if 'BLOG_USER_PUSH' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('BLOG_USER_PUSH',self.blog_user_push) + if 'BLOG_PASSWORD_PUSH' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('BLOG_PASSWORD_PUSH',self.blog_password_push) + if 'BLOG_FLAG' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('BLOG_FLAG',self.blog_flag) + if 'load_db' in self.test_dict[test]: 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": From 74f91f2ae2d8438d3871851db12fd08d6b2c9bed Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 08:35:31 -0600 Subject: [PATCH 091/152] ct_us_001.json : used for comparison between runs Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 8cf0ca56..4fa3ac90 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -48,6 +48,11 @@ "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWROD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DASHBOARD_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORT --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} }, + "suite_wc_dp_1":{ + "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, + "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} + }, "suite_wc_dp":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, From 35b8bdd370cd6b75c4a5b3c3b6fc01ad5a936456 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 08:44:39 -0600 Subject: [PATCH 092/152] lf_check.py : modified DUT name, creating wildcards for the DUT_SET_NAME Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index dc5ad122..8e486698 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -146,7 +146,7 @@ class lf_check(): self.database_org = "Candela" self.database_bucket = "lanforge_qa_testing" self.database_tag = 'testbed CT-US-001' # due to the space will need to single quote below - self.dut_name = 'DUT_NAME ASUSRT-AX88U' # note the name will be set as --set DUT_NAME ASUSRT-AX88U + self.dut_set_name = 'DUT_NAME ASUSRT-AX88U' # note the name will be set as --set DUT_NAME ASUSRT-AX88U # grafana configuration #dashboard self.dashboard_json = "" @@ -644,6 +644,10 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. 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 'TEST_BED' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('TEST_BED',self.database_tag) + # database configuration if 'DATABASE_HOST' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_HOST',self.database_host) @@ -654,11 +658,11 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. if 'DATABASE_ORG' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_ORG',self.database_org) if 'DATABASE_BUCKET' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_BUCKET',self.database_org) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_BUCKET',self.database_bucket) if 'DATABASE_TAG' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_TAG',self.database_tag) - if 'DUT_NAME' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_NAME',self.dut_name) + if 'DUT_SET_NAME' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_NAME',self.dut_set_name) # dashboard configuration if 'DASHBOARD_HOST' in self.test_dict[test]['args']: From cb28a0bb4baeb0efe54de30e2a21c6974eaf49e3 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 08:54:09 -0600 Subject: [PATCH 093/152] lf_check.py : bug fix to DUT_SET_NAME , updated ct_us_001.json Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 2 +- py-scripts/tools/lf_check.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 4fa3ac90..c85cccdc 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -42,7 +42,7 @@ }, "suite_wc_dp_0":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", - "args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig TEST_BED --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_NAME"}, + "args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig TEST_BED --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", "args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 8e486698..96d0574e 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -662,7 +662,7 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. if 'DATABASE_TAG' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DATABASE_TAG',self.database_tag) if 'DUT_SET_NAME' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_NAME',self.dut_set_name) + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_SET_NAME',self.dut_set_name) # dashboard configuration if 'DASHBOARD_HOST' in self.test_dict[test]['args']: From dc0f8a14179f4b8c0ee44a9a6d9b4984f8e97384 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 09:40:07 -0600 Subject: [PATCH 094/152] lf_check.py : allow for setting TEST_RIG seperate from database tag ct_us_001.py : set TEST_RIG Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 11 +++++++---- py-scripts/tools/lf_check.py | 9 ++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index c85cccdc..0c8d8782 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -42,16 +42,19 @@ }, "suite_wc_dp_0":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", - "args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig TEST_BED --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, + "args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", "args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWROD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DASHBOARD_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORT --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} }, "suite_wc_dp_1":{ - "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, - "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} + "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", + "args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, + "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", + "args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", + "args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} }, "suite_wc_dp":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 96d0574e..0a6e69fb 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -137,6 +137,9 @@ class lf_check(): #NOTE: My influx token is unlucky and starts with a '-', but using the syntax below # with '=' right after the argument keyword works as hoped. # --influx_token= + # DUT , Test rig must match testbed + self.test_rig = "CT-US-001" + # database configuration # database self.database_json = "" self.database_config = False @@ -145,9 +148,10 @@ class lf_check(): self.database_token = "-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ==" self.database_org = "Candela" self.database_bucket = "lanforge_qa_testing" - self.database_tag = 'testbed CT-US-001' # due to the space will need to single quote below + self.database_tag = 'testbed CT-US-001' # the test_rig needs to match self.dut_set_name = 'DUT_NAME ASUSRT-AX88U' # note the name will be set as --set DUT_NAME ASUSRT-AX88U + # grafana configuration #dashboard self.dashboard_json = "" self.dashboard_host = "c7-grafana.candelatech.com" # 192.168.100.201 @@ -664,6 +668,9 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from 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) + # dashboard configuration if 'DASHBOARD_HOST' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DASHBOARD_HOST',self.dashboard_host) From 69b37e7ef995fc078387c16bbfec819b493bdb13 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 11:12:51 -0600 Subject: [PATCH 095/152] ct_us_001.json : the DATABASE_BUCKET needed to be specified Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 0c8d8782..83946b13 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -46,7 +46,7 @@ "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", "args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", - "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWROD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DASHBOARD_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORT --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} + "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWROD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORT --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} }, "suite_wc_dp_1":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", From 87c519987035a6196741a5ded39f69feec0bb391 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 11:47:15 -0600 Subject: [PATCH 096/152] ct_us_001.json : typo error fixed on configuration Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 83946b13..b4175f7c 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -46,7 +46,7 @@ "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", "args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", - "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWROD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORT --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} + "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORT --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} }, "suite_wc_dp_1":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", From e95009ca47270584e10a3027654776f582e5e671 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 12:19:24 -0600 Subject: [PATCH 097/152] ct_us_001.json : update to the DATABASE_ORG Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index b4175f7c..53a361ea 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -46,7 +46,7 @@ "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", "args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", - "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORT --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} + "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} }, "suite_wc_dp_1":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", From 18911c1199447ae6fabc9a904c91e8f280766869 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 9 Jul 2021 11:35:36 -0700 Subject: [PATCH 098/152] Restructure DUT table in ghost report Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 40 ++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index 58ceefa4..c550f5ed 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -292,7 +292,7 @@ class GhostRequest: images = list() times = list() test_pass_fail = list() - devices = dict() + duts = dict() for target_folder in target_folders: try: @@ -305,7 +305,7 @@ class GhostRequest: dut_sw = csvreader.get_column(df, 'dut-sw-version')[0] dut_model = csvreader.get_column(df, 'dut-model-num')[0] dut_serial = csvreader.get_column(df, 'dut-serial-num')[0] - devices[csv_testbed] = [dut_hw, dut_sw, dut_model, dut_serial] + duts[csv_testbed] = [dut_hw, dut_sw, dut_model, dut_serial] times_append = csvreader.get_column(df, 'Date') for target_time in times_append: times.append(float(target_time) / 1000) @@ -424,27 +424,31 @@ class GhostRequest: influxdb.post_to_influx(short_description, numeric_score, tags, date) text = 'Testbed: %s
' % testbeds[0] - dut_table = '' \ - '' \ - '' \ - '' \ - '' \ - '' \ - '' \ - '' - for device, data in devices.items(): - dut_table = dut_table + '' \ - '' \ - '' \ - '' \ - '' \ - '' \ - '
DeviceDUT_HWDUT_SWDUT modelDUT SerialTests passedTests failed
%s%s%s%s%s%s%s
' % ( + dut_table = '' \ + '' + for device, data in duts.items(): + dut_table = dut_table + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '
Ghost Request requested values
Device%s
DUT_HW%s
DUT_SW%s
DUT model%s
DUT Serial%s
Tests passed%s
Tests failed%s
' % ( device, data[0], data[1], data[2], data[3], test_pass_fail_results['PASS'], test_pass_fail_results['FAIL']) text = text + dut_table for pdf in pdfs: + print(pdf) text = text + pdf for image in images: From 61b2a70629d853488efdcee7be57b5e1c8fdd0aa Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 9 Jul 2021 12:03:15 -0700 Subject: [PATCH 099/152] Fix dut_table argument Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index c550f5ed..f052351b 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -441,10 +441,11 @@ class GhostRequest: 'Tests passed' \ '%s' \ 'Tests failed' \ - '%s' \ - '' % ( + '%s' % ( device, data[0], data[1], data[2], data[3], test_pass_fail_results['PASS'], test_pass_fail_results['FAIL']) + + dut_table = dut_table + '' text = text + dut_table for pdf in pdfs: From 0a2785ae4b772fa3b03a8eb606411e5bcf52d463 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 13:21:10 -0600 Subject: [PATCH 100/152] lf_check.py : had code the c7-grafana.candelatech.com to 192.168100.201 ct_us_001.json also Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 27 ++++- py-scripts/tools/lf_check.py | 176 ++++++++++++++++++++++---------- 2 files changed, 148 insertions(+), 55 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 53a361ea..d720a041 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -18,6 +18,31 @@ "ftp_test_ip": "10.40.0.10", "test_ip": "192.168.0.104" }, + "test_database":{ + "database_config": "True", + "database_host": "192.168.100.201", + "database_port": "8086", + "database_token": "-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ==", + "database_org": "Candela", + "database_bucket": "lanforge_qa_testing", + "database_tag": "testbed CT-US-001", + "dut_set_name": "DUT_NAME ASUSRT-AX88U" + }, + "test_dashboard":{ + "dashboard_config": "True", + "dashboard_host": "192.168.100.201", + "dashboard_token": "eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ==" + }, + "test_blog":{ + "blog_config": "True", + "blog_host": "192.168.100.153", + "blog_token": "60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742", + "blog_authors": "Matthew", + "blog_customer": "candela", + "blog_user_push": "lanforge", + "blog_password_push": "lanforge", + "blog_flag": "--kpi_to_ghost" + }, "test_generic":{ "radio_used": "wiphy1", "ssid_used": "asus11ax-5", @@ -54,7 +79,7 @@ "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", "args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", - "args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} + "args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host 192.168.100.201 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} }, "suite_wc_dp":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 0a6e69fb..a033ce6a 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -142,8 +142,8 @@ class lf_check(): # database configuration # database self.database_json = "" - self.database_config = False - self.database_host = "c7-grafana.candelatech.com" # influx and grafana have the same host "192.168.100.201" + self.database_config = "True" # default to False once testing done + self.database_host = "192.168.100.201" #"c7-grafana.candelatech.com" # influx and grafana have the same host "192.168.100.201" self.database_port = "8086" self.database_token = "-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ==" self.database_org = "Candela" @@ -154,7 +154,8 @@ class lf_check(): # grafana configuration #dashboard self.dashboard_json = "" - self.dashboard_host = "c7-grafana.candelatech.com" # 192.168.100.201 + self.dashboard_config = "True" # default to False once testing done + self.dashboard_host = "192.168.100.201" #"c7-grafana.candelatech.com" # 192.168.100.201 self.dashboard_token = "eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ==" # ghost configuration @@ -189,14 +190,17 @@ class lf_check(): message_txt = """{email_txt} lanforge target {lf_mgr} Results from {hostname}: http://{ip}/{report} +Blog: +http://{blog} NOTE: for now to see stdout and stderr remove /home/lanforge from path. -""".format(hostname=hostname, ip=ip, report=report_url, email_txt=self.email_txt, lf_mgr=self.lf_mgr) +""".format(hostname=hostname, ip=ip, report=report_url, email_txt=self.email_txt, lf_mgr=self.lf_mgr,blog=self.blog_host) else: message_txt = """Results from {hostname}: http://{ip}/{report} -NOTE: for now to see stdout and stderr remove /home/lanforge from path. -""".format(hostname=hostname, ip=ip, report=report_url) +Blog: +blog: http://{blog} +""".format(hostname=hostname, ip=ip, report=report_url,blog=self.blog_host) if(self.email_title_txt != ""): mail_subject = "{} [{hostname}] {date}".format(self.email_title_txt,hostname=hostname, date=datetime.datetime.now()) @@ -264,54 +268,6 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path.

""" - # inprogress - def read_influx_json(self): - # use influx json config file - if self.influx_json == "": - self.influx_config = False - else: - self.influx_config = True - try: - with open(self.influx_json, 'r') as influx_json_config: - influx_json_data = json.load(influx_json_config) - except: - print("Error reading {}".format(self.influx_json)) - # json configuation takes presidence to command line - # influx DB configuration - if "influx_host" in influx_json_data: - self.influx_host = influx_json_data["influx_host"] - else: - self.logger.info("WARNING influx_host not in json {}".format(influx_json_data)) - self.influx_config = False - if "influx_port" in influx_json_data: - self.influx_port = influx_json_data["influx_port"] - else: - self.logger.info("WARNING influx_port not in json {}".format(influx_json_data)) - self.influx_config = False - if "influx_org" in influx_json_data: - self.influx_org = influx_json_data["influx_org"] - else: - self.logger.info("WARNING influx_org not in json {}".format(influx_json_data)) - self.influx_config = False - if "influx_token" in influx_json_data: - self.influx_token = influx_json_data["influx_token"] - else: - self.logger.info("WARNING influx_token not in json {}".format(influx_json_data)) - self.influx_config = False - if "influx_bucket" in influx_json_data: - self.influx_bucket = influx_json_data["influx_bucket"] - else: - self.logger.info("WARNING influx_bucket not in json {}".format(influx_json_data)) - self.influx_config = False - if "influx_tag" in influx_json_data: - self.influx_tag = influx_json_data["influx_tag"] - else: - self.logger.info("WARNING influx_tag not in json {}".format(influx_json_data)) - self.influx_config = False - - #def read_ghost_json(self): - - def read_config(self): @@ -340,6 +296,27 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. self.logger.info("EXITING test_network not in json {}".format(self.json_data)) exit(1) + if "test_database" in self.json_data: + self.logger.info("json: read test_database") + #self.logger.info("test_database {}".format(self.json_data["test_database"])) + self.read_test_database() + else: + self.logger.info("NOTE: test_database not found in json") + + if "test_dashboard" in self.json_data: + self.logger.info("json: read test_dashboard") + #self.logger.info("test_dashboard {}".format(self.json_data["test_dashboard"])) + self.read_test_dashboard() + else: + self.logger.info("NOTE: test_dashboard not found in json") + + if "test_blog" in self.json_data: + self.logger.info("json: read test_blog") + #self.logger.info("test_blog {}".format(self.json_data["test_blog"])) + self.read_test_blog() + else: + self.logger.info("NOTE: test_blog not found in json") + if "test_generic" in self.json_data: self.logger.info("json: read test_generic") #self.logger.info("test_generic {}".format(self.json_data["test_generic"])) @@ -448,6 +425,97 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. self.logger.info("test_ip not in test_network json") exit(1) + def read_test_database(self): + if "database_config" in self.json_data["test_database"]: + self.database_config = self.json_data["test_database"]["database_config"] + else: + self.logger.info("database_config not in test_database json") + if "database_host" in self.json_data["test_database"]: + self.database_host = self.json_data["test_database"]["database_host"] + else: + self.logger.info("database_host not in test_database json") + if "database_port" in self.json_data["test_database"]: + self.database_port = self.json_data["test_database"]["database_port"] + else: + self.logger.info("database_port not in test_database json") + if "database_token" in self.json_data["test_database"]: + self.database_token = self.json_data["test_database"]["database_token"] + else: + self.logger.info("database_token not in test_database json") + if "database_org" in self.json_data["test_database"]: + self.database_org = self.json_data["test_database"]["database_org"] + else: + self.logger.info("database_org not in test_database json") + if "database_bucket" in self.json_data["test_database"]: + self.database_bucket = self.json_data["test_database"]["database_bucket"] + else: + self.logger.info("database_bucket not in test_database json") + if "database_tag" in self.json_data["test_database"]: + self.database_tag = self.json_data["test_database"]["database_tag"] + else: + self.logger.info("database_tag not in test_database json") + if "dut_set_name" in self.json_data["test_database"]: + self.dut_set_name = self.json_data["test_database"]["dut_set_name"] + else: + self.logger.info("dut_set_name not in test_database json") + + def read_test_dashboard(self): + if "dashboard_config" in self.json_data["test_dashboard"]: + self.dashboard_config = self.json_data["test_dashboard"]["dashboard_config"] + else: + self.logger.info("dashboard_config not in test_dashboard json") + + if "dashboard_host" in self.json_data["test_dashboard"]: + self.dashboard_host = self.json_data["test_dashboard"]["dashboard_host"] + else: + self.logger.info("dashboard_host not in test_dashboard json") + + if "dashboard_token" in self.json_data["test_dashboard"]: + self.dashboard_token = self.json_data["test_dashboard"]["dashboard_token"] + else: + self.logger.info("dashboard_token not in test_dashboard json") + + def read_test_blog(self): + if "blog_config" in self.json_data["test_blog"]: + self.blog_config = self.json_data["test_blog"]["blog_config"] + else: + self.logger.info("blog_config not in test_blog json") + + if "blog_host" in self.json_data["test_blog"]: + self.blog_host = self.json_data["test_blog"]["blog_host"] + else: + self.logger.info("blog_host not in test_blog json") + + if "blog_token" in self.json_data["test_blog"]: + self.blog_token = self.json_data["test_blog"]["blog_token"] + else: + self.logger.info("blog_token not in test_blog json") + + if "blog_authors" in self.json_data["test_blog"]: + self.blog_authors = self.json_data["test_blog"]["blog_authors"] + else: + self.logger.info("blog_authors not in test_blog json") + + if "blog_customer" in self.json_data["test_blog"]: + self.blog_customer = self.json_data["test_blog"]["blog_customer"] + else: + self.logger.info("blog_customer not in test_blog json") + + if "blog_user_push" in self.json_data["test_blog"]: + self.blog_user_push = self.json_data["test_blog"]["blog_user_push"] + else: + self.logger.info("blog_user_push not in test_blog json") + + if "blog_password_push" in self.json_data["test_blog"]: + self.blog_password_push = self.json_data["test_blog"]["blog_password_push"] + else: + self.logger.info("blog_password_push not in test_blog json") + + if "blog_flag" in self.json_data["test_blog"]: + self.blog_flag = self.json_data["test_blog"]["blog_flag"] + else: + self.logger.info("blog_flag not in test_blog json") + def read_test_generic(self): if "radio_used" in self.json_data["test_generic"]: self.radio_lf = self.json_data["test_generic"]["radio_used"] From 99244737403c597f59f111d7aaa1af3ea5e0d8a2 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 16:45:37 -0600 Subject: [PATCH 101/152] lf_check.py : add the port for blog post in email Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index a033ce6a..28944363 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -35,8 +35,6 @@ GENERIC NOTES: 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 -2. Use json to pass in influx config and ghost config -3. note the symbolic link at 192.168.100.201:/var/www/html/html-reports is pointing to /home/lanforge/html-reports ''' import datetime @@ -199,7 +197,7 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. message_txt = """Results from {hostname}: http://{ip}/{report} Blog: -blog: http://{blog} +blog: http://{blog}:2368 """.format(hostname=hostname, ip=ip, report=report_url,blog=self.blog_host) if(self.email_title_txt != ""): @@ -996,6 +994,7 @@ Example : html_results = check.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: From f2bdeffb839f375e7c125e706e7523cae5e304d6 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Fri, 9 Jul 2021 16:22:04 -0700 Subject: [PATCH 102/152] Added check for generic tab enabled on gui --- py-scripts/test_generic.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/py-scripts/test_generic.py b/py-scripts/test_generic.py index 247d9554..50118d15 100755 --- a/py-scripts/test_generic.py +++ b/py-scripts/test_generic.py @@ -98,6 +98,13 @@ class GenTest(LFCliBase): if (speedtest_max_ping is not None): self.generic_endps_profile.speedtest_max_ping = float(speedtest_max_ping) + def check_tab_exists(self): + response = self.json_get("generic") + if response is None: + return False + else: + return True + def start(self, print_pass=False, print_fail=False): self.station_profile.admin_up() temp_stas = [] @@ -290,6 +297,8 @@ python3 ./test_generic.py client=args.client, _debug_on=args.debug) + if not generic_test.check_tab_exists(): + raise ValueError("Error received from GUI, please ensure generic tab is enabled") generic_test.cleanup(station_list) generic_test.build() if not generic_test.passes(): From cbea5ffe0bedac2d2fb8e0ffcd92f1b75c9a3328 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 17:54:01 -0600 Subject: [PATCH 103/152] lf_check.py : trying to simplify all the influx, grafana, and ghost Initial commit. Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 3 +- py-scripts/tools/ct_us_002.json | 57 +++++++++++++++++++++++++-------- py-scripts/tools/lf_check.py | 5 ++- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index d720a041..20b89c0d 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -25,8 +25,9 @@ "database_token": "-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ==", "database_org": "Candela", "database_bucket": "lanforge_qa_testing", + "dut_set_name": "DUT_NAME ASUSRT-AX88U", "database_tag": "testbed CT-US-001", - "dut_set_name": "DUT_NAME ASUSRT-AX88U" + "test_rig": "CT-US-001" }, "test_dashboard":{ "dashboard_config": "True", diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json index 2fe9e871..7c25921a 100644 --- a/py-scripts/tools/ct_us_002.json +++ b/py-scripts/tools/ct_us_002.json @@ -18,6 +18,32 @@ "ftp_test_ip": "10.40.0.10", "test_ip": "192.168.0.104" }, + "test_database":{ + "database_config": "True", + "database_host": "192.168.100.201", + "database_port": "8086", + "database_token": "-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ==", + "database_org": "Candela", + "database_bucket": "lanforge_qa_testing", + "dut_set_name": "DUT_NAME Ruckus-R750", + "database_tag": "testbed CT-US-002", + "test_rig": "CT-US-001" + }, + "test_dashboard":{ + "dashboard_config": "True", + "dashboard_host": "192.168.100.201", + "dashboard_token": "eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ==" + }, + "test_blog":{ + "blog_config": "True", + "blog_host": "192.168.100.153", + "blog_token": "60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742", + "blog_authors": "Matthew", + "blog_customer": "candela", + "blog_user_push": "lanforge", + "blog_password_push": "lanforge", + "blog_flag": "--kpi_to_ghost" + }, "test_generic":{ "radio_used": "wiphy1", "ssid_used": "ruckus-r750-5g", @@ -39,21 +65,26 @@ "wifi_capacity_0":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002"}, "dataplane_0":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus-r750-5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH"} }, - "suite_wc_dp":{ - "CT-US-002_wifi_capacity_ATH10k(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "CT-US-002_wifi_capacity_AX200 CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta4000 --create_stations --radio wiphy4 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "CT-US-002_dataplane_AX200":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta4000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 2' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "} + "suite_wc_dp_0":{ + "CT-US-002_wifi_capacity_ATH10k(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", + "args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, + "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", + "args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME "}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", + "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DASHBOARD_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} }, - "suite_wc_dp_old":{ - "CT-US-002_wifi_capacity_ATH10k(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "CT-US-002_wifi_capacity_AX200 CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta4000 --create_stations --radio wiphy4 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "CT-US-002_dataplane_AX200":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta4000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 2' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors LANForge --grafana_host 192.168.100.201 --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --parent_folder REPORT_PATH --user_push lanforge --password_push lanforge --customer candela --grafana_bucket lanforge_qa_testing --kpi_to_ghost"} + "suite_wc_dp":{ + "CT-US-002_wifi_capacity_ATH10k(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", + "args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", + "args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "CT-US-002_wifi_capacity_AX200 CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", + "args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta4000 --create_stations --radio wiphy4 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "CT-US-002_dataplane_AX200":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", + "args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta4000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 2' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", + "args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "} } - } } diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 28944363..dc45e313 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -452,6 +452,10 @@ blog: http://{blog}:2368 self.database_tag = self.json_data["test_database"]["database_tag"] else: self.logger.info("database_tag not in test_database json") + if "test_rig" in self.json_data["test_database"]: + self.test_rig = self.json_data["test_database"]["test_rig"] + else: + self.logger.info("test_rig not in test_database json") if "dut_set_name" in self.json_data["test_database"]: self.dut_set_name = self.json_data["test_database"]["dut_set_name"] else: @@ -994,7 +998,6 @@ Example : html_results = check.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: From 81a4f64cc219c3fbab3bbc4f05d312e193a9d4ce Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 18:05:24 -0600 Subject: [PATCH 104/152] lf_check.py : added the port to the blog post 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 dc45e313..180d3569 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -189,7 +189,7 @@ class lf_check(): Results from {hostname}: http://{ip}/{report} Blog: -http://{blog} +http://{blog}:2368 NOTE: for now to see stdout and stderr remove /home/lanforge from path. """.format(hostname=hostname, ip=ip, report=report_url, email_txt=self.email_txt, lf_mgr=self.lf_mgr,blog=self.blog_host) From 1a480434c84d16512f54e8ff685b49c0e5a4619e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 18:12:14 -0600 Subject: [PATCH 105/152] lf_check.py : added footer with had no png lf_report.py : footer with no png Signed-off-by: Chuck SmileyRekiere --- py-scripts/lf_report.py | 26 +++++++++++++++++++++++++- py-scripts/tools/lf_check.py | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/py-scripts/lf_report.py b/py-scripts/lf_report.py index 5bd239f2..b192d276 100755 --- a/py-scripts/lf_report.py +++ b/py-scripts/lf_report.py @@ -402,6 +402,29 @@ class lf_report(): """ self.html += self.footer_html + def build_footer_no_png(self): + self.footer_html = """ + +
+ + + + + +
+ +
+

Generate by Candela Technologies LANforge network testing tool

+

www.candelatech.com

+

+ + + """ + self.html += self.footer_html + + def build_custom(self): self.html += self.custom_html @@ -467,7 +490,8 @@ if __name__ == "__main__": report.build_table() #report.build_all() - report.build_footer() + #report.build_footer() + report.build_footer_no_png() html_file = report.write_html() print("returned file ") diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 180d3569..70783439 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -998,6 +998,7 @@ Example : html_results = check.get_html_results() report.set_custom_html(html_results) report.build_custom() + report.build_footer_no_png() html_report = report.write_html_with_timestamp() print("html report: {}".format(html_report)) try: From ce3961e7de3b3fa17a9618c2d102f2fb696a6716 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 9 Jul 2021 18:25:54 -0600 Subject: [PATCH 106/152] ct_us_002.json : changed DASHBOARD_BUCKET to DATABASE_BUCKET Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_002.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json index 7c25921a..4ea8efec 100644 --- a/py-scripts/tools/ct_us_002.json +++ b/py-scripts/tools/ct_us_002.json @@ -71,7 +71,7 @@ "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", "args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME "}, "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", - "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DASHBOARD_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} + "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} }, "suite_wc_dp":{ "CT-US-002_wifi_capacity_ATH10k(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", From e5d40af841352ba0f84c74515f1c3480fb1a0b9a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 05:33:41 -0600 Subject: [PATCH 107/152] ct_us_001.json : try multiple line json , \n, \r have been removed previously Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 20b89c0d..aa40f1f4 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -66,6 +66,35 @@ "suite_two":{ "test_l3_longevity":{"enabled":"TRUE","load_db":"skip","command":"test_l3_longevity.py","args":"--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"} }, + "suite_wc_dp_00":{ + "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", + "args":[ + " --mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1", + " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ] + }, + "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", + "args":[ + " --mgr 192.168.100.116 --port 8080 --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.wlan1", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line", + " 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", + " --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH ", + " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", + " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ]}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", + "args":[ + " --ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER", + " --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN", + " --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH", + " --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET", + " --influx_tag DATABASE_TAG " + ]} + }, "suite_wc_dp_0":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", "args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, From 1d6c0a97cf72b53ef0bf3f606b2b8ccc7265c0aa Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 06:46:41 -0600 Subject: [PATCH 108/152] CT_US_001.bash : script for creating a chamberview Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/CT_US_001.bash | 74 +++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100755 py-scripts/tools/CT_US_001.bash diff --git a/py-scripts/tools/CT_US_001.bash b/py-scripts/tools/CT_US_001.bash new file mode 100755 index 00000000..cad4bc6e --- /dev/null +++ b/py-scripts/tools/CT_US_001.bash @@ -0,0 +1,74 @@ +#!/bin/bash + +# This bash script creates/updates a DUT, creates/updates a chamberview scenario, +# loads and builds that scenario, runs wifi capacity test, and saves the kpi.csv info +# into influxdb. As final step, it builds a grafana dashboard for the KPI information. + +set -x + +# Define some common variables. This will need to be changed to match your own testbed. +# MGR is LANforge GUI machine +MGR=192.168.100.116 +#MGR=localhost + +# Candela internal influx +INFLUXTOKEN=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== +INFLUX_HOST=192.168.100.201 +INFLUX_BUCKET=ben +INFLUX_ORG=Candela + +GRAFANATOKEN=eyJrIjoiVXVyZ0dQSXlNdGlQNGQ1R282S2p6SE1PZXJVOVpvM1UiLCJuIjoiYmVuLWdyYWZhbmEiLCJpZCI6MX0= +GRAFANA_HOST=192.168.100.201 +GROUP_FILE=/tmp/lf_cv_rpt_filelocation.txt +TESTBED=Ferndale-01 +DUT=ASUSRT-AX88U +UPSTREAM=eth2 +#LF_WAN_PORT=eth3 +MGR_PORT=8080 + +if [ -f $HOME/influx_vars.sh ] +then + # Put private keys and other variable overrides in here. + . $HOME/influx_vars.sh +fi + + +# Create/update new DUT. +#Replace my arguments with your setup. Separate your ssid arguments with spaces and ensure the names are lowercase +echo "Make new DUT" +./create_chamberview_dut.py --lfmgr ${MGR} --port ${MGR_PORT} --dut_name ${DUT} \ + --ssid "ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64" \ + --ssid "ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64" \ + --sw_version "asus_version" --hw_version asus11ax --serial_num 0001 --model_num 88R + +# Create/update chamber view scenario and apply and build it. +# Easiest way to get these lines is to build it in the GUI and then +# copy/tweak what it shows in the 'Text Output' tab after saving and re-opening +# the scenario. +echo "Build Chamber View Scenario" +#change the lfmgr to your system, set the radio to a working radio on your LANforge system, same with the ethernet port. + +./create_chamberview.py --lfmgr ${MGR} --port ${MGR_PORT} --delete_scenario \ + --create_scenario ucentral-scenario \ + --raw_line "profile_link 1.1 STA-AC 1 'DUT: $DUT Radio-1' NA wiphy1,AUTO -1 NA" \ + --raw_line "profile_link 1.1 STA-AC 1 'DUT: $DUT Radio-1' NA wiphy3,AUTO -1 NA" \ + --raw_line "profile_link 1.1 upstream-dhcp 1 NA NA $UPSTREAM,AUTO -1 NA" \ + +# Run capacity test on the stations created by the chamber view scenario. +# Submit the KPI data into the influxdb. +#config_name doesn't matter, change the influx_host to your LANforge device, +# NOTE: My influx token is unlucky and starts with a '-', but using the syntax below +# with '=' right after the argument keyword works as hoped. +echo "run wifi capacity test" +./lf_wifi_capacity_test.py --config_name Custom --pull_report --influx_host ${INFLUX_HOST} \ + --influx_port 8086 --influx_org ${INFLUX_ORG} --influx_token=${INFLUXTOKEN} --influx_bucket ${INFLUX_BUCKET} --mgr ${MGR} \ + --port ${MGR_PORT} \ + --instance_name testing --upstream 1.1.$UPSTREAM --test_rig ${TESTBED} --graph_groups ${GROUP_FILE} \ + --batch_size "100" --protocol "TCP-IPv4" --duration 20000 --pull_report + +# Build grafana dashboard and graphs view for the KPI in the capacity test. +#echo "Adding grafana dashboard" +#./grafana_profile.py --create_custom --title ${TESTBED} --influx_bucket ${INFLUX_BUCKET} --grafana_token ${GRAFANATOKEN} \ +# --grafana_host ${GRAFANA_HOST} --testbed ${TESTBED} --graph-groups ${GROUPS} --scripts Dataplane --scripts 'WiFi Capacity' + +rm ${GROUP_FILE} From c05821a2cd73aaee5fe3915a6c21b95a35436ac1 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 07:12:23 -0600 Subject: [PATCH 109/152] lf_check.py : attempts at multi lin command line argument list ct_us_001.json : updated configuration Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 12 ++++++------ py-scripts/tools/lf_check.py | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index aa40f1f4..83f9c954 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -67,8 +67,8 @@ "test_l3_longevity":{"enabled":"TRUE","load_db":"skip","command":"test_l3_longevity.py","args":"--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"} }, "suite_wc_dp_00":{ - "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", - "args":[ + "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", + "argslist":[ " --mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1", @@ -76,8 +76,8 @@ " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" ] }, - "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", - "args":[ + "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", + "args_list":[ " --mgr 192.168.100.116 --port 8080 --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.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line", @@ -86,8 +86,8 @@ " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" ]}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", - "args":[ + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", + "args_list":[ " --ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER", " --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN", " --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 70783439..64ab8acf 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -676,6 +676,11 @@ blog: http://{blog}:2368 self.logger.info("test: {} skipped".format(test)) # load the default database elif self.test_dict[test]['enabled'] == "TRUE": + # if args key has a value of an empty scring 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. + 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'])) # Configure Tests # loop through radios for radio in self.radio_dict: From b83b7ea6d7e74bf35b5706393e66d25d5a403a58 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 07:28:54 -0600 Subject: [PATCH 110/152] ct_us_001.json : update arguments fixed error argslist to args_list Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 83f9c954..1ac5347a 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -68,7 +68,7 @@ }, "suite_wc_dp_00":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", - "argslist":[ + "args_list":[ " --mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1", From fd02dfa3da536e5605d5c707ae52296d50426796 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 10:02:13 -0600 Subject: [PATCH 111/152] lf_check.py : add support needed for create_chamberview_dut, create_chamberview ct_us_001.json : support needed for create_chamberview_dut, and create_chamberview Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 83 ++++++++++++++++++++++++++++----- py-scripts/tools/lf_check.py | 19 +++++++- 2 files changed, 88 insertions(+), 14 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 1ac5347a..89e6b0e6 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -1,5 +1,20 @@ { + "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 in the test below is replaced by the json lf_mgr", + "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_parameters":{ + "test_bed": "CT-US-001", + "lf_mgr": "192.168.100.116", + "lf_mgr_port": "8080", + "dut_name": "ASUSRT-AX88U", + "dut_bssid": "3c:7c:3f:55:4d:64", "test_timeout": 200, "load_blank_db": false, "load_factory_default_db": true, @@ -9,7 +24,6 @@ "host_ip_production": "192.168.100.201", "email_list_test": "chuck.rekiere@candelatech.com,logan.lipke@candelatech.com", "host_ip_test": "192.168.100.201", - "lf_mgr": "192.168.100.116", "email_title_txt": "Lanforge QA Testing CT-US-001", "email_txt": "Lanforge QA Testing CT-US-001 " }, @@ -18,6 +32,15 @@ "ftp_test_ip": "10.40.0.10", "test_ip": "192.168.0.104" }, + "test_generic":{ + "radio_used": "wiphy1", + "ssid_used": "asus11ax-5", + "ssid_pw_used": "hello123", + "security_used": "wpa2", + "num_sta": 1, + "col_names": "name,tx_byptes,rx_bytes,dropped", + "upstream_port": "eth2" + }, "test_database":{ "database_config": "True", "database_host": "192.168.100.201", @@ -44,18 +67,9 @@ "blog_password_push": "lanforge", "blog_flag": "--kpi_to_ghost" }, - "test_generic":{ - "radio_used": "wiphy1", - "ssid_used": "asus11ax-5", - "ssid_pw_used": "hello123", - "security_used": "wpa2", - "num_sta": 4, - "col_names": "name,tx_byptes,rx_bytes,dropped", - "upstream_port": "eth2" - }, "radio_dict":{ - "RADIO_0_CFG":{"KEY":"RADIO_0_CFG","RADIO":"wiphy0","STATIONS":"4","SSID":"asus11ax-5","PASSWD":"hello123","SECURITY":"wpa2"}, - "RADIO_1_CFG":{"KEY":"RADIO_1_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"asus11ax-5","PASSWD":"hello123","SECURITY":"wpa2"} + "RADIO_0_CFG":{"KEY":"RADIO_0_CFG","RADIO":"wiphy0","STATIONS":"1","SSID":"asus11ax-5","PASSWD":"hello123","SECURITY":"wpa2"}, + "RADIO_1_CFG":{"KEY":"RADIO_1_CFG","RADIO":"wiphy1","STATIONS":"1","SSID":"asus11ax-5","PASSWD":"hello123","SECURITY":"wpa2"} }, "test_suites":{ "suite_one":{ @@ -66,6 +80,51 @@ "suite_two":{ "test_l3_longevity":{"enabled":"TRUE","load_db":"skip","command":"test_l3_longevity.py","args":"--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"} }, + "suite_wc_dp_01":{ + "CT-US-001_create_chamberview_dut":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", + "args_list":[ + "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_indx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", + " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", + " --sw_version 'asus_version' --hw_version asus11ax --serial_num 4d64 --model_num 'Asus RT-AX88U'" + ]}, + "CT-US-001_create_chamberview":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", + "args_list":[ + " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", + " --create_scenario ucentral-scenario ", + " --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-1' NA wiphy3,AUTO -1 NA' ", + " --raw_line 'profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA'" + ]}, + + "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", + "args_list":[ + " --mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1", + " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ] + }, + "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", + "args_list":[ + " --mgr 192.168.100.116 --port 8080 --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.wlan1", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' ", + " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", + " --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH ", + " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", + " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ]}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", + "args_list":[ + " --ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER", + " --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN", + " --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH", + " --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET", + " --influx_tag DATABASE_TAG " + ]} + }, "suite_wc_dp_00":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", "args_list":[ diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 64ab8acf..8aacbfa0 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -131,6 +131,8 @@ class lf_check(): self.email_txt = "" self.lf_mgr = "" self.lf_mgr_port = "" + self.dut_name = "" # "ASUSRT-AX88U" note this is not dut_set_name + self.dut_bssid = "" #"3c:7c:3f:55:4d:64" - this is the mac for the radio this may be seen with a scan #NOTE: My influx token is unlucky and starts with a '-', but using the syntax below # with '=' right after the argument keyword works as hoped. # --influx_token= @@ -147,7 +149,7 @@ class lf_check(): self.database_org = "Candela" self.database_bucket = "lanforge_qa_testing" self.database_tag = 'testbed CT-US-001' # the test_rig needs to match - self.dut_set_name = 'DUT_NAME ASUSRT-AX88U' # note the name will be set as --set DUT_NAME ASUSRT-AX88U + 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) # grafana configuration #dashboard @@ -404,7 +406,18 @@ blog: http://{blog}:2368 self.lf_mgr = self.json_data["test_parameters"]["lf_mgr"] else: self.logger.info("lf_mgr not in test_parameters json") - + if "lf_mgr_port" in self.json_data["test_parameters"]: + self.lf_mgr_port = self.json_data["test_parameters"]["lf_mgr_port"] + else: + self.logger.info("lf_mgr_port not in test_parameters json") + if "dut_name" in self.json_data["test_parameters"]: + self.dut_name = self.json_data["test_parameters"]["dut_name"] + else: + self.logger.info("dut_name not in test_parameters json") + if "dut_bssid" in self.json_data["test_parameters"]: + self.dut_bssid = self.json_data["test_parameters"]["dut_bssid"] + else: + self.logger.info("dut_bssid not in test_parameters json") def read_test_network(self): if "http_test_ip" in self.json_data["test_network"]: @@ -702,6 +715,8 @@ blog: http://{blog}:2368 self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('LF_MGR',self.lf_mgr) 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) + if 'DUT_NAME' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('DUT_NAME',self.dut_name) if 'RADIO_USED' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('RADIO_USED',self.radio_lf) From 7edc54cdaeac4ee7abe67ee302e7365fa6ca29da Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 10:52:23 -0600 Subject: [PATCH 112/152] ct_us_001.json : test updates to try an AX210 Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 50 +++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 89e6b0e6..a32c7cbd 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -80,15 +80,15 @@ "suite_two":{ "test_l3_longevity":{"enabled":"TRUE","load_db":"skip","command":"test_l3_longevity.py","args":"--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"} }, - "suite_wc_dp_01":{ - "CT-US-001_create_chamberview_dut":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", + "suite_wc_dp":{ + "CT-US-001_create_chamberview_dut_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", "args_list":[ "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_indx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --sw_version 'asus_version' --hw_version asus11ax --serial_num 4d64 --model_num 'Asus RT-AX88U'" ]}, - "CT-US-001_create_chamberview":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", + "CT-US-001_create_chamberview_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", "args_list":[ " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", " --create_scenario ucentral-scenario ", @@ -116,7 +116,40 @@ " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" ]}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", + "CT-US-001_create_chamberview_dut_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", + "args_list":[ + "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_indx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", + " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", + " --sw_version 'asus_version' --hw_version asus11ax --serial_num 4d64 --model_num 'Asus RT-AX88U'" + ]}, + "CT-US-001_create_chamberview_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", + "args_list":[ + " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", + " --create_scenario ucentral-scenario ", + " --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-1' NA wiphy3,AUTO -1 NA' ", + " --raw_line 'profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA'" + ]}, + "CT-US-001_wifi_capacity_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", + "args_list":[ + " --mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan3 --test_rig CT-US-001", + " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ]}, + "CT-US-001_dataplane_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", + "args_list":[ + " --mgr 192.168.100.116 --port 8080 --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.wlan3", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' ", + " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", + " --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH", + " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", + " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ]}, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", "args_list":[ " --ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER", " --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN", @@ -170,19 +203,12 @@ "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", "args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host 192.168.100.201 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} }, - "suite_wc_dp":{ + "suite_wc_dp_old":{ "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, "CT-US-001_wifi_capacity_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan3 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, "CT-US-001_dataplane_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.wlan3 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} - }, - "suite_wc_dp_old":{ - "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid asus11ax-5 --security wpa2 --paswd hello123 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, - "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, - "CT-US-001_wifi_capacity_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.sta2000 --create_stations --radio wiphy2 --ssid asus11ax-5 --security wpa2 --paswd hello123 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, - "CT-US-001_dataplane_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.sta2000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} } } } From 8954917741119d267fdc1db2bba6aa0f6f738874 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 11:05:21 -0600 Subject: [PATCH 113/152] ct_us_001.json : test file cleanup Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 59 +-------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index a32c7cbd..a42577f5 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -72,12 +72,7 @@ "RADIO_1_CFG":{"KEY":"RADIO_1_CFG","RADIO":"wiphy1","STATIONS":"1","SSID":"asus11ax-5","PASSWD":"hello123","SECURITY":"wpa2"} }, "test_suites":{ - "suite_one":{ - "create_l3":{"enabled":"TRUE","command":"create_l4.py","args":"--radio RADIO_USED --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"}, - "create_l4":{"enabled":"TRUE","command":"create_l4.py","args":"RADIO_1_CFG --debug"}, - "create_l4_2":{"enabled":"TRUE","command":"create_l4.py","args":"--radio wiphy1 --ssid ct523c-vap --passwd ct523c-vap --security wpa2 --debug"} - }, - "suite_two":{ + "suite_l3":{ "test_l3_longevity":{"enabled":"TRUE","load_db":"skip","command":"test_l3_longevity.py","args":"--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"} }, "suite_wc_dp":{ @@ -157,58 +152,6 @@ " --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET", " --influx_tag DATABASE_TAG " ]} - }, - "suite_wc_dp_00":{ - "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", - "args_list":[ - " --mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1", - " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", - " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" - ] - }, - "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", - "args_list":[ - " --mgr 192.168.100.116 --port 8080 --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.wlan1", - " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line", - " 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", - " --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH ", - " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", - " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" - ]}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", - "args_list":[ - " --ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER", - " --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN", - " --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH", - " --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET", - " --influx_tag DATABASE_TAG " - ]} - }, - "suite_wc_dp_0":{ - "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", - "args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, - "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", - "args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", - "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} - }, - "suite_wc_dp_1":{ - "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", - "args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, - "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", - "args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", - "args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host 192.168.100.201 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} - }, - "suite_wc_dp_old":{ - "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan1 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, - "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.wlan1 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, - "CT-US-001_wifi_capacity_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan3 --test_rig CT-US-001 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, - "CT-US-001_dataplane_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.116 --port 8080 --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.wlan3 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 --set DUT_NAME ASUSRT-AX88U"}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-001 "} } } } From b4d95e423cf3e6380c3ed68403d5c13a2d77ffd0 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 19:48:36 -0600 Subject: [PATCH 114/152] ct_us_002.json : update for building the chamberview dut and chamberview for wiphy1 and wiphy4 ct_us_001.json : clean up test --- py-scripts/tools/ct_us_001.json | 84 +++++++++++++----------- py-scripts/tools/ct_us_002.json | 111 +++++++++++++++++++++++++------- 2 files changed, 132 insertions(+), 63 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index a42577f5..0e36fd5c 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -79,14 +79,14 @@ "CT-US-001_create_chamberview_dut_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", "args_list":[ "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_indx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", + " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", - " --sw_version 'asus_version' --hw_version asus11ax --serial_num 4d64 --model_num 'Asus RT-AX88U'" + " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" ]}, "CT-US-001_create_chamberview_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", "args_list":[ " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", - " --create_scenario ucentral-scenario ", + " --create_scenario ct-us-001-scenario ", " --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-1' NA wiphy3,AUTO -1 NA' ", " --raw_line 'profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA'" @@ -110,48 +110,54 @@ " --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH ", " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" - ]}, - "CT-US-001_create_chamberview_dut_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", - "args_list":[ - "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", - " --ssid 'ssid_indx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", - " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", - " --sw_version 'asus_version' --hw_version asus11ax --serial_num 4d64 --model_num 'Asus RT-AX88U'" - ]}, - "CT-US-001_create_chamberview_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", - "args_list":[ - " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", - " --create_scenario ucentral-scenario ", - " --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-1' NA wiphy3,AUTO -1 NA' ", - " --raw_line 'profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA'" - ]}, - "CT-US-001_wifi_capacity_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", - "args_list":[ - " --mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan3 --test_rig CT-US-001", - " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", - " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" - ]}, - "CT-US-001_dataplane_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", - "args_list":[ - " --mgr 192.168.100.116 --port 8080 --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.wlan3", - " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' ", - " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", - " --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH", - " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", - " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" - ]}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", + ] + }, + "CT-US-001_create_chamberview_dut_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", + "args_list":[ + "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", + " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", + " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" + ] + }, + "CT-US-001_create_chamberview_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", + "args_list":[ + " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", + " --create_scenario ct-us-001-scenario ", + " --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-1' NA wiphy3,AUTO -1 NA' ", + " --raw_line 'profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA'" + ] + }, + "CT-US-001_wifi_capacity_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", + "args_list":[ + " --mgr 192.168.100.116 --port 8080 --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 --stations 1.1.wlan3", + " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ] + }, + "CT-US-001_dataplane_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", + "args_list":[ + " --mgr 192.168.100.116 --port 8080 --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.wlan3", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' ", + " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", + " --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH", + " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", + " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ] + }, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", "args_list":[ " --ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER", " --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN", " --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH", " --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET", " --influx_tag DATABASE_TAG " - ]} + ] + } } } } diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json index 4ea8efec..2e8e1601 100644 --- a/py-scripts/tools/ct_us_002.json +++ b/py-scripts/tools/ct_us_002.json @@ -1,5 +1,10 @@ { "test_parameters":{ + "test_bed": "CT-US-002", + "lf_mgr": "192.168.100.201", + "lf_mgr_port": "8080", + "dut_name": "Ruckus-R750", + "dut_bssid": "4c:b1:cd:18:e8:ec", "test_timeout": 200, "load_blank_db": false, "load_factory_default_db": true, @@ -9,7 +14,6 @@ "host_ip_production": "192.168.100.201", "email_list_test": "chuck.rekiere@candelatech.com,logan.lipke@candelatech.com", "host_ip_test": "192.168.100.201", - "lf_mgr": "192.168.100.200", "email_title_txt": "Lanforge QA Testing CT-US-002", "email_txt": "Lanforge QA Testing CT-US-002" }, @@ -27,7 +31,7 @@ "database_bucket": "lanforge_qa_testing", "dut_set_name": "DUT_NAME Ruckus-R750", "database_tag": "testbed CT-US-002", - "test_rig": "CT-US-001" + "test_rig": "CT-US-002" }, "test_dashboard":{ "dashboard_config": "True", @@ -61,29 +65,88 @@ "suite_two":{ "test_l3_longevity":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"--test_duration 15s --polling_interval 5s --upstream_port eth2 --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"} }, - "suite_wc_dp_no_influx":{ - "wifi_capacity_0":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002"}, - "dataplane_0":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus-r750-5g --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH"} - }, - "suite_wc_dp_0":{ - "CT-US-002_wifi_capacity_ATH10k(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", - "args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME"}, - "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", - "args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME "}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", - "args":"--ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG "} - }, "suite_wc_dp":{ - "CT-US-002_wifi_capacity_ATH10k(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", - "args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta0000,1.1.sta0001 --create_stations --radio wiphy1 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", - "args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta0000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "CT-US-002_wifi_capacity_AX200 CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py", - "args":"--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.sta4000 --create_stations --radio wiphy4 --ssid ruckus-r750-5g --security wpa2 --paswd hello123 --test_rig CT-US-002 --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "CT-US-002_dataplane_AX200":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py", - "args":"--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt --config_name test_con --upstream 1.1.eth2 --dut ruckus750 --duration 30s --station 1.1.sta4000 --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 2' --pull_report --local_lf_report_dir REPORT_PATH --influx_host 192.168.100.201 --influx_port 8086 --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "}, - "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py", - "args":"--ghost_token 60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 --ghost_host 192.168.100.153 --authors Matthew --customer candela --user_push lanforge --password lanforge --kpi_to_ghost --grafana_token eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== --grafana_host 192.168.100.201 --grafana_bucket lanforge_qa_testing --parent_folder REPORT_PATH --influx_host c7-grafana.candelatech.com --influx_org Candela --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== --influx_bucket lanforge_qa_testing --influx_tag testbed CT-US-002 "} + "CT-US-002_create_chamberview_dut_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", + "args_list":[ + "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", + " --ssid 'ssid_idx=1 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", + " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" + ]}, + "CT-US-002_create_chamberview_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", + "args_list":[ + " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", + " --create_scenario ucentral-scenario ", + " --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-1' NA wiphy4,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)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", + "args_list":[ + "--mgr 192.168.100.200 --port 8080 --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 --stations 1.1.wlan1", + " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ] + }, + "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", + "args_list":[ + "--mgr 192.168.100.200 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --config_name test_con --upstream 1.1.eth2 --dut DUT_NAME --duration 30s --station 1.1.wlan1", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 ", + " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", + " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ] + }, + "CT-US-002_create_chamberview_dut_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", + "args_list":[ + "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", + " --ssid 'ssid_idx=0 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", + " --ssid 'ssid_idx=1 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", + " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" + ]}, + "CT-US-002_create_chamberview_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", + "args_list":[ + " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", + " --create_scenario ucentral-scenario ", + " --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-1' NA wiphy4,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":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", + "args_list":[ + " --mgr LF_MGR --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 --stations 1.1.wlan4 ", + " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ] + }, + "CT-US-002_dataplane_AX200":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", + "args_list":[ + " --mgr LF_MGR --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-dpt", + " --config_name test_con --upstream 1.1.eth2 --dut DUT_NAME --duration 30s --station 1.1.wlan4", + " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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", + " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", + " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ] + }, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", + "args_list":[ + " --ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER", + " --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN", + " --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH", + " --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET", + " --influx_tag DATABASE_TAG " + ] + } } } } From 062aac80eaf65b27d30a67693176d9e111cca892 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 19:58:07 -0600 Subject: [PATCH 115/152] ct_us_002.json : added "comment" in the json file fixed the lf_mgr ip ct_us_001.json : fomatting fixes --- py-scripts/tools/ct_us_001.json | 7 ++++--- py-scripts/tools/ct_us_002.json | 30 ++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 0e36fd5c..f818c494 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -82,7 +82,8 @@ " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" - ]}, + ] + }, "CT-US-001_create_chamberview_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", "args_list":[ " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", @@ -90,8 +91,8 @@ " --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-1' NA wiphy3,AUTO -1 NA' ", " --raw_line 'profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA'" - ]}, - + ] + }, "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", "args_list":[ " --mgr 192.168.100.116 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json index 2e8e1601..7e90c953 100644 --- a/py-scripts/tools/ct_us_002.json +++ b/py-scripts/tools/ct_us_002.json @@ -1,7 +1,17 @@ { + "ct_us_002":{ + "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 in the test below is replaced by the json lf_mgr", + "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_parameters":{ "test_bed": "CT-US-002", - "lf_mgr": "192.168.100.201", + "lf_mgr": "192.168.100.200", "lf_mgr_port": "8080", "dut_name": "Ruckus-R750", "dut_bssid": "4c:b1:cd:18:e8:ec", @@ -22,6 +32,15 @@ "ftp_test_ip": "10.40.0.10", "test_ip": "192.168.0.104" }, + "test_generic":{ + "radio_used": "wiphy1", + "ssid_used": "ruckus-r750-5g", + "ssid_pw_used": "hello123", + "security_used": "wpa2", + "num_sta": 4, + "col_names": "name,tx_byptes,rx_bytes,dropped", + "upstream_port": "eth2" + }, "test_database":{ "database_config": "True", "database_host": "192.168.100.201", @@ -48,15 +67,6 @@ "blog_password_push": "lanforge", "blog_flag": "--kpi_to_ghost" }, - "test_generic":{ - "radio_used": "wiphy1", - "ssid_used": "ruckus-r750-5g", - "ssid_pw_used": "hello123", - "security_used": "wpa2", - "num_sta": 4, - "col_names": "name,tx_byptes,rx_bytes,dropped", - "upstream_port": "eth2" - }, "radio_dict":{ "RADIO_0_CFG":{"KEY":"RADIO_0_CFG","RADIO":"wiphy0","STATIONS":"4","SSID":"ruckus-r750-5g","PASSWD":"hello123","SECURITY":"wpa2"}, "RADIO_1_CFG":{"KEY":"RADIO_1_CFG","RADIO":"wiphy1","STATIONS":"4","SSID":"ruckus-r750-5g","PASSWD":"hello123","SECURITY":"wpa2"} From 9bc1ec82515bcd51293adc6114ab482815ac3c4e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 20:15:13 -0600 Subject: [PATCH 116/152] lf_check.py , ct_us_002.json, ct_us_001.json the replace of LF_MGR needed to be more specific changed to LF_MGR_IP Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 12 ++++++------ py-scripts/tools/ct_us_002.json | 16 ++++++++-------- py-scripts/tools/lf_check.py | 12 ++++++------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index f818c494..7441a632 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -4,14 +4,14 @@ "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 in the test below is replaced by the json lf_mgr", + "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_parameters":{ "test_bed": "CT-US-001", - "lf_mgr": "192.168.100.116", + "lf_mgr_ip": "192.168.100.116", "lf_mgr_port": "8080", "dut_name": "ASUSRT-AX88U", "dut_bssid": "3c:7c:3f:55:4d:64", @@ -78,7 +78,7 @@ "suite_wc_dp":{ "CT-US-001_create_chamberview_dut_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", "args_list":[ - "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", + "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" @@ -86,7 +86,7 @@ }, "CT-US-001_create_chamberview_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", "args_list":[ - " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario ct-us-001-scenario ", " --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-1' NA wiphy3,AUTO -1 NA' ", @@ -115,7 +115,7 @@ }, "CT-US-001_create_chamberview_dut_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", "args_list":[ - "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", + "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" @@ -123,7 +123,7 @@ }, "CT-US-001_create_chamberview_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", "args_list":[ - " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario ct-us-001-scenario ", " --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-1' NA wiphy3,AUTO -1 NA' ", diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json index 7e90c953..4aadea03 100644 --- a/py-scripts/tools/ct_us_002.json +++ b/py-scripts/tools/ct_us_002.json @@ -4,14 +4,14 @@ "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 in the test below is replaced by the json lf_mgr", + "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_parameters":{ "test_bed": "CT-US-002", - "lf_mgr": "192.168.100.200", + "lf_mgr_ip": "192.168.100.200", "lf_mgr_port": "8080", "dut_name": "Ruckus-R750", "dut_bssid": "4c:b1:cd:18:e8:ec", @@ -78,14 +78,14 @@ "suite_wc_dp":{ "CT-US-002_create_chamberview_dut_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", "args_list":[ - "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", + "--lfmgr LF_MGR_IP--port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_idx=0 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", " --ssid 'ssid_idx=1 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" ]}, "CT-US-002_create_chamberview_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", "args_list":[ - " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario ucentral-scenario ", " --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-1' NA wiphy4,AUTO -1 NA' ", @@ -114,14 +114,14 @@ }, "CT-US-002_create_chamberview_dut_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", "args_list":[ - "--lfmgr LF_MGR --port LF_MGR_PORT --dut_name DUT_NAME", + "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_idx=0 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", " --ssid 'ssid_idx=1 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" ]}, "CT-US-002_create_chamberview_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", "args_list":[ - " --lfmgr LF_MGR --port LF_MGR_PORT --delete_scenario", + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario ucentral-scenario ", " --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-1' NA wiphy4,AUTO -1 NA' ", @@ -130,7 +130,7 @@ }, "CT-US-002_wifi_capacity_AX200 CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", "args_list":[ - " --mgr LF_MGR --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct", + " --mgr LF_MGR --port LF_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 --stations 1.1.wlan4 ", " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", @@ -139,7 +139,7 @@ }, "CT-US-002_dataplane_AX200":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", "args_list":[ - " --mgr LF_MGR --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 cicd-dpt", " --config_name test_con --upstream 1.1.eth2 --dut DUT_NAME --duration 30s --station 1.1.wlan4", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 8aacbfa0..59288a93 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -129,7 +129,7 @@ class lf_check(): self.host_ip_test = None self.email_title_txt = "" self.email_txt = "" - self.lf_mgr = "" + self.lf_mgr_ip = "" self.lf_mgr_port = "" self.dut_name = "" # "ASUSRT-AX88U" note this is not dut_set_name self.dut_bssid = "" #"3c:7c:3f:55:4d:64" - this is the mac for the radio this may be seen with a scan @@ -402,10 +402,10 @@ blog: http://{blog}:2368 self.email_txt = self.json_data["test_parameters"]["email_txt"] else: self.logger.info("email_txt not in test_parameters json") - if "lf_mgr" in self.json_data["test_parameters"]: - self.lf_mgr = self.json_data["test_parameters"]["lf_mgr"] + if "lf_mgr_ip" in self.json_data["test_parameters"]: + self.lf_mgr = self.json_data["test_parameters"]["lf_mgr_ip"] else: - self.logger.info("lf_mgr not in test_parameters json") + self.logger.info("lf_mgr_ip not in test_parameters json") if "lf_mgr_port" in self.json_data["test_parameters"]: self.lf_mgr_port = self.json_data["test_parameters"]["lf_mgr_port"] else: @@ -711,8 +711,8 @@ blog: http://{blog}:2368 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) - if 'LF_MGR' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('LF_MGR',self.lf_mgr) + 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) 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) if 'DUT_NAME' in self.test_dict[test]['args']: From 2b3c11f2af74c1b67e42eab7c60bc35fc03d83af Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 20:27:32 -0600 Subject: [PATCH 117/152] lf_check.py: bug fixes for using lf_mgr_ip ct_us_001.json, ct_us_002.json : updated to use LF_MGR_IP, LF_MGR_PORT in all tests Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 10 +++++----- py-scripts/tools/ct_us_002.json | 10 +++++----- py-scripts/tools/lf_check.py | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 7441a632..c1feec8d 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -78,7 +78,7 @@ "suite_wc_dp":{ "CT-US-001_create_chamberview_dut_1":{"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", + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" @@ -95,7 +95,7 @@ }, "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", "args_list":[ - " --mgr 192.168.100.116 --port 8080 --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 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 --stations 1.1.wlan1", " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", @@ -104,7 +104,7 @@ }, "CT-US-001_dataplane_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", "args_list":[ - " --mgr 192.168.100.116 --port 8080 --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 cicd-dpt", " --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;88;120;256;512;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", @@ -132,7 +132,7 @@ }, "CT-US-001_wifi_capacity_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", "args_list":[ - " --mgr 192.168.100.116 --port 8080 --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 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 --stations 1.1.wlan3", " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", @@ -141,7 +141,7 @@ }, "CT-US-001_dataplane_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", "args_list":[ - " --mgr 192.168.100.116 --port 8080 --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 cicd-dpt", " --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;88;120;256;512;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json index 4aadea03..87eb0320 100644 --- a/py-scripts/tools/ct_us_002.json +++ b/py-scripts/tools/ct_us_002.json @@ -78,7 +78,7 @@ "suite_wc_dp":{ "CT-US-002_create_chamberview_dut_1":{"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", + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_idx=0 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", " --ssid 'ssid_idx=1 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" @@ -94,7 +94,7 @@ }, "CT-US-002_wifi_capacity_ATH10k(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", "args_list":[ - "--mgr 192.168.100.200 --port 8080 --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 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 --stations 1.1.wlan1", " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", @@ -103,7 +103,7 @@ }, "CT-US-002_dataplane_ATH10k(9984) CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"", "args_list":[ - "--mgr 192.168.100.200 --port 8080 --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 cicd-dpt", " --config_name test_con --upstream 1.1.eth2 --dut DUT_NAME --duration 30s --station 1.1.wlan1", " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' ", @@ -114,7 +114,7 @@ }, "CT-US-002_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", + " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_idx=0 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", " --ssid 'ssid_idx=1 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" @@ -130,7 +130,7 @@ }, "CT-US-002_wifi_capacity_AX200 CT-US-002":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", "args_list":[ - " --mgr LF_MGR --port LF_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 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 --stations 1.1.wlan4 ", " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 59288a93..1006d7f0 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -187,13 +187,13 @@ class lf_check(): hostname = socket.gethostname() ip = socket.gethostbyname(hostname) if(self.email_txt != ""): - message_txt = """{email_txt} lanforge target {lf_mgr} + message_txt = """{email_txt} lanforge target {lf_mgr_ip} Results from {hostname}: http://{ip}/{report} Blog: http://{blog}:2368 NOTE: for now to see stdout and stderr remove /home/lanforge from path. -""".format(hostname=hostname, ip=ip, report=report_url, email_txt=self.email_txt, lf_mgr=self.lf_mgr,blog=self.blog_host) +""".format(hostname=hostname, ip=ip, report=report_url, email_txt=self.email_txt, lf_mgr_ip=self.lf_mgr_ip,blog=self.blog_host) else: message_txt = """Results from {hostname}: @@ -403,7 +403,7 @@ blog: http://{blog}:2368 else: self.logger.info("email_txt not in test_parameters json") if "lf_mgr_ip" in self.json_data["test_parameters"]: - self.lf_mgr = self.json_data["test_parameters"]["lf_mgr_ip"] + self.lf_mgr_ip = self.json_data["test_parameters"]["lf_mgr_ip"] else: self.logger.info("lf_mgr_ip not in test_parameters json") if "lf_mgr_port" in self.json_data["test_parameters"]: From 581345b1b24718000af3c279216e470c832cf0c4 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 20:55:01 -0600 Subject: [PATCH 118/152] lf_check.py : bugfix upstream port not being propogated from json correctly ct_us_001.json : formatting Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 2 +- py-scripts/tools/lf_check.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index c1feec8d..5d562d85 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -160,7 +160,7 @@ ] } } - } + } } diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 1006d7f0..dda30816 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -563,7 +563,7 @@ blog: http://{blog}:2368 self.logger.info("col_names not in test_generic json") exit(1) if "upstream_port" in self.json_data["test_generic"]: - self.num_sta = self.json_data["test_generic"]["upstream_port"] + self.upstream_port = self.json_data["test_generic"]["upstream_port"] else: self.logger.info("upstream_port not in test_generic json") exit(1) @@ -731,7 +731,7 @@ blog: http://{blog}:2368 if 'COL_NAMES' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('COL_NAMES',self.col_names) if 'UPSTREAM_PORT' in self.test_dict[test]['args']: - self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('UPSTREAM_PORT',self.col_names) + 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 # of the reports when the reports are pulled. From aa3e8974499d401be3dd0532358d617f58b9c78f Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 21:54:26 -0600 Subject: [PATCH 119/152] ct_us_001.json, ct_us_002.json : working on command line parameters for create_chamberview single quotes and double quotes Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 12 ++++++------ py-scripts/tools/ct_us_002.json | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 5d562d85..04b544dd 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -88,9 +88,9 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario ct-us-001-scenario ", - " --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-1' NA wiphy3,AUTO -1 NA' ", - " --raw_line 'profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,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-1' NA wiphy3,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\"" ] }, "CT-US-001_wifi_capacity_ATH10K(9984)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", @@ -125,9 +125,9 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario ct-us-001-scenario ", - " --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-1' NA wiphy3,AUTO -1 NA' ", - " --raw_line 'profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,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-1' NA wiphy3,AUTO -1 NA\" ", + " --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\" " ] }, "CT-US-001_wifi_capacity_AX210":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json index 87eb0320..a829f08f 100644 --- a/py-scripts/tools/ct_us_002.json +++ b/py-scripts/tools/ct_us_002.json @@ -87,9 +87,9 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario ucentral-scenario ", - " --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-1' NA wiphy4,AUTO -1 NA' ", - " --raw_line 'profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,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-1' NA wiphy4,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)":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", @@ -123,9 +123,9 @@ "args_list":[ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario", " --create_scenario ucentral-scenario ", - " --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-1' NA wiphy4,AUTO -1 NA' ", - " --raw_line 'profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,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-1' NA wiphy4,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":{"enabled":"TRUE","load_db":"skip","command":"lf_wifi_capacity_test.py","args":"", From ac13e8b8f0dd3106a88d4e69e3a90199d763344a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 10 Jul 2021 22:18:45 -0600 Subject: [PATCH 120/152] ct_us_001.json , ct_us_002.json added the DUT_NAME to the output Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 4 ++-- py-scripts/tools/ct_us_002.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 04b544dd..8a2ee360 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -81,7 +81,7 @@ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", - " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" + " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num DUT_NAME" ] }, "CT-US-001_create_chamberview_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", @@ -118,7 +118,7 @@ "--lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", " --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=3c:7c:3f:55:4d:64'", - " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" + " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num DUT_NAME" ] }, "CT-US-001_create_chamberview_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json index a829f08f..c73d63a0 100644 --- a/py-scripts/tools/ct_us_002.json +++ b/py-scripts/tools/ct_us_002.json @@ -81,7 +81,7 @@ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_idx=0 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", " --ssid 'ssid_idx=1 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", - " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" + " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num DUT_NAME" ]}, "CT-US-002_create_chamberview_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", "args_list":[ @@ -117,7 +117,7 @@ " --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME", " --ssid 'ssid_idx=0 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", " --ssid 'ssid_idx=1 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", - " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num 'ct523c'" + " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num DUT_NAME" ]}, "CT-US-002_create_chamberview_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview.py","args":"", "args_list":[ From cae26106ec7862b5561d24a4aa5dc6d53bd1d1af Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Mon, 12 Jul 2021 09:39:46 -0600 Subject: [PATCH 121/152] ct_us_001.json , ct_us_002.json : bug fix , added test_rig to dataplane test Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/ct_us_001.json | 8 ++++---- py-scripts/tools/ct_us_002.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/py-scripts/tools/ct_us_001.json b/py-scripts/tools/ct_us_001.json index 8a2ee360..477e8d44 100644 --- a/py-scripts/tools/ct_us_001.json +++ b/py-scripts/tools/ct_us_001.json @@ -109,8 +109,8 @@ " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", " --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH ", - " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", - " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" ] }, "CT-US-001_create_chamberview_dut_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", @@ -146,8 +146,8 @@ " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;1024;MTU' ", " --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20'", " --raw_line 'spatial_streams: 1' --pull_report --local_lf_report_dir REPORT_PATH", - " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", - " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" ] }, "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json index c73d63a0..eb2198da 100644 --- a/py-scripts/tools/ct_us_002.json +++ b/py-scripts/tools/ct_us_002.json @@ -108,8 +108,8 @@ " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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 ", - " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", - " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" ] }, "CT-US-002_create_chamberview_dut_2":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", @@ -144,8 +144,8 @@ " --download_speed 85% --upload_speed 0 --raw_line 'pkts: 60;88;120;256;512;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", - " --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN", - " --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" ] }, "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", From 8cef95962ef670ebf81aef2aa442e8a4dc78a6c7 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Mon, 12 Jul 2021 15:27:13 -0700 Subject: [PATCH 122/152] Major ghost improvements, create wifi_capacity dataplane, ghost script Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 81 +++++++++++++-------- py-dashboard/GrafanaRequest.py | 21 ++++-- py-scripts/cv_to_grafana.py | 2 - py-scripts/ghost_profile.py | 2 +- py-scripts/lf_ap_auto_test.py | 3 +- py-scripts/lf_tr398_test.py | 7 +- py-scripts/wifi_cap_to_grafana.sh | 17 +++-- py-scripts/wifi_capacity_dataplane_ghost.sh | 51 +++++++++++++ 8 files changed, 132 insertions(+), 52 deletions(-) create mode 100755 py-scripts/wifi_capacity_dataplane_ghost.sh diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index f052351b..adfc540f 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -15,6 +15,7 @@ import requests import jwt from datetime import datetime +from dateutil import tz import json import subprocess from scp import SCPClient @@ -239,7 +240,7 @@ class GhostRequest: user_push=None, password_push=None, customer=None, - testbed='Unknown Testbed', + testbed=None, test_run=None, target_folders=list(), grafana_token=None, @@ -248,6 +249,9 @@ class GhostRequest: grafana_datasource='InfluxDB', grafana_bucket=None): global dut_hw, dut_sw, dut_model, dut_serial + + now = datetime.now() + text = '' csvreader = CSVReader() if grafana_token is not None: @@ -292,20 +296,19 @@ class GhostRequest: images = list() times = list() test_pass_fail = list() - duts = dict() for target_folder in target_folders: try: target_file = '%s/kpi.csv' % target_folder df = csvreader.read_csv(file=target_file, sep='\t') - csv_testbed = csvreader.get_column(df, 'test-rig')[0] + test_rig = csvreader.get_column(df, 'test-rig')[0] pass_fail = Counter(csvreader.get_column(df, 'pass/fail')) test_pass_fail.append(pass_fail) dut_hw = csvreader.get_column(df, 'dut-hw-version')[0] dut_sw = csvreader.get_column(df, 'dut-sw-version')[0] dut_model = csvreader.get_column(df, 'dut-model-num')[0] dut_serial = csvreader.get_column(df, 'dut-serial-num')[0] - duts[csv_testbed] = [dut_hw, dut_sw, dut_model, dut_serial] + duts = [dut_serial, dut_hw, dut_sw, dut_model, test_rig] times_append = csvreader.get_column(df, 'Date') for target_time in times_append: times.append(float(target_time) / 1000) @@ -323,11 +326,14 @@ class GhostRequest: print("Failure") target_folders.remove(target_folder) break - testbeds.append(csv_testbed) - if testbed == 'Unknown Testbed': - raise UserWarning('Please define your testbed') + testbeds.append(test_rig) + if testbed is None: + testbed = test_rig - local_path = '/home/%s/%s/%s' % (user_push, customer, testbed) + if test_run is None: + test_run = now.strftime('%B-%d-%Y-%I-%M-%p-report') + + local_path = '/home/%s/%s/%s/%s' % (user_push, customer, testbed, test_run) transport = paramiko.Transport(ghost_host, port) transport.connect(None, user_push, password_push) @@ -336,12 +342,22 @@ class GhostRequest: if self.debug: print(local_path) print(target_folder) + + try: + sftp.mkdir('/home/%s/%s/%s' % (user_push, customer, testbed)) + except: + pass + + try: + sftp.mkdir(local_path) + except: + pass scp_push.put(target_folder, local_path, recursive=True) files = sftp.listdir(local_path + '/' + target_folder) for file in files: if 'pdf' in file: - url = 'http://%s/%s/%s/%s/%s' % ( - ghost_host, customer.strip('/'), testbed, target_folder, file) + url = 'http://%s/%s/%s/%s/%s/%s' % ( + ghost_host, customer.strip('/'), testbed, test_run, target_folder, file) pdfs.append('PDF of results: %s
' % (url, file)) scp_push.close() self.upload_images(target_folder) @@ -362,13 +378,15 @@ class GhostRequest: low_priority_list.append(low_priority) - now = datetime.now() test_pass_fail_results = sum((Counter(test) for test in test_pass_fail), Counter()) end_time = max(times) start_time = '2021-07-01' - end_time = datetime.utcfromtimestamp(end_time).strftime('%Y-%m-%d %H:%M:%S') + end_time = datetime.utcfromtimestamp(end_time)#.strftime('%Y-%m-%d %H:%M:%S') + now = time.time() + offset = datetime.fromtimestamp(now) - datetime.utcfromtimestamp(now) + end_time = end_time + offset high_priority = csvreader.concat(high_priority_list) low_priority = csvreader.concat(low_priority_list) @@ -381,7 +399,7 @@ class GhostRequest: high_priority.append(['Total Failed', test_pass_fail_results['FAIL'], 'Total subtests failed during this run']) if title is None: - title = now.strftime('%B %d, %Y %I:%M %p report') + title = end_time.strftime('%B %d, %Y %I:%M %p report') # create Grafana Dashboard target_files = [] @@ -394,7 +412,7 @@ class GhostRequest: datasource=grafana_datasource, bucket=grafana_bucket, from_date=start_time, - to_date=end_time, + to_date=end_time.strftime('%Y-%m-%d %H:%M:%S'), pass_fail='GhostRequest', testbed=testbeds[0]) @@ -426,24 +444,23 @@ class GhostRequest: text = 'Testbed: %s
' % testbeds[0] dut_table = '' \ - '' - for device, data in duts.items(): - dut_table = dut_table + '' \ - '' \ - '' \ - '' \ - '' \ - '' \ - '' \ - '' \ - '' \ - '' \ - '' \ - '' \ - '' \ - '' % ( - device, data[0], data[1], data[2], data[3], test_pass_fail_results['PASS'], - test_pass_fail_results['FAIL']) + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + '' % ( + duts[4], duts[1], duts[2], duts[3], duts[0], test_pass_fail_results['PASS'], + test_pass_fail_results['FAIL']) dut_table = dut_table + '
Ghost Request requested values
Device%s
DUT_HW%s
DUT_SW%s
DUT model%s
DUT Serial%s
Tests passed%s
Tests failed%s
Test Information
Testbed%s
DUT_HW%s
DUT_SW%s
DUT model%s
DUT Serial%s
Tests passed%s
Tests failed%s
' text = text + dut_table diff --git a/py-dashboard/GrafanaRequest.py b/py-dashboard/GrafanaRequest.py index a831904f..a6349938 100644 --- a/py-dashboard/GrafanaRequest.py +++ b/py-dashboard/GrafanaRequest.py @@ -15,6 +15,7 @@ import json import string import random + class CSVReader: def __init__(self): self.shape = None @@ -41,6 +42,7 @@ class CSVReader: values.append(row[index]) return values + class GrafanaRequest: def __init__(self, _grafana_token, @@ -63,6 +65,7 @@ class GrafanaRequest: self.data = dict() self.data['overwrite'] = _overwrite self.csvreader = CSVReader() + self.units = dict() def create_bucket(self, bucket_name=None): @@ -128,7 +131,12 @@ class GrafanaRequest: # we need to make sure we match each Graph Group to the script it occurs in for script in scripts: # Unique Graph Groups for each script - dictionary[script] = list(set(self.csvreader.get_column(csv, 'Graph-Group'))) + graph_groups = self.csvreader.get_column(csv, 'Graph-Group') + dictionary[script] = list(set(graph_groups)) + units = self.csvreader.get_column(csv, 'Units') + self.units[script] = dict() + for index in range(0, len(graph_groups)): + self.units[script][graph_groups[index]] = units[index] print(dictionary) return dictionary @@ -174,7 +182,6 @@ class GrafanaRequest: dic['type'] = grouptype return dic - def create_custom_dashboard(self, scripts=None, title=None, @@ -226,6 +233,7 @@ class GrafanaRequest: graph_groups[pass_fail] = ['PASS', 'FAIL'] for scriptname in graph_groups.keys(): + print(scriptname) for graph_group in graph_groups[scriptname]: panel = dict() @@ -276,7 +284,10 @@ class GrafanaRequest: yaxis = dict() yaxis['format'] = 'short' - #yaxis['label'] = unit_dict[graph_group] + try: + yaxis['label'] = self.units[scriptname][graph_group] + except: + pass yaxis['logBase'] = 1 yaxis['max'] = None yaxis['min'] = None @@ -389,8 +400,8 @@ class GrafanaRequest: df = self.csvreader.read_csv(csv) units = self.csvreader.get_column(df, 'Units') test_id = self.csvreader.get_column(df, 'test-id') - maxunit = max(set(units), key = units.count) - maxtest = max(set(test_id), key = test_id.count) + maxunit = max(set(units), key=units.count) + maxtest = max(set(test_id), key=test_id.count) d = dict() d[maxunit] = maxtest print(maxunit, maxtest) diff --git a/py-scripts/cv_to_grafana.py b/py-scripts/cv_to_grafana.py index df3d2c02..3e1574c5 100755 --- a/py-scripts/cv_to_grafana.py +++ b/py-scripts/cv_to_grafana.py @@ -16,7 +16,6 @@ Influx from this script. --line "Resource=1.1 Profile=default Amount=4 Uses-1=wiphy1 DUT=DUT_TO_GRAFANA_DUT Traffic=wiphy1 Freq=-1" --line "Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 DUT=DUT_TO_GRAFANA_DUT Traffic=eth1 Freq=-1" --dut DUT_TO_GRAFANA ---test_rig Stidmatt-01 --create_scenario DUT_TO_GRAFANA_SCENARIO --station 1.1.sta00002 --duration 15s @@ -103,7 +102,6 @@ def main(): --line --line --dut - --test_rig --create_scenario --station --influx_tag diff --git a/py-scripts/ghost_profile.py b/py-scripts/ghost_profile.py index 3abe00df..297b4fd6 100755 --- a/py-scripts/ghost_profile.py +++ b/py-scripts/ghost_profile.py @@ -166,7 +166,7 @@ def main(): optional.add_argument('--influx_mgr', help='IP address of the server your Influx database is hosted if different from your LANforge Manager', default=None) - optional.add_argument('--debug') + optional.add_argument('--debug', help='Enable debugging', default=False, action="store_true") args = parser.parse_args() Ghost = UseGhost(_ghost_token=args.ghost_token, diff --git a/py-scripts/lf_ap_auto_test.py b/py-scripts/lf_ap_auto_test.py index d77cc3d2..d431df98 100755 --- a/py-scripts/lf_ap_auto_test.py +++ b/py-scripts/lf_ap_auto_test.py @@ -23,7 +23,7 @@ the options and how best to input data. --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 --pull_report \ + --pull_report \ --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ --influx_bucket ben \ @@ -46,7 +46,6 @@ show_log: 0 port_sorting: 0 kpi_id: AP Auto bg: 0xE0ECF8 -test_rig: Ferndale-01-Basic show_scan: 1 auto_helper: 1 skip_2: 1 diff --git a/py-scripts/lf_tr398_test.py b/py-scripts/lf_tr398_test.py index 9f5d9d9e..8cbec10a 100755 --- a/py-scripts/lf_tr398_test.py +++ b/py-scripts/lf_tr398_test.py @@ -28,8 +28,7 @@ the options and how best to input data. --set 'Multiple Assoc Stability' 0 \ --set 'Downlink MU-MIMO' 0 \ --set 'AP Coexistence' 0 \ - --set 'Long Term Stability' 0 \ - --test_rig Testbed-01 + --set 'Long Term Stability' 0 Note: --raw_line 'line contents' will add any setting to the test config. This is @@ -61,7 +60,6 @@ notes1: smaller CT810a chamber. CT704b and CT714 4-module attenuators are used. notes2: mounted on the sides of the DUT chamber are used to communicate to the DUT. DUT is facing forward at notes3: the zero-rotation angle. bg: 0xE0ECF8 -test_rig: TR-398 test bed show_scan: 1 auto_helper: 1 skip_2: 0 @@ -278,8 +276,7 @@ def main(): --set 'Multiple Assoc Stability' 0 \ --set 'Downlink MU-MIMO' 0 \ --set 'AP Coexistence' 0 \ - --set 'Long Term Stability' 0 \ - --test_rig Testbed-01 + --set 'Long Term Stability' 0 """ ) diff --git a/py-scripts/wifi_cap_to_grafana.sh b/py-scripts/wifi_cap_to_grafana.sh index d9054061..baf918cb 100755 --- a/py-scripts/wifi_cap_to_grafana.sh +++ b/py-scripts/wifi_cap_to_grafana.sh @@ -37,18 +37,25 @@ echo "Build Chamber View Scenario" echo "run wifi capacity test" ./lf_wifi_capacity_test.py --config_name Custom --create_stations --radio wiphy1 --pull_report --influx_host ${INFLUX_MGR} \ --influx_port 8086 --influx_org Candela --influx_token ${INFLUXTOKEN} --influx_bucket ${INFLUXBUCKET} --mgr ${MGR} \ ---instance_name testing --upstream eth1 --test_rig ${TESTBED} --graph_groups lf_cv_rpt_filelocation.txt --duration 15s +--instance_name testing --upstream eth1 --test_rig ${TESTBED} --graph_groups lf_cv_rpt_filelocation.txt --duration 15s --local_lf_report_dir ${REPORT_PATH} + #config_name doesn't matter, change the influx_host to your LANforge device, echo "run Dataplane test" ./lf_dataplane_test.py --mgr ${MGR} --instance_name dataplane-instance --config_name test_config --upstream 1.1.eth1 \ --station 1.1.06 --dut linksys-8450 --influx_host ${INFLUX_MGR} --influx_port 8086 --influx_org Candela --influx_token ${INFLUXTOKEN} \ ---influx_bucket ${INFLUXBUCKET} --influx_tag testbed ${TESTBED} --graph_groups lf_cv_rpt_filelocation.txt --duration 15s +--influx_bucket ${INFLUXBUCKET} --influx_tag testbed ${TESTBED} --graph_groups lf_cv_rpt_filelocation.txt --duration 15s --pull_report --local_lf_report_dir ${REPORT_PATH} + # Build grafana dashboard and graphs view for the KPI in the capacity test. -./grafana_profile.py --create_custom --title ${TESTBED} --influx_bucket ${INFLUXBUCKET} --mgr ${MGR} --grafana_token \ -${GRAFANATOKEN} --grafana_host ${INFLUX_MGR} --testbed ${TESTBED} --graph_groups_file lf_cv_rpt_filelocation.txt \ ---scripts Dataplane --datasource 'InfluxDB stidmatt bucket' +#./grafana_profile.py --create_custom --title ${TESTBED} --influx_bucket ${INFLUXBUCKET} --mgr ${MGR} --grafana_token \ +#${GRAFANATOKEN} --grafana_host ${INFLUX_MGR} --testbed ${TESTBED} --graph_groups_file lf_cv_rpt_filelocation.txt \ +#--scripts Dataplane --datasource 'InfluxDB stidmatt bucket' + +./ghost_profile.py --ghost_token ${GHOST_TOKEN} --ghost_host ${GHOST_MGR} --authors ${AUTHOR} --customer ${CUSTOMER} \ +--user_push ${USER_PUSH} --password_push ${PASSWORD_PUSH} --kpi_to_ghost --grafana_token ${GRAFANATOKEN} --grafana_host ${INFLUX_MGR} \ +--grafana_bucket ${INFLUXBUCKET} --influx_host ${INFLUX_MGR} --influx_org Candela --influx_token ${INFLUXTOKEN} \ +--influx_bucket ${INFLUXBUCKET} --parent_folder ${REPORT_PATH} rm lf_cv_rpt_filelocation.txt diff --git a/py-scripts/wifi_capacity_dataplane_ghost.sh b/py-scripts/wifi_capacity_dataplane_ghost.sh new file mode 100755 index 00000000..ebdf9ddb --- /dev/null +++ b/py-scripts/wifi_capacity_dataplane_ghost.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +INFLUX_TOKEN=31N9QDhjJHBu4eMUlMBwbK3sOjXLRAhZuCzZGeO8WVCj-xvR8gZWWvRHOcuw-5RHeB7xBFnLs7ZV023k4koR1A== +INFLUX_HOST=c7-grafana.candelatech.com +INFLUX_BUCKET=stidmatt + +GRAFANA_TOKEN=eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== + +GHOST_TOKEN=60df4b0175953f400cd30650:d50e1fabf9a9b5d3d30fe97bc3bf04971d05496a89e92a169a0d72357c81f742 + +SSID=lanforge +PASSWORD=password +SECURITY=wpa2 +TEST_RIG=ct523c-ccbc +DUT_NAME=linksys-8450 +MGR=192.168.1.7 +RADIO=wiphy1 +UPSTREAM=1.1.eth1 + +NOW=$(date +"%Y-%m-%d-%H-%M") + +mkdir ${NOW} +#./scenario.py --mgr ${MGR} --load BLANK +#./create_l3.py --mgr ${MGR} --radio ${RADIO} --ssid ${SSID} --password ${PASSWORD} --security ${SECURITY} +# Create/update new DUT. +#Replace my arguments with your setup. Separate your ssid arguments with spaces and ensure the names are lowercase +echo "Make new DUT" +./create_chamberview_dut.py --lfmgr ${MGR} --dut_name DUT_TO_GRAFANA_DUT \ +--ssid "ssid_idx=0 ssid=lanforge security=WPA2 password=password bssid=04:f0:21:2c:41:84" + +# Create/update chamber view scenario and apply and build it. +echo "Build Chamber View Scenario" +#change the lfmgr to your system, set the radio to a working radio on your LANforge system, same with the ethernet port. +./create_chamberview.py --lfmgr ${MGR} --create_scenario DUT_TO_GRAFANA_SCENARIO \ +--line "Resource=1.1 Profile=default Amount=4 Uses-1=wiphy1 DUT=DUT_TO_GRAFANA_DUT Traffic=wiphy1 Freq=-1" \ +--line "Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 DUT=DUT_TO_GRAFANA_DUT Traffic=eth1 Freq=-1" + +./lf_wifi_capacity_test.py --mgr 192.168.1.7 --lf_user lanforge --lf_password lanforge --instance_name ${DUT_NAME} \ +--config_name wifi_config --upstream ${UPSTREAM} --radio wiphy0 --ssid ${SSID} --paswd ${PASSWORD} --security ${SECURITY} \ +--influx_host ${INFLUX_HOST} --influx_org Candela --influx_token ${INFLUX_TOKEN} --influx_bucket ${INFLUX_BUCKET} \ +--test_rig ${TEST_RIG} --influx_tag testbed ${TEST_RIG} --set DUT_NAME ${DUT_NAME} \ +--local_lf_report_dir /home/matthew/Documents/candela/lanforge-scripts/py-scripts/${NOW} +./lf_dataplane_test.py --mgr 192.168.1.7 --lf_user lanforge --lf_password lanforge --instance_name wct_instance \ +--config_name wifi_config --upstream ${UPSTREAM} --influx_host ${INFLUX_HOST} --influx_org Candela \ +--influx_token ${INFLUX_TOKEN} --influx_bucket ${INFLUX_BUCKET} --test_rig ${TEST_RIG} --influx_tag testbed ${TEST_RIG} \ +--station 1.1.sta00000 --raw_line 'traffic_types: UDP;TCP' --set DUT_NAME ${DUT_NAME} \ +--local_lf_report_dir /home/matthew/Documents/candela/lanforge-scripts/py-scripts/${NOW} --pull_report +./ghost_profile.py --ghost_token ${GHOST_TOKEN} --ghost_host v-centos8s.candelatech.com --authors Matthew --customer candela \ +--user_push lanforge --password_push lanforge --kpi_to_ghost --grafana_token ${GRAFANA_TOKEN} \ +--grafana_host c7-grafana.candelatech.com --grafana_bucket lanforge_qa_testing \ +--parent_folder /home/matthew/Documents/candela/lanforge-scripts/py-scripts/${NOW} \ No newline at end of file From 45e2688f3669d41f78f9fdc7e1b801ae80d16572 Mon Sep 17 00:00:00 2001 From: karthikaeyetea Date: Tue, 13 Jul 2021 11:59:30 +0530 Subject: [PATCH 123/152] print statement changed --'setting attenuator' instead creating attenuator --- 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 ce1a33b3..33b7f2b3 100644 --- a/py-json/lf_attenmod.py +++ b/py-json/lf_attenmod.py @@ -57,7 +57,7 @@ class ATTENUATORProfile(LFCliBase): def create(self, debug=False): if len(self.atten_serno) == 0 or len(self.atten_idx) == 0 or len(self.atten_val) == 0: print("ERROR: Must specify atten_serno, atten_idx, and atten_val when setting attenuator.\n") - print("Creating Attenuator...") + 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) From 1a16b65d373f17ba1f81301e7e1bc7ff26a6102c Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 13 Jul 2021 10:50:14 -0600 Subject: [PATCH 124/152] CT_US_001.bash : updated the key tokens Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/CT_US_001.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py-scripts/tools/CT_US_001.bash b/py-scripts/tools/CT_US_001.bash index cad4bc6e..dd3c6eb7 100755 --- a/py-scripts/tools/CT_US_001.bash +++ b/py-scripts/tools/CT_US_001.bash @@ -14,13 +14,13 @@ MGR=192.168.100.116 # Candela internal influx INFLUXTOKEN=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== INFLUX_HOST=192.168.100.201 -INFLUX_BUCKET=ben +INFLUX_BUCKET=lanforge_qa_testing INFLUX_ORG=Candela -GRAFANATOKEN=eyJrIjoiVXVyZ0dQSXlNdGlQNGQ1R282S2p6SE1PZXJVOVpvM1UiLCJuIjoiYmVuLWdyYWZhbmEiLCJpZCI6MX0= +GRAFANATOKEN=eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ== GRAFANA_HOST=192.168.100.201 GROUP_FILE=/tmp/lf_cv_rpt_filelocation.txt -TESTBED=Ferndale-01 +TESTBED=CT_US-001 DUT=ASUSRT-AX88U UPSTREAM=eth2 #LF_WAN_PORT=eth3 From d3b8385b853c7d710c3fb047bf393a388a52d9c5 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Thu, 20 May 2021 00:55:33 +0530 Subject: [PATCH 125/152] throughput-QOS script added --- py-scripts/throughput_qos.py | 286 +++++++++++++++++++++++++++++++++++ 1 file changed, 286 insertions(+) create mode 100644 py-scripts/throughput_qos.py diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py new file mode 100644 index 00000000..a99b9835 --- /dev/null +++ b/py-scripts/throughput_qos.py @@ -0,0 +1,286 @@ +#!/usr/bin/env python3 + +"""throughput_qos.py will create stations and endpoints which evaluates l3 traffic for a particular type of service. + + +Use './throughput_qos.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')) + +import argparse +from LANforge import LFUtils +from realm import Realm +import time +import datetime + + +class ThroughputQOS(Realm): + def __init__(self, + ssid=None, + security=None, + password=None, + sta_list=[], + create_sta=True, + name_prefix=None, + upstream=None, + radio=None, + host="localhost", + port=8080, + 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, + number_template="00000", + test_duration="15m", + ip_tos=None, + 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.sta_list = sta_list + self.create_sta = create_sta + self.security = security + self.password = password + self.radio = radio + self.mode = mode + self.ap = ap + self.traffic_type = traffic_type + self.number_template = number_template + self.debug = _debug_on + self.name_prefix = name_prefix + self.test_duration = test_duration + self.ip_tos = ["BK", "BE", "VI", "VO"] + 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) + 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 = 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 + + 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): + 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() + self.station_profile.admin_down() + + def pre_cleanup(self): + self.cx_profile.cleanup_prefix() + if self.create_sta: + for sta in self.sta_list: + self.rm_port(sta, check_exists=True) + + def cleanup(self): + self.cx_profile.cleanup() + if self.create_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) + + 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) + 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") + + self.cx_profile.create(endp_type=self.traffic_type, side_a=self.upstream, + side_b=self.sta_list, + sleep_time=0, tos="BK") + #self.create_cx() + print("cx build finished") + + def create_cx(self): + self.ip_tos = ["BK", "BE", "VI", "VO"] + for tos in self.ip_tos: + self.cx_profile.create(endp_type=self.traffic_type, side_a=self.upstream, + side_b=self.sta_list, + sleep_time=0, tos=tos) + print("cross connections with TOS type created.") + + def evaluate_throughput(self): + test_bps_rx_a, test_bps_rx_b = [], [] + for sta in self.cx_profile.created_cx.keys(): + if self.cx_profile.side_a_min_bps != '0': + test_bps_rx_a.append(float(f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % (sta))).values())[2]['bps rx a']/10000:.2f}")) + if self.cx_profile.side_b_min_bps != '0': + test_bps_rx_b.append(float(f"{list((self.json_get('/cx/%s?fields=bps+rx+b' % (sta))).values())[2]['bps rx b']/10000:.2f}")) + return test_bps_rx_a, test_bps_rx_b + + + +def main(): + parser = Realm.create_basic_argparse( + prog='throughput_QOS.py', + formatter_class=argparse.RawTextHelpFormatter, + epilog='''\ + Create stations to test connection and traffic on VAPs of varying security types (WEP, WPA, WPA2, WPA3, Open) + ''', + description='''\ +throughput_QOS.py: +-------------------- +Generic command layout: + +python3 ./throughput_QOS.py + --upstream_port eth1 + --radio wiphy0 + --num_stations 32 + --security {open|wep|wpa|wpa2|wpa3} + --mode 1 + {"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"} + --ssid netgear + --password admin123 + --test_duration 2m (default) + --monitor_interval_ms + --a_min 3000 + --b_min 1000 + --ap "00:0e:8e:78:e1:76" + --output_format csv + --traffic_type lf_udp + --report_file ~/Documents/results.csv (Example of csv file output - please use another extension for other file formats) + --compared_report ~/Documents/results_prev.csv (Example of csv file retrieval - please use another extension for other file formats) - UNDER CONSTRUCTION + --layer3_cols 'name','tx bytes','rx bytes','dropped' (column names from the GUI to print on report - please read below to know what to put here according to preferences) + --port_mgr_cols 'ap','ip' (column names from the GUI to print on report - please read below to know what to put here according to preferences) + --debug + + python3 ./throughput_QOS.py + --upstream_port eth1 (upstream POrt) + --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) + ''') + + 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]', required=True) + parser.add_argument('--output_format', help='choose either csv or xlsx') + parser.add_argument('--report_file', help='where you want to store results', default=None) + 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="2m") + parser.add_argument('--create_sta', help='Used to force a connection to a particular AP', default=True) + parser.add_argument('--sta_names', help='Used to force a connection to a particular AP', default="sta0000") + args = parser.parse_args() + create_sta = True + if args.create_sta == "False": + create_sta = False + + num_sta = 2 + if (args.num_stations is not None) and (int(args.num_stations) > 0): + num_sta = int(args.num_stations) + + + 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(",") + throughput_qos_test = ThroughputQOS(host=args.mgr, + port=args.mgr_port, + number_template="0000", + sta_list=station_list, + create_sta=create_sta, + name_prefix="TP", + 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, + mode=args.mode, + ap=args.ap, + traffic_type=args.traffic_type, + _debug_on=args.debug) + + throughput_qos_test.pre_cleanup() + + throughput_qos_test.build() + # exit() + if create_sta: + if not throughput_qos_test.passes(): + print(throughput_qos_test.get_fail_message()) + throughput_qos_test.exit_fail() + + try: + layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos_test.json_get('endp')['endpoint']]) + except: + raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') + + throughput_qos_test.start(False, False) + throughput_qos_test.stop() + if create_sta: + if not throughput_qos_test.passes(): + print(throughput_qos_test.get_fail_message()) + throughput_qos_test.exit_fail() + LFUtils.wait_until_ports_admin_up(port_list=station_list) + if throughput_qos_test.passes(): + throughput_qos_test.success() + #throughput_qos_test.cleanup() + + +if __name__ == "__main__": + main() From 1067537db3378ec555c3f8012fa0b8500beea273 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Sat, 22 May 2021 00:07:46 +0530 Subject: [PATCH 126/152] endpoints with ip tos created --- py-scripts/throughput_qos.py | 56 ++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index a99b9835..3738f473 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -1,6 +1,15 @@ #!/usr/bin/env python3 -"""throughput_qos.py will create stations and endpoints which evaluates l3 traffic for a particular type of service. +""" +NAME: throughput_qos.py + +PURPOSE: throughput_qos.py will create stations and endpoints which evaluates l3 traffic for a particular type of service. + +EXAMPLE: +python3 throughput_qos.py --mgr 192.168.200.240 --mgr_port 8080 -u eth1 --num_stations 1 +--radio wiphy1 --ssid TestAP5-71 --passwd lanforge --security wpa2 --mode 11 --a_min 1000000 --b_min 1000000 --traffic_type lf_udp + +python3 throughput_qos.py --num_stations 1 --radio wiphy1 --ssid ct523c-vap --passwd ct523c-vap --security wpa2 --mode 11 --a_min 1000000 --b_min 1000000 --traffic_type lf_udp Use './throughput_qos.py --help' to see command line usage and options @@ -27,6 +36,7 @@ import datetime class ThroughputQOS(Realm): def __init__(self, + tos, ssid=None, security=None, password=None, @@ -44,7 +54,6 @@ class ThroughputQOS(Realm): side_b_min_rate=56, side_b_max_rate=0, number_template="00000", test_duration="15m", - ip_tos=None, use_ht160=False, _debug_on=False, _exit_on_error=False, @@ -63,11 +72,11 @@ class ThroughputQOS(Realm): self.mode = mode self.ap = ap self.traffic_type = traffic_type + self.tos = tos.split(",") self.number_template = number_template self.debug = _debug_on self.name_prefix = name_prefix self.test_duration = test_duration - self.ip_tos = ["BK", "BE", "VI", "VO"] self.station_profile = self.new_station_profile() self.cx_profile = self.new_l3_cx_profile() self.station_profile.lfclient_url = self.lfclient_url @@ -131,31 +140,38 @@ class ThroughputQOS(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(endp_type=self.traffic_type, side_a=self.upstream, - side_b=self.sta_list, - sleep_time=0, tos="BK") - #self.create_cx() + # self.cx_profile.create(endp_type=self.traffic_type, side_a=self.upstream, + # side_b=self.sta_list, + # sleep_time=0, tos=BE) + self.create_cx() print("cx build finished") def create_cx(self): - self.ip_tos = ["BK", "BE", "VI", "VO"] - for tos in self.ip_tos: - self.cx_profile.create(endp_type=self.traffic_type, side_a=self.upstream, - side_b=self.sta_list, - sleep_time=0, tos=tos) + _tos = "BE,BK,VI,VO" + self.tos = _tos.split(",") + print("tos: {}".format(self.tos)) + for ip_tos in self.tos: + print("## ip_tos: {}".format(ip_tos)) + print("Creating connections for endpoint type: %s TOS: %s cx-count: %s" % ( + self.traffic_type, ip_tos, self.cx_profile.get_cx_count())) + self.cx_profile.create(endp_type=self.traffic_type, side_a=self.sta_list, + side_b=self.upstream, + sleep_time=0, tos=ip_tos) + print("cross connections with TOS type created.") def evaluate_throughput(self): test_bps_rx_a, test_bps_rx_b = [], [] for sta in self.cx_profile.created_cx.keys(): if self.cx_profile.side_a_min_bps != '0': - test_bps_rx_a.append(float(f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % (sta))).values())[2]['bps rx a']/10000:.2f}")) + test_bps_rx_a.append(float( + f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % (sta))).values())[2]['bps rx a'] / 10000:.2f}")) if self.cx_profile.side_b_min_bps != '0': - test_bps_rx_b.append(float(f"{list((self.json_get('/cx/%s?fields=bps+rx+b' % (sta))).values())[2]['bps rx b']/10000:.2f}")) + test_bps_rx_b.append(float( + f"{list((self.json_get('/cx/%s?fields=bps+rx+b' % (sta))).values())[2]['bps rx b'] / 10000:.2f}")) return test_bps_rx_a, test_bps_rx_b - def main(): parser = Realm.create_basic_argparse( prog='throughput_QOS.py', @@ -221,6 +237,8 @@ python3 ./throughput_QOS.py parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m") parser.add_argument('--create_sta', help='Used to force a connection to a particular AP', default=True) parser.add_argument('--sta_names', help='Used to force a connection to a particular AP', default="sta0000") + parser.add_argument('--tos', help='used to provide different ToS settings: BK | BE | VI | VO | numeric', + default="BE") args = parser.parse_args() create_sta = True if args.create_sta == "False": @@ -230,7 +248,6 @@ python3 ./throughput_QOS.py if (args.num_stations is not None) and (int(args.num_stations) > 0): num_sta = int(args.num_stations) - if create_sta: station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, radio=args.radio) @@ -254,6 +271,7 @@ python3 ./throughput_QOS.py mode=args.mode, ap=args.ap, traffic_type=args.traffic_type, + tos=args.tos, _debug_on=args.debug) throughput_qos_test.pre_cleanup() @@ -271,7 +289,7 @@ python3 ./throughput_QOS.py raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') throughput_qos_test.start(False, False) - throughput_qos_test.stop() + # throughput_qos_test.stop() if create_sta: if not throughput_qos_test.passes(): print(throughput_qos_test.get_fail_message()) @@ -279,8 +297,8 @@ python3 ./throughput_QOS.py LFUtils.wait_until_ports_admin_up(port_list=station_list) if throughput_qos_test.passes(): throughput_qos_test.success() - #throughput_qos_test.cleanup() + # throughput_qos_test.cleanup() if __name__ == "__main__": - main() + main() \ No newline at end of file From d8dfd93747b6c54a34d85d01d1876340d7e80f40 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Tue, 25 May 2021 23:12:14 +0530 Subject: [PATCH 127/152] tos values retrieved --- py-scripts/throughput_qos.py | 76 ++++++++------- py-scripts/throughput_qos_report.py | 142 ++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+), 34 deletions(-) create mode 100644 py-scripts/throughput_qos_report.py diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 3738f473..321fec8b 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -139,37 +139,41 @@ class ThroughputQOS(Realm): 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") - - # self.cx_profile.create(endp_type=self.traffic_type, side_a=self.upstream, - # side_b=self.sta_list, - # sleep_time=0, tos=BE) self.create_cx() print("cx build finished") def create_cx(self): - _tos = "BE,BK,VI,VO" + _tos = "BK,BE,VI,VO" self.tos = _tos.split(",") print("tos: {}".format(self.tos)) for ip_tos in self.tos: print("## ip_tos: {}".format(ip_tos)) print("Creating connections for endpoint type: %s TOS: %s cx-count: %s" % ( - self.traffic_type, ip_tos, self.cx_profile.get_cx_count())) + self.traffic_type, ip_tos, self.cx_profile.get_cx_count())) self.cx_profile.create(endp_type=self.traffic_type, side_a=self.sta_list, side_b=self.upstream, sleep_time=0, tos=ip_tos) - print("cross connections with TOS type created.") def evaluate_throughput(self): - test_bps_rx_a, test_bps_rx_b = [], [] - for sta in self.cx_profile.created_cx.keys(): - if self.cx_profile.side_a_min_bps != '0': - test_bps_rx_a.append(float( - f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % (sta))).values())[2]['bps rx a'] / 10000:.2f}")) - if self.cx_profile.side_b_min_bps != '0': - test_bps_rx_b.append(float( - f"{list((self.json_get('/cx/%s?fields=bps+rx+b' % (sta))).values())[2]['bps rx b'] / 10000:.2f}")) - return test_bps_rx_a, test_bps_rx_b + tos_upload, tos_download = {}, {} + tos_video, tos_voice, tos_bk, tos_be = [], [], [], [] + if self.cx_profile.get_cx_count() > 0: + for sta in self.cx_profile.created_cx.keys(): + temp = int(sta[12:]) + if temp % 4 == 0: + tos_bk.append(list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b,name' % sta).values())[2]) + elif temp % 4 == 1: + tos_be.append(list(self.json_get('cx/%s?fields=bps+rx+a,bps+rx+b,name' % sta).values())[2]) + elif temp % 4 == 2: + tos_voice.append(list(self.json_get('cx/%s?fields=bps+rx+a,bps+rx+b,name' % sta).values())[2]) + elif temp % 4 == 3: + tos_video.append(list(self.json_get('cx/%s?fields=bps+rx+a,bps+rx+b,name' % sta).values())[2]) + else: + print("no connections available to evaluate QOS") + + print(tos_bk, tos_be, tos_voice, tos_video) + return tos_upload, tos_download def main(): @@ -220,7 +224,7 @@ python3 ./throughput_QOS.py --debug python3 ./throughput_QOS.py - --upstream_port eth1 (upstream POrt) + --upstream_port eth1 (upstream Port) --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) @@ -238,7 +242,7 @@ python3 ./throughput_QOS.py parser.add_argument('--create_sta', help='Used to force a connection to a particular AP', default=True) parser.add_argument('--sta_names', help='Used to force a connection to a particular AP', default="sta0000") parser.add_argument('--tos', help='used to provide different ToS settings: BK | BE | VI | VO | numeric', - default="BE") + default="Best Effort") args = parser.parse_args() create_sta = True if args.create_sta == "False": @@ -253,12 +257,12 @@ python3 ./throughput_QOS.py radio=args.radio) else: station_list = args.sta_names.split(",") - throughput_qos_test = ThroughputQOS(host=args.mgr, + throughput_qos = ThroughputQOS(host=args.mgr, port=args.mgr_port, number_template="0000", sta_list=station_list, create_sta=create_sta, - name_prefix="TP", + name_prefix="TOS-", upstream=args.upstream_port, ssid=args.ssid, password=args.passwd, @@ -274,30 +278,34 @@ python3 ./throughput_QOS.py tos=args.tos, _debug_on=args.debug) - throughput_qos_test.pre_cleanup() - throughput_qos_test.build() + throughput_qos.pre_cleanup() + + throughput_qos.build() # exit() if create_sta: - if not throughput_qos_test.passes(): - print(throughput_qos_test.get_fail_message()) - throughput_qos_test.exit_fail() + + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() try: - layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos_test.json_get('endp')['endpoint']]) + layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) except: raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') - throughput_qos_test.start(False, False) - # throughput_qos_test.stop() + throughput_qos.start(False, False) + time.sleep(30) + throughput_qos.stop() + throughput_qos.evaluate_throughput() if create_sta: - if not throughput_qos_test.passes(): - print(throughput_qos_test.get_fail_message()) - throughput_qos_test.exit_fail() + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() LFUtils.wait_until_ports_admin_up(port_list=station_list) - if throughput_qos_test.passes(): - throughput_qos_test.success() - # throughput_qos_test.cleanup() + if throughput_qos.passes(): + throughput_qos.success() + throughput_qos.cleanup() if __name__ == "__main__": diff --git a/py-scripts/throughput_qos_report.py b/py-scripts/throughput_qos_report.py new file mode 100644 index 00000000..a06868fb --- /dev/null +++ b/py-scripts/throughput_qos_report.py @@ -0,0 +1,142 @@ +''' +------------------------------------------------------------------------------------ +Throughput QOS report evaluates the throughput for a number of clients which are running +traffic with a particular type of service Video | Voice | BE | BK +------------------------------------------------------------------------------------ +''' +import matplotlib.pyplot as plt +import matplotlib as mpl +import numpy as np +import pandas as pd +import pdfkit +from lf_report import lf_report +from lf_graph import lf_bar_graph + + +def table(report, title, data): + # creating table + report.set_table_title(title) + report.build_table_title() + report.set_table_dataframe(data) + report.build_table() + + +def grph(report, data_set=None, xaxis_name="stations", yaxis_name="Throughput 2 (Mbps)", + xaxis_categories=None, label=None, graph_image_name=""): + # creating bar graph + report.set_graph_title(graph_image_name) + report.build_graph_title() + graph = lf_bar_graph(_data_set=data_set, + _xaxis_name=xaxis_name, + _yaxis_name=yaxis_name, + _xaxis_categories=xaxis_categories, + _graph_image_name=graph_image_name, + _label=label, + _color=None, + _color_edge='red') + graph_png = graph.build_bar_graph() + print("graph name {}".format(graph_png)) + report.set_graph_image(graph_png) + report.move_graph_image() + report.build_graph() + + +def tos_report(util, sta_num, bps_rx_a, bps_rx_b, tbl_title, grp_title, upload=1000000, download=1000000): + # report generation main function + rx_a = [] + rx_b = [] + pas_fail_up = [] + pas_fail_down = [] + thrp_b = upload * len(sta_num) # get overall upload values + thrp_a = download * len(sta_num) ## get overall download values + print(f"given upload--{thrp_b} and download--{thrp_a} values") + index = -1 + for a in bps_rx_a: + index += 1 + if len(a): + rx_a.append(f'min: {min(a)} | max: {max(a)} | avg: {sum(a) / len(a)}') + if thrp_a: + print( + f"getting overall download values '{index}'----- {sum(a)} \n {(thrp_a / 100) * (100 - int(util[index]))}") + if (thrp_a / 100) * (100 - int(util[index])) <= sum(a): + pas_fail_down.append("PASS") + else: + pas_fail_down.append("FAIL") + else: + pas_fail_down.append("NA") + rx_a.append(0) + + if len(bps_rx_b[index]): + rx_b.append(f'min: {min(bps_rx_b[index])} | max: {max(bps_rx_b[index])} | ' + f'avg: {(sum(bps_rx_b[index]) / len(bps_rx_b[index])):.2f}') + + if thrp_b: + print( + f"getting overall upload values '{index}'----- {sum(bps_rx_b[index])} \n {(thrp_b / 100) * (100 - int(util[index]))}") + if (thrp_b / 100) * (100 - int(util[index])) <= sum(bps_rx_b[index]): + pas_fail_up.append("PASS") + else: + pas_fail_up.append("FAIL") + else: + pas_fail_up.append("NA") + rx_b.append(0) + + util[index] = f'{util[index]}%' # append % to the util values + + overall_tab = pd.DataFrame({ + 'Channel Utilization (%)': util, "No.of.clients": [len(sta_num)] * len(util), + 'Speed (mbps)': [f'upload: {upload} | download: {download}'] * len(util), + 'Upload (mbps)': rx_b, 'Download (mbps)': rx_a + }) + print(f"overall table \n{overall_tab}") + + pasfail_tab = pd.DataFrame({ + 'Channel Utilization (%)': util, + 'Upload': pas_fail_up, + 'Download': pas_fail_down + }) + print(f"pass-fail table \n {pasfail_tab}") + + report = lf_report() + report_path = report.get_path() + report_path_date_time = report.get_path_date_time() + print("path: {}".format(report_path)) + print("path_date_time: {}".format(report_path_date_time)) + report.set_title(tbl_title) + report.build_banner() + + # objective title and description + report.set_obj_html(_obj_title="Objective", + _obj="Through this test we can evaluate the throughput given number of clients which" + "are running the traffic with a particular TOS i.e BK,BE,VI,VO") + report.build_objective() + + table(report, "Overall throughput", overall_tab) + table(report, "Throughput Pass/Fail", pasfail_tab) + + if download: + grph(report, + data_set=[[min(i) for i in bps_rx_a], [max(i) for i in bps_rx_a], [sum(i) / len(i) for i in bps_rx_a]], + xaxis_name="Utilizations", yaxis_name="Throughput (Mbps)", + xaxis_categories=util, label=["min", "max", 'avg'], graph_image_name="Throughput_download") + if upload: + grph(report, + data_set=[[min(i) for i in bps_rx_b], [max(i) for i in bps_rx_b], [sum(i) / len(i) for i in bps_rx_b]], + xaxis_name="Utilizations", yaxis_name="Throughput (Mbps)", + xaxis_categories=util, label=["min", "max", 'avg'], graph_image_name="Throughput_upload") + + for i in range(len(util)): + if download: + grph(report, data_set=[bps_rx_a[i]], xaxis_name="stations", + yaxis_name="Throughput (Mbps)", xaxis_categories=range(0, len(sta_num)), + label=[util[i]], graph_image_name=f"client-Throughput-download_{i}") + if upload: + grph(report, data_set=[bps_rx_b[i]], xaxis_name="stations", + yaxis_name="Throughput (Mbps)", xaxis_categories=range(0, len(sta_num)), + label=[util[i]], graph_image_name=f"client-Throughput-upload_{i}") + + html_file = report.write_html() + print("returned file {}".format(html_file)) + report.write_pdf() + + # report.generate_report() From ea1416aef4b2ec11e5edc206c9fde6455781b461 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Thu, 27 May 2021 03:34:50 +0530 Subject: [PATCH 128/152] upload download values can be generated --- py-scripts/throughput_qos.py | 122 ++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 58 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 321fec8b..546096a1 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -53,7 +53,8 @@ class ThroughputQOS(Realm): 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="15m", + test_duration="2m", + modes="0", use_ht160=False, _debug_on=False, _exit_on_error=False, @@ -73,6 +74,7 @@ class ThroughputQOS(Realm): self.ap = ap self.traffic_type = traffic_type self.tos = tos.split(",") + self.modes = modes.split(",") self.number_template = number_template self.debug = _debug_on self.name_prefix = name_prefix @@ -156,23 +158,30 @@ class ThroughputQOS(Realm): print("cross connections with TOS type created.") def evaluate_throughput(self): - tos_upload, tos_download = {}, {} - tos_video, tos_voice, tos_bk, tos_be = [], [], [], [] + tos_upload = {'_video': [], '_voice': [], '_bk': [], '_be': []} + tos_download = {'_video': [], '_voice': [], '_bk': [], '_be': []} if self.cx_profile.get_cx_count() > 0: for sta in self.cx_profile.created_cx.keys(): temp = int(sta[12:]) if temp % 4 == 0: - tos_bk.append(list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b,name' % sta).values())[2]) + data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] + tos_upload['_bk'].append(data['bps rx a']) + tos_download['_bk'].append(data['bps rx b']) elif temp % 4 == 1: - tos_be.append(list(self.json_get('cx/%s?fields=bps+rx+a,bps+rx+b,name' % sta).values())[2]) + data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] + tos_upload['_be'].append(data['bps rx a']) + tos_download['_be'].append(data['bps rx b']) elif temp % 4 == 2: - tos_voice.append(list(self.json_get('cx/%s?fields=bps+rx+a,bps+rx+b,name' % sta).values())[2]) + data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] + tos_upload['_voice'].append(data['bps rx a']) + tos_download['_voice'].append(data['bps rx b']) elif temp % 4 == 3: - tos_video.append(list(self.json_get('cx/%s?fields=bps+rx+a,bps+rx+b,name' % sta).values())[2]) + data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] + tos_upload['_video'].append(data['bps rx a']) + tos_download['_video'].append(data['bps rx b']) else: print("no connections available to evaluate QOS") - - print(tos_bk, tos_be, tos_voice, tos_video) + print(tos_upload, tos_download) return tos_upload, tos_download @@ -181,7 +190,7 @@ def main(): prog='throughput_QOS.py', formatter_class=argparse.RawTextHelpFormatter, epilog='''\ - Create stations to test connection and traffic on VAPs of varying security types (WEP, WPA, WPA2, WPA3, Open) + Create stations and endpoints and runs L3 traffic with various IP types of service(BK | BE | Video | Voice) ''', description='''\ throughput_QOS.py: @@ -215,15 +224,7 @@ python3 ./throughput_QOS.py --a_min 3000 --b_min 1000 --ap "00:0e:8e:78:e1:76" - --output_format csv - --traffic_type lf_udp - --report_file ~/Documents/results.csv (Example of csv file output - please use another extension for other file formats) - --compared_report ~/Documents/results_prev.csv (Example of csv file retrieval - please use another extension for other file formats) - UNDER CONSTRUCTION - --layer3_cols 'name','tx bytes','rx bytes','dropped' (column names from the GUI to print on report - please read below to know what to put here according to preferences) - --port_mgr_cols 'ap','ip' (column names from the GUI to print on report - please read below to know what to put here according to preferences) --debug - - python3 ./throughput_QOS.py --upstream_port eth1 (upstream Port) --traffic_type lf_udp (traffic type, lf_udp | lf_tcp) --test_duration 5m (duration to run traffic 5m --> 5 Minutes) @@ -234,8 +235,6 @@ python3 ./throughput_QOS.py 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]', required=True) - parser.add_argument('--output_format', help='choose either csv or xlsx') - parser.add_argument('--report_file', help='where you want to store results', default=None) 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="2m") @@ -243,62 +242,69 @@ python3 ./throughput_QOS.py parser.add_argument('--sta_names', help='Used to force a connection to a particular AP', default="sta0000") parser.add_argument('--tos', help='used to provide different ToS settings: BK | BE | VI | VO | numeric', default="Best Effort") + parser.add_argument('--modes', help='used to run on multiple radio modes,can be used with multiple stations', + default="0") args = parser.parse_args() - create_sta = True - if args.create_sta == "False": - create_sta = False - num_sta = 2 - if (args.num_stations is not None) and (int(args.num_stations) > 0): - num_sta = int(args.num_stations) + print("--------------------------------------------") + print(args) + print("--------------------------------------------") - if create_sta: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000, + # for multiple test conditions # + if args.num_stations is not None: + if len(args.num_stations.split(',')) > 1: + num_stations = args.num_stations.split(',') + if args.modes is not None: + modes = args.modes.split(',') + if args.radio is not None: + radios = args.modes.split(',') + # ---------------------------------------# + + if args.create_sta: + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, + padding_number_=10000, radio=args.radio) else: station_list = args.sta_names.split(",") throughput_qos = ThroughputQOS(host=args.mgr, - port=args.mgr_port, - number_template="0000", - sta_list=station_list, - create_sta=create_sta, - name_prefix="TOS-", - 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, - mode=args.mode, - ap=args.ap, - traffic_type=args.traffic_type, - tos=args.tos, - _debug_on=args.debug) - + port=args.mgr_port, + number_template="0000", + sta_list=station_list, + create_sta=args.create_sta, + name_prefix="TOS-", + 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, + mode=args.mode, + ap=args.ap, + traffic_type=args.traffic_type, + tos=args.tos, + modes=args.modes, + _debug_on=args.debug) throughput_qos.pre_cleanup() - throughput_qos.build() # exit() - if create_sta: - + if args.create_sta: if not throughput_qos.passes(): print(throughput_qos.get_fail_message()) throughput_qos.exit_fail() - - try: - layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) - except: - raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') + # try: + # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) + # except: + # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') throughput_qos.start(False, False) time.sleep(30) throughput_qos.stop() throughput_qos.evaluate_throughput() - if create_sta: + if args.create_sta: if not throughput_qos.passes(): print(throughput_qos.get_fail_message()) throughput_qos.exit_fail() @@ -309,4 +315,4 @@ python3 ./throughput_QOS.py if __name__ == "__main__": - main() \ No newline at end of file + main() From 2142ca10f5b176b88cc558cc8c459c41143b9a9d Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Thu, 27 May 2021 19:54:30 +0530 Subject: [PATCH 129/152] run multiple number of stations --- py-scripts/throughput_qos.py | 134 ++++++++++++++++------------ py-scripts/throughput_qos_report.py | 4 +- 2 files changed, 78 insertions(+), 60 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 546096a1..959097b6 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -179,6 +179,14 @@ class ThroughputQOS(Realm): data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] tos_upload['_video'].append(data['bps rx a']) tos_download['_video'].append(data['bps rx b']) + tos_upload.update({"_video" : sum(tos_upload['_video'])}) + tos_upload.update({"_voice": sum(tos_upload['_voice'])}) + tos_upload.update({"_bk": sum(tos_upload['_bk'])}) + tos_upload.update({"_be": sum(tos_upload['_be'])}) + tos_download.update({"_video": sum(tos_download['_video'])}) + tos_download.update({"_voice": sum(tos_download['_voice'])}) + tos_download.update({"_bk": sum(tos_download['_bk'])}) + tos_download.update({"_be": sum(tos_download['_be'])}) else: print("no connections available to evaluate QOS") print(tos_upload, tos_download) @@ -249,69 +257,79 @@ python3 ./throughput_QOS.py print("--------------------------------------------") print(args) print("--------------------------------------------") - + results = [], load = {"a_min": [], "b_min": []} # for multiple test conditions # if args.num_stations is not None: - if len(args.num_stations.split(',')) > 1: - num_stations = args.num_stations.split(',') - if args.modes is not None: - modes = args.modes.split(',') - if args.radio is not None: - radios = args.modes.split(',') - # ---------------------------------------# + stations = args.num_stations.split(',') + if args.modes is not None: + modes = args.mode.split(',') + if args.radio is not None: + radios = args.radio.split(',') + if args.a_min is not None or args.b_min is not None: + args.a_min = args.a_min.split(',') + args.b_min = args.b_min.split(',') + load.update({"a_min": args.a_min}) + load.update({"b_min": args.b_min}) + if args.test_duration is not None: + args.test_duration = args.test_duration.strip('m') + for station in stations: + if args.create_sta: + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(station) - 1, + padding_number_=10000, + radio=args.radio) + else: + station_list = args.sta_names.split(",") + throughput_qos = ThroughputQOS(host=args.mgr, + port=args.mgr_port, + number_template="0000", + sta_list=station_list, + create_sta=args.create_sta, + name_prefix="TOS-", + 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, + mode=args.mode, + ap=args.ap, + traffic_type=args.traffic_type, + tos=args.tos, + modes=args.modes, + _debug_on=args.debug) - if args.create_sta: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, - padding_number_=10000, - radio=args.radio) - else: - station_list = args.sta_names.split(",") - throughput_qos = ThroughputQOS(host=args.mgr, - port=args.mgr_port, - number_template="0000", - sta_list=station_list, - create_sta=args.create_sta, - name_prefix="TOS-", - 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, - mode=args.mode, - ap=args.ap, - traffic_type=args.traffic_type, - tos=args.tos, - modes=args.modes, - _debug_on=args.debug) + throughput_qos.pre_cleanup() + throughput_qos.build() + # exit() + if args.create_sta: + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() + # try: + # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) + # except: + # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') - throughput_qos.pre_cleanup() - throughput_qos.build() - # exit() - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - # try: - # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) - # except: - # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') + throughput_qos.start(False, False) + time.sleep(int(args.test_duration) * 60) + throughput_qos.stop() + results.append(throughput_qos.evaluate_throughput()) + if args.create_sta: + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() + LFUtils.wait_until_ports_admin_up(port_list=station_list) + if throughput_qos.passes(): + throughput_qos.success() + throughput_qos.cleanup() + # ---------------------------------------# + print('+++++++++++++++++') + print(results) + print('+++++++++++++++++') - throughput_qos.start(False, False) - time.sleep(30) - throughput_qos.stop() - throughput_qos.evaluate_throughput() - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - LFUtils.wait_until_ports_admin_up(port_list=station_list) - if throughput_qos.passes(): - throughput_qos.success() - throughput_qos.cleanup() if __name__ == "__main__": diff --git a/py-scripts/throughput_qos_report.py b/py-scripts/throughput_qos_report.py index a06868fb..15b8a5c8 100644 --- a/py-scripts/throughput_qos_report.py +++ b/py-scripts/throughput_qos_report.py @@ -117,12 +117,12 @@ def tos_report(util, sta_num, bps_rx_a, bps_rx_b, tbl_title, grp_title, upload=1 if download: grph(report, data_set=[[min(i) for i in bps_rx_a], [max(i) for i in bps_rx_a], [sum(i) / len(i) for i in bps_rx_a]], - xaxis_name="Utilizations", yaxis_name="Throughput (Mbps)", + xaxis_name="Load", yaxis_name="Throughput (Mbps)", xaxis_categories=util, label=["min", "max", 'avg'], graph_image_name="Throughput_download") if upload: grph(report, data_set=[[min(i) for i in bps_rx_b], [max(i) for i in bps_rx_b], [sum(i) / len(i) for i in bps_rx_b]], - xaxis_name="Utilizations", yaxis_name="Throughput (Mbps)", + xaxis_name="Load", yaxis_name="Throughput (Mbps)", xaxis_categories=util, label=["min", "max", 'avg'], graph_image_name="Throughput_upload") for i in range(len(util)): From 13f8e9755b77b80167519503a19bce4d784a6389 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Wed, 2 Jun 2021 22:57:46 +0530 Subject: [PATCH 130/152] multiple stations list with multiple speeds added --- py-scripts/throughput_qos.py | 122 ++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 959097b6..9a598632 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -179,14 +179,14 @@ class ThroughputQOS(Realm): data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] tos_upload['_video'].append(data['bps rx a']) tos_download['_video'].append(data['bps rx b']) - tos_upload.update({"_video" : sum(tos_upload['_video'])}) - tos_upload.update({"_voice": sum(tos_upload['_voice'])}) - tos_upload.update({"_bk": sum(tos_upload['_bk'])}) - tos_upload.update({"_be": sum(tos_upload['_be'])}) - tos_download.update({"_video": sum(tos_download['_video'])}) - tos_download.update({"_voice": sum(tos_download['_voice'])}) - tos_download.update({"_bk": sum(tos_download['_bk'])}) - tos_download.update({"_be": sum(tos_download['_be'])}) + tos_upload.update({"_videoQOS": sum(tos_upload['_video'])}) + tos_upload.update({"_voiceQOS": sum(tos_upload['_voice'])}) + tos_upload.update({"_bkQOS": sum(tos_upload['_bk'])}) + tos_upload.update({"_beQOS": sum(tos_upload['_be'])}) + tos_download.update({"_videoQOS": sum(tos_download['_video'])}) + tos_download.update({"_voiceQOS": sum(tos_download['_voice'])}) + tos_download.update({"_bkQOS": sum(tos_download['_bk'])}) + tos_download.update({"_beQOS": sum(tos_download['_be'])}) else: print("no connections available to evaluate QOS") print(tos_upload, tos_download) @@ -257,19 +257,23 @@ python3 ./throughput_QOS.py print("--------------------------------------------") print(args) print("--------------------------------------------") - results = [], load = {"a_min": [], "b_min": []} + results = [] # for multiple test conditions # if args.num_stations is not None: stations = args.num_stations.split(',') - if args.modes is not None: + if args.mode is not None: modes = args.mode.split(',') if args.radio is not None: radios = args.radio.split(',') - if args.a_min is not None or args.b_min is not None: + if args.a_min is not None or args.b_min is not None: args.a_min = args.a_min.split(',') args.b_min = args.b_min.split(',') - load.update({"a_min": args.a_min}) - load.update({"b_min": args.b_min}) + loads = {"a_min": args.a_min, "b_min": args.b_min} + # try: + # if len(args.a_min) != len(args.b_min): + # raise print("The values of a_min and b_min should be same.") + # finally: + # print("") if args.test_duration is not None: args.test_duration = args.test_duration.strip('m') for station in stations: @@ -279,53 +283,53 @@ python3 ./throughput_QOS.py radio=args.radio) else: station_list = args.sta_names.split(",") - throughput_qos = ThroughputQOS(host=args.mgr, - port=args.mgr_port, - number_template="0000", - sta_list=station_list, - create_sta=args.create_sta, - name_prefix="TOS-", - 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, - mode=args.mode, - ap=args.ap, - traffic_type=args.traffic_type, - tos=args.tos, - modes=args.modes, - _debug_on=args.debug) + for index in range(len(loads["a_min"])): + throughput_qos = ThroughputQOS(host=args.mgr, + port=args.mgr_port, + number_template="0000", + sta_list=station_list, + create_sta=args.create_sta, + name_prefix="TOS-", + 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=loads["a_min"][index], + side_b_min_rate=loads["b_min"][index], + mode=args.mode, + ap=args.ap, + traffic_type=args.traffic_type, + tos=args.tos, + _debug_on=args.debug) - throughput_qos.pre_cleanup() - throughput_qos.build() - # exit() - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - # try: - # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) - # except: - # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') + throughput_qos.pre_cleanup() + throughput_qos.build() + # exit() + if args.create_sta: + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() + # try: + # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) + # except: + # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') - throughput_qos.start(False, False) - time.sleep(int(args.test_duration) * 60) - throughput_qos.stop() - results.append(throughput_qos.evaluate_throughput()) - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - LFUtils.wait_until_ports_admin_up(port_list=station_list) - if throughput_qos.passes(): - throughput_qos.success() - throughput_qos.cleanup() - # ---------------------------------------# + throughput_qos.start(False, False) + time.sleep(int(args.test_duration) * 60) + throughput_qos.stop() + results.append(throughput_qos.evaluate_throughput()) + if args.create_sta: + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() + LFUtils.wait_until_ports_admin_up(port_list=station_list) + if throughput_qos.passes(): + throughput_qos.success() + throughput_qos.cleanup() + # ---------------------------------------# print('+++++++++++++++++') print(results) print('+++++++++++++++++') @@ -333,4 +337,4 @@ python3 ./throughput_QOS.py if __name__ == "__main__": - main() + main() \ No newline at end of file From 78109710ef20ec3dd28171f16f5c93402ccc4465 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Mon, 7 Jun 2021 23:08:48 +0530 Subject: [PATCH 131/152] multiple modes added to test scenario --- py-scripts/throughput_qos.py | 101 +++++++++++++++++----------- py-scripts/throughput_qos_report.py | 4 +- 2 files changed, 62 insertions(+), 43 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 9a598632..afe68e54 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -158,38 +158,37 @@ class ThroughputQOS(Realm): print("cross connections with TOS type created.") def evaluate_throughput(self): - tos_upload = {'_video': [], '_voice': [], '_bk': [], '_be': []} - tos_download = {'_video': [], '_voice': [], '_bk': [], '_be': []} + tos_upload = {'video': [], 'voice': [], 'bk': [], 'be': []} + tos_download = {'video': [], 'voice': [], 'bk': [], 'be': []} if self.cx_profile.get_cx_count() > 0: for sta in self.cx_profile.created_cx.keys(): temp = int(sta[12:]) if temp % 4 == 0: data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - tos_upload['_bk'].append(data['bps rx a']) - tos_download['_bk'].append(data['bps rx b']) + tos_upload['bk'].append(data['bps rx a']) + tos_download['bk'].append(data['bps rx b']) elif temp % 4 == 1: data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - tos_upload['_be'].append(data['bps rx a']) - tos_download['_be'].append(data['bps rx b']) + tos_upload['be'].append(data['bps rx a']) + tos_download['be'].append(data['bps rx b']) elif temp % 4 == 2: data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - tos_upload['_voice'].append(data['bps rx a']) - tos_download['_voice'].append(data['bps rx b']) + tos_upload['voice'].append(data['bps rx a']) + tos_download['voice'].append(data['bps rx b']) elif temp % 4 == 3: data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - tos_upload['_video'].append(data['bps rx a']) - tos_download['_video'].append(data['bps rx b']) - tos_upload.update({"_videoQOS": sum(tos_upload['_video'])}) - tos_upload.update({"_voiceQOS": sum(tos_upload['_voice'])}) - tos_upload.update({"_bkQOS": sum(tos_upload['_bk'])}) - tos_upload.update({"_beQOS": sum(tos_upload['_be'])}) - tos_download.update({"_videoQOS": sum(tos_download['_video'])}) - tos_download.update({"_voiceQOS": sum(tos_download['_voice'])}) - tos_download.update({"_bkQOS": sum(tos_download['_bk'])}) - tos_download.update({"_beQOS": sum(tos_download['_be'])}) + tos_upload['video'].append(data['bps rx a']) + tos_download['video'].append(data['bps rx b']) + tos_upload.update({"videoQOS": sum(tos_upload['video'])}) + tos_upload.update({"voiceQOS": sum(tos_upload['voice'])}) + tos_upload.update({"bkQOS": sum(tos_upload['bk'])}) + tos_upload.update({"beQOS": sum(tos_upload['be'])}) + tos_download.update({"videoQOS": sum(tos_download['video'])}) + tos_download.update({"voiceQOS": sum(tos_download['voice'])}) + tos_download.update({"bkQOS": sum(tos_download['bk'])}) + tos_download.update({"beQOS": sum(tos_download['be'])}) else: print("no connections available to evaluate QOS") - print(tos_upload, tos_download) return tos_upload, tos_download @@ -198,7 +197,7 @@ def main(): prog='throughput_QOS.py', formatter_class=argparse.RawTextHelpFormatter, epilog='''\ - Create stations and endpoints and runs L3 traffic with various IP types of service(BK | BE | Video | Voice) + Create stations and endpoints and runs L3 traffic with various IP type of service(BK | BE | Video | Voice) ''', description='''\ throughput_QOS.py: @@ -253,14 +252,12 @@ python3 ./throughput_QOS.py parser.add_argument('--modes', help='used to run on multiple radio modes,can be used with multiple stations', default="0") args = parser.parse_args() - print("--------------------------------------------") print(args) print("--------------------------------------------") results = [] + loads = {} # for multiple test conditions # - if args.num_stations is not None: - stations = args.num_stations.split(',') if args.mode is not None: modes = args.mode.split(',') if args.radio is not None: @@ -269,20 +266,44 @@ python3 ./throughput_QOS.py args.a_min = args.a_min.split(',') args.b_min = args.b_min.split(',') loads = {"a_min": args.a_min, "b_min": args.b_min} - # try: - # if len(args.a_min) != len(args.b_min): - # raise print("The values of a_min and b_min should be same.") - # finally: - # print("") + # if radios is not None: + # try: + # if len(args.a_min) != len(args.b_min): + # raise print("The values of a_min and b_min should be same.") + # finally: + # print("") if args.test_duration is not None: args.test_duration = args.test_duration.strip('m') - for station in stations: - if args.create_sta: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(station) - 1, - padding_number_=10000, - radio=args.radio) - else: - station_list = args.sta_names.split(",") + for key in modes: + if key == "2.4G" or key == "2.4g": + if args.create_sta: + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, + padding_number_=10000, + radio=radios[0]) + else: + station_list = args.sta_names.split(",") + elif key == "5G" or key == "5g": + if radios[1] is None: + radios[1] = "wiphy0" + if args.create_sta: + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, + padding_number_=10000, + radio=radios[1]) + else: + station_list = args.sta_names.split(",") + elif key == "BOTH" or key == "both": + if radios[2] is not None: + radios[2] = "wiphy0" + if args.create_sta: + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) // 2, + padding_number_=10000, + radio=radios[2]) + station_list.append(LFUtils.portNameSeries(prefix_="sta", start_id_=(int(args.num_stations) // 2) + 1, + end_id_=int(args.num_stations) - 1, + padding_number_=10000, + radio=radios[2])) + else: + station_list = args.sta_names.split(",") for index in range(len(loads["a_min"])): throughput_qos = ThroughputQOS(host=args.mgr, port=args.mgr_port, @@ -293,21 +314,20 @@ python3 ./throughput_QOS.py upstream=args.upstream_port, ssid=args.ssid, password=args.passwd, - radio=args.radio, + radio=radios[key], security=args.security, test_duration=args.test_duration, use_ht160=False, side_a_min_rate=loads["a_min"][index], side_b_min_rate=loads["b_min"][index], - mode=args.mode, + mode=int(modes[key]), ap=args.ap, traffic_type=args.traffic_type, tos=args.tos, _debug_on=args.debug) - throughput_qos.pre_cleanup() throughput_qos.build() - # exit() + if args.create_sta: if not throughput_qos.passes(): print(throughput_qos.get_fail_message()) @@ -335,6 +355,5 @@ python3 ./throughput_QOS.py print('+++++++++++++++++') - if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/py-scripts/throughput_qos_report.py b/py-scripts/throughput_qos_report.py index 15b8a5c8..0da8b9ee 100644 --- a/py-scripts/throughput_qos_report.py +++ b/py-scripts/throughput_qos_report.py @@ -41,7 +41,7 @@ def grph(report, data_set=None, xaxis_name="stations", yaxis_name="Throughput 2 report.build_graph() -def tos_report(util, sta_num, bps_rx_a, bps_rx_b, tbl_title, grp_title, upload=1000000, download=1000000): +def generate_report(util, sta_num, bps_rx_a, bps_rx_b, tbl_title, grp_title, upload=1000000, download=1000000): # report generation main function rx_a = [] rx_b = [] @@ -107,7 +107,7 @@ def tos_report(util, sta_num, bps_rx_a, bps_rx_b, tbl_title, grp_title, upload=1 # objective title and description report.set_obj_html(_obj_title="Objective", - _obj="Through this test we can evaluate the throughput given number of clients which" + _obj="Through this test we can evaluate the throughput for given number of clients which" "are running the traffic with a particular TOS i.e BK,BE,VI,VO") report.build_objective() From 7552324ec1e8fb65388b37b0e222b500131a8218 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Thu, 10 Jun 2021 02:05:34 +0530 Subject: [PATCH 132/152] multiple bands scenario added --- py-scripts/throughput_qos.py | 214 ++++++++++++++++++----------------- 1 file changed, 112 insertions(+), 102 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index afe68e54..a7164636 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -44,7 +44,7 @@ class ThroughputQOS(Realm): create_sta=True, name_prefix=None, upstream=None, - radio=None, + radio="wiphy0", host="localhost", port=8080, mode=0, @@ -54,7 +54,7 @@ class ThroughputQOS(Realm): side_b_min_rate=56, side_b_max_rate=0, number_template="00000", test_duration="2m", - modes="0", + bands="2.4G, 5G, BOTH", use_ht160=False, _debug_on=False, _exit_on_error=False, @@ -69,12 +69,12 @@ class ThroughputQOS(Realm): self.create_sta = create_sta self.security = security self.password = password - self.radio = radio + self.radio = radio.split(",") self.mode = mode self.ap = ap self.traffic_type = traffic_type self.tos = tos.split(",") - self.modes = modes.split(",") + self.bands = bands.split(",") self.number_template = number_template self.debug = _debug_on self.name_prefix = name_prefix @@ -104,10 +104,9 @@ class ThroughputQOS(Realm): 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): + # check here if upstream port got IP + temp_stations = self.station_profile.station_names.copy() + if self.wait_for_ip(temp_stations): self._pass("All stations got IPs") else: self._fail("Stations failed to get IPs") @@ -132,17 +131,23 @@ class ThroughputQOS(Realm): 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) - 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") - self.create_cx() - print("cx build finished") + for key in self.bands: + if self.create_sta: + 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) + if key == "BOTH" or key == "both": + split = len(self.sta_list) // 2 + self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list[:split], debug=self.debug) + self.station_profile.create(radio=self.radio[1], sta_names_=self.sta_list[split:], debug=self.debug) + else: + self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list, debug=self.debug) + self._pass("PASS: Station build finished") + self.create_cx() + print("cx build finished") def create_cx(self): _tos = "BK,BE,VI,VO" @@ -219,7 +224,7 @@ python3 ./throughput_QOS.py "bgn" : "6", "bg" : "7", "abgnAC" : "8", - "anAC" : "9", + "anAC" : "9", "an" : "10", "bgnAC" : "11", "abgnAX" : "12", @@ -249,109 +254,114 @@ python3 ./throughput_QOS.py parser.add_argument('--sta_names', help='Used to force a connection to a particular AP', default="sta0000") parser.add_argument('--tos', help='used to provide different ToS settings: BK | BE | VI | VO | numeric', default="Best Effort") - parser.add_argument('--modes', help='used to run on multiple radio modes,can be used with multiple stations', - default="0") + parser.add_argument('--bands', help='used to run on multiple radio bands,can be used with multiple stations', + default="2,4G, 5G, BOTH") args = parser.parse_args() print("--------------------------------------------") print(args) print("--------------------------------------------") - results = [] - loads = {} - # for multiple test conditions # - if args.mode is not None: - modes = args.mode.split(',') + test_results = [] + test_cases = {} + + if args.bands is not None: + bands = args.bands.split(',') + if args.radio is not None: radios = args.radio.split(',') - if args.a_min is not None or args.b_min is not None: - args.a_min = args.a_min.split(',') - args.b_min = args.b_min.split(',') - loads = {"a_min": args.a_min, "b_min": args.b_min} - # if radios is not None: - # try: - # if len(args.a_min) != len(args.b_min): - # raise print("The values of a_min and b_min should be same.") - # finally: - # print("") + if len(radios) < 2: + radios.append(radios[0]) + if args.test_duration is not None: args.test_duration = args.test_duration.strip('m') - for key in modes: - if key == "2.4G" or key == "2.4g": + + for i in range(len(bands)): + if bands[i] == "2.4G" or bands[i] == "2.4g": + args.bands = bands[i] + args.mode = 9 + if i == 0: + args.radio = radios[0] + if i == 1: + args.radio = radios[1] if args.create_sta: station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, + padding_number_=10000, radio=args.radio) + else: + station_list = args.sta_names.split(",") + elif bands[i] == "5G" or bands[i] == "5g": + args.bands = bands[i] + args.mode = 11 + if i == 0: + args.radio = radios[0] + if i == 1: + args.radio = radios[1] + if args.create_sta: + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, + padding_number_=10000, + radio=args.radio) + else: + station_list = args.sta_names.split(",") + elif bands[i] == "BOTH" or bands[i] == "both": + args.bands = bands[i] + args.radio = radios + if args.create_sta: + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=(int(args.num_stations) // 2), padding_number_=10000, radio=radios[0]) - else: - station_list = args.sta_names.split(",") - elif key == "5G" or key == "5g": - if radios[1] is None: - radios[1] = "wiphy0" - if args.create_sta: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, - padding_number_=10000, - radio=radios[1]) - else: - station_list = args.sta_names.split(",") - elif key == "BOTH" or key == "both": - if radios[2] is not None: - radios[2] = "wiphy0" - if args.create_sta: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) // 2, - padding_number_=10000, - radio=radios[2]) station_list.append(LFUtils.portNameSeries(prefix_="sta", start_id_=(int(args.num_stations) // 2) + 1, end_id_=int(args.num_stations) - 1, padding_number_=10000, - radio=radios[2])) + radio=radios[1])) else: station_list = args.sta_names.split(",") - for index in range(len(loads["a_min"])): - throughput_qos = ThroughputQOS(host=args.mgr, - port=args.mgr_port, - number_template="0000", - sta_list=station_list, - create_sta=args.create_sta, - name_prefix="TOS-", - upstream=args.upstream_port, - ssid=args.ssid, - password=args.passwd, - radio=radios[key], - security=args.security, - test_duration=args.test_duration, - use_ht160=False, - side_a_min_rate=loads["a_min"][index], - side_b_min_rate=loads["b_min"][index], - mode=int(modes[key]), - ap=args.ap, - traffic_type=args.traffic_type, - tos=args.tos, - _debug_on=args.debug) - throughput_qos.pre_cleanup() - throughput_qos.build() - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - # try: - # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) - # except: - # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') + throughput_qos = ThroughputQOS(host=args.mgr, + port=args.mgr_port, + number_template="0000", + sta_list=station_list, + create_sta=args.create_sta, + name_prefix="TOS-", + 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, + mode=args.mode, + bands=args.bands, + ap=args.ap, + traffic_type=args.traffic_type, + tos=args.tos, + _debug_on=args.debug) + throughput_qos.pre_cleanup() + throughput_qos.build() - throughput_qos.start(False, False) - time.sleep(int(args.test_duration) * 60) - throughput_qos.stop() - results.append(throughput_qos.evaluate_throughput()) - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - LFUtils.wait_until_ports_admin_up(port_list=station_list) - if throughput_qos.passes(): - throughput_qos.success() - throughput_qos.cleanup() + if args.create_sta: + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() + # try: + # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) + # except: + # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') + + throughput_qos.start(False, False) + time.sleep(int(args.test_duration) * 60) + throughput_qos.stop() + test_results.append(throughput_qos.evaluate_throughput()) + if args.create_sta: + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() + LFUtils.wait_until_ports_admin_up(port_list=station_list) + if throughput_qos.passes(): + throughput_qos.success() + throughput_qos.cleanup() # ---------------------------------------# print('+++++++++++++++++') - print(results) + print(test_results) print('+++++++++++++++++') From c2d973cd47046ecabb609485faa1bcd2be3bf4b2 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Thu, 10 Jun 2021 23:21:56 +0530 Subject: [PATCH 133/152] bands mode added --- py-scripts/throughput_qos.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index a7164636..8fb2ba9a 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -141,7 +141,9 @@ class ThroughputQOS(Realm): self.station_profile.set_command_flag("set_port", "rpt_timer", 1) if key == "BOTH" or key == "both": split = len(self.sta_list) // 2 + self.station_profile.mode = 9 self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list[:split], debug=self.debug) + self.station_profile.mode = 11 self.station_profile.create(radio=self.radio[1], sta_names_=self.sta_list[split:], debug=self.debug) else: self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list, debug=self.debug) @@ -244,7 +246,7 @@ python3 ./throughput_QOS.py --sta_names sta000,sta001,sta002 (used if --create_sta False, comma separated names of stations) ''') - parser.add_argument('--mode', help='Used to force mode of stations') + 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('--traffic_type', help='Select the Traffic Type [lf_udp, lf_tcp]', required=True) parser.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) @@ -270,14 +272,14 @@ python3 ./throughput_QOS.py radios = args.radio.split(',') if len(radios) < 2: radios.append(radios[0]) - if args.test_duration is not None: args.test_duration = args.test_duration.strip('m') for i in range(len(bands)): if bands[i] == "2.4G" or bands[i] == "2.4g": args.bands = bands[i] - args.mode = 9 + if args.mode is not None: + args.mode = 11 if i == 0: args.radio = radios[0] if i == 1: @@ -289,7 +291,7 @@ python3 ./throughput_QOS.py station_list = args.sta_names.split(",") elif bands[i] == "5G" or bands[i] == "5g": args.bands = bands[i] - args.mode = 11 + args.mode = 9 if i == 0: args.radio = radios[0] if i == 1: @@ -302,17 +304,25 @@ python3 ./throughput_QOS.py station_list = args.sta_names.split(",") elif bands[i] == "BOTH" or bands[i] == "both": args.bands = bands[i] - args.radio = radios + args.radio = str(radios[0]+","+radios[1]) if args.create_sta: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=(int(args.num_stations) // 2), + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=(int(args.num_stations) // 2) + - 1, padding_number_=10000, radio=radios[0]) - station_list.append(LFUtils.portNameSeries(prefix_="sta", start_id_=(int(args.num_stations) // 2) + 1, - end_id_=int(args.num_stations) - 1, + station_list.extend(LFUtils.portNameSeries(prefix_="sta", start_id_=(int(args.num_stations) // 2) - 1, + end_id_=int(args.num_stations), padding_number_=10000, radio=radios[1])) else: station_list = args.sta_names.split(",") + print("-----------------") + print(bands[i]) + print(args.radio) + print(args.mode) + print(station_list) + print("-----------------") + exit(1) throughput_qos = ThroughputQOS(host=args.mgr, port=args.mgr_port, From 9c5c69156bbe1d52a7571d8dc4dc40352fc41d46 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Fri, 11 Jun 2021 14:58:35 +0530 Subject: [PATCH 134/152] multiple bands with mode added --- py-scripts/throughput_qos.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 8fb2ba9a..d5aa04f4 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -304,14 +304,14 @@ python3 ./throughput_QOS.py station_list = args.sta_names.split(",") elif bands[i] == "BOTH" or bands[i] == "both": args.bands = bands[i] - args.radio = str(radios[0]+","+radios[1]) + args.radio = str(radios[0] + "," + radios[1]) + mid = int(args.num_stations) // 2 if args.create_sta: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=(int(args.num_stations) // 2) - - 1, + station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=mid - 1, padding_number_=10000, radio=radios[0]) - station_list.extend(LFUtils.portNameSeries(prefix_="sta", start_id_=(int(args.num_stations) // 2) - 1, - end_id_=int(args.num_stations), + station_list.extend(LFUtils.portNameSeries(prefix_="sta", start_id_=mid, + end_id_=int(args.num_stations) - 1, padding_number_=10000, radio=radios[1])) else: @@ -322,7 +322,6 @@ python3 ./throughput_QOS.py print(args.mode) print(station_list) print("-----------------") - exit(1) throughput_qos = ThroughputQOS(host=args.mgr, port=args.mgr_port, From a3ef6b48a7ffead4ec1c49052301f2a80bfcc234 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Fri, 11 Jun 2021 22:50:39 +0530 Subject: [PATCH 135/152] bands mode with multiple ssid added --- py-scripts/throughput_qos.py | 140 ++++++++++++++++++++++------------- 1 file changed, 90 insertions(+), 50 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index d5aa04f4..7bd1e5d2 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -40,6 +40,12 @@ class ThroughputQOS(Realm): ssid=None, security=None, password=None, + ssid_2g=None, + security_2g=None, + password_2g=None, + ssid_5g=None, + security_5g=None, + password_5g=None, sta_list=[], create_sta=True, name_prefix=None, @@ -65,11 +71,17 @@ class ThroughputQOS(Realm): self.host = host self.port = port self.ssid = ssid - self.sta_list = sta_list - self.create_sta = create_sta self.security = security self.password = password + self.ssid_2g = ssid_2g + self.security_2g = security_2g + self.password_2g = password_2g + self.ssid_5g = ssid_5g + self.security_5g = security_5g + self.password_5g = password_5g self.radio = radio.split(",") + self.sta_list = sta_list + self.create_sta = create_sta self.mode = mode self.ap = ap self.traffic_type = traffic_type @@ -133,17 +145,30 @@ class ThroughputQOS(Realm): def build(self): for key in self.bands: if self.create_sta: - self.station_profile.use_security(self.security, self.ssid, self.password) + if key == "2.4G" or key == "2,4g": + if self.ssid is None: + self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) + else: + self.station_profile.use_security(self.security, self.ssid, self.password) + elif key == "5G" or key == "5G": + if self.ssid is None: + self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) + else: + self.station_profile.use_security(self.security, self.ssid, self.password) + else: + 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) if key == "BOTH" or key == "both": + if (self.ssid is None) and (self.password is None) and (self.security is None): + self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) split = len(self.sta_list) // 2 - self.station_profile.mode = 9 + self.station_profile.mode = 2 self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list[:split], debug=self.debug) - self.station_profile.mode = 11 + self.station_profile.mode = 9 self.station_profile.create(radio=self.radio[1], sta_names_=self.sta_list[split:], debug=self.debug) else: self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list, debug=self.debug) @@ -258,13 +283,22 @@ python3 ./throughput_QOS.py default="Best Effort") parser.add_argument('--bands', help='used to run on multiple radio bands,can be used with multiple stations', default="2,4G, 5G, BOTH") + parser.add_argument('--ssid_2g', help="ssid for 2.4Ghz band") + parser.add_argument('--security_2g', help="security type for 2.4Ghz band") + parser.add_argument('--passwd_2g', help="password for 2.4Ghz band") + parser.add_argument('--ssid_5g', help="ssid for 5Ghz band") + parser.add_argument('--security_5g', help="security type for 5Ghz band") + parser.add_argument('--passwd_5g', help="password for 5Ghz band") args = parser.parse_args() print("--------------------------------------------") print(args) print("--------------------------------------------") test_results = [] test_cases = {} - + if (args.a_min is not None) and (args.b_min is not None): + args.a_min = args.a_min.split(',') + args.b_min = args.b_min.split(',') + loads = {"a_min": args.a_min, "b_min": args.b_min} if args.bands is not None: bands = args.bands.split(',') @@ -322,52 +356,58 @@ python3 ./throughput_QOS.py print(args.mode) print(station_list) print("-----------------") + for index in range(len(loads["a_min"])): + throughput_qos = ThroughputQOS(host=args.mgr, + port=args.mgr_port, + number_template="0000", + sta_list=station_list, + create_sta=args.create_sta, + name_prefix="TOS-", + upstream=args.upstream_port, + ssid=args.ssid, + password=args.passwd, + security=args.security, + ssid_2g=args.ssid_2g, + password_2g=args.passwd_2g, + security_2g=args.security_2g, + ssid_5g=args.ssid_5g, + password_5g=args.passwd_5g, + security_5g=args.security_5g, + radio=args.radio, + test_duration=args.test_duration, + use_ht160=False, + side_a_min_rate=loads['a_min'][index], + side_b_min_rate=loads['b_min'][index], + mode=args.mode, + bands=args.bands, + ap=args.ap, + traffic_type=args.traffic_type, + tos=args.tos, + _debug_on=args.debug) + throughput_qos.pre_cleanup() + throughput_qos.build() - throughput_qos = ThroughputQOS(host=args.mgr, - port=args.mgr_port, - number_template="0000", - sta_list=station_list, - create_sta=args.create_sta, - name_prefix="TOS-", - 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, - mode=args.mode, - bands=args.bands, - ap=args.ap, - traffic_type=args.traffic_type, - tos=args.tos, - _debug_on=args.debug) - throughput_qos.pre_cleanup() - throughput_qos.build() + if args.create_sta: + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() + # try: + # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) + # except: + # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - # try: - # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) - # except: - # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') - - throughput_qos.start(False, False) - time.sleep(int(args.test_duration) * 60) - throughput_qos.stop() - test_results.append(throughput_qos.evaluate_throughput()) - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - LFUtils.wait_until_ports_admin_up(port_list=station_list) - if throughput_qos.passes(): - throughput_qos.success() - throughput_qos.cleanup() + throughput_qos.start(False, False) + time.sleep(int(args.test_duration) * 60) + throughput_qos.stop() + test_results.append(throughput_qos.evaluate_throughput()) + if args.create_sta: + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() + LFUtils.wait_until_ports_admin_up(port_list=station_list) + if throughput_qos.passes(): + throughput_qos.success() + throughput_qos.cleanup() # ---------------------------------------# print('+++++++++++++++++') print(test_results) From c7113b213fd8bc80b6e7b5a3b469972bb777d945 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Sat, 12 Jun 2021 23:06:39 +0530 Subject: [PATCH 136/152] radio assignment for multiple band fixed --- py-scripts/throughput_qos.py | 133 +++++++++++++++++++---------------- 1 file changed, 71 insertions(+), 62 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 7bd1e5d2..56cb75cb 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -293,19 +293,21 @@ python3 ./throughput_QOS.py print("--------------------------------------------") print(args) print("--------------------------------------------") + args.test_case = {} test_results = [] - test_cases = {} if (args.a_min is not None) and (args.b_min is not None): args.a_min = args.a_min.split(',') args.b_min = args.b_min.split(',') loads = {"a_min": args.a_min, "b_min": args.b_min} + if args.bands is not None: bands = args.bands.split(',') if args.radio is not None: radios = args.radio.split(',') if len(radios) < 2: - radios.append(radios[0]) + radios.extend(radios[0]) + if args.test_duration is not None: args.test_duration = args.test_duration.strip('m') @@ -316,8 +318,10 @@ python3 ./throughput_QOS.py args.mode = 11 if i == 0: args.radio = radios[0] - if i == 1: + args.test_case.update({bands[i]: radios[0]}) + else: args.radio = radios[1] + args.test_case.update({bands[i]: radios[1]}) if args.create_sta: station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, padding_number_=10000, radio=args.radio) @@ -328,8 +332,10 @@ python3 ./throughput_QOS.py args.mode = 9 if i == 0: args.radio = radios[0] - if i == 1: + args.test_case.update({bands[i]: radios[0]}) + else: args.radio = radios[1] + args.test_case.update({bands[i]: radios[1]}) if args.create_sta: station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, padding_number_=10000, @@ -339,6 +345,7 @@ python3 ./throughput_QOS.py elif bands[i] == "BOTH" or bands[i] == "both": args.bands = bands[i] args.radio = str(radios[0] + "," + radios[1]) + args.test_case.update({bands[i]: radios[0] + "," + radios[1]}) mid = int(args.num_stations) // 2 if args.create_sta: station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=mid - 1, @@ -350,64 +357,66 @@ python3 ./throughput_QOS.py radio=radios[1])) else: station_list = args.sta_names.split(",") - print("-----------------") - print(bands[i]) - print(args.radio) - print(args.mode) - print(station_list) - print("-----------------") - for index in range(len(loads["a_min"])): - throughput_qos = ThroughputQOS(host=args.mgr, - port=args.mgr_port, - number_template="0000", - sta_list=station_list, - create_sta=args.create_sta, - name_prefix="TOS-", - upstream=args.upstream_port, - ssid=args.ssid, - password=args.passwd, - security=args.security, - ssid_2g=args.ssid_2g, - password_2g=args.passwd_2g, - security_2g=args.security_2g, - ssid_5g=args.ssid_5g, - password_5g=args.passwd_5g, - security_5g=args.security_5g, - radio=args.radio, - test_duration=args.test_duration, - use_ht160=False, - side_a_min_rate=loads['a_min'][index], - side_b_min_rate=loads['b_min'][index], - mode=args.mode, - bands=args.bands, - ap=args.ap, - traffic_type=args.traffic_type, - tos=args.tos, - _debug_on=args.debug) - throughput_qos.pre_cleanup() - throughput_qos.build() - - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - # try: - # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) - # except: - # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') - - throughput_qos.start(False, False) - time.sleep(int(args.test_duration) * 60) - throughput_qos.stop() - test_results.append(throughput_qos.evaluate_throughput()) - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - LFUtils.wait_until_ports_admin_up(port_list=station_list) - if throughput_qos.passes(): - throughput_qos.success() - throughput_qos.cleanup() + print("-----------------") + # print(bands[i]) + print(args.radio) + # print(args.mode) + # print(station_list) + print(args.test_case) + print("-----------------") + exit(1) + # for index in range(len(loads["a_min"])): + # throughput_qos = ThroughputQOS(host=args.mgr, + # port=args.mgr_port, + # number_template="0000", + # sta_list=station_list, + # create_sta=args.create_sta, + # name_prefix="TOS-", + # upstream=args.upstream_port, + # ssid=args.ssid, + # password=args.passwd, + # security=args.security, + # ssid_2g=args.ssid_2g, + # password_2g=args.passwd_2g, + # security_2g=args.security_2g, + # ssid_5g=args.ssid_5g, + # password_5g=args.passwd_5g, + # security_5g=args.security_5g, + # radio=args.radio, + # test_duration=args.test_duration, + # use_ht160=False, + # side_a_min_rate=loads['a_min'][index], + # side_b_min_rate=loads['b_min'][index], + # mode=args.mode, + # bands=args.bands, + # ap=args.ap, + # traffic_type=args.traffic_type, + # tos=args.tos, + # _debug_on=args.debug) + # throughput_qos.pre_cleanup() + # throughput_qos.build() + # + # if args.create_sta: + # if not throughput_qos.passes(): + # print(throughput_qos.get_fail_message()) + # throughput_qos.exit_fail() + # # try: + # # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) + # # except: + # # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') + # + # throughput_qos.start(False, False) + # time.sleep(int(args.test_duration) * 60) + # throughput_qos.stop() + # test_results.append(throughput_qos.evaluate_throughput()) + # if args.create_sta: + # if not throughput_qos.passes(): + # print(throughput_qos.get_fail_message()) + # throughput_qos.exit_fail() + # LFUtils.wait_until_ports_admin_up(port_list=station_list) + # if throughput_qos.passes(): + # throughput_qos.success() + # throughput_qos.cleanup() # ---------------------------------------# print('+++++++++++++++++') print(test_results) From 24dfc0f22b944c33825eabdf01aa6e9c79ae08de Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Sun, 13 Jun 2021 21:18:39 +0530 Subject: [PATCH 137/152] fetch results for all bands 2.4g,5g,both --- py-scripts/throughput_qos.py | 182 +++++++++++++++++++++-------------- 1 file changed, 110 insertions(+), 72 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 56cb75cb..24eb64f2 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -61,6 +61,8 @@ class ThroughputQOS(Realm): number_template="00000", test_duration="2m", bands="2.4G, 5G, BOTH", + radios="", + test_case={}, use_ht160=False, _debug_on=False, _exit_on_error=False, @@ -87,6 +89,8 @@ class ThroughputQOS(Realm): self.traffic_type = traffic_type self.tos = tos.split(",") self.bands = bands.split(",") + self.radios = radios + self.test_case = test_case self.number_template = number_template self.debug = _debug_on self.name_prefix = name_prefix @@ -145,31 +149,61 @@ class ThroughputQOS(Realm): def build(self): for key in self.bands: if self.create_sta: - if key == "2.4G" or key == "2,4g": + if key == "2.4G" or key == "2.4g": if self.ssid is None: self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) else: self.station_profile.use_security(self.security, self.ssid, self.password) - elif key == "5G" or key == "5G": + + if key == "5G" or key == "5g": if self.ssid is None: self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) else: self.station_profile.use_security(self.security, self.ssid, self.password) - else: - 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) + if key == "BOTH" or key == "both": - if (self.ssid is None) and (self.password is None) and (self.security is None): - self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) + keys = list(self.test_case.keys()) + if "BOTH" in self.test_case: + self.radios = self.test_case["BOTH"].split(",") + elif "both" in self.test_case: + self.radios = self.test_case["both"].split(",") split = len(self.sta_list) // 2 - self.station_profile.mode = 2 - self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list[:split], debug=self.debug) - self.station_profile.mode = 9 - self.station_profile.create(radio=self.radio[1], sta_names_=self.sta_list[split:], debug=self.debug) + if keys[0] == "2.4G" or keys[0] == "2.4g": + if self.ssid is None: + self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) + else: + self.station_profile.use_security(self.security, self.ssid, self.password) + self.station_profile.mode = 11 + self.station_profile.create(radio=self.radios[0], sta_names_=self.sta_list[:split], + debug=self.debug) + if self.ssid is None: + self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) + else: + self.station_profile.use_security(self.security, self.ssid, self.password) + self.station_profile.mode = 9 + self.station_profile.create(radio=self.radios[1], sta_names_=self.sta_list[split:], + debug=self.debug) + elif keys[0] == "5G" or keys[0] == "5g": + if self.ssid is None: + self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) + else: + self.station_profile.use_security(self.security, self.ssid, self.password) + self.station_profile.mode = 9 + self.station_profile.create(radio=self.radios[0], sta_names_=self.sta_list[:split], + debug=self.debug) + if self.ssid is None: + self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) + else: + self.station_profile.use_security(self.security, self.ssid, self.password) + self.station_profile.mode = 11 + self.station_profile.create(radio=self.radios[1], sta_names_=self.sta_list[split:], + debug=self.debug) else: self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list, debug=self.debug) self._pass("PASS: Station build finished") @@ -282,7 +316,7 @@ python3 ./throughput_QOS.py parser.add_argument('--tos', help='used to provide different ToS settings: BK | BE | VI | VO | numeric', default="Best Effort") parser.add_argument('--bands', help='used to run on multiple radio bands,can be used with multiple stations', - default="2,4G, 5G, BOTH") + default="2,4G, 5G, BOTH", required=True) parser.add_argument('--ssid_2g', help="ssid for 2.4Ghz band") parser.add_argument('--security_2g', help="security type for 2.4Ghz band") parser.add_argument('--passwd_2g', help="password for 2.4Ghz band") @@ -295,6 +329,10 @@ python3 ./throughput_QOS.py print("--------------------------------------------") args.test_case = {} test_results = [] + loads = {} + bands = [] + radios = [] + station_list = [] if (args.a_min is not None) and (args.b_min is not None): args.a_min = args.a_min.split(',') args.b_min = args.b_min.split(',') @@ -357,67 +395,67 @@ python3 ./throughput_QOS.py radio=radios[1])) else: station_list = args.sta_names.split(",") - print("-----------------") - # print(bands[i]) - print(args.radio) - # print(args.mode) - # print(station_list) - print(args.test_case) - print("-----------------") - exit(1) - # for index in range(len(loads["a_min"])): - # throughput_qos = ThroughputQOS(host=args.mgr, - # port=args.mgr_port, - # number_template="0000", - # sta_list=station_list, - # create_sta=args.create_sta, - # name_prefix="TOS-", - # upstream=args.upstream_port, - # ssid=args.ssid, - # password=args.passwd, - # security=args.security, - # ssid_2g=args.ssid_2g, - # password_2g=args.passwd_2g, - # security_2g=args.security_2g, - # ssid_5g=args.ssid_5g, - # password_5g=args.passwd_5g, - # security_5g=args.security_5g, - # radio=args.radio, - # test_duration=args.test_duration, - # use_ht160=False, - # side_a_min_rate=loads['a_min'][index], - # side_b_min_rate=loads['b_min'][index], - # mode=args.mode, - # bands=args.bands, - # ap=args.ap, - # traffic_type=args.traffic_type, - # tos=args.tos, - # _debug_on=args.debug) - # throughput_qos.pre_cleanup() - # throughput_qos.build() - # - # if args.create_sta: - # if not throughput_qos.passes(): - # print(throughput_qos.get_fail_message()) - # throughput_qos.exit_fail() - # # try: - # # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) - # # except: - # # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') - # - # throughput_qos.start(False, False) - # time.sleep(int(args.test_duration) * 60) - # throughput_qos.stop() - # test_results.append(throughput_qos.evaluate_throughput()) - # if args.create_sta: - # if not throughput_qos.passes(): - # print(throughput_qos.get_fail_message()) - # throughput_qos.exit_fail() - # LFUtils.wait_until_ports_admin_up(port_list=station_list) - # if throughput_qos.passes(): - # throughput_qos.success() - # throughput_qos.cleanup() - # ---------------------------------------# + print("-----------------") + # print(bands[i]) + print(args.radio) + # print(args.mode) + # print(station_list) + print(args.test_case) + print("-----------------") + # ---------------------------------------# + for index in range(len(loads["a_min"])): + throughput_qos = ThroughputQOS(host=args.mgr, + port=args.mgr_port, + number_template="0000", + sta_list=station_list, + create_sta=args.create_sta, + name_prefix="TOS-", + upstream=args.upstream_port, + ssid=args.ssid, + password=args.passwd, + security=args.security, + ssid_2g=args.ssid_2g, + password_2g=args.passwd_2g, + security_2g=args.security_2g, + ssid_5g=args.ssid_5g, + password_5g=args.passwd_5g, + security_5g=args.security_5g, + radio=args.radio, + test_duration=args.test_duration, + use_ht160=False, + side_a_min_rate=loads['a_min'][index], + side_b_min_rate=loads['b_min'][index], + mode=args.mode, + bands=args.bands, + ap=args.ap, + traffic_type=args.traffic_type, + tos=args.tos, + test_case=args.test_case, + _debug_on=args.debug) + throughput_qos.pre_cleanup() + throughput_qos.build() + + if args.create_sta: + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() + # try: + # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) + # except: + # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') + + throughput_qos.start(False, False) + time.sleep(int(args.test_duration) * 60) + throughput_qos.stop() + test_results.append(throughput_qos.evaluate_throughput()) + if args.create_sta: + if not throughput_qos.passes(): + print(throughput_qos.get_fail_message()) + throughput_qos.exit_fail() + LFUtils.wait_until_ports_admin_up(port_list=station_list) + if throughput_qos.passes(): + throughput_qos.success() + throughput_qos.cleanup() print('+++++++++++++++++') print(test_results) print('+++++++++++++++++') From e548b45b5c95439442a1121a97d83fa97361e770 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Tue, 15 Jun 2021 21:11:23 +0530 Subject: [PATCH 138/152] report generation added to script --- py-scripts/throughput_qos.py | 158 +++++++++++++++++++++++++++++++---- 1 file changed, 143 insertions(+), 15 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 24eb64f2..232250bb 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -19,6 +19,13 @@ License: Free to distribute and modify. LANforge systems must be licensed. import sys import os +import matplotlib.pyplot as plt +import matplotlib as mpl +import numpy as np +import pandas as pd +import pdfkit +from lf_report import lf_report +from lf_graph import lf_bar_graph if sys.version_info[0] != 3: print("This script requires Python 3") @@ -204,6 +211,22 @@ class ThroughputQOS(Realm): self.station_profile.mode = 11 self.station_profile.create(radio=self.radios[1], sta_names_=self.sta_list[split:], debug=self.debug) + else: + if self.ssid is None: + self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) + else: + self.station_profile.use_security(self.security, self.ssid, self.password) + self.station_profile.mode = 11 + self.station_profile.create(radio=self.radios[0], sta_names_=self.sta_list[:split], + debug=self.debug) + if self.ssid is None: + self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) + else: + self.station_profile.use_security(self.security, self.ssid, self.password) + self.station_profile.mode = 9 + self.station_profile.create(radio=self.radios[1], sta_names_=self.sta_list[split:], + debug=self.debug) + else: self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list, debug=self.debug) self._pass("PASS: Station build finished") @@ -226,6 +249,10 @@ class ThroughputQOS(Realm): def evaluate_throughput(self): tos_upload = {'video': [], 'voice': [], 'bk': [], 'be': []} tos_download = {'video': [], 'voice': [], 'bk': [], 'be': []} + if self.cx_profile.side_a_min_bps != 0: + case = str(int(self.cx_profile.side_a_min_bps) // 1000000) + else: + case = str(int(self.cx_profile.side_b_min_bps) // 1000000) if self.cx_profile.get_cx_count() > 0: for sta in self.cx_profile.created_cx.keys(): temp = int(sta[12:]) @@ -245,17 +272,110 @@ class ThroughputQOS(Realm): data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] tos_upload['video'].append(data['bps rx a']) tos_download['video'].append(data['bps rx b']) - tos_upload.update({"videoQOS": sum(tos_upload['video'])}) - tos_upload.update({"voiceQOS": sum(tos_upload['voice'])}) - tos_upload.update({"bkQOS": sum(tos_upload['bk'])}) - tos_upload.update({"beQOS": sum(tos_upload['be'])}) - tos_download.update({"videoQOS": sum(tos_download['video'])}) - tos_download.update({"voiceQOS": sum(tos_download['voice'])}) - tos_download.update({"bkQOS": sum(tos_download['bk'])}) - tos_download.update({"beQOS": sum(tos_download['be'])}) + tos_upload.update({"videoQOS": sum(tos_upload['video']) / 100000}) + tos_upload.update({"voiceQOS": sum(tos_upload['voice']) / 100000}) + tos_upload.update({"bkQOS": sum(tos_upload['bk']) / 1000000}) + tos_upload.update({"beQOS": sum(tos_upload['be']) / 1000000}) + tos_download.update({"videoQOS": sum(tos_download['video']) / 1000000}) + tos_download.update({"voiceQOS": sum(tos_download['voice']) / 1000000}) + tos_download.update({"bkQOS": sum(tos_download['bk']) / 1000000}) + tos_download.update({"beQOS": sum(tos_download['be']) / 1000000}) else: print("no connections available to evaluate QOS") - return tos_upload, tos_download + key = case + " " + "Mbps" + return {key: {"tos_upload": tos_upload, "tos_download": tos_download}} + + def generate_report(self, data): + print(data) + res = {} + if data is not None: + for i in range(len(data)): + res.update(data[i]) + else: + print("No Data found to generate report!") + exit(1) + report = lf_report() + report_path = report.get_path() + report_path_date_time = report.get_path_date_time() + print("path: {}".format(report_path)) + print("path_date_time: {}".format(report_path_date_time)) + report.set_title("Throughput QOS") + report.build_banner() + # objective title and description + report.set_obj_html(_obj_title="Objective", + _obj="Through this test we can evaluate the throughput for given number of clients which" + " runs the traffic with a particular Type of Service i.e BK,BE,VI,VO") + report.build_objective() + report.set_table_title("Overall Throughput for all TOS i.e BK | BE | Video (VI) | Voice (VO)") + report.build_table_title() + + t_1mb = [] + t_2mb = [] + t_3mb = [] + t_4mb = [] + t_5mb = [] + new = {} + table_df = [t_1mb, t_2mb, t_3mb, t_4mb, t_5mb] + + for key in res: + for i in table_df: + i.append(res[key]['tos_upload']['bkQOS']) + i.append(res[key]['tos_upload']['beQOS']) + i.append(res[key]['tos_upload']['videoQOS']) + i.append(res[key]['tos_upload']['voiceQOS']) + + table_df2 = [] + for i in range(len(table_df)): + table_df2.append(f'BK: {table_df[i][0]} | BE: {table_df[i][1]} | VI: {table_df[i][2]} | VO: {table_df[i][3]}') + + df_throughput = pd.DataFrame({ + 'Mode()': ['bgn-AC'], "No.of.clients": [len(self.sta_list)], + 'Throughput for Load (1 Mbps)': [table_df2[0]], + 'Throughput for Load (2 Mbps)': [table_df2[1]], + 'Throughput for Load (3 Mbps)': [table_df2[2]], + 'Throughput for Load (4 Mbps)': [table_df2[3]], + 'Throughput for Load (5 Mbps)': [table_df2[4]], + }) + report.set_table_dataframe(df_throughput) + report.build_table() + + report.set_graph_title("Overall upload Throughput for 2.4G clients for various TOS.") + report.build_graph_title() + + y_1mb = [] + y_2mb = [] + y_3mb = [] + y_4mb = [] + y_5mb = [] + + graph_df = [y_1mb, y_2mb, y_3mb, y_4mb, y_5mb] + for key in res: + for i in graph_df: + i.append(res[key]['tos_upload']['beQOS']) + i.append(res[key]['tos_upload']['bkQOS']) + i.append(res[key]['tos_upload']['videoQOS']) + i.append(res[key]['tos_upload']['voiceQOS']) + + graph = lf_bar_graph(_data_set=graph_df, + _xaxis_name="TOS (Type of Service)", + _yaxis_name="Throughput (Mbps)", + _xaxis_categories=["BK", "BE", "VI", "VO"], + _graph_image_name="Bi-single_radio_2.4GHz", + _label=["1 Mbps", "2 Mbps", "3 Mbps", "4 Mbps", "5 Mbps"], + _color=['red', 'yellow', 'green', 'purple', 'thistle'], + _color_edge='black') + + graph_png = graph.build_bar_graph() + + print("graph name {}".format(graph_png)) + + report.set_graph_image(graph_png) + # need to move the graph image to the results + report.move_graph_image() + + report.build_graph() + report.write_html() + report.write_pdf() def main(): @@ -334,9 +454,14 @@ python3 ./throughput_QOS.py radios = [] station_list = [] if (args.a_min is not None) and (args.b_min is not None): - args.a_min = args.a_min.split(',') - args.b_min = args.b_min.split(',') - loads = {"a_min": args.a_min, "b_min": args.b_min} + if (type(args.a_min) is not int) and (type(args.b_min) is not int): + args.a_min = args.a_min.split(',') + args.b_min = args.b_min.split(',') + loads = {"a_min": args.a_min, "b_min": args.b_min} + else: + args.a_min = str(args.a_min).split(",") + args.b_min = str(args.b_min).split(",") + loads = {"a_min": args.a_min, "b_min": args.b_min} if args.bands is not None: bands = args.bands.split(',') @@ -395,6 +520,9 @@ python3 ./throughput_QOS.py radio=radios[1])) else: station_list = args.sta_names.split(",") + else: + print("Band " + bands[i] + " Not Exist") + exit(1) print("-----------------") # print(bands[i]) print(args.radio) @@ -456,9 +584,9 @@ python3 ./throughput_QOS.py if throughput_qos.passes(): throughput_qos.success() throughput_qos.cleanup() - print('+++++++++++++++++') - print(test_results) - print('+++++++++++++++++') + + data = test_results + throughput_qos.generate_report(data=data) if __name__ == "__main__": From 05ab1704fb8ec1d00bb0e85f8f0943dc99720c05 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Wed, 16 Jun 2021 16:33:28 +0530 Subject: [PATCH 139/152] tos graph generation --- py-scripts/throughput_qos.py | 127 ++++++++++++++++++++++++++--------- 1 file changed, 95 insertions(+), 32 deletions(-) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 232250bb..9ab22c6f 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -258,20 +258,44 @@ class ThroughputQOS(Realm): temp = int(sta[12:]) if temp % 4 == 0: data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - tos_upload['bk'].append(data['bps rx a']) - tos_download['bk'].append(data['bps rx b']) + if int(self.cx_profile.side_a_min_bps) != 0: + tos_upload['bk'].append(data['bps rx a'] / 1000000) + else: + tos_upload['bk'].append(data['bps rx a']) + if int(self.cx_profile.side_b_min_bps) != 0: + tos_download['bk'].append(data['bps rx b'] / 1000000) + else: + tos_upload['bk'].append(data['bps rx b']) elif temp % 4 == 1: data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - tos_upload['be'].append(data['bps rx a']) - tos_download['be'].append(data['bps rx b']) + if int(self.cx_profile.side_a_min_bps) != 0: + tos_upload['be'].append(data['bps rx a'] / 1000000) + else: + tos_upload['be'].append(data['bps rx a']) + if int(self.cx_profile.side_b_min_bps) != 0: + tos_download['be'].append(data['bps rx b'] / 1000000) + else: + tos_upload['be'].append(data['bps rx b']) elif temp % 4 == 2: data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - tos_upload['voice'].append(data['bps rx a']) - tos_download['voice'].append(data['bps rx b']) + if int(self.cx_profile.side_a_min_bps) != 0: + tos_upload['voice'].append(data['bps rx a'] / 1000000) + else: + tos_upload['voice'].append(data['bps rx a']) + if int(self.cx_profile.side_b_min_bps) != 0: + tos_download['voice'].append(data['bps rx b'] / 1000000) + else: + tos_upload['voice'].append(data['bps rx b']) elif temp % 4 == 3: data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - tos_upload['video'].append(data['bps rx a']) - tos_download['video'].append(data['bps rx b']) + if int(self.cx_profile.side_a_min_bps) != 0: + tos_upload['video'].append(data['bps rx a'] / 1000000) + else: + tos_upload['video'].append(data['bps rx a']) + if int(self.cx_profile.side_b_min_bps) != 0: + tos_download['video'].append(data['bps rx b'] / 1000000) + else: + tos_upload['video'].append(data['bps rx b']) tos_upload.update({"videoQOS": sum(tos_upload['video']) / 100000}) tos_upload.update({"voiceQOS": sum(tos_upload['voice']) / 100000}) tos_upload.update({"bkQOS": sum(tos_upload['bk']) / 1000000}) @@ -314,22 +338,41 @@ class ThroughputQOS(Realm): t_3mb = [] t_4mb = [] t_5mb = [] - new = {} + table_df = [t_1mb, t_2mb, t_3mb, t_4mb, t_5mb] for key in res: - for i in table_df: - i.append(res[key]['tos_upload']['bkQOS']) - i.append(res[key]['tos_upload']['beQOS']) - i.append(res[key]['tos_upload']['videoQOS']) - i.append(res[key]['tos_upload']['voiceQOS']) - + if key == '1 Mbps': + table_df[0].append(res[key]['tos_upload']['bkQOS']) + table_df[0].append(res[key]['tos_upload']['beQOS']) + table_df[0].append(res[key]['tos_upload']['videoQOS']) + table_df[0].append(res[key]['tos_upload']['voiceQOS']) + if key == '2 Mbps': + table_df[1].append(res[key]['tos_upload']['bkQOS']) + table_df[1].append(res[key]['tos_upload']['beQOS']) + table_df[1].append(res[key]['tos_upload']['videoQOS']) + table_df[1].append(res[key]['tos_upload']['voiceQOS']) + if key == '3 Mbps': + table_df[2].append(res[key]['tos_upload']['bkQOS']) + table_df[2].append(res[key]['tos_upload']['beQOS']) + table_df[2].append(res[key]['tos_upload']['videoQOS']) + table_df[2].append(res[key]['tos_upload']['voiceQOS']) + if key == '4 Mbps': + table_df[3].append(res[key]['tos_upload']['bkQOS']) + table_df[3].append(res[key]['tos_upload']['beQOS']) + table_df[3].append(res[key]['tos_upload']['videoQOS']) + table_df[3].append(res[key]['tos_upload']['voiceQOS']) + if key == '5 Mbps': + table_df[4].append(res[key]['tos_upload']['bkQOS']) + table_df[4].append(res[key]['tos_upload']['beQOS']) + table_df[4].append(res[key]['tos_upload']['videoQOS']) + table_df[4].append(res[key]['tos_upload']['voiceQOS']) table_df2 = [] for i in range(len(table_df)): table_df2.append(f'BK: {table_df[i][0]} | BE: {table_df[i][1]} | VI: {table_df[i][2]} | VO: {table_df[i][3]}') df_throughput = pd.DataFrame({ - 'Mode()': ['bgn-AC'], "No.of.clients": [len(self.sta_list)], + 'Mode': ['bgn-AC'], "No.of.clients": [len(self.sta_list)], 'Throughput for Load (1 Mbps)': [table_df2[0]], 'Throughput for Load (2 Mbps)': [table_df2[1]], 'Throughput for Load (3 Mbps)': [table_df2[2]], @@ -342,28 +385,48 @@ class ThroughputQOS(Realm): report.set_graph_title("Overall upload Throughput for 2.4G clients for various TOS.") report.build_graph_title() - y_1mb = [] - y_2mb = [] - y_3mb = [] - y_4mb = [] - y_5mb = [] + y_bk = [] + y_be = [] + y_vi = [] + y_vo = [] - graph_df = [y_1mb, y_2mb, y_3mb, y_4mb, y_5mb] + graph_df = [y_bk, y_be, y_vi, y_vo] for key in res: - for i in graph_df: - i.append(res[key]['tos_upload']['beQOS']) - i.append(res[key]['tos_upload']['bkQOS']) - i.append(res[key]['tos_upload']['videoQOS']) - i.append(res[key]['tos_upload']['voiceQOS']) + if key == '1 Mbps': + graph_df[0].append(res[key]['tos_upload']['bkQOS']) + graph_df[1].append(res[key]['tos_upload']['beQOS']) + graph_df[2].append(res[key]['tos_upload']['videoQOS']) + graph_df[3].append(res[key]['tos_upload']['voiceQOS']) + if key == '2 Mbps': + graph_df[0].append(res[key]['tos_upload']['bkQOS']) + graph_df[1].append(res[key]['tos_upload']['beQOS']) + graph_df[2].append(res[key]['tos_upload']['videoQOS']) + graph_df[3].append(res[key]['tos_upload']['voiceQOS']) + if key == '3 Mbps': + graph_df[0].append(res[key]['tos_upload']['bkQOS']) + graph_df[1].append(res[key]['tos_upload']['beQOS']) + graph_df[2].append(res[key]['tos_upload']['videoQOS']) + graph_df[3].append(res[key]['tos_upload']['voiceQOS']) + if key == '4 Mbps': + graph_df[0].append(res[key]['tos_upload']['bkQOS']) + graph_df[1].append(res[key]['tos_upload']['beQOS']) + graph_df[2].append(res[key]['tos_upload']['videoQOS']) + graph_df[3].append(res[key]['tos_upload']['voiceQOS']) + if key == '5 Mbps': + graph_df[0].append(res[key]['tos_upload']['bkQOS']) + graph_df[1].append(res[key]['tos_upload']['beQOS']) + graph_df[2].append(res[key]['tos_upload']['videoQOS']) + graph_df[3].append(res[key]['tos_upload']['voiceQOS']) graph = lf_bar_graph(_data_set=graph_df, - _xaxis_name="TOS (Type of Service)", + _xaxis_name="Load (Mbps) per Type of Service", _yaxis_name="Throughput (Mbps)", - _xaxis_categories=["BK", "BE", "VI", "VO"], + _xaxis_categories=[1, 2, 3, 4, 5], _graph_image_name="Bi-single_radio_2.4GHz", - _label=["1 Mbps", "2 Mbps", "3 Mbps", "4 Mbps", "5 Mbps"], - _color=['red', 'yellow', 'green', 'purple', 'thistle'], - _color_edge='black') + _label=["BE", "BK", "VI", "VO"], + _color=['blue', 'yellow', 'green', 'purple'], + _color_edge='black', + _bar_width=0.15) graph_png = graph.build_bar_graph() From 2b3e86acfa6811a7b124a03c8fbe40f216922fc0 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Fri, 25 Jun 2021 00:37:49 +0530 Subject: [PATCH 140/152] packet loss data retrieval added pick 6dd9cef lf_csv - creates csv for graph data pick 6ea0cec lf_csv - creates csv for graph data You are currently rebasing branch 'master' on '55fd625'. --- py-scripts/lf_graph.py | 12 +- py-scripts/lf_report.py | 2 +- py-scripts/throughput_qos.py | 314 ++++++++++++++++++++++++----------- 3 files changed, 230 insertions(+), 98 deletions(-) diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index 10b60881..169a7d4b 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -31,10 +31,12 @@ from matplotlib.colors import ListedColormap # graph reporting classes class lf_bar_graph(): - def __init__(self, _data_set=[[30, 55, 69, 37], [45, 67, 34, 22], [22, 45, 12, 34]], + 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], + _xaxis_categories=[1, 2, 3, 4, 5], + _xaxis_label=["a", "b", "c", "d", "e"], + _step_size=5, _graph_image_name="image_name", _label=["bi-downlink", "bi-uplink", 'uplink'], _color=None, @@ -53,6 +55,8 @@ class lf_bar_graph(): self.xaxis_name = _xaxis_name self.yaxis_name = _yaxis_name self.xaxis_categories = _xaxis_categories + self.xaxis_label = _xaxis_label + self.step_size = _step_size self.graph_image_name = _graph_image_name self.label = _label self.color = _color @@ -102,6 +106,10 @@ class lf_bar_graph(): i = i + 1 plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15) plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15) + """plt.xticks([r + self.bar_width for r in range(len(self.data_set[0]))], + self.xaxis_categories)""" + plt.xticks(np.arange(0, len(self.xaxis_categories), step=self.step_size), labels=self.xaxis_label) + plt.legend() if self.xaxis_categories[0] == 0: plt.xticks(np.arange(0, len(self.xaxis_categories), step=self.xaxis_step),fontsize = self.xticks_font) diff --git a/py-scripts/lf_report.py b/py-scripts/lf_report.py index b192d276..2486c905 100755 --- a/py-scripts/lf_report.py +++ b/py-scripts/lf_report.py @@ -448,7 +448,7 @@ class lf_report(): self.graph_html_obj = """ """.format(image=self.graph_image) - self.html +=self.graph_html_obj + self.html += self.graph_html_obj def end_content_div(self): self.html += "\n\n" diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 9ab22c6f..7ea74d63 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -247,67 +247,85 @@ class ThroughputQOS(Realm): print("cross connections with TOS type created.") def evaluate_throughput(self): - tos_upload = {'video': [], 'voice': [], 'bk': [], 'be': []} + global case tos_download = {'video': [], 'voice': [], 'bk': [], 'be': []} - if self.cx_profile.side_a_min_bps != 0: - case = str(int(self.cx_profile.side_a_min_bps) // 1000000) - else: + tx_b = {'bk': [], 'be': [], 'video': [], 'voice': []} + rx_a = {'bk': [], 'be': [], 'video': [], 'voice': []} + pkt_loss = {} + tx_endps = {} + rx_endps = {} + if int(self.cx_profile.side_b_min_bps) != 0: case = str(int(self.cx_profile.side_b_min_bps) // 1000000) - if self.cx_profile.get_cx_count() > 0: + elif int(self.cx_profile.side_a_min_bps) != 0: + case = str(int(self.cx_profile.side_a_min_bps) // 1000000) + if len(self.cx_profile.created_cx.keys()) > 0: + endp_data = self.json_get('endp/all?fields=name,tx+pkts+ll,rx+pkts+ll') + endp_data.pop("handler") + endp_data.pop("uri") + print(endp_data) + endps = endp_data['endpoint'] + for i in range(len(endps)): + if i < len(endps) // 2: + tx_endps.update(endps[i]) + if i >= len(endps) // 2: + rx_endps.update(endps[i]) for sta in self.cx_profile.created_cx.keys(): temp = int(sta[12:]) if temp % 4 == 0: - data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - if int(self.cx_profile.side_a_min_bps) != 0: - tos_upload['bk'].append(data['bps rx a'] / 1000000) - else: - tos_upload['bk'].append(data['bps rx a']) if int(self.cx_profile.side_b_min_bps) != 0: - tos_download['bk'].append(data['bps rx b'] / 1000000) + tos_download['bk'].append(float( + f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) + tx_b['bk'].append(int(f"{tx_endps['%s-B' %sta]['tx pkts ll']}")) + rx_a['bk'].append(int(f"{rx_endps['%s-A' %sta]['rx pkts ll']}")) else: - tos_upload['bk'].append(data['bps rx b']) + tos_download['bk'].append(float(0)) + tx_b['bk'].append(int(0)) + rx_a['bk'].append(int(0)) elif temp % 4 == 1: - data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - if int(self.cx_profile.side_a_min_bps) != 0: - tos_upload['be'].append(data['bps rx a'] / 1000000) - else: - tos_upload['be'].append(data['bps rx a']) if int(self.cx_profile.side_b_min_bps) != 0: - tos_download['be'].append(data['bps rx b'] / 1000000) + tos_download['be'].append(float( + f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) + tx_b['be'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) + rx_a['be'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) else: - tos_upload['be'].append(data['bps rx b']) + tos_download['be'].append(float(0)) + tx_b['be'].append(int(0)) + rx_a['be'].append(int(0)) elif temp % 4 == 2: - data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - if int(self.cx_profile.side_a_min_bps) != 0: - tos_upload['voice'].append(data['bps rx a'] / 1000000) - else: - tos_upload['voice'].append(data['bps rx a']) if int(self.cx_profile.side_b_min_bps) != 0: - tos_download['voice'].append(data['bps rx b'] / 1000000) + tos_download['voice'].append(float( + f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) + tx_b['voice'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) + rx_a['voice'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) else: - tos_upload['voice'].append(data['bps rx b']) + tos_download['voice'].append(float(0)) + tx_b['voice'].append(int(0)) + rx_a['voice'].append(int(0)) elif temp % 4 == 3: - data = list(self.json_get('/cx/%s?fields=bps+rx+a,bps+rx+b' % sta).values())[2] - if int(self.cx_profile.side_a_min_bps) != 0: - tos_upload['video'].append(data['bps rx a'] / 1000000) - else: - tos_upload['video'].append(data['bps rx a']) if int(self.cx_profile.side_b_min_bps) != 0: - tos_download['video'].append(data['bps rx b'] / 1000000) + tos_download['video'].append(float( + f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) + tx_b['video'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) + rx_a['video'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) else: - tos_upload['video'].append(data['bps rx b']) - tos_upload.update({"videoQOS": sum(tos_upload['video']) / 100000}) - tos_upload.update({"voiceQOS": sum(tos_upload['voice']) / 100000}) - tos_upload.update({"bkQOS": sum(tos_upload['bk']) / 1000000}) - tos_upload.update({"beQOS": sum(tos_upload['be']) / 1000000}) - tos_download.update({"videoQOS": sum(tos_download['video']) / 1000000}) - tos_download.update({"voiceQOS": sum(tos_download['voice']) / 1000000}) - tos_download.update({"bkQOS": sum(tos_download['bk']) / 1000000}) - tos_download.update({"beQOS": sum(tos_download['be']) / 1000000}) + tos_download['video'].append(float(0)) + tx_b['video'].append(int(0)) + rx_a['video'].append(int(0)) + tos_download.update({"bkQOS": float(f"{sum(tos_download['bk']):.2f}")}) + tos_download.update({"beQOS": float(f"{sum(tos_download['be']):.2f}")}) + tos_download.update({"videoQOS": float(f"{sum(tos_download['video']):.2f}")}) + tos_download.update({"voiceQOS": float(f"{sum(tos_download['voice']):.2f}")}) + if sum(tx_b['bk']) != 0 or sum(tx_b['be']) != 0 or sum(tx_b['video']) != 0 or sum(tx_b['voice']) != 0: + pkt_loss.update({"bkLOSS": float(f"{((sum(tx_b['bk']) - sum(rx_a['bk']))/sum(tx_b['bk']))*100:.2f}")}) + pkt_loss.update({"beLOSS": float(f"{((sum(tx_b['be']) - sum(rx_a['be']))/sum(tx_b['be']))*100:.2f}")}) + pkt_loss.update({"videoLOSS": float(f"{((sum(tx_b['video']) - sum(rx_a['video']))/sum(tx_b['video']))*100:.2f}")}) + pkt_loss.update({"voiceLOSS": float(f"{((sum(tx_b['voice']) - sum(rx_a['voice']))/sum(tx_b['voice']))*100:.2f}")}) else: - print("no connections available to evaluate QOS") + print("no RX values available to evaluate QOS") key = case + " " + "Mbps" - return {key: {"tos_upload": tos_upload, "tos_download": tos_download}} + print(tos_download) + print(pkt_loss) + return {key: tos_download}, pkt_loss def generate_report(self, data): print(data) @@ -330,7 +348,9 @@ class ThroughputQOS(Realm): _obj="Through this test we can evaluate the throughput for given number of clients which" " runs the traffic with a particular Type of Service i.e BK,BE,VI,VO") report.build_objective() - report.set_table_title("Overall Throughput for all TOS i.e BK | BE | Video (VI) | Voice (VO)") + + report.set_table_title( + "Overall download Throughput for all TOS i.e BK | BE | Video (VI) | Voice (VO) in 2.4Ghz") report.build_table_title() t_1mb = [] @@ -343,33 +363,34 @@ class ThroughputQOS(Realm): for key in res: if key == '1 Mbps': - table_df[0].append(res[key]['tos_upload']['bkQOS']) - table_df[0].append(res[key]['tos_upload']['beQOS']) - table_df[0].append(res[key]['tos_upload']['videoQOS']) - table_df[0].append(res[key]['tos_upload']['voiceQOS']) + table_df[0].append(res[key]['bkQOS']) + table_df[0].append(res[key]['beQOS']) + table_df[0].append(res[key]['videoQOS']) + table_df[0].append(res[key]['voiceQOS']) if key == '2 Mbps': - table_df[1].append(res[key]['tos_upload']['bkQOS']) - table_df[1].append(res[key]['tos_upload']['beQOS']) - table_df[1].append(res[key]['tos_upload']['videoQOS']) - table_df[1].append(res[key]['tos_upload']['voiceQOS']) + table_df[1].append(res[key]['bkQOS']) + table_df[1].append(res[key]['beQOS']) + table_df[1].append(res[key]['videoQOS']) + table_df[1].append(res[key]['voiceQOS']) if key == '3 Mbps': - table_df[2].append(res[key]['tos_upload']['bkQOS']) - table_df[2].append(res[key]['tos_upload']['beQOS']) - table_df[2].append(res[key]['tos_upload']['videoQOS']) - table_df[2].append(res[key]['tos_upload']['voiceQOS']) + table_df[2].append(res[key]['bkQOS']) + table_df[2].append(res[key]['beQOS']) + table_df[2].append(res[key]['videoQOS']) + table_df[2].append(res[key]['voiceQOS']) if key == '4 Mbps': - table_df[3].append(res[key]['tos_upload']['bkQOS']) - table_df[3].append(res[key]['tos_upload']['beQOS']) - table_df[3].append(res[key]['tos_upload']['videoQOS']) - table_df[3].append(res[key]['tos_upload']['voiceQOS']) + table_df[3].append(res[key]['bkQOS']) + table_df[3].append(res[key]['beQOS']) + table_df[3].append(res[key]['videoQOS']) + table_df[3].append(res[key]['voiceQOS']) if key == '5 Mbps': - table_df[4].append(res[key]['tos_upload']['bkQOS']) - table_df[4].append(res[key]['tos_upload']['beQOS']) - table_df[4].append(res[key]['tos_upload']['videoQOS']) - table_df[4].append(res[key]['tos_upload']['voiceQOS']) + table_df[4].append(res[key]['bkQOS']) + table_df[4].append(res[key]['beQOS']) + table_df[4].append(res[key]['videoQOS']) + table_df[4].append(res[key]['voiceQOS']) table_df2 = [] for i in range(len(table_df)): - table_df2.append(f'BK: {table_df[i][0]} | BE: {table_df[i][1]} | VI: {table_df[i][2]} | VO: {table_df[i][3]}') + table_df2.append( + f'BK: {table_df[i][0]} | BE: {table_df[i][1]} | VI: {table_df[i][2]} | VO: {table_df[i][3]}') df_throughput = pd.DataFrame({ 'Mode': ['bgn-AC'], "No.of.clients": [len(self.sta_list)], @@ -382,8 +403,12 @@ class ThroughputQOS(Realm): report.set_table_dataframe(df_throughput) report.build_table() - report.set_graph_title("Overall upload Throughput for 2.4G clients for various TOS.") + report.set_graph_title("Overall download Throughput for all 2.4G clients with different TOS.") + report.set_obj_html(_obj_title="", _obj="This graph represents the download throughput for Bk, BE, Video, Voice" + " services when stations are running the traffic with load 1 Mbps, " + "2 Mbps, 3 Mbps, 4 Mbps") report.build_graph_title() + report.build_objective() y_bk = [] y_be = [] @@ -393,41 +418,44 @@ class ThroughputQOS(Realm): graph_df = [y_bk, y_be, y_vi, y_vo] for key in res: if key == '1 Mbps': - graph_df[0].append(res[key]['tos_upload']['bkQOS']) - graph_df[1].append(res[key]['tos_upload']['beQOS']) - graph_df[2].append(res[key]['tos_upload']['videoQOS']) - graph_df[3].append(res[key]['tos_upload']['voiceQOS']) + graph_df[0].append(res[key]['bkQOS']) + graph_df[1].append(res[key]['beQOS']) + graph_df[2].append(res[key]['videoQOS']) + graph_df[3].append(res[key]['voiceQOS']) if key == '2 Mbps': - graph_df[0].append(res[key]['tos_upload']['bkQOS']) - graph_df[1].append(res[key]['tos_upload']['beQOS']) - graph_df[2].append(res[key]['tos_upload']['videoQOS']) - graph_df[3].append(res[key]['tos_upload']['voiceQOS']) + graph_df[0].append(res[key]['bkQOS']) + graph_df[1].append(res[key]['beQOS']) + graph_df[2].append(res[key]['videoQOS']) + graph_df[3].append(res[key]['voiceQOS']) if key == '3 Mbps': - graph_df[0].append(res[key]['tos_upload']['bkQOS']) - graph_df[1].append(res[key]['tos_upload']['beQOS']) - graph_df[2].append(res[key]['tos_upload']['videoQOS']) - graph_df[3].append(res[key]['tos_upload']['voiceQOS']) + graph_df[0].append(res[key]['bkQOS']) + graph_df[1].append(res[key]['beQOS']) + graph_df[2].append(res[key]['videoQOS']) + graph_df[3].append(res[key]['voiceQOS']) if key == '4 Mbps': - graph_df[0].append(res[key]['tos_upload']['bkQOS']) - graph_df[1].append(res[key]['tos_upload']['beQOS']) - graph_df[2].append(res[key]['tos_upload']['videoQOS']) - graph_df[3].append(res[key]['tos_upload']['voiceQOS']) + graph_df[0].append(res[key]['bkQOS']) + graph_df[1].append(res[key]['beQOS']) + graph_df[2].append(res[key]['videoQOS']) + graph_df[3].append(res[key]['voiceQOS']) if key == '5 Mbps': - graph_df[0].append(res[key]['tos_upload']['bkQOS']) - graph_df[1].append(res[key]['tos_upload']['beQOS']) - graph_df[2].append(res[key]['tos_upload']['videoQOS']) - graph_df[3].append(res[key]['tos_upload']['voiceQOS']) + graph_df[0].append(res[key]['bkQOS']) + graph_df[1].append(res[key]['beQOS']) + graph_df[2].append(res[key]['videoQOS']) + graph_df[3].append(res[key]['voiceQOS']) graph = lf_bar_graph(_data_set=graph_df, - _xaxis_name="Load (Mbps) per Type of Service", + _xaxis_name="Load per Type of Service", _yaxis_name="Throughput (Mbps)", - _xaxis_categories=[1, 2, 3, 4, 5], - _graph_image_name="Bi-single_radio_2.4GHz", + _xaxis_categories=[1, 2, 3, 4, 5, 6], + _xaxis_label=['1 Mbps', '2 Mbps', '3 Mbps', '4 Mbps', '5 Mbps'], + _graph_image_name="tos_download_2.4GHz", _label=["BE", "BK", "VI", "VO"], - _color=['blue', 'yellow', 'green', 'purple'], + _step_size=1, + _color=['orangered', 'greenyellow', 'steelblue', 'blueviolet'], _color_edge='black', - _bar_width=0.15) - + _bar_width=0.15, + _dpi=96, + _color_name=['orangered', 'greenyellow', 'steelblue', 'blueviolet']) graph_png = graph.build_bar_graph() print("graph name {}".format(graph_png)) @@ -435,11 +463,107 @@ class ThroughputQOS(Realm): report.set_graph_image(graph_png) # need to move the graph image to the results report.move_graph_image() - report.build_graph() + self.generate_individual_graph(data, report) report.write_html() report.write_pdf() + def generate_individual_graph(self, data, report): + if data is not None: + res = {} + for i in range(len(data)): + res.update(data[i]) + if len(res.keys()) > 0: + count = 1 + for key in res: + report.set_graph_title(_graph_title="Individual stations Download Throughput for the service Bk(WIFI) of load {}.".format(key)) + report.set_obj_html(_obj_title="", + _obj="This is the individual throughput for {} number of clients running service BK".format( + len(self.sta_list))) + report.build_graph_title() + report.build_objective() + graph = lf_bar_graph(_data_set=[res[key]['bk']], _xaxis_name="Clients running - BK", + _yaxis_name="Throughput in Mbps", + _xaxis_categories=[i for i in range(len(self.sta_list))], + _xaxis_label=[i for i in range(len(self.sta_list))], + _label=["BK"], + _step_size=1, + _bar_width=0.15, _color_name=['orangered'], + _graph_image_name="{}_bk_{}".format(self.bands[0], count), _color_edge=['black'], + _color=['orangered']) + graph_png = graph.build_bar_graph() + print("graph name {}".format(graph_png)) + report.set_graph_image(graph_png) + # need to move the graph image to the results + report.move_graph_image() + report.build_graph() + report.set_graph_title(_graph_title="Individual stations Download Throughput for the service BE(WIFI) of load {}.".format(key)) + report.set_obj_html(_obj_title="", + _obj="This is the individual throughput for {} number of clients running service BE".format( + len(self.sta_list))) + report.build_graph_title() + report.build_objective() + graph = lf_bar_graph(_data_set=[res[key]['be']], _xaxis_name="Clients running - BE", + _yaxis_name="Throughput in Mbps", + _xaxis_categories=[i for i in range(len(self.sta_list))], + _xaxis_label=[i for i in range(len(self.sta_list))], + _label=["BE"], + _step_size=1, + _bar_width=0.15, _color_name=['greenyellow'], + _graph_image_name="{}_be_{}".format(self.bands[0], count), _color_edge=['black'], + _color=['greenyellow']) + graph_png = graph.build_bar_graph() + print("graph name {}".format(graph_png)) + report.set_graph_image(graph_png) + # need to move the graph image to the results + report.move_graph_image() + report.build_graph() + report.set_graph_title(_graph_title="Individual stations Download Throughput for the service VI(WIFI) of load {}.".format(key)) + report.set_obj_html(_obj_title="", + _obj="This is the individual throughput for {} number of clients running service VI".format( + len(self.sta_list))) + report.build_graph_title() + report.build_objective() + graph = lf_bar_graph(_data_set=[res[key]['video']], _xaxis_name="Clients running - VI", + _yaxis_name="Throughput in Mbps", + _xaxis_categories=[i for i in range(len(self.sta_list))], + _xaxis_label=[i for i in range(len(self.sta_list))], + _label=["Video"], + _step_size=1, + _bar_width=0.15, _color_name=['steelblue'], + _graph_image_name="{}_video_{}".format(self.bands[0], count), _color_edge=['black'], + _color=['steelblue']) + graph_png = graph.build_bar_graph() + print("graph name {}".format(graph_png)) + report.set_graph_image(graph_png) + # need to move the graph image to the results + report.move_graph_image() + report.build_graph() + report.set_graph_title(_graph_title="Individual stations Download Throughput for the service VO(WIFI) of load {}.".format(key)) + report.set_obj_html(_obj_title="", + _obj="This is the individual throughput for {} number of clients running service VO".format( + len(self.sta_list))) + report.build_graph_title() + report.build_objective() + graph = lf_bar_graph(_data_set=[res[key]['voice']], _xaxis_name="Clients running - VO", + _yaxis_name="Throughput in Mbps", + _xaxis_categories=[i for i in range(len(self.sta_list))], + _xaxis_label=[i for i in range(len(self.sta_list))], + _label=['Voice'], + _step_size=1, + _bar_width=0.15, _color_name=['blueviolet'], + _graph_image_name="{}_voice_{}".format(self.bands[0], count), _color_edge=['black'], + _color=['blueviolet']) + graph_png = graph.build_bar_graph() + print("graph name {}".format(graph_png)) + report.set_graph_image(graph_png) + # need to move the graph image to the results + report.move_graph_image() + report.build_graph() + count += 1 + else: + print("No individual graph to generate.") + def main(): parser = Realm.create_basic_argparse( @@ -594,7 +718,7 @@ python3 ./throughput_QOS.py print(args.test_case) print("-----------------") # ---------------------------------------# - for index in range(len(loads["a_min"])): + for index in range(len(loads["b_min"])): throughput_qos = ThroughputQOS(host=args.mgr, port=args.mgr_port, number_template="0000", @@ -649,7 +773,7 @@ python3 ./throughput_QOS.py throughput_qos.cleanup() data = test_results - throughput_qos.generate_report(data=data) + #throughput_qos.generate_report(data=data) if __name__ == "__main__": From 22ce8723b7ca2c86e5347559d88101087c5023d5 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Thu, 1 Jul 2021 18:13:30 +0530 Subject: [PATCH 141/152] lf_csv - creates csv for graph data pick 6ea0cec lf_csv - creates csv for graph data pick 2fdb937 lf_csv - creates csv for graph data pick 0429552 conflicts resolved in lf_graph changes --- py-scripts/lf_csv.py | 0 py-scripts/lf_graph.py | 68 +++++++++---- py-scripts/lf_report.py | 2 + py-scripts/lf_report_test.py | 2 +- py-scripts/throughput_qos_report.py | 142 ---------------------------- 5 files changed, 53 insertions(+), 161 deletions(-) create mode 100644 py-scripts/lf_csv.py delete mode 100644 py-scripts/throughput_qos_report.py diff --git a/py-scripts/lf_csv.py b/py-scripts/lf_csv.py new file mode 100644 index 00000000..e69de29b diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index 169a7d4b..61ad7cdd 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -25,6 +25,7 @@ import pandas as pd import pdfkit import math from matplotlib.colors import ListedColormap +from lf_csv import LfCSV # internal candela references included during intial phases, to be deleted at future date @@ -36,7 +37,8 @@ class lf_bar_graph(): _yaxis_name="y-axis", _xaxis_categories=[1, 2, 3, 4, 5], _xaxis_label=["a", "b", "c", "d", "e"], - _step_size=5, + _graph_title="", + _title_size=16, _graph_image_name="image_name", _label=["bi-downlink", "bi-uplink", 'uplink'], _color=None, @@ -49,14 +51,17 @@ class lf_bar_graph(): _xaxis_step=5, _xticks_font = None, _grp_title = "", - _dpi=96): + _dpi=96, + _enable_csv=True): +>>>>>>> 6dd9cef... lf_csv - creates csv for graph data self.data_set = _data_set self.xaxis_name = _xaxis_name self.yaxis_name = _yaxis_name self.xaxis_categories = _xaxis_categories self.xaxis_label = _xaxis_label - self.step_size = _step_size + self.title = _graph_title + self.title_size = _title_size self.graph_image_name = _graph_image_name self.label = _label self.color = _color @@ -69,6 +74,8 @@ class lf_bar_graph(): self.xaxis_step = _xaxis_step self.xticks_font = _xticks_font self.grp_title = _grp_title + self.enable_csv = _enable_csv + self.lf_csv = LfCSV() def build_bar_graph(self): if self.color is None: @@ -106,24 +113,27 @@ class lf_bar_graph(): i = i + 1 plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15) plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15) - """plt.xticks([r + self.bar_width for r in range(len(self.data_set[0]))], - self.xaxis_categories)""" - plt.xticks(np.arange(0, len(self.xaxis_categories), step=self.step_size), labels=self.xaxis_label) - plt.legend() - if self.xaxis_categories[0] == 0: plt.xticks(np.arange(0, len(self.xaxis_categories), step=self.xaxis_step),fontsize = self.xticks_font) else: plt.xticks(np.arange(0, len(self.data_set[0]), step=self.xaxis_step), self.xaxis_categories, fontsize = self.xticks_font) - plt.legend() + plt.suptitle(self.title, fontsize=self.title_size) plt.title(self.grp_title) fig = plt.gcf() plt.savefig("%s.png" % self.graph_image_name, dpi=96) plt.close() print("{}.png".format(self.graph_image_name)) - + if self.enable_csv: + if self.data_set is not None: + self.lf_csv.columns = self.label + self.lf_csv.rows = self.data_set + self.lf_csv.filename = f"{self.graph_image_name}.csv" + self.lf_csv.generate_csv() + else: + print("No Dataset Found") + print("{}.csv".format(self.graph_image_name)) return "%s.png" % self.graph_image_name @@ -135,9 +145,10 @@ class lf_scatter_graph(): _xaxis_name="x-axis", _yaxis_name="y-axis", _label=["num1", "num2"], - _graph_image_name="image_name", + _graph_image_name="image_name1", _color=["r", "y"], - _figsize=(9, 4)): + _figsize=(9, 4), + _enable_csv=True): self.x_data_set = _x_data_set self.y_data_set = _y_data_set self.xaxis_name = _xaxis_name @@ -147,6 +158,8 @@ class lf_scatter_graph(): self.color = _color self.label = _label self.values = _values + self.enable_csv = _enable_csv + self.lf_csv = LfCSV() def build_scatter_graph(self): if self.color is None: @@ -171,6 +184,11 @@ class lf_scatter_graph(): plt.savefig("%s.png" % self.graph_image_name, dpi=96) plt.close() print("{}.png".format(self.graph_image_name)) + if self.enable_csv: + self.lf_csv.columns = self.label + self.lf_csv.rows = self.y_data_set + self.lf_csv.filename = f"{self.graph_image_name}.csv" + self.lf_csv.generate_csv() return "%s.png" % self.graph_image_name @@ -181,9 +199,10 @@ class lf_stacked_graph(): _xaxis_name="Stations", _yaxis_name="Numbers", _label=['Success', 'Fail'], - _graph_image_name="image_name", + _graph_image_name="image_name2", _color=["b", "g"], - _figsize=(9, 4)): + _figsize=(9, 4), + _enable_csv=True): self.data_set = _data_set # [x_axis,y1_axis,y2_axis] self.xaxis_name = _xaxis_name self.yaxis_name = _yaxis_name @@ -191,6 +210,8 @@ class lf_stacked_graph(): self.graph_image_name = _graph_image_name self.label = _label self.color = _color + self.enable_csv = _enable_csv + self.lf_csv = LfCSV() def build_stacked_graph(self): fig = plt.subplots(figsize=self.figsize) @@ -208,7 +229,11 @@ class lf_stacked_graph(): plt.savefig("%s.png" % (self.graph_image_name), dpi=96) plt.close() print("{}.png".format(self.graph_image_name)) - + if self.enable_csv: + self.lf_csv.columns = self.label + self.lf_csv.rows = self.data_set + self.lf_csv.filename = f"{self.graph_image_name}.csv" + self.lf_csv.generate_csv() return "%s.png" % (self.graph_image_name) @@ -221,10 +246,11 @@ class lf_horizontal_stacked_graph(): _unit="%", _xaxis_name="Stations", _label=['Success', 'Fail'], - _graph_image_name="image_name", + _graph_image_name="image_name3", _color=["success", "Fail"], _figsize=(9, 4), - _disable_xaxis=False): + _disable_xaxis=False, + _enable_csv=True): self.unit = _unit self.seg = _seg self.xaxis_set1 = _xaxis_set1 @@ -236,6 +262,8 @@ class lf_horizontal_stacked_graph(): self.label = _label self.color = _color self.disable_xaxis = _disable_xaxis + self.enable_csv = _enable_csv + self.lf_csv = LfCSV() def build_horizontal_stacked_graph(self): def sumzip(items): @@ -277,7 +305,11 @@ class lf_horizontal_stacked_graph(): plt.savefig("%s.png" % self.graph_image_name, dpi=96) plt.close() print("{}.png".format(self.graph_image_name)) - + # if self.enable_csv: + # self.lf_csv.columns = self.label + # self.lf_csv.rows = self.data_set + # self.lf_csv.filename = f"{self.graph_image_name}.csv" + # self.lf_csv.generate_csv() return "%s.png" % self.graph_image_name diff --git a/py-scripts/lf_report.py b/py-scripts/lf_report.py index 2486c905..46c1dd15 100755 --- a/py-scripts/lf_report.py +++ b/py-scripts/lf_report.py @@ -146,6 +146,8 @@ class lf_report(): 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.fil) def set_path(self,_path): self.path = _path diff --git a/py-scripts/lf_report_test.py b/py-scripts/lf_report_test.py index a9340f34..a89c2bb7 100755 --- a/py-scripts/lf_report_test.py +++ b/py-scripts/lf_report_test.py @@ -96,7 +96,7 @@ if __name__ == "__main__": _xaxis_categories=x_axis_values, _graph_image_name="Bi-single_radio_2.4GHz", _label=["bi-downlink", "bi-uplink", 'uplink'], - _color=None, + _color=['darkorange', 'forestgreen','blueviolet'], _color_edge='red') graph_png = graph.build_bar_graph() diff --git a/py-scripts/throughput_qos_report.py b/py-scripts/throughput_qos_report.py deleted file mode 100644 index 0da8b9ee..00000000 --- a/py-scripts/throughput_qos_report.py +++ /dev/null @@ -1,142 +0,0 @@ -''' ------------------------------------------------------------------------------------- -Throughput QOS report evaluates the throughput for a number of clients which are running -traffic with a particular type of service Video | Voice | BE | BK ------------------------------------------------------------------------------------- -''' -import matplotlib.pyplot as plt -import matplotlib as mpl -import numpy as np -import pandas as pd -import pdfkit -from lf_report import lf_report -from lf_graph import lf_bar_graph - - -def table(report, title, data): - # creating table - report.set_table_title(title) - report.build_table_title() - report.set_table_dataframe(data) - report.build_table() - - -def grph(report, data_set=None, xaxis_name="stations", yaxis_name="Throughput 2 (Mbps)", - xaxis_categories=None, label=None, graph_image_name=""): - # creating bar graph - report.set_graph_title(graph_image_name) - report.build_graph_title() - graph = lf_bar_graph(_data_set=data_set, - _xaxis_name=xaxis_name, - _yaxis_name=yaxis_name, - _xaxis_categories=xaxis_categories, - _graph_image_name=graph_image_name, - _label=label, - _color=None, - _color_edge='red') - graph_png = graph.build_bar_graph() - print("graph name {}".format(graph_png)) - report.set_graph_image(graph_png) - report.move_graph_image() - report.build_graph() - - -def generate_report(util, sta_num, bps_rx_a, bps_rx_b, tbl_title, grp_title, upload=1000000, download=1000000): - # report generation main function - rx_a = [] - rx_b = [] - pas_fail_up = [] - pas_fail_down = [] - thrp_b = upload * len(sta_num) # get overall upload values - thrp_a = download * len(sta_num) ## get overall download values - print(f"given upload--{thrp_b} and download--{thrp_a} values") - index = -1 - for a in bps_rx_a: - index += 1 - if len(a): - rx_a.append(f'min: {min(a)} | max: {max(a)} | avg: {sum(a) / len(a)}') - if thrp_a: - print( - f"getting overall download values '{index}'----- {sum(a)} \n {(thrp_a / 100) * (100 - int(util[index]))}") - if (thrp_a / 100) * (100 - int(util[index])) <= sum(a): - pas_fail_down.append("PASS") - else: - pas_fail_down.append("FAIL") - else: - pas_fail_down.append("NA") - rx_a.append(0) - - if len(bps_rx_b[index]): - rx_b.append(f'min: {min(bps_rx_b[index])} | max: {max(bps_rx_b[index])} | ' - f'avg: {(sum(bps_rx_b[index]) / len(bps_rx_b[index])):.2f}') - - if thrp_b: - print( - f"getting overall upload values '{index}'----- {sum(bps_rx_b[index])} \n {(thrp_b / 100) * (100 - int(util[index]))}") - if (thrp_b / 100) * (100 - int(util[index])) <= sum(bps_rx_b[index]): - pas_fail_up.append("PASS") - else: - pas_fail_up.append("FAIL") - else: - pas_fail_up.append("NA") - rx_b.append(0) - - util[index] = f'{util[index]}%' # append % to the util values - - overall_tab = pd.DataFrame({ - 'Channel Utilization (%)': util, "No.of.clients": [len(sta_num)] * len(util), - 'Speed (mbps)': [f'upload: {upload} | download: {download}'] * len(util), - 'Upload (mbps)': rx_b, 'Download (mbps)': rx_a - }) - print(f"overall table \n{overall_tab}") - - pasfail_tab = pd.DataFrame({ - 'Channel Utilization (%)': util, - 'Upload': pas_fail_up, - 'Download': pas_fail_down - }) - print(f"pass-fail table \n {pasfail_tab}") - - report = lf_report() - report_path = report.get_path() - report_path_date_time = report.get_path_date_time() - print("path: {}".format(report_path)) - print("path_date_time: {}".format(report_path_date_time)) - report.set_title(tbl_title) - report.build_banner() - - # objective title and description - report.set_obj_html(_obj_title="Objective", - _obj="Through this test we can evaluate the throughput for given number of clients which" - "are running the traffic with a particular TOS i.e BK,BE,VI,VO") - report.build_objective() - - table(report, "Overall throughput", overall_tab) - table(report, "Throughput Pass/Fail", pasfail_tab) - - if download: - grph(report, - data_set=[[min(i) for i in bps_rx_a], [max(i) for i in bps_rx_a], [sum(i) / len(i) for i in bps_rx_a]], - xaxis_name="Load", yaxis_name="Throughput (Mbps)", - xaxis_categories=util, label=["min", "max", 'avg'], graph_image_name="Throughput_download") - if upload: - grph(report, - data_set=[[min(i) for i in bps_rx_b], [max(i) for i in bps_rx_b], [sum(i) / len(i) for i in bps_rx_b]], - xaxis_name="Load", yaxis_name="Throughput (Mbps)", - xaxis_categories=util, label=["min", "max", 'avg'], graph_image_name="Throughput_upload") - - for i in range(len(util)): - if download: - grph(report, data_set=[bps_rx_a[i]], xaxis_name="stations", - yaxis_name="Throughput (Mbps)", xaxis_categories=range(0, len(sta_num)), - label=[util[i]], graph_image_name=f"client-Throughput-download_{i}") - if upload: - grph(report, data_set=[bps_rx_b[i]], xaxis_name="stations", - yaxis_name="Throughput (Mbps)", xaxis_categories=range(0, len(sta_num)), - label=[util[i]], graph_image_name=f"client-Throughput-upload_{i}") - - html_file = report.write_html() - print("returned file {}".format(html_file)) - report.write_pdf() - - # report.generate_report() From 67930578d2e48a48e21dbce7e69fd979030fd932 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Thu, 1 Jul 2021 18:14:42 +0530 Subject: [PATCH 142/152] lf_csv - creates csv for graph data --- py-scripts/lf_csv.py | 49 +++++++ py-scripts/throughput_qos.py | 273 +++++++++++++++++++++++++++-------- 2 files changed, 260 insertions(+), 62 deletions(-) diff --git a/py-scripts/lf_csv.py b/py-scripts/lf_csv.py index e69de29b..e205c6e3 100644 --- a/py-scripts/lf_csv.py +++ b/py-scripts/lf_csv.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 +''' +NAME: lf_csv.py + +PURPOSE: +Common Library for generating csv for LANforge output + +SETUP: +/lanforge/html-reports directory needs to be present or output generated in local file + +EXAMPLE: +see: /py-scritps/lf_csv_test.py for example + +COPYWRITE + Copyright 2021 Candela Technologies Inc + License: Free to distribute and modify. LANforge systems must be licensed. + +INCLUDE_IN_README +''' + +import numpy as np +import pandas as pd + + +class LfCSV: + def __init__(self, + _columns=['Stations', 'bk', 'be', 'vi', 'vo'], + _rows=[['sta0001', 'sta0002', 'sta0003', 'sta0004', 'sta0005'], + [1, 2, 3, 4, 5], + [11, 22, 33, 44, 55], + [6, 7, 8, 9, 10], + [66, 77, 88, 99, 100]], + _filename='test.csv'): + self.rows = _rows + self.columns = _columns + self.filename = _filename + + def generate_csv(self): + df = {} + for i in range(len(self.columns)): + df[self.columns[i]] = self.rows[i] + csv_df = pd.DataFrame(df) + print(csv_df) + csv_df.to_csv(self.filename, encoding='utf-8', na_rep='NA', float_format='%.2f') + + +if __name__ == "__main__": + test = LfCSV() + test.generate_csv() diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 7ea74d63..5ce675de 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -6,7 +6,7 @@ NAME: throughput_qos.py PURPOSE: throughput_qos.py will create stations and endpoints which evaluates l3 traffic for a particular type of service. EXAMPLE: -python3 throughput_qos.py --mgr 192.168.200.240 --mgr_port 8080 -u eth1 --num_stations 1 +python3 throughput_qos.py --mgr 192.168.200.37 --mgr_port 8080 -u eth1 --num_stations 1 --radio wiphy1 --ssid TestAP5-71 --passwd lanforge --security wpa2 --mode 11 --a_min 1000000 --b_min 1000000 --traffic_type lf_udp python3 throughput_qos.py --num_stations 1 --radio wiphy1 --ssid ct523c-vap --passwd ct523c-vap --security wpa2 --mode 11 --a_min 1000000 --b_min 1000000 --traffic_type lf_udp @@ -62,6 +62,7 @@ class ThroughputQOS(Realm): port=8080, mode=0, ap=None, + ap_name="", traffic_type=None, side_a_min_rate=56, side_a_max_rate=0, side_b_min_rate=56, side_b_max_rate=0, @@ -93,6 +94,7 @@ class ThroughputQOS(Realm): self.create_sta = create_sta self.mode = mode self.ap = ap + self.ap_name = ap_name self.traffic_type = traffic_type self.tos = tos.split(",") self.bands = bands.split(",") @@ -275,8 +277,8 @@ class ThroughputQOS(Realm): if int(self.cx_profile.side_b_min_bps) != 0: tos_download['bk'].append(float( f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) - tx_b['bk'].append(int(f"{tx_endps['%s-B' %sta]['tx pkts ll']}")) - rx_a['bk'].append(int(f"{rx_endps['%s-A' %sta]['rx pkts ll']}")) + tx_b['bk'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) + rx_a['bk'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) else: tos_download['bk'].append(float(0)) tx_b['bk'].append(int(0)) @@ -316,18 +318,23 @@ class ThroughputQOS(Realm): tos_download.update({"videoQOS": float(f"{sum(tos_download['video']):.2f}")}) tos_download.update({"voiceQOS": float(f"{sum(tos_download['voice']):.2f}")}) if sum(tx_b['bk']) != 0 or sum(tx_b['be']) != 0 or sum(tx_b['video']) != 0 or sum(tx_b['voice']) != 0: - pkt_loss.update({"bkLOSS": float(f"{((sum(tx_b['bk']) - sum(rx_a['bk']))/sum(tx_b['bk']))*100:.2f}")}) - pkt_loss.update({"beLOSS": float(f"{((sum(tx_b['be']) - sum(rx_a['be']))/sum(tx_b['be']))*100:.2f}")}) - pkt_loss.update({"videoLOSS": float(f"{((sum(tx_b['video']) - sum(rx_a['video']))/sum(tx_b['video']))*100:.2f}")}) - pkt_loss.update({"voiceLOSS": float(f"{((sum(tx_b['voice']) - sum(rx_a['voice']))/sum(tx_b['voice']))*100:.2f}")}) + tos_download.update( + {"bkLOSS": float(f"{((sum(tx_b['bk']) - sum(rx_a['bk'])) / sum(tx_b['bk'])) * 100:.2f}")}) + tos_download.update( + {"beLOSS": float(f"{((sum(tx_b['be']) - sum(rx_a['be'])) / sum(tx_b['be'])) * 100:.2f}")}) + tos_download.update({"videoLOSS": float( + f"{((sum(tx_b['video']) - sum(rx_a['video'])) / sum(tx_b['video'])) * 100:.2f}")}) + tos_download.update({"voiceLOSS": float( + f"{((sum(tx_b['voice']) - sum(rx_a['voice'])) / sum(tx_b['voice'])) * 100:.2f}")}) + tos_download.update({'tx_b': tx_b}) + tos_download.update({'rx_a': rx_a}) else: print("no RX values available to evaluate QOS") key = case + " " + "Mbps" print(tos_download) - print(pkt_loss) - return {key: tos_download}, pkt_loss + return {key: tos_download} - def generate_report(self, data): + def generate_report(self, data, test_setup_info, input_setup_info): print(data) res = {} if data is not None: @@ -336,7 +343,7 @@ class ThroughputQOS(Realm): else: print("No Data found to generate report!") exit(1) - report = lf_report() + report = lf_report(_output_pdf="throughput_qos.pdf", _output_html="throughput_qos.html") report_path = report.get_path() report_path_date_time = report.get_path_date_time() print("path: {}".format(report_path)) @@ -348,18 +355,15 @@ class ThroughputQOS(Realm): _obj="Through this test we can evaluate the throughput for given number of clients which" " runs the traffic with a particular Type of Service i.e BK,BE,VI,VO") report.build_objective() - + report.set_custom_html(_custom_html=self.test_setup_information(test_setup_data=test_setup_info, + colmn="Device Under Test")) + report.build_custom() report.set_table_title( "Overall download Throughput for all TOS i.e BK | BE | Video (VI) | Voice (VO) in 2.4Ghz") report.build_table_title() - t_1mb = [] - t_2mb = [] - t_3mb = [] - t_4mb = [] - t_5mb = [] - - table_df = [t_1mb, t_2mb, t_3mb, t_4mb, t_5mb] + table_df = [[], [], [], [], []] + pkt_loss = [[], [], [], [], []] for key in res: if key == '1 Mbps': @@ -367,26 +371,46 @@ class ThroughputQOS(Realm): table_df[0].append(res[key]['beQOS']) table_df[0].append(res[key]['videoQOS']) table_df[0].append(res[key]['voiceQOS']) + pkt_loss[0].append(res[key]['bkLOSS']) + pkt_loss[0].append(res[key]['beLOSS']) + pkt_loss[0].append(res[key]['videoLOSS']) + pkt_loss[0].append(res[key]['voiceLOSS']) if key == '2 Mbps': table_df[1].append(res[key]['bkQOS']) table_df[1].append(res[key]['beQOS']) table_df[1].append(res[key]['videoQOS']) table_df[1].append(res[key]['voiceQOS']) + pkt_loss[1].append(res[key]['bkLOSS']) + pkt_loss[1].append(res[key]['beLOSS']) + pkt_loss[1].append(res[key]['videoLOSS']) + pkt_loss[1].append(res[key]['voiceLOSS']) if key == '3 Mbps': table_df[2].append(res[key]['bkQOS']) table_df[2].append(res[key]['beQOS']) table_df[2].append(res[key]['videoQOS']) table_df[2].append(res[key]['voiceQOS']) + pkt_loss[2].append(res[key]['bkLOSS']) + pkt_loss[2].append(res[key]['beLOSS']) + pkt_loss[2].append(res[key]['videoLOSS']) + pkt_loss[2].append(res[key]['voiceLOSS']) if key == '4 Mbps': table_df[3].append(res[key]['bkQOS']) table_df[3].append(res[key]['beQOS']) table_df[3].append(res[key]['videoQOS']) table_df[3].append(res[key]['voiceQOS']) + pkt_loss[3].append(res[key]['bkLOSS']) + pkt_loss[3].append(res[key]['beLOSS']) + pkt_loss[3].append(res[key]['videoLOSS']) + pkt_loss[3].append(res[key]['voiceLOSS']) if key == '5 Mbps': table_df[4].append(res[key]['bkQOS']) table_df[4].append(res[key]['beQOS']) table_df[4].append(res[key]['videoQOS']) table_df[4].append(res[key]['voiceQOS']) + pkt_loss[4].append(res[key]['bkLOSS']) + pkt_loss[4].append(res[key]['beLOSS']) + pkt_loss[4].append(res[key]['videoLOSS']) + pkt_loss[4].append(res[key]['voiceLOSS']) table_df2 = [] for i in range(len(table_df)): table_df2.append( @@ -402,55 +426,102 @@ class ThroughputQOS(Realm): }) report.set_table_dataframe(df_throughput) report.build_table() - - report.set_graph_title("Overall download Throughput for all 2.4G clients with different TOS.") - report.set_obj_html(_obj_title="", _obj="This graph represents the download throughput for Bk, BE, Video, Voice" - " services when stations are running the traffic with load 1 Mbps, " - "2 Mbps, 3 Mbps, 4 Mbps") - report.build_graph_title() - report.build_objective() - - y_bk = [] - y_be = [] - y_vi = [] - y_vo = [] - - graph_df = [y_bk, y_be, y_vi, y_vo] + graph_df = [[], [], [], []] + pkt_loss_df = [[], [], [], []] for key in res: if key == '1 Mbps': graph_df[0].append(res[key]['bkQOS']) graph_df[1].append(res[key]['beQOS']) graph_df[2].append(res[key]['videoQOS']) graph_df[3].append(res[key]['voiceQOS']) + pkt_loss_df[0].append(res[key]['bkLOSS']) + pkt_loss_df[1].append(res[key]['beLOSS']) + pkt_loss_df[2].append(res[key]['videoLOSS']) + pkt_loss_df[3].append(res[key]['voiceLOSS']) if key == '2 Mbps': graph_df[0].append(res[key]['bkQOS']) graph_df[1].append(res[key]['beQOS']) graph_df[2].append(res[key]['videoQOS']) graph_df[3].append(res[key]['voiceQOS']) + pkt_loss_df[0].append(res[key]['bkLOSS']) + pkt_loss_df[1].append(res[key]['beLOSS']) + pkt_loss_df[2].append(res[key]['videoLOSS']) + pkt_loss_df[3].append(res[key]['voiceLOSS']) if key == '3 Mbps': graph_df[0].append(res[key]['bkQOS']) graph_df[1].append(res[key]['beQOS']) graph_df[2].append(res[key]['videoQOS']) graph_df[3].append(res[key]['voiceQOS']) + pkt_loss_df[0].append(res[key]['bkLOSS']) + pkt_loss_df[1].append(res[key]['beLOSS']) + pkt_loss_df[2].append(res[key]['videoLOSS']) + pkt_loss_df[3].append(res[key]['voiceLOSS']) if key == '4 Mbps': graph_df[0].append(res[key]['bkQOS']) graph_df[1].append(res[key]['beQOS']) graph_df[2].append(res[key]['videoQOS']) graph_df[3].append(res[key]['voiceQOS']) + pkt_loss_df[0].append(res[key]['bkLOSS']) + pkt_loss_df[1].append(res[key]['beLOSS']) + pkt_loss_df[2].append(res[key]['videoLOSS']) + pkt_loss_df[3].append(res[key]['voiceLOSS']) if key == '5 Mbps': graph_df[0].append(res[key]['bkQOS']) graph_df[1].append(res[key]['beQOS']) graph_df[2].append(res[key]['videoQOS']) graph_df[3].append(res[key]['voiceQOS']) + pkt_loss_df[0].append(res[key]['bkLOSS']) + pkt_loss_df[1].append(res[key]['beLOSS']) + pkt_loss_df[2].append(res[key]['videoLOSS']) + pkt_loss_df[3].append(res[key]['voiceLOSS']) + + report.set_graph_title(f"Overall Download throughput for all {self.bands[0]} clients with different TOS.") + report.set_obj_html(_obj_title="", _obj="The below graph represents overall download throughput for all " + "connected stations running BK, BE, VO, VI traffic with different " + "intended loads per station – 1 Mbps, 2 Mbps, 3 Mbps, 4 Mbps, 5 Mbps.") + report.build_graph_title() + report.build_objective() graph = lf_bar_graph(_data_set=graph_df, _xaxis_name="Load per Type of Service", _yaxis_name="Throughput (Mbps)", _xaxis_categories=[1, 2, 3, 4, 5, 6], _xaxis_label=['1 Mbps', '2 Mbps', '3 Mbps', '4 Mbps', '5 Mbps'], - _graph_image_name="tos_download_2.4GHz", - _label=["BE", "BK", "VI", "VO"], + _graph_image_name=f"tos_download_{self.bands[0]}Hz", + _label=["BK", "BE", "VI", "VO"], _step_size=1, + _graph_title="Overall download throughput – BK,BE,VO,VI traffic streams", + _title_size=16, + _color=['orangered', 'greenyellow', 'steelblue', 'blueviolet'], + _color_edge='black', + _bar_width=0.15, + _dpi=96, + _color_name=['orangered', 'greenyellow', 'steelblue', 'blueviolet']) + graph_png = graph.build_bar_graph() + + print("graph name {}".format(graph_png)) + + report.set_graph_image(graph_png) + # need to move the graph image to the results + report.move_graph_image() + report.build_graph() + report.set_graph_title(f"Overall Packet loss for all {self.bands[0]} clients with different TOS.") + report.set_obj_html(_obj_title="", _obj="This graph shows the overall packet loss for the connected stations " + "for BK,BE,VO,VI traffic with intended load per station – 1 Mbps, " + "2 Mbps, 3 Mbps, 4 Mbps, 5 Mbps") + report.build_graph_title() + report.build_objective() + + graph = lf_bar_graph(_data_set=pkt_loss_df, + _xaxis_name="Load per Type of Service", + _yaxis_name="Packet Loss (%)", + _xaxis_categories=[1, 2, 3, 4, 5, 6], + _xaxis_label=['1 Mbps', '2 Mbps', '3 Mbps', '4 Mbps', '5 Mbps'], + _graph_image_name=f"pkt_loss_{self.bands[0]}Hz", + _label=["BK", "BE", "VI", "VO"], + _step_size=1, + _graph_title="Load vs Packet Loss", + _title_size=16, _color=['orangered', 'greenyellow', 'steelblue', 'blueviolet'], _color_edge='black', _bar_width=0.15, @@ -465,6 +536,8 @@ class ThroughputQOS(Realm): report.move_graph_image() report.build_graph() self.generate_individual_graph(data, report) + report.set_custom_html(_custom_html=self.test_setup_information(test_setup_data=input_setup_info, colmn="Information")) + report.build_custom() report.write_html() report.write_pdf() @@ -476,18 +549,23 @@ class ThroughputQOS(Realm): if len(res.keys()) > 0: count = 1 for key in res: - report.set_graph_title(_graph_title="Individual stations Download Throughput for the service Bk(WIFI) of load {}.".format(key)) + report.set_graph_title( + _graph_title=f"Individual download throughput with intended load {key}/station for traffic BK(WiFi).") report.set_obj_html(_obj_title="", - _obj="This is the individual throughput for {} number of clients running service BK".format( - len(self.sta_list))) + _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running BK " + f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows “" + f"Throughput in Mbps”.") report.build_graph_title() report.build_objective() graph = lf_bar_graph(_data_set=[res[key]['bk']], _xaxis_name="Clients running - BK", _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i for i in range(len(self.sta_list))], - _xaxis_label=[i for i in range(len(self.sta_list))], + _xaxis_categories=[i+1 for i in range(len(self.sta_list))], + _xaxis_label=[i+1 for i in range(len(self.sta_list))], _label=["BK"], _step_size=1, + _xticks_font=8, + _graph_title="Individual download throughput for BK(WIFI) traffic - {} clients".format(self.bands[0]), + _title_size=16, _bar_width=0.15, _color_name=['orangered'], _graph_image_name="{}_bk_{}".format(self.bands[0], count), _color_edge=['black'], _color=['orangered']) @@ -497,18 +575,23 @@ class ThroughputQOS(Realm): # need to move the graph image to the results report.move_graph_image() report.build_graph() - report.set_graph_title(_graph_title="Individual stations Download Throughput for the service BE(WIFI) of load {}.".format(key)) + report.set_graph_title( + _graph_title=f"Individual download throughput with intended load {key}/station for traffic BE(WiFi).") report.set_obj_html(_obj_title="", - _obj="This is the individual throughput for {} number of clients running service BE".format( - len(self.sta_list))) + _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running BE " + f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " + f"“Throughput in Mbps”.") report.build_graph_title() report.build_objective() graph = lf_bar_graph(_data_set=[res[key]['be']], _xaxis_name="Clients running - BE", _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i for i in range(len(self.sta_list))], - _xaxis_label=[i for i in range(len(self.sta_list))], + _xaxis_categories=[i+1 for i in range(len(self.sta_list))], + _xaxis_label=[i+1 for i in range(len(self.sta_list))], _label=["BE"], _step_size=1, + _xticks_font=8, + _graph_title="Individual download throughput for BE(WIFI) traffic - {} clients".format(self.bands[0]), + _title_size=16, _bar_width=0.15, _color_name=['greenyellow'], _graph_image_name="{}_be_{}".format(self.bands[0], count), _color_edge=['black'], _color=['greenyellow']) @@ -518,20 +601,26 @@ class ThroughputQOS(Realm): # need to move the graph image to the results report.move_graph_image() report.build_graph() - report.set_graph_title(_graph_title="Individual stations Download Throughput for the service VI(WIFI) of load {}.".format(key)) + report.set_graph_title( + _graph_title=f"Individual download throughput with intended load {key}/station for traffic VI(WiFi).") report.set_obj_html(_obj_title="", - _obj="This is the individual throughput for {} number of clients running service VI".format( - len(self.sta_list))) + _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running VI " + f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " + f"“Throughput in Mbps”.") report.build_graph_title() report.build_objective() graph = lf_bar_graph(_data_set=[res[key]['video']], _xaxis_name="Clients running - VI", _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i for i in range(len(self.sta_list))], - _xaxis_label=[i for i in range(len(self.sta_list))], + _xaxis_categories=[i+1 for i in range(len(self.sta_list))], + _xaxis_label=[i+1 for i in range(len(self.sta_list))], _label=["Video"], _step_size=1, + _xticks_font=8, + _graph_title="Individual download throughput for VI(WIFI) traffic - {} clients".format(self.bands[0]), + _title_size=16, _bar_width=0.15, _color_name=['steelblue'], - _graph_image_name="{}_video_{}".format(self.bands[0], count), _color_edge=['black'], + _graph_image_name="{}_video_{}".format(self.bands[0], count), + _color_edge=['black'], _color=['steelblue']) graph_png = graph.build_bar_graph() print("graph name {}".format(graph_png)) @@ -539,20 +628,26 @@ class ThroughputQOS(Realm): # need to move the graph image to the results report.move_graph_image() report.build_graph() - report.set_graph_title(_graph_title="Individual stations Download Throughput for the service VO(WIFI) of load {}.".format(key)) + report.set_graph_title( + _graph_title=f"Individual download throughput with intended load {key}/station for traffic VO(WiFi).") report.set_obj_html(_obj_title="", - _obj="This is the individual throughput for {} number of clients running service VO".format( - len(self.sta_list))) + _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running VO " + f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " + f"“Throughput in Mbps”.") report.build_graph_title() report.build_objective() graph = lf_bar_graph(_data_set=[res[key]['voice']], _xaxis_name="Clients running - VO", _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i for i in range(len(self.sta_list))], - _xaxis_label=[i for i in range(len(self.sta_list))], + _xaxis_categories=[i+1 for i in range(len(self.sta_list))], + _xaxis_label=[i+1 for i in range(len(self.sta_list))], _label=['Voice'], _step_size=1, + _xticks_font=8, + _graph_title="Individual download throughput for VO(WIFI) traffic - {} clients".format(self.bands[0]), + _title_size=16, _bar_width=0.15, _color_name=['blueviolet'], - _graph_image_name="{}_voice_{}".format(self.bands[0], count), _color_edge=['black'], + _graph_image_name="{}_voice_{}".format(self.bands[0], count), + _color_edge=['black'], _color=['blueviolet']) graph_png = graph.build_bar_graph() print("graph name {}".format(graph_png)) @@ -564,6 +659,34 @@ class ThroughputQOS(Realm): else: print("No individual graph to generate.") + def test_setup_information(self, test_setup_data=None, colmn="Setup Information"): + # custom table for test-setup/input-setup information + if test_setup_data is None: + return None + else: + var = "" + for i in test_setup_data: + var = var + "" + i + "" + str(test_setup_data[i]) + "" + setup_information = """ + +

+ + + + + + + + +
Test Setup Information
""" + colmn + """ + + """ + str(var) + """ +
+
+

+ """ + return str(setup_information) + def main(): parser = Realm.create_basic_argparse( @@ -605,6 +728,7 @@ python3 ./throughput_QOS.py --b_min 1000 --ap "00:0e:8e:78:e1:76" --debug + --ap_name Netgear RC6700 --upstream_port eth1 (upstream Port) --traffic_type lf_udp (traffic type, lf_udp | lf_tcp) --test_duration 5m (duration to run traffic 5m --> 5 Minutes) @@ -622,6 +746,7 @@ python3 ./throughput_QOS.py parser.add_argument('--sta_names', help='Used to force a connection to a particular AP', default="sta0000") parser.add_argument('--tos', help='used to provide different ToS settings: BK | BE | VI | VO | numeric', default="Best Effort") + parser.add_argument('--ap_name', help="AP Model Name", default="Test-AP") parser.add_argument('--bands', help='used to run on multiple radio bands,can be used with multiple stations', default="2,4G, 5G, BOTH", required=True) parser.add_argument('--ssid_2g', help="ssid for 2.4Ghz band") @@ -640,6 +765,7 @@ python3 ./throughput_QOS.py bands = [] radios = [] station_list = [] + if (args.a_min is not None) and (args.b_min is not None): if (type(args.a_min) is not int) and (type(args.b_min) is not int): args.a_min = args.a_min.split(',') @@ -661,6 +787,9 @@ python3 ./throughput_QOS.py if args.test_duration is not None: args.test_duration = args.test_duration.strip('m') + test_start_time = datetime.datetime.now().strftime("%b %d %H:%M:%S") + print("Test started at: ", test_start_time) + for i in range(len(bands)): if bands[i] == "2.4G" or bands[i] == "2.4g": args.bands = bands[i] @@ -722,6 +851,7 @@ python3 ./throughput_QOS.py throughput_qos = ThroughputQOS(host=args.mgr, port=args.mgr_port, number_template="0000", + ap_name=args.ap_name, sta_list=station_list, create_sta=args.create_sta, name_prefix="TOS-", @@ -754,10 +884,10 @@ python3 ./throughput_QOS.py if not throughput_qos.passes(): print(throughput_qos.get_fail_message()) throughput_qos.exit_fail() - # try: - # layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) - # except: - # raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') + try: + layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) + except: + raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') throughput_qos.start(False, False) time.sleep(int(args.test_duration) * 60) @@ -772,8 +902,27 @@ python3 ./throughput_QOS.py throughput_qos.success() throughput_qos.cleanup() + test_end_time = datetime.datetime.now().strftime("%b %d %H:%M:%S") + print("Test ended at: ", test_end_time) + test_setup_info = { + "AP Model": throughput_qos.ap_name, + "SSID": throughput_qos.ssid, + "SSID - 2.4 Ghz": throughput_qos.ssid_2g, + "SSID - 5 Ghz": throughput_qos.ssid_5g, + "Test Duration": datetime.datetime.strptime(test_end_time, "%b %d %H:%M:%S") - datetime.datetime.strptime(test_start_time, "%b %d %H:%M:%S") + } + if throughput_qos.ssid is None: + test_setup_info.pop("SSID") + else: + if throughput_qos.ssid_2g is None: + test_setup_info.pop("SSID - 2.4 Ghz") + if throughput_qos.ssid_5g is None: + test_setup_info.pop("SSID - 5 Ghz") + input_setup_info = { + "contact": "support@candelatech.com" + } data = test_results - #throughput_qos.generate_report(data=data) + throughput_qos.generate_report(data=data, test_setup_info=test_setup_info, input_setup_info=input_setup_info) if __name__ == "__main__": From d50ed322f5b6ea2b9f6240586e9459d7bc33c533 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Thu, 1 Jul 2021 18:47:04 +0530 Subject: [PATCH 143/152] conflicts resolved in lf_graph changes --- py-scripts/lf_graph.py | 1 - 1 file changed, 1 deletion(-) diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index 61ad7cdd..9bcd5f69 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -53,7 +53,6 @@ class lf_bar_graph(): _grp_title = "", _dpi=96, _enable_csv=True): ->>>>>>> 6dd9cef... lf_csv - creates csv for graph data self.data_set = _data_set self.xaxis_name = _xaxis_name From bcbaff86e63da8fdee0412bb0e3107f313163089 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Tue, 13 Jul 2021 19:18:28 +0530 Subject: [PATCH 144/152] report generation added for dynamic data pick 0429552 conflicts resolved in lf_graph changes --- py-scripts/lf_csv.py | 4 +- py-scripts/lf_graph.py | 12 +- py-scripts/lf_report.py | 16 +- py-scripts/lf_report_test.py | 2 +- py-scripts/throughput_qos.py | 794 ++++++++++++++++------------------- 5 files changed, 378 insertions(+), 450 deletions(-) diff --git a/py-scripts/lf_csv.py b/py-scripts/lf_csv.py index e205c6e3..a87fb038 100644 --- a/py-scripts/lf_csv.py +++ b/py-scripts/lf_csv.py @@ -9,7 +9,7 @@ SETUP: /lanforge/html-reports directory needs to be present or output generated in local file EXAMPLE: -see: /py-scritps/lf_csv_test.py for example +see: /py-scritps/lf_report_test.py for example COPYWRITE Copyright 2021 Candela Technologies Inc @@ -41,7 +41,7 @@ class LfCSV: df[self.columns[i]] = self.rows[i] csv_df = pd.DataFrame(df) print(csv_df) - csv_df.to_csv(self.filename, encoding='utf-8', na_rep='NA', float_format='%.2f') + csv_df.to_csv(self.filename, index=False, encoding='utf-8', na_rep='NA', float_format='%.2f') if __name__ == "__main__": diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index 9bcd5f69..c65c3425 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -52,7 +52,7 @@ class lf_bar_graph(): _xticks_font = None, _grp_title = "", _dpi=96, - _enable_csv=True): + _enable_csv=False): self.data_set = _data_set self.xaxis_name = _xaxis_name @@ -304,11 +304,11 @@ class lf_horizontal_stacked_graph(): plt.savefig("%s.png" % self.graph_image_name, dpi=96) plt.close() print("{}.png".format(self.graph_image_name)) - # if self.enable_csv: - # self.lf_csv.columns = self.label - # self.lf_csv.rows = self.data_set - # self.lf_csv.filename = f"{self.graph_image_name}.csv" - # self.lf_csv.generate_csv() + if self.enable_csv: + self.lf_csv.columns = self.label + self.lf_csv.rows = self.data_set + self.lf_csv.filename = f"{self.graph_image_name}.csv" + self.lf_csv.generate_csv() return "%s.png" % self.graph_image_name diff --git a/py-scripts/lf_report.py b/py-scripts/lf_report.py index 46c1dd15..2215f033 100755 --- a/py-scripts/lf_report.py +++ b/py-scripts/lf_report.py @@ -81,6 +81,7 @@ class lf_report(): self.footer_html = "" self.graph_titles="" self.graph_image="" + self.csv_file_name="" self.html = "" self.custom_html = "" self.objective = _obj @@ -146,8 +147,13 @@ class lf_report(): 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.fil) + csv_src_file = 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): self.path = _path @@ -187,6 +193,11 @@ class lf_report(): def set_graph_title(self,_graph_title): self.graph_title = _graph_title + # sets the csv file name as graph title + def set_csv_filename(self, _graph_title): + fname, ext = os.path.splitext(_graph_title) + 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): self.date = _date @@ -275,7 +286,6 @@ class lf_report(): 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 generate_report(self): self.write_html() self.write_pdf() @@ -351,7 +361,7 @@ class lf_report(): os.mkdir(self.path_date_time) def build_table(self): - self.dataframe_html = self.dataframe.to_html(index=False, justify='left') # 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): diff --git a/py-scripts/lf_report_test.py b/py-scripts/lf_report_test.py index a89c2bb7..4399da37 100755 --- a/py-scripts/lf_report_test.py +++ b/py-scripts/lf_report_test.py @@ -36,7 +36,7 @@ if __name__ == "__main__": '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] + '1 mbps': [300, 300, 300, 10000, 10000, 10000, 10000] }) print(dataframe) diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py index 5ce675de..0f5b98e9 100644 --- a/py-scripts/throughput_qos.py +++ b/py-scripts/throughput_qos.py @@ -57,7 +57,8 @@ class ThroughputQOS(Realm): create_sta=True, name_prefix=None, upstream=None, - radio="wiphy0", + radio_2g="wiphy0", + radio_5g="wiphy1", host="localhost", port=8080, mode=0, @@ -69,7 +70,6 @@ class ThroughputQOS(Realm): number_template="00000", test_duration="2m", bands="2.4G, 5G, BOTH", - radios="", test_case={}, use_ht160=False, _debug_on=False, @@ -89,7 +89,8 @@ class ThroughputQOS(Realm): self.ssid_5g = ssid_5g self.security_5g = security_5g self.password_5g = password_5g - self.radio = radio.split(",") + self.radio_2g = radio_2g + self.radio_5g = radio_5g self.sta_list = sta_list self.create_sta = create_sta self.mode = mode @@ -98,7 +99,6 @@ class ThroughputQOS(Realm): self.traffic_type = traffic_type self.tos = tos.split(",") self.bands = bands.split(",") - self.radios = radios self.test_case = test_case self.number_template = number_template self.debug = _debug_on @@ -115,7 +115,7 @@ class ThroughputQOS(Realm): self.station_profile.use_ht160 = use_ht160 if self.station_profile.use_ht160: self.station_profile.mode = 9 - self.station_profile.mode = mode + # self.station_profile.mode = mode if self.ap is not None: self.station_profile.set_command_param("add_sta", "ap", self.ap) self.cx_profile.host = self.host @@ -127,15 +127,6 @@ class ThroughputQOS(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() - # check here if upstream port got IP - temp_stations = self.station_profile.station_names.copy() - if self.wait_for_ip(temp_stations): - 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): @@ -159,78 +150,62 @@ class ThroughputQOS(Realm): for key in self.bands: if self.create_sta: if key == "2.4G" or key == "2.4g": + self.station_profile.mode = 11 if self.ssid is None: self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) else: 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_2g, sta_names_=self.sta_list, debug=self.debug) if key == "5G" or key == "5g": + self.station_profile.mode = 9 if self.ssid is None: self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) else: 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.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_5g, sta_names_=self.sta_list, debug=self.debug) if key == "BOTH" or key == "both": - keys = list(self.test_case.keys()) - if "BOTH" in self.test_case: - self.radios = self.test_case["BOTH"].split(",") - elif "both" in self.test_case: - self.radios = self.test_case["both"].split(",") split = len(self.sta_list) // 2 - if keys[0] == "2.4G" or keys[0] == "2.4g": - if self.ssid is None: - self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) - else: - self.station_profile.use_security(self.security, self.ssid, self.password) - self.station_profile.mode = 11 - self.station_profile.create(radio=self.radios[0], sta_names_=self.sta_list[:split], - debug=self.debug) - if self.ssid is None: - self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) - else: - self.station_profile.use_security(self.security, self.ssid, self.password) - self.station_profile.mode = 9 - self.station_profile.create(radio=self.radios[1], sta_names_=self.sta_list[split:], - debug=self.debug) - elif keys[0] == "5G" or keys[0] == "5g": - if self.ssid is None: - self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) - else: - self.station_profile.use_security(self.security, self.ssid, self.password) - self.station_profile.mode = 9 - self.station_profile.create(radio=self.radios[0], sta_names_=self.sta_list[:split], - debug=self.debug) - if self.ssid is None: - self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) - else: - self.station_profile.use_security(self.security, self.ssid, self.password) - self.station_profile.mode = 11 - self.station_profile.create(radio=self.radios[1], sta_names_=self.sta_list[split:], - debug=self.debug) + if self.ssid is None: + self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) else: - if self.ssid is None: - self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) - else: - self.station_profile.use_security(self.security, self.ssid, self.password) - self.station_profile.mode = 11 - self.station_profile.create(radio=self.radios[0], sta_names_=self.sta_list[:split], - debug=self.debug) - if self.ssid is None: - self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) - else: - self.station_profile.use_security(self.security, self.ssid, self.password) - self.station_profile.mode = 9 - self.station_profile.create(radio=self.radios[1], sta_names_=self.sta_list[split:], - debug=self.debug) - + self.station_profile.use_security(self.security, self.ssid, self.password) + self.station_profile.mode = 11 + 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_2g, sta_names_=self.sta_list[:split], + debug=self.debug) + if self.ssid is None: + self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) + else: + self.station_profile.use_security(self.security, self.ssid, self.password) + self.station_profile.mode = 9 + self.station_profile.set_number_template(self.number_template) + 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_5g, sta_names_=self.sta_list[split:], + debug=self.debug) + self.station_profile.admin_up() + # check here if upstream port got IP + temp_stations = self.station_profile.station_names.copy() + if self.wait_for_ip(temp_stations): + self._pass("All stations got IPs") else: - self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list, debug=self.debug) + self._fail("Stations failed to get IPs") + self.exit_fail() self._pass("PASS: Station build finished") self.create_cx() print("cx build finished") @@ -248,11 +223,12 @@ class ThroughputQOS(Realm): sleep_time=0, tos=ip_tos) print("cross connections with TOS type created.") - def evaluate_throughput(self): - global case + def evaluate_qos(self): + case = "" tos_download = {'video': [], 'voice': [], 'bk': [], 'be': []} tx_b = {'bk': [], 'be': [], 'video': [], 'voice': []} rx_a = {'bk': [], 'be': [], 'video': [], 'voice': []} + delay = {'bk': [], 'be': [], 'video': [], 'voice': []} pkt_loss = {} tx_endps = {} rx_endps = {} @@ -261,10 +237,9 @@ class ThroughputQOS(Realm): elif int(self.cx_profile.side_a_min_bps) != 0: case = str(int(self.cx_profile.side_a_min_bps) // 1000000) if len(self.cx_profile.created_cx.keys()) > 0: - endp_data = self.json_get('endp/all?fields=name,tx+pkts+ll,rx+pkts+ll') + endp_data = self.json_get('endp/all?fields=name,tx+pkts+ll,rx+pkts+ll,delay') endp_data.pop("handler") endp_data.pop("uri") - print(endp_data) endps = endp_data['endpoint'] for i in range(len(endps)): if i < len(endps) // 2: @@ -279,44 +254,56 @@ class ThroughputQOS(Realm): f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) tx_b['bk'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) rx_a['bk'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) + delay['bk'].append(int(f"{rx_endps['%s-A' % sta]['delay']}")) else: tos_download['bk'].append(float(0)) tx_b['bk'].append(int(0)) rx_a['bk'].append(int(0)) + delay['bk'].append(int(0)) elif temp % 4 == 1: if int(self.cx_profile.side_b_min_bps) != 0: tos_download['be'].append(float( f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) tx_b['be'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) rx_a['be'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) + delay['be'].append(int(f"{rx_endps['%s-A' % sta]['delay']}")) else: tos_download['be'].append(float(0)) tx_b['be'].append(int(0)) rx_a['be'].append(int(0)) + delay['be'].append(int(0)) elif temp % 4 == 2: if int(self.cx_profile.side_b_min_bps) != 0: tos_download['voice'].append(float( f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) tx_b['voice'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) rx_a['voice'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) + delay['voice'].append(int(f"{rx_endps['%s-A' % sta]['delay']}")) else: tos_download['voice'].append(float(0)) tx_b['voice'].append(int(0)) rx_a['voice'].append(int(0)) + delay['voice'].append(int(0)) elif temp % 4 == 3: if int(self.cx_profile.side_b_min_bps) != 0: tos_download['video'].append(float( f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) tx_b['video'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) rx_a['video'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) + delay['video'].append(int(f"{rx_endps['%s-A' % sta]['delay']}")) else: tos_download['video'].append(float(0)) tx_b['video'].append(int(0)) rx_a['video'].append(int(0)) + delay['video'].append(int(0)) tos_download.update({"bkQOS": float(f"{sum(tos_download['bk']):.2f}")}) tos_download.update({"beQOS": float(f"{sum(tos_download['be']):.2f}")}) tos_download.update({"videoQOS": float(f"{sum(tos_download['video']):.2f}")}) tos_download.update({"voiceQOS": float(f"{sum(tos_download['voice']):.2f}")}) + tos_download.update({"bkDELAY": float(f"{sum(delay['bk']) / 1000:.2f}")}) + tos_download.update({"beDELAY": float(f"{sum(delay['be']) / 1000:.2f}")}) + tos_download.update({"videoDELAY": float(f"{sum(delay['video']) / 1000:.2f}")}) + tos_download.update({"voiceDELAY": float(f"{sum(delay['voice']) / 1000:.2f}")}) if sum(tx_b['bk']) != 0 or sum(tx_b['be']) != 0 or sum(tx_b['video']) != 0 or sum(tx_b['voice']) != 0: tos_download.update( {"bkLOSS": float(f"{((sum(tx_b['bk']) - sum(rx_a['bk'])) / sum(tx_b['bk'])) * 100:.2f}")}) @@ -328,21 +315,66 @@ class ThroughputQOS(Realm): f"{((sum(tx_b['voice']) - sum(rx_a['voice'])) / sum(tx_b['voice'])) * 100:.2f}")}) tos_download.update({'tx_b': tx_b}) tos_download.update({'rx_a': rx_a}) + tos_download.update({'delay': delay}) else: print("no RX values available to evaluate QOS") key = case + " " + "Mbps" - print(tos_download) return {key: tos_download} - def generate_report(self, data, test_setup_info, input_setup_info): + def set_report_data(self, data): print(data) res = {} if data is not None: for i in range(len(data)): - res.update(data[i]) + res.update({self.test_case[i]: data[i]}) else: print("No Data found to generate report!") exit(1) + if self.test_case is not None: + table_df = {} + num_stations = [] + throughput = [] + graph_df = {} + for case in self.test_case: + throughput_df = [[], [], [], []] + pkt_loss_df = [[], [], [], []] + latency_df = [[], [], [], []] + if case == "2.4g" or case == "2.4G": + num_stations.append("{} - bgn-AC".format(str(len(self.sta_list)))) + elif case == "5g" or case == "5G": + num_stations.append("{} - an-AC".format(str(len(self.sta_list)))) + elif case == "both" or case == "BOTH": + num_stations.append( + "{} - bgn-AC + {} - an-AC ".format(str(len(self.sta_list) // 2), str(len(self.sta_list) // 2))) + for key in res[case]: + throughput.append( + "BK : {}, BE : {}, VI: {}, VO: {}".format(res[case][key]["bkQOS"], + res[case][key]["beQOS"], + res[case][key][ + "videoQOS"], + res[case][key][ + "voiceQOS"])) + throughput_df[0].append(res[case][key]['bkQOS']) + throughput_df[1].append(res[case][key]['beQOS']) + throughput_df[2].append(res[case][key]['videoQOS']) + throughput_df[3].append(res[case][key]['voiceQOS']) + pkt_loss_df[0].append(res[case][key]['bkLOSS']) + pkt_loss_df[1].append(res[case][key]['beLOSS']) + pkt_loss_df[2].append(res[case][key]['videoLOSS']) + pkt_loss_df[3].append(res[case][key]['voiceLOSS']) + latency_df[0].append(res[case][key]['bkDELAY']) + latency_df[1].append(res[case][key]['beDELAY']) + latency_df[2].append(res[case][key]['videoDELAY']) + latency_df[3].append(res[case][key]['voiceDELAY']) + table_df.update({"No of Stations": num_stations}) + table_df.update({"Throughput for Load {}".format(key): throughput}) + graph_df.update({case: [throughput_df, pkt_loss_df, latency_df]}) + res.update({"throughput_table_df": table_df}) + res.update({"graph_df": graph_df}) + return res + + def generate_report(self, data, test_setup_info, input_setup_info): + res = self.set_report_data(data) report = lf_report(_output_pdf="throughput_qos.pdf", _output_html="throughput_qos.html") report_path = report.get_path() report_path_date_time = report.get_path_date_time() @@ -355,337 +387,244 @@ class ThroughputQOS(Realm): _obj="Through this test we can evaluate the throughput for given number of clients which" " runs the traffic with a particular Type of Service i.e BK,BE,VI,VO") report.build_objective() - report.set_custom_html(_custom_html=self.test_setup_information(test_setup_data=test_setup_info, - colmn="Device Under Test")) - report.build_custom() + report.test_setup_table(test_setup_data=test_setup_info, value="Device Under Test") report.set_table_title( - "Overall download Throughput for all TOS i.e BK | BE | Video (VI) | Voice (VO) in 2.4Ghz") + "Overall download Throughput for all TOS i.e BK | BE | Video (VI) | Voice (VO)") report.build_table_title() - - table_df = [[], [], [], [], []] - pkt_loss = [[], [], [], [], []] - - for key in res: - if key == '1 Mbps': - table_df[0].append(res[key]['bkQOS']) - table_df[0].append(res[key]['beQOS']) - table_df[0].append(res[key]['videoQOS']) - table_df[0].append(res[key]['voiceQOS']) - pkt_loss[0].append(res[key]['bkLOSS']) - pkt_loss[0].append(res[key]['beLOSS']) - pkt_loss[0].append(res[key]['videoLOSS']) - pkt_loss[0].append(res[key]['voiceLOSS']) - if key == '2 Mbps': - table_df[1].append(res[key]['bkQOS']) - table_df[1].append(res[key]['beQOS']) - table_df[1].append(res[key]['videoQOS']) - table_df[1].append(res[key]['voiceQOS']) - pkt_loss[1].append(res[key]['bkLOSS']) - pkt_loss[1].append(res[key]['beLOSS']) - pkt_loss[1].append(res[key]['videoLOSS']) - pkt_loss[1].append(res[key]['voiceLOSS']) - if key == '3 Mbps': - table_df[2].append(res[key]['bkQOS']) - table_df[2].append(res[key]['beQOS']) - table_df[2].append(res[key]['videoQOS']) - table_df[2].append(res[key]['voiceQOS']) - pkt_loss[2].append(res[key]['bkLOSS']) - pkt_loss[2].append(res[key]['beLOSS']) - pkt_loss[2].append(res[key]['videoLOSS']) - pkt_loss[2].append(res[key]['voiceLOSS']) - if key == '4 Mbps': - table_df[3].append(res[key]['bkQOS']) - table_df[3].append(res[key]['beQOS']) - table_df[3].append(res[key]['videoQOS']) - table_df[3].append(res[key]['voiceQOS']) - pkt_loss[3].append(res[key]['bkLOSS']) - pkt_loss[3].append(res[key]['beLOSS']) - pkt_loss[3].append(res[key]['videoLOSS']) - pkt_loss[3].append(res[key]['voiceLOSS']) - if key == '5 Mbps': - table_df[4].append(res[key]['bkQOS']) - table_df[4].append(res[key]['beQOS']) - table_df[4].append(res[key]['videoQOS']) - table_df[4].append(res[key]['voiceQOS']) - pkt_loss[4].append(res[key]['bkLOSS']) - pkt_loss[4].append(res[key]['beLOSS']) - pkt_loss[4].append(res[key]['videoLOSS']) - pkt_loss[4].append(res[key]['voiceLOSS']) - table_df2 = [] - for i in range(len(table_df)): - table_df2.append( - f'BK: {table_df[i][0]} | BE: {table_df[i][1]} | VI: {table_df[i][2]} | VO: {table_df[i][3]}') - - df_throughput = pd.DataFrame({ - 'Mode': ['bgn-AC'], "No.of.clients": [len(self.sta_list)], - 'Throughput for Load (1 Mbps)': [table_df2[0]], - 'Throughput for Load (2 Mbps)': [table_df2[1]], - 'Throughput for Load (3 Mbps)': [table_df2[2]], - 'Throughput for Load (4 Mbps)': [table_df2[3]], - 'Throughput for Load (5 Mbps)': [table_df2[4]], - }) + df_throughput = pd.DataFrame(res["throughput_table_df"]) report.set_table_dataframe(df_throughput) report.build_table() - graph_df = [[], [], [], []] - pkt_loss_df = [[], [], [], []] - for key in res: - if key == '1 Mbps': - graph_df[0].append(res[key]['bkQOS']) - graph_df[1].append(res[key]['beQOS']) - graph_df[2].append(res[key]['videoQOS']) - graph_df[3].append(res[key]['voiceQOS']) - pkt_loss_df[0].append(res[key]['bkLOSS']) - pkt_loss_df[1].append(res[key]['beLOSS']) - pkt_loss_df[2].append(res[key]['videoLOSS']) - pkt_loss_df[3].append(res[key]['voiceLOSS']) - if key == '2 Mbps': - graph_df[0].append(res[key]['bkQOS']) - graph_df[1].append(res[key]['beQOS']) - graph_df[2].append(res[key]['videoQOS']) - graph_df[3].append(res[key]['voiceQOS']) - pkt_loss_df[0].append(res[key]['bkLOSS']) - pkt_loss_df[1].append(res[key]['beLOSS']) - pkt_loss_df[2].append(res[key]['videoLOSS']) - pkt_loss_df[3].append(res[key]['voiceLOSS']) - if key == '3 Mbps': - graph_df[0].append(res[key]['bkQOS']) - graph_df[1].append(res[key]['beQOS']) - graph_df[2].append(res[key]['videoQOS']) - graph_df[3].append(res[key]['voiceQOS']) - pkt_loss_df[0].append(res[key]['bkLOSS']) - pkt_loss_df[1].append(res[key]['beLOSS']) - pkt_loss_df[2].append(res[key]['videoLOSS']) - pkt_loss_df[3].append(res[key]['voiceLOSS']) - if key == '4 Mbps': - graph_df[0].append(res[key]['bkQOS']) - graph_df[1].append(res[key]['beQOS']) - graph_df[2].append(res[key]['videoQOS']) - graph_df[3].append(res[key]['voiceQOS']) - pkt_loss_df[0].append(res[key]['bkLOSS']) - pkt_loss_df[1].append(res[key]['beLOSS']) - pkt_loss_df[2].append(res[key]['videoLOSS']) - pkt_loss_df[3].append(res[key]['voiceLOSS']) - if key == '5 Mbps': - graph_df[0].append(res[key]['bkQOS']) - graph_df[1].append(res[key]['beQOS']) - graph_df[2].append(res[key]['videoQOS']) - graph_df[3].append(res[key]['voiceQOS']) - pkt_loss_df[0].append(res[key]['bkLOSS']) - pkt_loss_df[1].append(res[key]['beLOSS']) - pkt_loss_df[2].append(res[key]['videoLOSS']) - pkt_loss_df[3].append(res[key]['voiceLOSS']) + for key in res["graph_df"]: + report.set_graph_title(f"Overall Download throughput for {len(self.sta_list)} - {key} clients with different TOS.") + report.set_obj_html(_obj_title="", _obj="The below graph represents overall download throughput for all " + "connected stations running BK, BE, VO, VI traffic with different " + "intended loads per station – {}".format(res["graph_df"][key].keys())) + report.build_graph_title() + report.build_objective() - report.set_graph_title(f"Overall Download throughput for all {self.bands[0]} clients with different TOS.") - report.set_obj_html(_obj_title="", _obj="The below graph represents overall download throughput for all " - "connected stations running BK, BE, VO, VI traffic with different " - "intended loads per station – 1 Mbps, 2 Mbps, 3 Mbps, 4 Mbps, 5 Mbps.") - report.build_graph_title() - report.build_objective() + graph = lf_bar_graph(_data_set=res["graph_df"][key][0], + _xaxis_name="Load per Type of Service", + _yaxis_name="Throughput (Mbps)", + _xaxis_categories=[1], + _xaxis_label=['1 Mbps', '2 Mbps', '3 Mbps', '4 Mbps', '5 Mbps'], + _graph_image_name=f"tos_download_{key}Hz", + _label=["BK", "BE", "VI", "VO"], + _xaxis_step=1, + _graph_title="Overall download throughput – BK,BE,VO,VI traffic streams", + _title_size=16, + _color=['orangered', 'greenyellow', 'steelblue', 'blueviolet'], + _color_edge='black', + _bar_width=0.15, + _dpi=96, + _enable_csv=True, + _color_name=['orangered', 'greenyellow', 'steelblue', 'blueviolet']) + graph_png = graph.build_bar_graph() - graph = lf_bar_graph(_data_set=graph_df, - _xaxis_name="Load per Type of Service", - _yaxis_name="Throughput (Mbps)", - _xaxis_categories=[1, 2, 3, 4, 5, 6], - _xaxis_label=['1 Mbps', '2 Mbps', '3 Mbps', '4 Mbps', '5 Mbps'], - _graph_image_name=f"tos_download_{self.bands[0]}Hz", - _label=["BK", "BE", "VI", "VO"], - _step_size=1, - _graph_title="Overall download throughput – BK,BE,VO,VI traffic streams", - _title_size=16, - _color=['orangered', 'greenyellow', 'steelblue', 'blueviolet'], - _color_edge='black', - _bar_width=0.15, - _dpi=96, - _color_name=['orangered', 'greenyellow', 'steelblue', 'blueviolet']) - graph_png = graph.build_bar_graph() + print("graph name {}".format(graph_png)) - print("graph name {}".format(graph_png)) + report.set_graph_image(graph_png) + # need to move the graph image to the results directory + report.move_graph_image() + report.set_csv_filename(graph_png) + report.move_csv_file() + report.build_graph() + report.set_graph_title(f"Overall Packet loss for {len(self.sta_list)} - {key} clients with different TOS.") + report.set_obj_html(_obj_title="", + _obj="This graph shows the overall packet loss for the connected stations " + "for BK,BE,VO,VI traffic with intended load per station – {}".format(res["graph_df"][key].keys())) + report.build_graph_title() + report.build_objective() - report.set_graph_image(graph_png) - # need to move the graph image to the results - report.move_graph_image() - report.build_graph() - report.set_graph_title(f"Overall Packet loss for all {self.bands[0]} clients with different TOS.") - report.set_obj_html(_obj_title="", _obj="This graph shows the overall packet loss for the connected stations " - "for BK,BE,VO,VI traffic with intended load per station – 1 Mbps, " - "2 Mbps, 3 Mbps, 4 Mbps, 5 Mbps") - report.build_graph_title() - report.build_objective() + graph = lf_bar_graph(_data_set=res["graph_df"][key][1], + _xaxis_name="Load per Type of Service", + _yaxis_name="Packet Loss (%)", + _xaxis_categories=[1], + _xaxis_label=['1 Mbps', '2 Mbps', '3 Mbps', '4 Mbps', '5 Mbps'], + _graph_image_name=f"pkt_loss_{key}Hz", + _label=["BK", "BE", "VI", "VO"], + _xaxis_step=1, + _graph_title="Load vs Packet Loss", + _title_size=16, + _color=['orangered', 'greenyellow', 'steelblue', 'blueviolet'], + _color_edge='black', + _bar_width=0.15, + _dpi=96, + _enable_csv=True, + _color_name=['orangered', 'greenyellow', 'steelblue', 'blueviolet']) + graph_png = graph.build_bar_graph() - graph = lf_bar_graph(_data_set=pkt_loss_df, - _xaxis_name="Load per Type of Service", - _yaxis_name="Packet Loss (%)", - _xaxis_categories=[1, 2, 3, 4, 5, 6], - _xaxis_label=['1 Mbps', '2 Mbps', '3 Mbps', '4 Mbps', '5 Mbps'], - _graph_image_name=f"pkt_loss_{self.bands[0]}Hz", - _label=["BK", "BE", "VI", "VO"], - _step_size=1, - _graph_title="Load vs Packet Loss", - _title_size=16, - _color=['orangered', 'greenyellow', 'steelblue', 'blueviolet'], - _color_edge='black', - _bar_width=0.15, - _dpi=96, - _color_name=['orangered', 'greenyellow', 'steelblue', 'blueviolet']) - graph_png = graph.build_bar_graph() + print("graph name {}".format(graph_png)) - print("graph name {}".format(graph_png)) + report.set_graph_image(graph_png) + # need to move the graph image to the results directory + report.move_graph_image() + report.set_csv_filename(graph_png) + report.move_csv_file() + report.build_graph() + report.set_obj_html( + _obj_title=f"Overall Latency for {len(self.sta_list)} - {key} clients with different TOS.", + _obj="This graph shows the overall Latency for the connected stations " + "for BK,BE,VO,VI traffic with intended load per station – {}".format(res["graph_df"][key].keys())) + report.build_objective() - report.set_graph_image(graph_png) - # need to move the graph image to the results - report.move_graph_image() - report.build_graph() - self.generate_individual_graph(data, report) - report.set_custom_html(_custom_html=self.test_setup_information(test_setup_data=input_setup_info, colmn="Information")) + graph = lf_bar_graph(_data_set=res["graph_df"][key][2], + _xaxis_name="Load per Type of Service", + _yaxis_name="Average Latency (in seconds)", + _xaxis_categories=[1], + _xaxis_label=['1 Mbps', '2 Mbps', '3 Mbps', '4 Mbps', '5 Mbps'], + _graph_image_name=f"latency_{key}Hz", + _label=["BK", "BE", "VI", "VO"], + _xaxis_step=1, + _graph_title="Overall Download Latency – BK,BE,VO,VI traffic streams", + _title_size=16, + _show_bar_value=True, + _color=['orangered', 'yellowgreen', 'steelblue', 'blueviolet'], + _color_edge='black', + _bar_width=0.15, + _dpi=96, + _enable_csv=True, + _color_name=['orangered', 'yellowgreen', 'steelblue', 'blueviolet']) + graph_png = graph.build_bar_graph() + + print("graph name {}".format(graph_png)) + + report.set_graph_image(graph_png) + # need to move the graph image to the results directory + report.move_graph_image() + report.set_csv_filename(graph_png) + report.move_csv_file() + report.build_graph() + self.generate_individual_graph(res, report) + report.test_setup_table(test_setup_data=input_setup_info, value="Information") report.build_custom() report.write_html() report.write_pdf() - def generate_individual_graph(self, data, report): - if data is not None: - res = {} - for i in range(len(data)): - res.update(data[i]) + def generate_individual_graph(self, res, report): if len(res.keys()) > 0: - count = 1 + if "throughput_table_df" in res: + res.pop("throughput_table_df") + if "graph_df" in res: + res.pop("graph_df") for key in res: - report.set_graph_title( - _graph_title=f"Individual download throughput with intended load {key}/station for traffic BK(WiFi).") - report.set_obj_html(_obj_title="", - _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running BK " - f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows “" - f"Throughput in Mbps”.") - report.build_graph_title() - report.build_objective() - graph = lf_bar_graph(_data_set=[res[key]['bk']], _xaxis_name="Clients running - BK", - _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i+1 for i in range(len(self.sta_list))], - _xaxis_label=[i+1 for i in range(len(self.sta_list))], - _label=["BK"], - _step_size=1, - _xticks_font=8, - _graph_title="Individual download throughput for BK(WIFI) traffic - {} clients".format(self.bands[0]), - _title_size=16, - _bar_width=0.15, _color_name=['orangered'], - _graph_image_name="{}_bk_{}".format(self.bands[0], count), _color_edge=['black'], - _color=['orangered']) - graph_png = graph.build_bar_graph() - print("graph name {}".format(graph_png)) - report.set_graph_image(graph_png) - # need to move the graph image to the results - report.move_graph_image() - report.build_graph() - report.set_graph_title( - _graph_title=f"Individual download throughput with intended load {key}/station for traffic BE(WiFi).") - report.set_obj_html(_obj_title="", - _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running BE " - f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " - f"“Throughput in Mbps”.") - report.build_graph_title() - report.build_objective() - graph = lf_bar_graph(_data_set=[res[key]['be']], _xaxis_name="Clients running - BE", - _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i+1 for i in range(len(self.sta_list))], - _xaxis_label=[i+1 for i in range(len(self.sta_list))], - _label=["BE"], - _step_size=1, - _xticks_font=8, - _graph_title="Individual download throughput for BE(WIFI) traffic - {} clients".format(self.bands[0]), - _title_size=16, - _bar_width=0.15, _color_name=['greenyellow'], - _graph_image_name="{}_be_{}".format(self.bands[0], count), _color_edge=['black'], - _color=['greenyellow']) - graph_png = graph.build_bar_graph() - print("graph name {}".format(graph_png)) - report.set_graph_image(graph_png) - # need to move the graph image to the results - report.move_graph_image() - report.build_graph() - report.set_graph_title( - _graph_title=f"Individual download throughput with intended load {key}/station for traffic VI(WiFi).") - report.set_obj_html(_obj_title="", - _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running VI " - f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " - f"“Throughput in Mbps”.") - report.build_graph_title() - report.build_objective() - graph = lf_bar_graph(_data_set=[res[key]['video']], _xaxis_name="Clients running - VI", - _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i+1 for i in range(len(self.sta_list))], - _xaxis_label=[i+1 for i in range(len(self.sta_list))], - _label=["Video"], - _step_size=1, - _xticks_font=8, - _graph_title="Individual download throughput for VI(WIFI) traffic - {} clients".format(self.bands[0]), - _title_size=16, - _bar_width=0.15, _color_name=['steelblue'], - _graph_image_name="{}_video_{}".format(self.bands[0], count), - _color_edge=['black'], - _color=['steelblue']) - graph_png = graph.build_bar_graph() - print("graph name {}".format(graph_png)) - report.set_graph_image(graph_png) - # need to move the graph image to the results - report.move_graph_image() - report.build_graph() - report.set_graph_title( - _graph_title=f"Individual download throughput with intended load {key}/station for traffic VO(WiFi).") - report.set_obj_html(_obj_title="", - _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running VO " - f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " - f"“Throughput in Mbps”.") - report.build_graph_title() - report.build_objective() - graph = lf_bar_graph(_data_set=[res[key]['voice']], _xaxis_name="Clients running - VO", - _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i+1 for i in range(len(self.sta_list))], - _xaxis_label=[i+1 for i in range(len(self.sta_list))], - _label=['Voice'], - _step_size=1, - _xticks_font=8, - _graph_title="Individual download throughput for VO(WIFI) traffic - {} clients".format(self.bands[0]), - _title_size=16, - _bar_width=0.15, _color_name=['blueviolet'], - _graph_image_name="{}_voice_{}".format(self.bands[0], count), - _color_edge=['black'], - _color=['blueviolet']) - graph_png = graph.build_bar_graph() - print("graph name {}".format(graph_png)) - report.set_graph_image(graph_png) - # need to move the graph image to the results - report.move_graph_image() - report.build_graph() - count += 1 + for load in res[key]: + report.set_obj_html( + _obj_title=f"Individual download throughput with intended load {load}/station for traffic BK(WiFi).", + _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running BK " + f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows “" + f"Throughput in Mbps”.") + report.build_objective() + graph = lf_bar_graph(_data_set=[res[key][load]['bk']], _xaxis_name="Clients running - BK", + _yaxis_name="Throughput in Mbps", + _xaxis_categories=[i + 1 for i in range(len(self.sta_list))], + _xaxis_label=[i + 1 for i in range(len(self.sta_list))], + _label=["BK"], + _xaxis_step=1, + _xticks_font=8, + _graph_title="Individual download throughput for BK(WIFI) traffic - {} clients".format( + key), + _title_size=16, + _bar_width=0.15, _color_name=['orangered'], + _enable_csv=True, + _graph_image_name="{}_bk_{}".format(key, load), _color_edge=['black'], + _color=['orangered']) + graph_png = graph.build_bar_graph() + print("graph name {}".format(graph_png)) + report.set_graph_image(graph_png) + # need to move the graph image to the results + report.move_graph_image() + report.set_csv_filename(graph_png) + report.move_csv_file() + report.build_graph() + report.set_obj_html( + _obj_title=f"Individual download throughput with intended load {load}/station for traffic BE(WiFi).", + _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running BE " + f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " + f"“Throughput in Mbps”.") + report.build_objective() + graph = lf_bar_graph(_data_set=[res[key][load]['be']], _xaxis_name="Clients running - BE", + _yaxis_name="Throughput in Mbps", + _xaxis_categories=[i + 1 for i in range(len(self.sta_list))], + _xaxis_label=[i + 1 for i in range(len(self.sta_list))], + _label=["BE"], + _xaxis_step=1, + _xticks_font=8, + _graph_title="Individual download throughput for BE(WIFI) traffic - {} clients".format( + key), + _title_size=16, + _bar_width=0.15, _color_name=['yellowgreen'], + _enable_csv=True, + _graph_image_name="{}_be_{}".format(key, load), _color_edge=['black'], + _color=['yellowgreen']) + graph_png = graph.build_bar_graph() + print("graph name {}".format(graph_png)) + report.set_graph_image(graph_png) + # need to move the graph image to the results + report.move_graph_image() + report.set_csv_filename(graph_png) + report.move_csv_file() + report.build_graph() + report.set_obj_html( + _obj_title=f"Individual download throughput with intended load {load}/station for traffic VI(WiFi).", + _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running VI " + f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " + f"“Throughput in Mbps”.") + report.build_objective() + graph = lf_bar_graph(_data_set=[res[key][load]['video']], _xaxis_name="Clients running - VI", + _yaxis_name="Throughput in Mbps", + _xaxis_categories=[i + 1 for i in range(len(self.sta_list))], + _xaxis_label=[i + 1 for i in range(len(self.sta_list))], + _label=["Video"], + _xaxis_step=1, + _xticks_font=8, + _graph_title="Individual download throughput for VI(WIFI) traffic - {} clients".format( + key), + _title_size=16, + _bar_width=0.15, _color_name=['steelblue'], + _enable_csv=True, + _graph_image_name="{}_video_{}".format(key, load), + _color_edge=['black'], + _color=['steelblue']) + graph_png = graph.build_bar_graph() + print("graph name {}".format(graph_png)) + report.set_graph_image(graph_png) + # need to move the graph image to the results + report.move_graph_image() + report.set_csv_filename(graph_png) + report.move_csv_file() + report.build_graph() + report.set_obj_html( + _obj_title=f"Individual download throughput with intended load {load}/station for traffic VO(WiFi).", + _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running VO " + f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " + f"“Throughput in Mbps”.") + report.build_objective() + graph = lf_bar_graph(_data_set=[res[key][load]['voice']], _xaxis_name="Clients running - VO", + _yaxis_name="Throughput in Mbps", + _xaxis_categories=[i + 1 for i in range(len(self.sta_list))], + _xaxis_label=[i + 1 for i in range(len(self.sta_list))], + _label=['Voice'], + _xaxis_step=1, + _xticks_font=8, + _graph_title="Individual download throughput for VO(WIFI) traffic - {} clients".format( + key), + _title_size=16, + _bar_width=0.15, _color_name=['blueviolet'], + _enable_csv=True, + _graph_image_name="{}_voice_{}".format(key, load), + _color_edge=['black'], + _color=['blueviolet']) + graph_png = graph.build_bar_graph() + print("graph name {}".format(graph_png)) + report.set_graph_image(graph_png) + # need to move the graph image to the results + report.move_graph_image() + report.set_csv_filename(graph_png) + report.move_csv_file() + report.build_graph() else: print("No individual graph to generate.") - def test_setup_information(self, test_setup_data=None, colmn="Setup Information"): - # custom table for test-setup/input-setup information - if test_setup_data is None: - return None - else: - var = "" - for i in test_setup_data: - var = var + "" + i + "" + str(test_setup_data[i]) + "" - setup_information = """ - -

- - - - - - - - -
Test Setup Information
""" + colmn + """ - - """ + str(var) + """ -
-
-

- """ - return str(setup_information) def main(): @@ -702,7 +641,7 @@ Generic command layout: python3 ./throughput_QOS.py --upstream_port eth1 - --radio wiphy0 + --radio_2g wiphy0 --num_stations 32 --security {open|wep|wpa|wpa2|wpa3} --mode 1 @@ -722,8 +661,6 @@ python3 ./throughput_QOS.py "bgnAX" : "13"} --ssid netgear --password admin123 - --test_duration 2m (default) - --monitor_interval_ms --a_min 3000 --b_min 1000 --ap "00:0e:8e:78:e1:76" @@ -733,9 +670,8 @@ python3 ./throughput_QOS.py --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) + --sta_names sta000,sta001,sta002 (used if --create_sta is False, comma separated names of stations) ''') - 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('--traffic_type', help='Select the Traffic Type [lf_udp, lf_tcp]', required=True) @@ -748,22 +684,23 @@ python3 ./throughput_QOS.py default="Best Effort") parser.add_argument('--ap_name', help="AP Model Name", default="Test-AP") parser.add_argument('--bands', help='used to run on multiple radio bands,can be used with multiple stations', - default="2,4G, 5G, BOTH", required=True) + default="2.4G, 5G, BOTH", required=True) parser.add_argument('--ssid_2g', help="ssid for 2.4Ghz band") parser.add_argument('--security_2g', help="security type for 2.4Ghz band") parser.add_argument('--passwd_2g', help="password for 2.4Ghz band") parser.add_argument('--ssid_5g', help="ssid for 5Ghz band") parser.add_argument('--security_5g', help="security type for 5Ghz band") parser.add_argument('--passwd_5g', help="password for 5Ghz band") + parser.add_argument('--radio_2g', help="radio which supports 2.4G bandwidth", default="wiphy0") + parser.add_argument('--radio_5g', help="radio which supports 5G bandwidth", default="wiphy1") args = parser.parse_args() print("--------------------------------------------") print(args) print("--------------------------------------------") - args.test_case = {} + args.test_case = args.bands.split(',') test_results = [] loads = {} bands = [] - radios = [] station_list = [] if (args.a_min is not None) and (args.b_min is not None): @@ -779,11 +716,6 @@ python3 ./throughput_QOS.py if args.bands is not None: bands = args.bands.split(',') - if args.radio is not None: - radios = args.radio.split(',') - if len(radios) < 2: - radios.extend(radios[0]) - if args.test_duration is not None: args.test_duration = args.test_duration.strip('m') @@ -793,59 +725,44 @@ python3 ./throughput_QOS.py for i in range(len(bands)): if bands[i] == "2.4G" or bands[i] == "2.4g": args.bands = bands[i] - if args.mode is not None: - args.mode = 11 - if i == 0: - args.radio = radios[0] - args.test_case.update({bands[i]: radios[0]}) - else: - args.radio = radios[1] - args.test_case.update({bands[i]: radios[1]}) + args.mode = 11 if args.create_sta: station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, - padding_number_=10000, radio=args.radio) + padding_number_=10000, radio=args.radio_2g) else: station_list = args.sta_names.split(",") elif bands[i] == "5G" or bands[i] == "5g": args.bands = bands[i] args.mode = 9 - if i == 0: - args.radio = radios[0] - args.test_case.update({bands[i]: radios[0]}) - else: - args.radio = radios[1] - args.test_case.update({bands[i]: radios[1]}) if args.create_sta: station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, padding_number_=10000, - radio=args.radio) + radio=args.radio_5g) else: station_list = args.sta_names.split(",") elif bands[i] == "BOTH" or bands[i] == "both": args.bands = bands[i] - args.radio = str(radios[0] + "," + radios[1]) - args.test_case.update({bands[i]: radios[0] + "," + radios[1]}) + args.mode = 0 + if (int(args.num_stations) % 2) != 0: + print("Number of stations for Both Band should be even in number.") + exit(1) mid = int(args.num_stations) // 2 if args.create_sta: station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=mid - 1, padding_number_=10000, - radio=radios[0]) + radio=args.radio_2g) station_list.extend(LFUtils.portNameSeries(prefix_="sta", start_id_=mid, end_id_=int(args.num_stations) - 1, padding_number_=10000, - radio=radios[1])) + radio=args.radio_5g)) else: station_list = args.sta_names.split(",") else: print("Band " + bands[i] + " Not Exist") exit(1) - print("-----------------") - # print(bands[i]) - print(args.radio) - # print(args.mode) - # print(station_list) - print(args.test_case) - print("-----------------") + print("------------------------") + print(args.bands) + print("------------------------") # ---------------------------------------# for index in range(len(loads["b_min"])): throughput_qos = ThroughputQOS(host=args.mgr, @@ -865,11 +782,12 @@ python3 ./throughput_QOS.py ssid_5g=args.ssid_5g, password_5g=args.passwd_5g, security_5g=args.security_5g, - radio=args.radio, + radio_2g=args.radio_2g, + radio_5g=args.radio_5g, test_duration=args.test_duration, use_ht160=False, - side_a_min_rate=loads['a_min'][index], - side_b_min_rate=loads['b_min'][index], + side_a_min_rate=int(loads['a_min'][index]), + side_b_min_rate=int(loads['b_min'][index]), mode=args.mode, bands=args.bands, ap=args.ap, @@ -888,11 +806,10 @@ python3 ./throughput_QOS.py layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) except: raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') - throughput_qos.start(False, False) time.sleep(int(args.test_duration) * 60) throughput_qos.stop() - test_results.append(throughput_qos.evaluate_throughput()) + test_results.append(throughput_qos.evaluate_qos()) if args.create_sta: if not throughput_qos.passes(): print(throughput_qos.get_fail_message()) @@ -900,7 +817,7 @@ python3 ./throughput_QOS.py LFUtils.wait_until_ports_admin_up(port_list=station_list) if throughput_qos.passes(): throughput_qos.success() - throughput_qos.cleanup() + throughput_qos.cleanup() test_end_time = datetime.datetime.now().strftime("%b %d %H:%M:%S") print("Test ended at: ", test_end_time) @@ -909,7 +826,8 @@ python3 ./throughput_QOS.py "SSID": throughput_qos.ssid, "SSID - 2.4 Ghz": throughput_qos.ssid_2g, "SSID - 5 Ghz": throughput_qos.ssid_5g, - "Test Duration": datetime.datetime.strptime(test_end_time, "%b %d %H:%M:%S") - datetime.datetime.strptime(test_start_time, "%b %d %H:%M:%S") + "Test Duration": datetime.datetime.strptime(test_end_time, "%b %d %H:%M:%S") - datetime.datetime.strptime( + test_start_time, "%b %d %H:%M:%S") } if throughput_qos.ssid is None: test_setup_info.pop("SSID") From 02d937d1eab5d6ff89f65eb6c6e354fb26fb6ae5 Mon Sep 17 00:00:00 2001 From: anil-tegala Date: Tue, 13 Jul 2021 23:46:23 +0530 Subject: [PATCH 145/152] lf_csv added to py-scripts --- py-scripts/throughput_qos.py | 847 ----------------------------------- 1 file changed, 847 deletions(-) delete mode 100644 py-scripts/throughput_qos.py diff --git a/py-scripts/throughput_qos.py b/py-scripts/throughput_qos.py deleted file mode 100644 index 0f5b98e9..00000000 --- a/py-scripts/throughput_qos.py +++ /dev/null @@ -1,847 +0,0 @@ -#!/usr/bin/env python3 - -""" -NAME: throughput_qos.py - -PURPOSE: throughput_qos.py will create stations and endpoints which evaluates l3 traffic for a particular type of service. - -EXAMPLE: -python3 throughput_qos.py --mgr 192.168.200.37 --mgr_port 8080 -u eth1 --num_stations 1 ---radio wiphy1 --ssid TestAP5-71 --passwd lanforge --security wpa2 --mode 11 --a_min 1000000 --b_min 1000000 --traffic_type lf_udp - -python3 throughput_qos.py --num_stations 1 --radio wiphy1 --ssid ct523c-vap --passwd ct523c-vap --security wpa2 --mode 11 --a_min 1000000 --b_min 1000000 --traffic_type lf_udp - - -Use './throughput_qos.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 -import matplotlib.pyplot as plt -import matplotlib as mpl -import numpy as np -import pandas as pd -import pdfkit -from lf_report import lf_report -from lf_graph import lf_bar_graph - -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')) - -import argparse -from LANforge import LFUtils -from realm import Realm -import time -import datetime - - -class ThroughputQOS(Realm): - def __init__(self, - tos, - ssid=None, - security=None, - password=None, - ssid_2g=None, - security_2g=None, - password_2g=None, - ssid_5g=None, - security_5g=None, - password_5g=None, - sta_list=[], - create_sta=True, - name_prefix=None, - upstream=None, - radio_2g="wiphy0", - radio_5g="wiphy1", - host="localhost", - port=8080, - mode=0, - ap=None, - ap_name="", - traffic_type=None, - 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="2m", - bands="2.4G, 5G, BOTH", - test_case={}, - 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.security = security - self.password = password - self.ssid_2g = ssid_2g - self.security_2g = security_2g - self.password_2g = password_2g - self.ssid_5g = ssid_5g - self.security_5g = security_5g - self.password_5g = password_5g - self.radio_2g = radio_2g - self.radio_5g = radio_5g - self.sta_list = sta_list - self.create_sta = create_sta - self.mode = mode - self.ap = ap - self.ap_name = ap_name - self.traffic_type = traffic_type - self.tos = tos.split(",") - self.bands = bands.split(",") - self.test_case = test_case - self.number_template = number_template - self.debug = _debug_on - 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) - 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 = 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 - - def start(self, print_pass=False, print_fail=False): - self.cx_profile.start_cx() - - def stop(self): - self.cx_profile.stop_cx() - self.station_profile.admin_down() - - def pre_cleanup(self): - self.cx_profile.cleanup_prefix() - if self.create_sta: - for sta in self.sta_list: - self.rm_port(sta, check_exists=True) - - def cleanup(self): - self.cx_profile.cleanup() - if self.create_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) - - def build(self): - for key in self.bands: - if self.create_sta: - if key == "2.4G" or key == "2.4g": - self.station_profile.mode = 11 - if self.ssid is None: - self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) - else: - 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_2g, sta_names_=self.sta_list, debug=self.debug) - if key == "5G" or key == "5g": - self.station_profile.mode = 9 - if self.ssid is None: - self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) - else: - 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_5g, sta_names_=self.sta_list, debug=self.debug) - if key == "BOTH" or key == "both": - split = len(self.sta_list) // 2 - if self.ssid is None: - self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) - else: - self.station_profile.use_security(self.security, self.ssid, self.password) - self.station_profile.mode = 11 - 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_2g, sta_names_=self.sta_list[:split], - debug=self.debug) - if self.ssid is None: - self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) - else: - self.station_profile.use_security(self.security, self.ssid, self.password) - self.station_profile.mode = 9 - self.station_profile.set_number_template(self.number_template) - 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_5g, sta_names_=self.sta_list[split:], - debug=self.debug) - self.station_profile.admin_up() - # check here if upstream port got IP - temp_stations = self.station_profile.station_names.copy() - if self.wait_for_ip(temp_stations): - self._pass("All stations got IPs") - else: - self._fail("Stations failed to get IPs") - self.exit_fail() - self._pass("PASS: Station build finished") - self.create_cx() - print("cx build finished") - - def create_cx(self): - _tos = "BK,BE,VI,VO" - self.tos = _tos.split(",") - print("tos: {}".format(self.tos)) - for ip_tos in self.tos: - print("## ip_tos: {}".format(ip_tos)) - print("Creating connections for endpoint type: %s TOS: %s cx-count: %s" % ( - self.traffic_type, ip_tos, self.cx_profile.get_cx_count())) - self.cx_profile.create(endp_type=self.traffic_type, side_a=self.sta_list, - side_b=self.upstream, - sleep_time=0, tos=ip_tos) - print("cross connections with TOS type created.") - - def evaluate_qos(self): - case = "" - tos_download = {'video': [], 'voice': [], 'bk': [], 'be': []} - tx_b = {'bk': [], 'be': [], 'video': [], 'voice': []} - rx_a = {'bk': [], 'be': [], 'video': [], 'voice': []} - delay = {'bk': [], 'be': [], 'video': [], 'voice': []} - pkt_loss = {} - tx_endps = {} - rx_endps = {} - if int(self.cx_profile.side_b_min_bps) != 0: - case = str(int(self.cx_profile.side_b_min_bps) // 1000000) - elif int(self.cx_profile.side_a_min_bps) != 0: - case = str(int(self.cx_profile.side_a_min_bps) // 1000000) - if len(self.cx_profile.created_cx.keys()) > 0: - endp_data = self.json_get('endp/all?fields=name,tx+pkts+ll,rx+pkts+ll,delay') - endp_data.pop("handler") - endp_data.pop("uri") - endps = endp_data['endpoint'] - for i in range(len(endps)): - if i < len(endps) // 2: - tx_endps.update(endps[i]) - if i >= len(endps) // 2: - rx_endps.update(endps[i]) - for sta in self.cx_profile.created_cx.keys(): - temp = int(sta[12:]) - if temp % 4 == 0: - if int(self.cx_profile.side_b_min_bps) != 0: - tos_download['bk'].append(float( - f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) - tx_b['bk'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) - rx_a['bk'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) - delay['bk'].append(int(f"{rx_endps['%s-A' % sta]['delay']}")) - else: - tos_download['bk'].append(float(0)) - tx_b['bk'].append(int(0)) - rx_a['bk'].append(int(0)) - delay['bk'].append(int(0)) - elif temp % 4 == 1: - if int(self.cx_profile.side_b_min_bps) != 0: - tos_download['be'].append(float( - f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) - tx_b['be'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) - rx_a['be'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) - delay['be'].append(int(f"{rx_endps['%s-A' % sta]['delay']}")) - else: - tos_download['be'].append(float(0)) - tx_b['be'].append(int(0)) - rx_a['be'].append(int(0)) - delay['be'].append(int(0)) - elif temp % 4 == 2: - if int(self.cx_profile.side_b_min_bps) != 0: - tos_download['voice'].append(float( - f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) - tx_b['voice'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) - rx_a['voice'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) - delay['voice'].append(int(f"{rx_endps['%s-A' % sta]['delay']}")) - else: - tos_download['voice'].append(float(0)) - tx_b['voice'].append(int(0)) - rx_a['voice'].append(int(0)) - delay['voice'].append(int(0)) - elif temp % 4 == 3: - if int(self.cx_profile.side_b_min_bps) != 0: - tos_download['video'].append(float( - f"{list((self.json_get('/cx/%s?fields=bps+rx+a' % sta)).values())[2]['bps rx a'] / 1000000:.2f}")) - tx_b['video'].append(int(f"{tx_endps['%s-B' % sta]['tx pkts ll']}")) - rx_a['video'].append(int(f"{rx_endps['%s-A' % sta]['rx pkts ll']}")) - delay['video'].append(int(f"{rx_endps['%s-A' % sta]['delay']}")) - else: - tos_download['video'].append(float(0)) - tx_b['video'].append(int(0)) - rx_a['video'].append(int(0)) - delay['video'].append(int(0)) - tos_download.update({"bkQOS": float(f"{sum(tos_download['bk']):.2f}")}) - tos_download.update({"beQOS": float(f"{sum(tos_download['be']):.2f}")}) - tos_download.update({"videoQOS": float(f"{sum(tos_download['video']):.2f}")}) - tos_download.update({"voiceQOS": float(f"{sum(tos_download['voice']):.2f}")}) - tos_download.update({"bkDELAY": float(f"{sum(delay['bk']) / 1000:.2f}")}) - tos_download.update({"beDELAY": float(f"{sum(delay['be']) / 1000:.2f}")}) - tos_download.update({"videoDELAY": float(f"{sum(delay['video']) / 1000:.2f}")}) - tos_download.update({"voiceDELAY": float(f"{sum(delay['voice']) / 1000:.2f}")}) - if sum(tx_b['bk']) != 0 or sum(tx_b['be']) != 0 or sum(tx_b['video']) != 0 or sum(tx_b['voice']) != 0: - tos_download.update( - {"bkLOSS": float(f"{((sum(tx_b['bk']) - sum(rx_a['bk'])) / sum(tx_b['bk'])) * 100:.2f}")}) - tos_download.update( - {"beLOSS": float(f"{((sum(tx_b['be']) - sum(rx_a['be'])) / sum(tx_b['be'])) * 100:.2f}")}) - tos_download.update({"videoLOSS": float( - f"{((sum(tx_b['video']) - sum(rx_a['video'])) / sum(tx_b['video'])) * 100:.2f}")}) - tos_download.update({"voiceLOSS": float( - f"{((sum(tx_b['voice']) - sum(rx_a['voice'])) / sum(tx_b['voice'])) * 100:.2f}")}) - tos_download.update({'tx_b': tx_b}) - tos_download.update({'rx_a': rx_a}) - tos_download.update({'delay': delay}) - else: - print("no RX values available to evaluate QOS") - key = case + " " + "Mbps" - return {key: tos_download} - - def set_report_data(self, data): - print(data) - res = {} - if data is not None: - for i in range(len(data)): - res.update({self.test_case[i]: data[i]}) - else: - print("No Data found to generate report!") - exit(1) - if self.test_case is not None: - table_df = {} - num_stations = [] - throughput = [] - graph_df = {} - for case in self.test_case: - throughput_df = [[], [], [], []] - pkt_loss_df = [[], [], [], []] - latency_df = [[], [], [], []] - if case == "2.4g" or case == "2.4G": - num_stations.append("{} - bgn-AC".format(str(len(self.sta_list)))) - elif case == "5g" or case == "5G": - num_stations.append("{} - an-AC".format(str(len(self.sta_list)))) - elif case == "both" or case == "BOTH": - num_stations.append( - "{} - bgn-AC + {} - an-AC ".format(str(len(self.sta_list) // 2), str(len(self.sta_list) // 2))) - for key in res[case]: - throughput.append( - "BK : {}, BE : {}, VI: {}, VO: {}".format(res[case][key]["bkQOS"], - res[case][key]["beQOS"], - res[case][key][ - "videoQOS"], - res[case][key][ - "voiceQOS"])) - throughput_df[0].append(res[case][key]['bkQOS']) - throughput_df[1].append(res[case][key]['beQOS']) - throughput_df[2].append(res[case][key]['videoQOS']) - throughput_df[3].append(res[case][key]['voiceQOS']) - pkt_loss_df[0].append(res[case][key]['bkLOSS']) - pkt_loss_df[1].append(res[case][key]['beLOSS']) - pkt_loss_df[2].append(res[case][key]['videoLOSS']) - pkt_loss_df[3].append(res[case][key]['voiceLOSS']) - latency_df[0].append(res[case][key]['bkDELAY']) - latency_df[1].append(res[case][key]['beDELAY']) - latency_df[2].append(res[case][key]['videoDELAY']) - latency_df[3].append(res[case][key]['voiceDELAY']) - table_df.update({"No of Stations": num_stations}) - table_df.update({"Throughput for Load {}".format(key): throughput}) - graph_df.update({case: [throughput_df, pkt_loss_df, latency_df]}) - res.update({"throughput_table_df": table_df}) - res.update({"graph_df": graph_df}) - return res - - def generate_report(self, data, test_setup_info, input_setup_info): - res = self.set_report_data(data) - report = lf_report(_output_pdf="throughput_qos.pdf", _output_html="throughput_qos.html") - report_path = report.get_path() - report_path_date_time = report.get_path_date_time() - print("path: {}".format(report_path)) - print("path_date_time: {}".format(report_path_date_time)) - report.set_title("Throughput QOS") - report.build_banner() - # objective title and description - report.set_obj_html(_obj_title="Objective", - _obj="Through this test we can evaluate the throughput for given number of clients which" - " runs the traffic with a particular Type of Service i.e BK,BE,VI,VO") - report.build_objective() - report.test_setup_table(test_setup_data=test_setup_info, value="Device Under Test") - report.set_table_title( - "Overall download Throughput for all TOS i.e BK | BE | Video (VI) | Voice (VO)") - report.build_table_title() - df_throughput = pd.DataFrame(res["throughput_table_df"]) - report.set_table_dataframe(df_throughput) - report.build_table() - for key in res["graph_df"]: - report.set_graph_title(f"Overall Download throughput for {len(self.sta_list)} - {key} clients with different TOS.") - report.set_obj_html(_obj_title="", _obj="The below graph represents overall download throughput for all " - "connected stations running BK, BE, VO, VI traffic with different " - "intended loads per station – {}".format(res["graph_df"][key].keys())) - report.build_graph_title() - report.build_objective() - - graph = lf_bar_graph(_data_set=res["graph_df"][key][0], - _xaxis_name="Load per Type of Service", - _yaxis_name="Throughput (Mbps)", - _xaxis_categories=[1], - _xaxis_label=['1 Mbps', '2 Mbps', '3 Mbps', '4 Mbps', '5 Mbps'], - _graph_image_name=f"tos_download_{key}Hz", - _label=["BK", "BE", "VI", "VO"], - _xaxis_step=1, - _graph_title="Overall download throughput – BK,BE,VO,VI traffic streams", - _title_size=16, - _color=['orangered', 'greenyellow', 'steelblue', 'blueviolet'], - _color_edge='black', - _bar_width=0.15, - _dpi=96, - _enable_csv=True, - _color_name=['orangered', 'greenyellow', 'steelblue', 'blueviolet']) - graph_png = graph.build_bar_graph() - - print("graph name {}".format(graph_png)) - - report.set_graph_image(graph_png) - # need to move the graph image to the results directory - report.move_graph_image() - report.set_csv_filename(graph_png) - report.move_csv_file() - report.build_graph() - report.set_graph_title(f"Overall Packet loss for {len(self.sta_list)} - {key} clients with different TOS.") - report.set_obj_html(_obj_title="", - _obj="This graph shows the overall packet loss for the connected stations " - "for BK,BE,VO,VI traffic with intended load per station – {}".format(res["graph_df"][key].keys())) - report.build_graph_title() - report.build_objective() - - graph = lf_bar_graph(_data_set=res["graph_df"][key][1], - _xaxis_name="Load per Type of Service", - _yaxis_name="Packet Loss (%)", - _xaxis_categories=[1], - _xaxis_label=['1 Mbps', '2 Mbps', '3 Mbps', '4 Mbps', '5 Mbps'], - _graph_image_name=f"pkt_loss_{key}Hz", - _label=["BK", "BE", "VI", "VO"], - _xaxis_step=1, - _graph_title="Load vs Packet Loss", - _title_size=16, - _color=['orangered', 'greenyellow', 'steelblue', 'blueviolet'], - _color_edge='black', - _bar_width=0.15, - _dpi=96, - _enable_csv=True, - _color_name=['orangered', 'greenyellow', 'steelblue', 'blueviolet']) - graph_png = graph.build_bar_graph() - - print("graph name {}".format(graph_png)) - - report.set_graph_image(graph_png) - # need to move the graph image to the results directory - report.move_graph_image() - report.set_csv_filename(graph_png) - report.move_csv_file() - report.build_graph() - report.set_obj_html( - _obj_title=f"Overall Latency for {len(self.sta_list)} - {key} clients with different TOS.", - _obj="This graph shows the overall Latency for the connected stations " - "for BK,BE,VO,VI traffic with intended load per station – {}".format(res["graph_df"][key].keys())) - report.build_objective() - - graph = lf_bar_graph(_data_set=res["graph_df"][key][2], - _xaxis_name="Load per Type of Service", - _yaxis_name="Average Latency (in seconds)", - _xaxis_categories=[1], - _xaxis_label=['1 Mbps', '2 Mbps', '3 Mbps', '4 Mbps', '5 Mbps'], - _graph_image_name=f"latency_{key}Hz", - _label=["BK", "BE", "VI", "VO"], - _xaxis_step=1, - _graph_title="Overall Download Latency – BK,BE,VO,VI traffic streams", - _title_size=16, - _show_bar_value=True, - _color=['orangered', 'yellowgreen', 'steelblue', 'blueviolet'], - _color_edge='black', - _bar_width=0.15, - _dpi=96, - _enable_csv=True, - _color_name=['orangered', 'yellowgreen', 'steelblue', 'blueviolet']) - graph_png = graph.build_bar_graph() - - print("graph name {}".format(graph_png)) - - report.set_graph_image(graph_png) - # need to move the graph image to the results directory - report.move_graph_image() - report.set_csv_filename(graph_png) - report.move_csv_file() - report.build_graph() - self.generate_individual_graph(res, report) - report.test_setup_table(test_setup_data=input_setup_info, value="Information") - report.build_custom() - report.write_html() - report.write_pdf() - - def generate_individual_graph(self, res, report): - if len(res.keys()) > 0: - if "throughput_table_df" in res: - res.pop("throughput_table_df") - if "graph_df" in res: - res.pop("graph_df") - for key in res: - for load in res[key]: - report.set_obj_html( - _obj_title=f"Individual download throughput with intended load {load}/station for traffic BK(WiFi).", - _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running BK " - f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows “" - f"Throughput in Mbps”.") - report.build_objective() - graph = lf_bar_graph(_data_set=[res[key][load]['bk']], _xaxis_name="Clients running - BK", - _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i + 1 for i in range(len(self.sta_list))], - _xaxis_label=[i + 1 for i in range(len(self.sta_list))], - _label=["BK"], - _xaxis_step=1, - _xticks_font=8, - _graph_title="Individual download throughput for BK(WIFI) traffic - {} clients".format( - key), - _title_size=16, - _bar_width=0.15, _color_name=['orangered'], - _enable_csv=True, - _graph_image_name="{}_bk_{}".format(key, load), _color_edge=['black'], - _color=['orangered']) - graph_png = graph.build_bar_graph() - print("graph name {}".format(graph_png)) - report.set_graph_image(graph_png) - # need to move the graph image to the results - report.move_graph_image() - report.set_csv_filename(graph_png) - report.move_csv_file() - report.build_graph() - report.set_obj_html( - _obj_title=f"Individual download throughput with intended load {load}/station for traffic BE(WiFi).", - _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running BE " - f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " - f"“Throughput in Mbps”.") - report.build_objective() - graph = lf_bar_graph(_data_set=[res[key][load]['be']], _xaxis_name="Clients running - BE", - _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i + 1 for i in range(len(self.sta_list))], - _xaxis_label=[i + 1 for i in range(len(self.sta_list))], - _label=["BE"], - _xaxis_step=1, - _xticks_font=8, - _graph_title="Individual download throughput for BE(WIFI) traffic - {} clients".format( - key), - _title_size=16, - _bar_width=0.15, _color_name=['yellowgreen'], - _enable_csv=True, - _graph_image_name="{}_be_{}".format(key, load), _color_edge=['black'], - _color=['yellowgreen']) - graph_png = graph.build_bar_graph() - print("graph name {}".format(graph_png)) - report.set_graph_image(graph_png) - # need to move the graph image to the results - report.move_graph_image() - report.set_csv_filename(graph_png) - report.move_csv_file() - report.build_graph() - report.set_obj_html( - _obj_title=f"Individual download throughput with intended load {load}/station for traffic VI(WiFi).", - _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running VI " - f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " - f"“Throughput in Mbps”.") - report.build_objective() - graph = lf_bar_graph(_data_set=[res[key][load]['video']], _xaxis_name="Clients running - VI", - _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i + 1 for i in range(len(self.sta_list))], - _xaxis_label=[i + 1 for i in range(len(self.sta_list))], - _label=["Video"], - _xaxis_step=1, - _xticks_font=8, - _graph_title="Individual download throughput for VI(WIFI) traffic - {} clients".format( - key), - _title_size=16, - _bar_width=0.15, _color_name=['steelblue'], - _enable_csv=True, - _graph_image_name="{}_video_{}".format(key, load), - _color_edge=['black'], - _color=['steelblue']) - graph_png = graph.build_bar_graph() - print("graph name {}".format(graph_png)) - report.set_graph_image(graph_png) - # need to move the graph image to the results - report.move_graph_image() - report.set_csv_filename(graph_png) - report.move_csv_file() - report.build_graph() - report.set_obj_html( - _obj_title=f"Individual download throughput with intended load {load}/station for traffic VO(WiFi).", - _obj=f"The below graph represents individual throughput for {len(self.sta_list)} clients running VO " - f"(WiFi) traffic. X- axis shows “number of clients” and Y-axis shows " - f"“Throughput in Mbps”.") - report.build_objective() - graph = lf_bar_graph(_data_set=[res[key][load]['voice']], _xaxis_name="Clients running - VO", - _yaxis_name="Throughput in Mbps", - _xaxis_categories=[i + 1 for i in range(len(self.sta_list))], - _xaxis_label=[i + 1 for i in range(len(self.sta_list))], - _label=['Voice'], - _xaxis_step=1, - _xticks_font=8, - _graph_title="Individual download throughput for VO(WIFI) traffic - {} clients".format( - key), - _title_size=16, - _bar_width=0.15, _color_name=['blueviolet'], - _enable_csv=True, - _graph_image_name="{}_voice_{}".format(key, load), - _color_edge=['black'], - _color=['blueviolet']) - graph_png = graph.build_bar_graph() - print("graph name {}".format(graph_png)) - report.set_graph_image(graph_png) - # need to move the graph image to the results - report.move_graph_image() - report.set_csv_filename(graph_png) - report.move_csv_file() - report.build_graph() - else: - print("No individual graph to generate.") - - - -def main(): - parser = Realm.create_basic_argparse( - prog='throughput_QOS.py', - formatter_class=argparse.RawTextHelpFormatter, - epilog='''\ - Create stations and endpoints and runs L3 traffic with various IP type of service(BK | BE | Video | Voice) - ''', - description='''\ -throughput_QOS.py: --------------------- -Generic command layout: - -python3 ./throughput_QOS.py - --upstream_port eth1 - --radio_2g wiphy0 - --num_stations 32 - --security {open|wep|wpa|wpa2|wpa3} - --mode 1 - {"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"} - --ssid netgear - --password admin123 - --a_min 3000 - --b_min 1000 - --ap "00:0e:8e:78:e1:76" - --debug - --ap_name Netgear RC6700 - --upstream_port eth1 (upstream Port) - --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 is False, comma separated names of stations) - ''') - 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('--traffic_type', help='Select the Traffic Type [lf_udp, lf_tcp]', required=True) - 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="2m") - parser.add_argument('--create_sta', help='Used to force a connection to a particular AP', default=True) - parser.add_argument('--sta_names', help='Used to force a connection to a particular AP', default="sta0000") - parser.add_argument('--tos', help='used to provide different ToS settings: BK | BE | VI | VO | numeric', - default="Best Effort") - parser.add_argument('--ap_name', help="AP Model Name", default="Test-AP") - parser.add_argument('--bands', help='used to run on multiple radio bands,can be used with multiple stations', - default="2.4G, 5G, BOTH", required=True) - parser.add_argument('--ssid_2g', help="ssid for 2.4Ghz band") - parser.add_argument('--security_2g', help="security type for 2.4Ghz band") - parser.add_argument('--passwd_2g', help="password for 2.4Ghz band") - parser.add_argument('--ssid_5g', help="ssid for 5Ghz band") - parser.add_argument('--security_5g', help="security type for 5Ghz band") - parser.add_argument('--passwd_5g', help="password for 5Ghz band") - parser.add_argument('--radio_2g', help="radio which supports 2.4G bandwidth", default="wiphy0") - parser.add_argument('--radio_5g', help="radio which supports 5G bandwidth", default="wiphy1") - args = parser.parse_args() - print("--------------------------------------------") - print(args) - print("--------------------------------------------") - args.test_case = args.bands.split(',') - test_results = [] - loads = {} - bands = [] - station_list = [] - - if (args.a_min is not None) and (args.b_min is not None): - if (type(args.a_min) is not int) and (type(args.b_min) is not int): - args.a_min = args.a_min.split(',') - args.b_min = args.b_min.split(',') - loads = {"a_min": args.a_min, "b_min": args.b_min} - else: - args.a_min = str(args.a_min).split(",") - args.b_min = str(args.b_min).split(",") - loads = {"a_min": args.a_min, "b_min": args.b_min} - - if args.bands is not None: - bands = args.bands.split(',') - - if args.test_duration is not None: - args.test_duration = args.test_duration.strip('m') - - test_start_time = datetime.datetime.now().strftime("%b %d %H:%M:%S") - print("Test started at: ", test_start_time) - - for i in range(len(bands)): - if bands[i] == "2.4G" or bands[i] == "2.4g": - args.bands = bands[i] - args.mode = 11 - if args.create_sta: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, - padding_number_=10000, radio=args.radio_2g) - else: - station_list = args.sta_names.split(",") - elif bands[i] == "5G" or bands[i] == "5g": - args.bands = bands[i] - args.mode = 9 - if args.create_sta: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=int(args.num_stations) - 1, - padding_number_=10000, - radio=args.radio_5g) - else: - station_list = args.sta_names.split(",") - elif bands[i] == "BOTH" or bands[i] == "both": - args.bands = bands[i] - args.mode = 0 - if (int(args.num_stations) % 2) != 0: - print("Number of stations for Both Band should be even in number.") - exit(1) - mid = int(args.num_stations) // 2 - if args.create_sta: - station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=mid - 1, - padding_number_=10000, - radio=args.radio_2g) - station_list.extend(LFUtils.portNameSeries(prefix_="sta", start_id_=mid, - end_id_=int(args.num_stations) - 1, - padding_number_=10000, - radio=args.radio_5g)) - else: - station_list = args.sta_names.split(",") - else: - print("Band " + bands[i] + " Not Exist") - exit(1) - print("------------------------") - print(args.bands) - print("------------------------") - # ---------------------------------------# - for index in range(len(loads["b_min"])): - throughput_qos = ThroughputQOS(host=args.mgr, - port=args.mgr_port, - number_template="0000", - ap_name=args.ap_name, - sta_list=station_list, - create_sta=args.create_sta, - name_prefix="TOS-", - upstream=args.upstream_port, - ssid=args.ssid, - password=args.passwd, - security=args.security, - ssid_2g=args.ssid_2g, - password_2g=args.passwd_2g, - security_2g=args.security_2g, - ssid_5g=args.ssid_5g, - password_5g=args.passwd_5g, - security_5g=args.security_5g, - radio_2g=args.radio_2g, - radio_5g=args.radio_5g, - test_duration=args.test_duration, - use_ht160=False, - side_a_min_rate=int(loads['a_min'][index]), - side_b_min_rate=int(loads['b_min'][index]), - mode=args.mode, - bands=args.bands, - ap=args.ap, - traffic_type=args.traffic_type, - tos=args.tos, - test_case=args.test_case, - _debug_on=args.debug) - throughput_qos.pre_cleanup() - throughput_qos.build() - - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - try: - layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) - except: - raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') - throughput_qos.start(False, False) - time.sleep(int(args.test_duration) * 60) - throughput_qos.stop() - test_results.append(throughput_qos.evaluate_qos()) - if args.create_sta: - if not throughput_qos.passes(): - print(throughput_qos.get_fail_message()) - throughput_qos.exit_fail() - LFUtils.wait_until_ports_admin_up(port_list=station_list) - if throughput_qos.passes(): - throughput_qos.success() - throughput_qos.cleanup() - - test_end_time = datetime.datetime.now().strftime("%b %d %H:%M:%S") - print("Test ended at: ", test_end_time) - test_setup_info = { - "AP Model": throughput_qos.ap_name, - "SSID": throughput_qos.ssid, - "SSID - 2.4 Ghz": throughput_qos.ssid_2g, - "SSID - 5 Ghz": throughput_qos.ssid_5g, - "Test Duration": datetime.datetime.strptime(test_end_time, "%b %d %H:%M:%S") - datetime.datetime.strptime( - test_start_time, "%b %d %H:%M:%S") - } - if throughput_qos.ssid is None: - test_setup_info.pop("SSID") - else: - if throughput_qos.ssid_2g is None: - test_setup_info.pop("SSID - 2.4 Ghz") - if throughput_qos.ssid_5g is None: - test_setup_info.pop("SSID - 5 Ghz") - input_setup_info = { - "contact": "support@candelatech.com" - } - data = test_results - throughput_qos.generate_report(data=data, test_setup_info=test_setup_info, input_setup_info=input_setup_info) - - -if __name__ == "__main__": - main() From de546b8ff3d81af3e9a9d14173dac5a61279775f Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Tue, 13 Jul 2021 17:13:01 -0700 Subject: [PATCH 146/152] Initial commit of scripts which install grafana, ghost, and influx in one script for Fedora, CentOS, and Debian based Linux distros. Signed-off-by: Matthew Stidham --- influxgrafanaghost_fedora_install.sh | 46 ++++++++++++++++++++++++ influxgrafanaghost_ubuntu_install.sh | 52 ++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100755 influxgrafanaghost_fedora_install.sh create mode 100755 influxgrafanaghost_ubuntu_install.sh diff --git a/influxgrafanaghost_fedora_install.sh b/influxgrafanaghost_fedora_install.sh new file mode 100755 index 00000000..62a9def3 --- /dev/null +++ b/influxgrafanaghost_fedora_install.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# This bash script installs Influx, Grafana, and Ghost on Fedora or CentOS. +# Run this script as a normal user with sudo access. +# You need to provide your username at the beginning of the script. +# There are a few fields you will need to enter when this installs Ghost, and you will be prompted by the script. +# Many scripts in this library are built around Influx, Grafana, and Ghost. Influx is a time series database, +# Grafana has dashboards which display the data stored in Influx, +# and Ghost is a blogging platform which creates an easy way for a user to view automated reports which are built using LANforge scripts +# Once a user uses this script, the user can use those features with the credentials for the system this script sets up. + +# After running this script, Grafana is at port 3000, Influx is at port 8086, and Ghost is at port 2368 +# The user will need to login to those through a web browser to create login credentials, and find API tokens. +# These API tokens are needed to run many scripts in LANforge scripts with these three programs. + +echo Type in your username here +read -r USER + +#Influx installation +wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.4.x86_64.rpm +sudo yum localinstall influxdb2-2.0.4.x86_64.rpm +sudo service influxdb start +sudo service influxdb enable + +#Grafana installation +wget https://dl.grafana.com/oss/release/grafana-7.5.3-1.x86_64.rpm +sudo yum localinstall grafana-7.5.3-1.x86_64.rpm -y +sudo systemctl start grafana-server +sudo systemctl enable grafana-server + +#Ghost installation +sudo adduser ghost +sudo usermod -aG sudo ghost +sudo ufw allow 'Nginx Full' +curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash +sudo npm install ghost-cli@latest -g +# Ensure that NPM is up to date +npm cache verify +sudo npm install -g n +sudo n stable +curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash +npm install ghost-cli@latest -g +sudo mkdir -p /var/www/ghostsite +sudo chown ${USER}:${USER} /var/www/ghostsite +sudo chmod 775 /var/www/ghostsite +cd /var/www/ghostsite +ghost install local \ No newline at end of file diff --git a/influxgrafanaghost_ubuntu_install.sh b/influxgrafanaghost_ubuntu_install.sh new file mode 100755 index 00000000..5220db80 --- /dev/null +++ b/influxgrafanaghost_ubuntu_install.sh @@ -0,0 +1,52 @@ +#!/bin/bash +#This script installs Influx, Grafana, and Ghost on Ubuntu. +#Run this script as a normal user with sudo access. +#You need to provide your username at the beginning of the script. +#There are a few fields you will need to enter when it is installing Ghost, and you will be prompted by the script. +#Lanforge scripts is built around Influx, Grafana, and Ghost. Influx is a time series database, +#Grafana has dashboards which display the data stored in Influx, +#and Ghost is a blogging platform which creates an easy way for a user to view automated reports which are built using LANforge scripts +#Once a user uses this script, the user can use those features with the credentials for the system this script sets up. + +#After running this script, Grafana is accessible through port 3000, Influx is at port 8086, and Ghost is accessible at 2368 +#The user will need to login to those through a web browser to create login credentials, and find API tokens. +#These API tokens are needed to run many scripts in LANforge scripts with the functionality these three programs provide. + +#Update necessary parts of system +echo Type in your username here +read -r USER + +sudo apt-get update && sudo apt-get upgrade -y +sudo apt-get install nginx mysql-server nodejs npm -y + +#Influx installation +wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.7-amd64.deb +sudo dpkg -i influxdb2-2.0.7-amd64.deb +sudo systemctl unmask influxdb +sudo systemctl start influxdb +sudo systemctl enable influxdb + +#Grafana installation +sudo apt-get install -y adduser libfontconfig1 +wget https://dl.grafana.com/oss/release/grafana_8.0.5_amd64.deb +sudo dpkg -i grafana_8.0.5_amd64.deb +sudo systemctl start grafana-server +sudo systemctl enable grafana-server + +#Ghost installation +sudo adduser ghost +sudo usermod -aG sudo ghost +sudo ufw allow 'Nginx Full' +curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash +sudo npm install ghost-cli@latest -g +# Ensure that NPM is up to date +npm cache verify +sudo npm install -g n +sudo n stable +curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash +npm install ghost-cli@latest -g +sudo mkdir -p /var/www/ghostsite +sudo chown ${USER}:${USER} /var/www/ghostsite +sudo chmod 775 /var/www/ghostsite +cd /var/www/ghostsite +ghost install local \ No newline at end of file From ae0837f1d6b56e87d9b19a301c277e41d77fcea6 Mon Sep 17 00:00:00 2001 From: karthikaeyetea Date: Wed, 14 Jul 2021 11:56:51 +0530 Subject: [PATCH 147/152] font-szie and rotation for text above the bargraph is added --- py-scripts/lf_graph.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index c65c3425..fa82d944 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -50,6 +50,8 @@ class lf_bar_graph(): _show_bar_value=False, _xaxis_step=5, _xticks_font = None, + _text_font=None, + _text_rotation=None, _grp_title = "", _dpi=96, _enable_csv=False): @@ -72,6 +74,8 @@ class lf_bar_graph(): self.show_bar_value = _show_bar_value self.xaxis_step = _xaxis_step self.xticks_font = _xticks_font + self.text_font = _text_font + self.text_rotation = _text_rotation self.grp_title = _grp_title self.enable_csv = _enable_csv self.lf_csv = LfCSV() @@ -90,8 +94,8 @@ class lf_bar_graph(): def show_value(rects): for rect in rects: h = rect.get_height() - plt.text(rect.get_x() + rect.get_width() / 2., h + 0.05, '%d' % int(h), - ha='center', va='bottom') + plt.text(rect.get_x() + rect.get_width() / 2., h, h, + ha='center', va='bottom', rotation=self.text_rotation, fontsize=self.text_font) for data in self.data_set: if i > 0: @@ -323,7 +327,7 @@ if __name__ == "__main__":

""" - # + # test_file = open(output_html_1, "w") test_file.write(graph_html_obj) test_file.close() @@ -355,7 +359,7 @@ if __name__ == "__main__":

""" - # + # test_file = open(output_html_2, "w") test_file.write(graph_html_obj) test_file.close() From d6ef5bee74870c2aa81542e6782954c2eb8e9b23 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 14 Jul 2021 11:33:04 -0700 Subject: [PATCH 148/152] Adding in lf_ap_auto_test to ct_us_002 and enabling local_lf_report_dir in lf_ap_auto_test Signed-off-by: Matthew Stidham --- py-scripts/lf_ap_auto_test.py | 6 +++- py-scripts/tools/ct_us_002.json | 60 ++++++++++++++++++++++++++++++++- py-scripts/tools/lf_check.json | 3 +- py-scripts/tools/lf_check.py | 2 +- 4 files changed, 67 insertions(+), 4 deletions(-) diff --git a/py-scripts/lf_ap_auto_test.py b/py-scripts/lf_ap_auto_test.py index d431df98..573e44a0 100755 --- a/py-scripts/lf_ap_auto_test.py +++ b/py-scripts/lf_ap_auto_test.py @@ -186,6 +186,7 @@ class ApAutoTest(cvtest): lf_port=8080, lf_user="lanforge", lf_password="lanforge", + local_lf_report_dir="", instance_name="ap_auto_instance", config_name="ap_auto_config", upstream="1.1.eth1", @@ -230,6 +231,7 @@ class ApAutoTest(cvtest): self.raw_lines_file = raw_lines_file self.sets = sets self.graph_groups = graph_groups + self.local_lf_report_dir = local_lf_report_dir def setup(self): # Nothing to do at this time. @@ -282,7 +284,7 @@ class ApAutoTest(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, graph_groups_file=self.graph_groups) + cv_cmds, graph_groups_file=self.graph_groups, local_lf_report_dir=self.local_lf_report_dir) self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name @@ -332,6 +334,7 @@ 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="") args = parser.parse_args() @@ -345,6 +348,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, dut5_0 = args.dut5_0, dut2_0 = args.dut2_0, load_old_cfg = args.load_old_cfg, diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json index eb2198da..3c0ef7c4 100644 --- a/py-scripts/tools/ct_us_002.json +++ b/py-scripts/tools/ct_us_002.json @@ -22,7 +22,7 @@ "custom_db": "DFLT_ETH1_GEN", "email_list_production": "konikofi@candelatech.com,greearb@candelatech.com,logan.lipke@candelatech.com,dipti.dhond@candelatech.com,chuck.rekiere@candelatech.com,matthew@candelatech.com,iain.davidson@candelatech.com,jreynolds@candelatech.com", "host_ip_production": "192.168.100.201", - "email_list_test": "chuck.rekiere@candelatech.com,logan.lipke@candelatech.com", + "email_list_test": "chuck.rekiere@candelatech.com,logan.lipke@candelatech.com,matthew.stidham@candelatech.com", "host_ip_test": "192.168.100.201", "email_title_txt": "Lanforge QA Testing CT-US-002", "email_txt": "Lanforge QA Testing CT-US-002" @@ -75,6 +75,48 @@ "suite_two":{ "test_l3_longevity":{"enabled":"TRUE","command":"test_l3_longevity.py","args":"--test_duration 15s --polling_interval 5s --upstream_port eth2 --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":{"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=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", + " --ssid 'ssid_idx=1 ssid=ruckus-r750-5g security=WPA2 password=hello123 bssid=4c:b1:cd:18:e8:ec'", + " --sw_version '3.5.4' --hw_version 5.12.14+ --serial_num ct523c-3b7b --model_num DUT_NAME" + ]}, + "CT-US-002_create_chamberview_1":{"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 ", + " --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-1' NA wiphy4,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": { + "enabled": "TRUE", + "command": "lf_ap_auto_test.py", + "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 1.1.eth1", + " --dut5_0 'DUT_NAME lanforge DUT_BSSID (1)' --dut2_0 'DUT_NAME lanforge DUT_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' 1 --set 'Skip 2.4 Ghz Tests' 1 --pull_report --local_lf_report_dir REPORT_PATH", + " --test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + ] + }, + "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", + "args_list":[ + " --ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER", + " --user_push BLOG_USER_PUSH --password BLOG_PASSWORD_PUSH BLOG_FLAG --grafana_token DASHBOARD_TOKEN", + " --grafana_host DASHBOARD_HOST --grafana_bucket DATABASE_BUCKET --parent_folder REPORT_PATH", + " --influx_host DATABASE_HOST --influx_org DATABASE_ORG --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET", + " --influx_tag DATABASE_TAG " + ] + } + }, "suite_wc_dp":{ "CT-US-002_create_chamberview_dut_1":{"enabled":"TRUE","load_db":"skip","command":"create_chamberview_dut.py","args":"", "args_list":[ @@ -148,6 +190,22 @@ " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" ] }, + "CT-US-002_lf_ap_auto_test": { + "enabled": "TRUE", + "command": "lf_ap_auto_test.py", + "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 1.1.eth1", + "--dut5_0 'DUT_NAME lanforge DUT_BSSID (1)' --dut2_0 'DUT_NAME lanforge DUT_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' 1 --set 'Skip 2.4 Ghz Tests' 1 --pull_report --local_lf_report_dir REPORT_PATH", + "--test_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", + "--influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" + + ] + }, "GHOST":{"enabled":"TRUE","load_db":"skip","command":"ghost_profile.py","args":"", "args_list":[ " --ghost_token BLOG_TOKEN --ghost_host BLOG_HOST --authors BLOG_AUTHORS --customer BLOG_CUSTOMER", diff --git a/py-scripts/tools/lf_check.json b/py-scripts/tools/lf_check.json index 8ef66e95..5783c39d 100644 --- a/py-scripts/tools/lf_check.json +++ b/py-scripts/tools/lf_check.json @@ -50,7 +50,8 @@ "create_station":{"enabled":"TRUE","command":"create_station.py","args":"--radio RADIO_USED --start_id 2 --num_stations 1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --debug"}, "data_plane_0":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"}, "data_plane_1":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"}, - "data_plane_2":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"} + "data_plane_2":{"enabled":"TRUE","load_db":"skip","command":"lf_dataplane_test.py","args":"--json lf_dp.json --influx_json lf_influx_db.json"}, + "lf_ap_auto_test": {"enabled":"True","command":"lf_ap_auto_test.py","args": "--instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth1 --dut5_0 'linksys-8450 lanforge 04:f0:21:2c:41:84 (1)' --dut2_0 'linksys-8450 lanforge 04:f0:21:2c:41:84 (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' 1 --set 'Skip 2.4 Ghz Tests' 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 –pull_report"} } } } diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index dda30816..99cdc040 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -921,7 +921,7 @@ Example : parser.add_argument('--ini', help="--ini default lf_check_config.ini", default="lf_check_config.ini") parser.add_argument('--json', help="--json ", default="lf_check_config.json") parser.add_argument('--use_json', help="--use_json ", action='store_true') - parser.add_argument('--suite', help="--suite default TEST_DICTIONARY", default="TEST_DICTIONARY") + parser.add_argument('--suite', '--test_suite', help="--suite default TEST_DICTIONARY", default="TEST_DICTIONARY") 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", default="") parser.add_argument('--logfile', help="--logfile logging for output of lf_check.py script", default="lf_check.log") From ae2e95723cd58592d65c57f3731c26dbcaab90cd Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 14 Jul 2021 16:05:56 -0700 Subject: [PATCH 149/152] CSVReader splits on tabs, not commas, and replace NaN with 0x0 in csv file swhen reporting to influx Signed-off-by: Matthew Stidham --- py-dashboard/GhostRequest.py | 2 +- py-scripts/csv_to_influx.py | 5 ++++- py-scripts/tools/ct_us_002.json | 8 +++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/py-dashboard/GhostRequest.py b/py-dashboard/GhostRequest.py index adfc540f..23f08522 100644 --- a/py-dashboard/GhostRequest.py +++ b/py-dashboard/GhostRequest.py @@ -30,7 +30,7 @@ import shutil class CSVReader: def read_csv(self, file, - sep=','): + sep='\t'): df = open(file).read().split('\n') rows = list() for x in df: diff --git a/py-scripts/csv_to_influx.py b/py-scripts/csv_to_influx.py index 8ae2fdb4..8c126b0d 100755 --- a/py-scripts/csv_to_influx.py +++ b/py-scripts/csv_to_influx.py @@ -69,7 +69,10 @@ class CSVtoInflux(): tags = dict() print("row: %s" % row) short_description = row[columns['short-description']] - numeric_score = float(row[columns['numeric-score']]) + if row[columns['numeric-score']] == 'NaN': + numeric_score = '0x0' + else: + numeric_score = float(row[columns['numeric-score']]) date = row[columns['Date']] date = datetime.datetime.utcfromtimestamp(int(date) / 1000).isoformat() #convert to datetime so influx can read it, this is required for variable in csv_variables: diff --git a/py-scripts/tools/ct_us_002.json b/py-scripts/tools/ct_us_002.json index 3c0ef7c4..892d1a1e 100644 --- a/py-scripts/tools/ct_us_002.json +++ b/py-scripts/tools/ct_us_002.json @@ -15,7 +15,7 @@ "lf_mgr_port": "8080", "dut_name": "Ruckus-R750", "dut_bssid": "4c:b1:cd:18:e8:ec", - "test_timeout": 200, + "test_timeout": 1200, "load_blank_db": false, "load_factory_default_db": true, "load_custom_db": false, @@ -101,8 +101,10 @@ " --instance_name ap-auto-instance --config_name test_con --upstream 1.1.eth1", " --dut5_0 'DUT_NAME lanforge DUT_BSSID (1)' --dut2_0 'DUT_NAME lanforge DUT_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' 1 --set 'Skip 2.4 Ghz Tests' 1 --pull_report --local_lf_report_dir REPORT_PATH", + " --radio5 1.1.wiphy2 --set 'Basic Client Connectivity' 0", + " --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_rig TEST_RIG --influx_host DATABASE_HOST --influx_port DATABASE_PORT --influx_org DATABASE_ORG", " --influx_token=DATABASE_TOKEN --influx_bucket DATABASE_BUCKET --influx_tag DATABASE_TAG --set DUT_SET_NAME" ] From a7ff3e9227f26652bcc702212b6e010d68c05007 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 14 Jul 2021 16:07:56 -0700 Subject: [PATCH 150/152] Add optional debug output to Chamberview test scripts, wifi capacity, dataplane Signed-off-by: Matthew Stidham --- py-json/cv_test_manager.py | 8 ++++---- py-scripts/lf_dataplane_test.py | 10 +++++++--- py-scripts/lf_wifi_capacity_test.py | 11 ++++++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index cb764e35..0354839e 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -5,11 +5,9 @@ Note: This script is working as library for chamberview tests. import time -from LANforge.lfcli_base import LFCliBase from realm import Realm import json from pprint import pprint -import argparse from cv_test_reports import lanforge_reports as lf_rpt from csv_to_influx import * import os.path @@ -68,12 +66,14 @@ class cv_test(Realm): def __init__(self, lfclient_host="localhost", lfclient_port=8080, - lf_report_dir="" + lf_report_dir="", + debug=False ): super().__init__(lfclient_host=lfclient_host, lfclient_port=lfclient_port) self.lf_report_dir = lf_report_dir self.report_name = None + self.debug = debug # Add a config line to a text blob. Will create new text blob # if none exists already. @@ -128,7 +128,7 @@ class cv_test(Realm): "cmd": command } debug_par = "" - rsp = self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, response_json_list_=response_json) + rsp = self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=self.debug, response_json_list_=response_json) try: if response_json[0]["LAST"]["warnings"].startswith("Unknown"): print("Unknown command?\n"); diff --git a/py-scripts/lf_dataplane_test.py b/py-scripts/lf_dataplane_test.py index e76d6bc0..ff4ca0a7 100755 --- a/py-scripts/lf_dataplane_test.py +++ b/py-scripts/lf_dataplane_test.py @@ -139,7 +139,8 @@ class DataplaneTest(cv_test): sets=[], graph_groups=None, report_dir="", - test_rig="" + test_rig="", + debug=False ): super().__init__(lfclient_host=lf_host, lfclient_port=lf_port) @@ -168,6 +169,7 @@ class DataplaneTest(cv_test): self.ssh_port = ssh_port self.local_lf_report_dir = local_lf_report_dir self.test_rig = test_rig + self.debug = debug def setup(self): # Nothing to do at this time. @@ -214,7 +216,7 @@ class DataplaneTest(cv_test): 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_lf_report_dir, - graph_groups_file=self.graph_groups) + graph_groups_file=self.graph_groups, debug=self.debug) self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name @@ -306,6 +308,7 @@ def main(): 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="") + parser.add_argument("--debug", default=False) args = parser.parse_args() @@ -394,7 +397,8 @@ def main(): raw_lines_file = args.raw_lines_file, sets = args.set, graph_groups = args.graph_groups, - test_rig=args.test_rig + test_rig=args.test_rig, + debug=args.debug ) CV_Test.setup() CV_Test.run() diff --git a/py-scripts/lf_wifi_capacity_test.py b/py-scripts/lf_wifi_capacity_test.py index 3e207317..951713ee 100755 --- a/py-scripts/lf_wifi_capacity_test.py +++ b/py-scripts/lf_wifi_capacity_test.py @@ -357,7 +357,8 @@ class WiFiCapacityTest(cv_test): report_dir="", graph_groups=None, test_rig="", - local_lf_report_dir="" + local_lf_report_dir="", + debug=False, ): super().__init__(lfclient_host=lfclient_host, lfclient_port=lf_port) @@ -396,6 +397,7 @@ class WiFiCapacityTest(cv_test): self.graph_groups = graph_groups self.test_rig = test_rig self.local_lf_report_dir = local_lf_report_dir + self.debug = debug def setup(self): if self.create_stations and self.stations != "": @@ -473,7 +475,8 @@ class WiFiCapacityTest(cv_test): self.create_and_run_test(self.load_old_cfg, self.test_name, self.instance_name, self.config_name, self.sets, self.pull_report, self.lfclient_host, self.lf_user, self.lf_password, - cv_cmds, graph_groups_file=self.graph_groups, local_lf_report_dir=self.local_lf_report_dir) + cv_cmds, graph_groups_file=self.graph_groups, local_lf_report_dir=self.local_lf_report_dir, + debug=self.debug) self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name @@ -528,6 +531,7 @@ def main(): 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("--debug", default=False) args = parser.parse_args() @@ -562,7 +566,8 @@ def main(): sets=args.set, graph_groups=args.graph_groups, test_rig=args.test_rig, - local_lf_report_dir=args.local_lf_report_dir + local_lf_report_dir=args.local_lf_report_dir, + debug=args.debug ) WFC_Test.setup() WFC_Test.run() From f383300fc27e1797eb108f4343be141fa5728b4f Mon Sep 17 00:00:00 2001 From: shivamcandela Date: Thu, 15 Jul 2021 12:46:03 +0530 Subject: [PATCH 151/152] import name updates IPV4VariableTime to IPVariableTIme Signed-off-by: shivamcandela --- py-scripts/test_ipv4_ttls.py | 43 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/py-scripts/test_ipv4_ttls.py b/py-scripts/test_ipv4_ttls.py index 12071cb4..bc54998b 100755 --- a/py-scripts/test_ipv4_ttls.py +++ b/py-scripts/test_ipv4_ttls.py @@ -17,7 +17,8 @@ from LANforge import LFUtils import realm import time import pprint -from test_ipv4_variable_time import IPV4VariableTime +from test_ip_variable_time import IPVariableTime + class TTLSTest(LFCliBase): def __init__(self, host="localhost", port=8080, @@ -79,11 +80,11 @@ class TTLSTest(LFCliBase): self.key = wep_key self.ca_cert = ca_cert self.eap = eap - self.identity = identity # eap identity + self.identity = identity # eap identity self.anonymous_identity = anonymous_identity self.phase1 = phase1 self.phase2 = phase2 - self.ttls_passwd = ttls_passwd #eap passwd + self.ttls_passwd = ttls_passwd # eap passwd self.pin = pin self.pac_file = pac_file self.private_key = private_key @@ -124,9 +125,9 @@ class TTLSTest(LFCliBase): self.station_profile.mode = 0 # Layer3 Traffic - self.l3_cx_obj_udp = IPV4VariableTime(host=self.host, port=self.port, - create_sta=False, sta_list=self.sta_list, traffic_type="lf_udp", - upstream=self.upstream_port) + self.l3_cx_obj_udp = IPVariableTime(host=self.host, port=self.port, + create_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-" self.l3_cx_obj_udp.cx_profile.side_a_min_bps = 128000 @@ -137,9 +138,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 = IPV4VariableTime(host=self.host, port=self.port, - create_sta=False, sta_list=self.sta_list, traffic_type="lf_tcp", - upstream=self.upstream_port) + self.l3_cx_obj_tcp = IPVariableTime(host=self.host, port=self.port, + create_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 self.l3_cx_obj_tcp.cx_profile.side_a_max_bps = 128000 @@ -172,7 +173,7 @@ class TTLSTest(LFCliBase): passwd=self.ttls_passwd, realm=self.ttls_realm, domain=self.domain, - hessid=self.hessid ) + hessid=self.hessid) if self.ieee80211w: self.station_profile.set_command_param("add_sta", "ieee80211w", self.ieee80211w) if self.enable_pkc: @@ -241,7 +242,7 @@ class TTLSTest(LFCliBase): if (len(sta_list) == len(ip_map)) and (len(sta_list) == len(associated_map)): self._pass("PASS: All stations associated with IP", print_pass) else: - + self._fail("FAIL: Not all stations able to associate/get IP", print_fail) if self.debug: print("sta_list", sta_list) @@ -255,7 +256,6 @@ class TTLSTest(LFCliBase): # please see test_ipv4_variable_time for example of generating traffic return self.passes() - def stop(self): # Bring stations down self.station_profile.admin_down() @@ -311,11 +311,11 @@ class TTLSTest(LFCliBase): else: self._fail("%s did not report traffic: %s" % (name, postVal), print_fail) -def main(): +def main(): parser = LFCliBase.create_basic_argparse( prog='test_ipv4_ttls.py', - #formatter_class=argparse.RawDescriptionHelpFormatter, + # formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawTextHelpFormatter, epilog='''Demonstration showing wpa2-ent ttls authentication''', @@ -338,25 +338,28 @@ test_ipv4_ttls.py: for agroup in parser._action_groups: if agroup.title == "required arguments": required = agroup - #if required is not None: + # 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('--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('--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('--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 Date: Thu, 15 Jul 2021 12:52:39 +0530 Subject: [PATCH 152/152] rvr test argument fix local_path to local_lf_report_dir Signed-off-by: shivamcandela --- 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 12d2f1f8..ad7f13c3 100755 --- a/py-scripts/lf_rvr_test.py +++ b/py-scripts/lf_rvr_test.py @@ -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_path=self.local_path, + cv_cmds, ssh_port=self.ssh_port, local_lf_report_dir=self.local_path, graph_groups_file=self.graph_groups) self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name