From 8428c20f751d78ca40458ae389eb18013d99fa1b Mon Sep 17 00:00:00 2001 From: Tarun Date: Mon, 27 Jul 2026 11:17:20 +0000 Subject: [PATCH 1/2] lf_wifi_capacity_test.py: Add support to load the existing test config VERIFIED CLI: (New functionality) python3 ./lf_wifi_capacity_test.py --mgr 192.168.204.60 --load_old_cfg --config_name new_config --pull_report VERIFIED CLI: (Existing functionality) python3 ./lf_wifi_capacity_test.py --mgr 192.168.204.60 --upstream 1.1.eth2 --stations 1.1.sta0000 --protocol UDP --duration 60s --pull_report --- py-scripts/lf_wifi_capacity_test.py | 126 +++++++++++++++------------- 1 file changed, 68 insertions(+), 58 deletions(-) diff --git a/py-scripts/lf_wifi_capacity_test.py b/py-scripts/lf_wifi_capacity_test.py index eeacc5f26..adea30730 100755 --- a/py-scripts/lf_wifi_capacity_test.py +++ b/py-scripts/lf_wifi_capacity_test.py @@ -189,61 +189,62 @@ def run(self): time.sleep(2) self.sync_cv() - self.rm_text_blob(self.config_name, "Wifi-Capacity-") # To delete old config with same name - self.show_text_blob(None, None, False) - - # Test related settings - cfg_options = [] - - if self.upstream != "": - eid = LFUtils.name_to_eid(self.upstream) - port = "%i.%i.%s" % (eid[0], eid[1], eid[2]) - - port_list = [port] - if self.stations != "" or self.stations_list != []: - stas = None - if self.stations: - stas = self.stations.split(",") - elif self.stations_list: - stas = self.stations_list - for s in stas: - port_list.append(s) - else: - stas = self.station_map() # See realm - for eid in stas.keys(): - port_list.append(eid) - logger.info(f"Selected Port list: {port_list}") - - idx = 0 - for eid in port_list: - add_port = "sel_port-" + str(idx) + ": " + eid - self.create_test_config(self.config_name, "Wifi-Capacity-", add_port) - idx += 1 - if self.batch_size != "": - cfg_options.append("batch_size: " + self.batch_size) - if self.loop_iter != "": - cfg_options.append("loop_iter: " + self.loop_iter) - if self.protocol != "": - cfg_options.append("protocol: " + str(self.protocol)) - if self.duration != "": - cfg_options.append("duration: " + self.duration) - if self.upload_rate != "": - 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) - if self.test_tag != "": - cfg_options.append("test_tag: " + self.test_tag) - - cfg_options.append("save_csv: 1") - - self.apply_cfg_options(cfg_options, self.enables, self.disables, self.raw_lines, self.raw_lines_file) - blob_test = "Wifi-Capacity-" - # We deleted the scenario earlier, now re-build new one line at a time. - self.build_cfg(self.config_name, blob_test, cfg_options) + if not self.load_old_cfg: + 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 = [] + + if self.upstream != "": + eid = LFUtils.name_to_eid(self.upstream) + port = "%i.%i.%s" % (eid[0], eid[1], eid[2]) + + port_list = [port] + if self.stations != "" or self.stations_list != []: + stas = None + if self.stations: + stas = self.stations.split(",") + elif self.stations_list: + stas = self.stations_list + for s in stas: + port_list.append(s) + else: + stas = self.station_map() # See realm + for eid in stas.keys(): + port_list.append(eid) + logger.info(f"Selected Port list: {port_list}") + + idx = 0 + for eid in port_list: + add_port = "sel_port-" + str(idx) + ": " + eid + self.create_test_config(self.config_name, blob_test, add_port) + idx += 1 + if self.batch_size != "": + cfg_options.append("batch_size: " + self.batch_size) + if self.loop_iter != "": + cfg_options.append("loop_iter: " + self.loop_iter) + if self.protocol != "": + cfg_options.append("protocol: " + str(self.protocol)) + if self.duration != "": + cfg_options.append("duration: " + self.duration) + if self.upload_rate != "": + 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) + if self.test_tag != "": + cfg_options.append("test_tag: " + self.test_tag) + + cfg_options.append("save_csv: 1") + + self.apply_cfg_options(cfg_options, self.enables, self.disables, self.raw_lines, self.raw_lines_file) + + # 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 = [] @@ -257,13 +258,22 @@ def run(self): cmd = "cv click '%s' 'Interleave Sort'" % self.instance_name cv_cmds.append(cmd) - self.create_and_run_test(lf_host=self.lfclient_host, + self.create_and_run_test(load_old_cfg=self.load_old_cfg, + test_name=self.test_name, + instance_name=self.instance_name, + config_name=self.config_name, + sets=self.sets, + pull_report=self.pull_report, + lf_host=self.lfclient_host, + lf_user=self.lf_user, + lf_password=self.lf_password, cv_cmds=cv_cmds, - **vars(self)) - - self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name + 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, "Wifi-Capacity-") # To delete old config with same name + if not self.load_old_cfg: + self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name def main(): From 9607a233f819f61095944261fcae30cf6e8b52af Mon Sep 17 00:00:00 2001 From: Tarun Date: Mon, 3 Aug 2026 09:51:34 +0000 Subject: [PATCH 2/2] lf_wifi_capacity_test.py: Improve station list edge case handling Verified CLIs: 1. Existing Functionality: python3 ./lf_wifi_capacity_test.py --mgr 192.168.207.78 --upstream 1.1.eth1 --stations 1.1.sta0000 --protocol UDP --duration 60s --pull_report 2. New Functionality: python3 ./lf_wifi_capacity_test.py --mgr 192.168.207.78 --load_old_cfg --config_name customer_scenario --pull_report Signed-off-by: Tarun --- py-scripts/lf_wifi_capacity_test.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/py-scripts/lf_wifi_capacity_test.py b/py-scripts/lf_wifi_capacity_test.py index adea30730..13e0f1520 100755 --- a/py-scripts/lf_wifi_capacity_test.py +++ b/py-scripts/lf_wifi_capacity_test.py @@ -113,12 +113,14 @@ def __init__(self, test_rig="", test_tag="", local_lf_report_dir="", - sta_list="", + sta_list=None, verbosity="5", force: bool = False, **kwargs): super().__init__(lfclient_host=lfclient_host, lfclient_port=lf_port) + if sta_list is None: + sta_list = [] if enables is None: enables = [] if disables is None: @@ -194,16 +196,13 @@ def run(self): if not self.load_old_cfg: 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 = [] - if self.upstream != "": eid = LFUtils.name_to_eid(self.upstream) port = "%i.%i.%s" % (eid[0], eid[1], eid[2]) - port_list = [port] - if self.stations != "" or self.stations_list != []: + if self.stations or self.stations_list: stas = None if self.stations: stas = self.stations.split(",") @@ -212,7 +211,7 @@ def run(self): for s in stas: port_list.append(s) else: - stas = self.station_map() # See realm + stas = self.station_map() for eid in stas.keys(): port_list.append(eid) logger.info(f"Selected Port list: {port_list}") @@ -243,7 +242,7 @@ def run(self): self.apply_cfg_options(cfg_options, self.enables, self.disables, self.raw_lines, self.raw_lines_file) - # We deleted the scenario earlier, now re-build new one line at a time. + # 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 = []