Skip to content

Commit

Permalink
Merge pull request #28 from opencomputeproject/feature/return_lmt_res…
Browse files Browse the repository at this point in the history
…ults

Returned LMT results to the caller for further post-processing.
  • Loading branch information
sksekar authored Jan 13, 2025
2 parents c10b398 + 723037b commit beccaf3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/pci_lmt/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,15 @@ def collect_lmt_on_bdfs(test_info: LmtTestInfo, bdf_list: ty.List[str]) -> ty.Li
# FIXME: the args param should not be here, arg parsing and usage should be limited to main.py
# instead, replace this with the actual inputs needed; if it's too many, a RuntimeConfig can be made
# pylint: disable=too-many-locals
def run_lmt(args: argparse.Namespace, config: PlatformConfig, host: HostInfo, reporter: Reporter) -> None:
def run_lmt(
args: argparse.Namespace, config: PlatformConfig, host: HostInfo, reporter: Reporter
) -> ty.List[LmtLaneResult]:
"""Runs LMT tests on all the interfaces listed in the platform_config."""

# Caller may do more post-processing on the results.
# So, gather all results (from individual steps x BDFs x lanes) and return to the caller.
all_results = []

logger.info("Loading config: %s", config)
with reporter.start_run(host):
test_info = LmtTestInfo()
Expand Down Expand Up @@ -216,3 +222,7 @@ def run_lmt(args: argparse.Namespace, config: PlatformConfig, host: HostInfo, re
for result in results:
logger.info(result)
reporter.write(result)

all_results.extend(results)

return all_results

0 comments on commit beccaf3

Please sign in to comment.