Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 36 additions & 26 deletions py-scripts/lf_wifi_capacity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,32 +195,30 @@ def run(self):
# Test related settings
cfg_options = []

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

self.apply_cfg_options(cfg_options, self.enables, self.disables, self.raw_lines, self.raw_lines_file)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this line necessary ? self.apply_cfg_options? we do use self.raw_lines and raw_lines_files ,

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file name is left out of the logging as the --logger_no_file flag is passed from WebGUI. It was less of a decision on my end, and more of a interface change to make it more compatible.


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 != "":
Expand All @@ -240,6 +238,8 @@ def run(self):

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.
Expand Down Expand Up @@ -380,6 +380,10 @@ def main():

parser.add_argument('--log_level', default=None, help='Set logging level: debug | info | warning | error | critical')
parser.add_argument('--help_summary', action="store_true", help='Show summary of what this script does')
parser.add_argument('--logger_no_file',
default=None,
action="store_true",
help='Show loggingout without the trailing file name and line')

args = parser.parse_args()

Expand All @@ -401,6 +405,12 @@ def main():
logger_config.lf_logger_config_json = args.lf_logger_config_json
logger_config.load_lf_logger_config()

if args.logger_no_file:
f = '%(created)f %(levelname)-8s %(message)s'
ff = logging.Formatter(fmt=f)
for handler in logging.getLogger().handlers:
handler.setFormatter(ff)

# getting station list if number of stations provided.
start_id = 0
if args.start_id != 0:
Expand Down