From 504caad825782e4e783cab6d6abe1df09f71203c Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 23 Feb 2022 21:11:56 -0700 Subject: [PATCH] lf_tx_power.py : search for signal the formatting for the AX210 matches cc_module_9800_3504.py :changes for show ap bssid Signed-off-by: Chuck SmileyRekiere --- cc_module_9800_3504.py | 42 +++++++++++++++++++++++++++++++----------- lf_tx_power.py | 18 +++++++++++++----- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/cc_module_9800_3504.py b/cc_module_9800_3504.py index 4c8dcc5e..5ac6162b 100755 --- a/cc_module_9800_3504.py +++ b/cc_module_9800_3504.py @@ -190,7 +190,7 @@ class create_controller_series_object: # possible need to look for exact command elif self.action in ["summary", "show_radio", "no_logging_console", "line_console_0", "show_ap_wlan_summary", "show_wlan_summary", "show_wlan_id", - "advanced", "disable", "disable_network_6ghz", "disable_network_5ghz", "disable_network_24ghz", + "advanced", "disable", "disable_network_6ghz", "disable_network_5ghz", "disable_network_24ghz", "show_ap_bssid_24g", "show_ap_bssid_5g", "manual", "auto", "enable_network_6ghz", "enable_network_5ghz", "enable_network_24ghz", "enable"]: self.command_extend = ["--action", self.action] @@ -267,6 +267,18 @@ class create_controller_series_object: summary = self.send_command() return summary + def show_ap_bssid_24ghz(self): + logger.info("show ap name wlan dot11 24ghz") + self.action = "show_ap_bssid_24g" + summary = self.send_command() + return summary + + def show_ap_bssid_5ghz(self): + logger.info("show ap name wlan dot11 5ghz") + self.action = "show_ap_bssid_5g" + summary = self.send_command() + return summary + def show_ap_wlan_summary(self): logger.info("show ap wlan summary") self.action = "show_ap_wlan_summary" @@ -944,18 +956,18 @@ def test_config_tx_power_5g_open(cs): logger.info("test_config_tx_power_open") # configure once at the top - cs.wlan = 'open-wlan-16_' - cs.wlanID = '15' - cs.wlanSSID = 'open-wlan-16' + cs.wlan = 'open-wlan-14' + cs.wlanID = '14' + cs.wlanSSID = 'open-wlan-14' cs.config_wlan_open() # wireless_tag_policy - cs.tag_policy = 'RM204-TB1' + cs.tag_policy = 'RM204-TB1-AP2' cs.policy_profile = 'default-policy-profile' cs.config_wireless_tag_policy_and_policy_profile() cs.tx_power = '1' - cs.channel = '100' + cs.channel = '149' cs.bandwidth = '40' # no_logging_console @@ -987,7 +999,10 @@ def test_config_tx_power_5g_open(cs): cs.bandwidth = '20' cs.config_dot11_5ghz_channel_width() # channel + cs.channel = '100' cs.config_dot11_5ghz_channel() + cs.channel = '5' + cs.config_dot11_24ghz_channel() # bandwidth cs.bandwidth = '40' cs.config_dot11_5ghz_channel_width() @@ -1018,6 +1033,10 @@ def test_config_tx_power_5g_open(cs): # show_wlan_summary cs.show_wlan_summary() + cs.show_ap_dot11_5gz_summary() + cs.show_ap_bssid_5ghz() + + # 2g test def test_config_tx_power_2g_open(cs): @@ -1035,7 +1054,7 @@ def test_config_tx_power_2g_open(cs): cs.config_wireless_tag_policy_and_policy_profile() cs.tx_power = '5' - cs.channel = '1' + cs.channel = '2' cs.bandwidth = '20' # no_logging_console @@ -1056,8 +1075,8 @@ def test_config_tx_power_2g_open(cs): # disable_network_24ghz cs.ap_dot11_24ghz_shutdown() # manual - # cs.ap_dot11_5ghz_radio_role_manual_client_serving() - cs.ap_dot11_24ghz_radio_role_manual_client_serving() + cs.ap_dot11_5ghz_radio_role_manual_client_serving() + # cs.ap_dot11_24ghz_radio_role_manual_client_serving() # Configuration for 5g @@ -1099,7 +1118,7 @@ def test_config_tx_power_2g_open(cs): cs.show_wlan_summary() cs.show_ap_dot11_24gz_summary() - cs.show_ap_bssid_24g() + cs.show_ap_bssid_24ghz() # tb2 @@ -1506,7 +1525,8 @@ INCLUDE_IN_README # cs.wlanID = 7 # summary = cs.show_wlan_id() # test_config_tx_power_5g_open_tb2_AP1(cs=cs) - test_config_tx_power_2g_open(cs=cs) + test_config_tx_power_5g_open(cs=cs) + # test_config_tx_power_2g_open(cs=cs) # test_config_tx_power_wpa2_IDIC(cs=cs) diff --git a/lf_tx_power.py b/lf_tx_power.py index 77f5512b..2db5a6d2 100755 --- a/lf_tx_power.py +++ b/lf_tx_power.py @@ -303,7 +303,7 @@ def main(): parser.add_argument("-c", "--channel", type=str, help="[test configuration] List of channels to test, with optional path-loss, 36:64 149:60. NA means no change") parser.add_argument("-n", "--nss", type=str, help="[test configuration] List of spatial streams to test. NA means no change") parser.add_argument("-T", "--txpower", type=str, help="[test configuration] List of txpowers to test. NA means no change") - parser.add_argument('-D', '--duration', type=str, help='[test configuration] --traffic example -t 20 (seconds) default: 20 ', default='20') + parser.add_argument('-D', '--duration', type=str, help='[test configuration] --traffic example -D 30 (seconds) default: 30 ', default='20') parser.add_argument("--outfile", help="[test configuration] Output file for csv data") # testbed configuration @@ -863,6 +863,7 @@ def main(): logg.info(pss) # "number of WLANs:\s+(\S+)" + # https://regex101.com/ search_wlan = False for line in pss.splitlines(): logg.info(line) @@ -1074,7 +1075,7 @@ def main(): i += 1 # We wait a fairly long time since AP will take a long time to start on a CAC channel. - if (i > 180): + if (i > 180): # TODO make configurable err = "ERROR: Station did not connect within 180 seconds." logg.info(err) e_tot += err @@ -1111,6 +1112,11 @@ def main(): "--cli_cmd", "probe_port 1 %s %s" % (lfresource, lfstation)], capture_output=True, check=True) pss = port_stats.stdout.decode('utf-8', 'ignore') # for debug: print the output of lf_portmod.pl and the command used + logg.info("######## lf_portmod ######### ") + logg.info(pss) + logg.info("######## lf_portmod END ######### ") + + if (args.show_lf_portmod): logg.info("./lf_portmod.pl --manager {} --card {} --port_name {} --cli_cmd probe_port 1 {} {}".format(lfmgr, lfresource, lfstation, lfresource, lfstation)) @@ -1119,9 +1125,11 @@ def main(): foundit = False for line in pss.splitlines(): # logg.info("probe-line: %s"%(line)) - m = re.search('signal avg:\\s+(\\S+)\\s+\\[(.*)\\]\\s+dBm', line) + m = re.search('signal:\\s+(\\S+)\\s+\\[(.*)\\]\\s+dBm', line) + # if (m is None): + # m = re.search('signal:\\s+(\\S+)\\s+dBm', line) if (m is not None): - logg.info("search: signal ave: resulted in m = {}".format(m)) + logg.info("search: signal: resulted in m = {}".format(m)) sig = m.group(1) ants = m.group(2).split() q = 0 @@ -1135,7 +1143,6 @@ def main(): foundit = True else: logg.info("Looking for %s spatial streams, signal avg reported fewer: %s" % (n, m.group(1))) - m = re.search('beacon signal avg:\\s+(\\S+)\\s+dBm', line) if (m is not None): logg.info("search: beacon signal avg: resulted in m = {}".format(m)) @@ -1189,6 +1196,7 @@ def main(): port_stats = subprocess.run(["./lf_portmod.pl", "--manager", lfmgr, "--card", lfresource, "--port_name", lfstation, "--show_port", "AP,IP,Mode,NSS,Bandwidth,Channel,Signal,Noise,Status,RX-Rate"], capture_output=True, check=True) pss = port_stats.stdout.decode('utf-8', 'ignore') + logg.info(pss) _ap = None _bw = None