Skip to content

Revise network.py to support per-run and overall test criteria (New)#2378

Open
rodwsmith wants to merge 1 commit intomainfrom
change-network-defaults
Open

Revise network.py to support per-run and overall test criteria (New)#2378
rodwsmith wants to merge 1 commit intomainfrom
change-network-defaults

Conversation

@rodwsmith
Copy link
Copy Markdown
Collaborator

Title: Revise network.py to support per-run and overall test criteria (New)

Description

This PR adds a new command-line parameter (--overall-fail-threshold) to the network.py script, enabling setting separate per-run and overall failure thresholds. That is, previously, if --fail-threshold was set to, say, 90, and if --num_runs was set to, say, 4, then this script would cause a re-run if any individual run fell below 90%, and if the timeout period passed and any run was under 90%, then the script would return an error code and the test would fail. This change permits setting a separate criterion for the overall failure threshold. That is, if --fail-threshold is set to 80 and --overall-fail-threshold is set to 90, then with four runs, results on individual runs could fall as low as 80% and not trigger a re-run, so long as the final average is above 90% -- so, for example, if the individual results were 92%, 93%, 89%, and 93%, the test would pass without re-running. The new --overall-fail-threshold parameter is optional; if it's missing, the value defaults to the same value set by --fail-threshold. Thus, there is no change in the script's behavior if the new option is not specified.

This PR also adjusts the providers/base/unit/ethernet/jobs.pxu file so that the new option is set to 90 for the ethernet/sru_iperf3_stress_device-{__index__}_{interface}, ethernet/multi_iperf3_nic_device{__index__}_{interface}, and ethernet/multi_iperf3_nic_underspeed_device{__index__}_{interface} tests, used exclusively in server certification. This change satisfies the Jira task noted below, as discussed by Jeff Lane and Rod Smith to create stricter pass criteria (previously set to 80) without creating undo problems because of occasional sub-runs that produce sub-90% results.

Resolved issues

(https://warthogs.atlassian.net/browse/SERVCERT-1893)

Documentation

No changes are required to Checkbox documentation. Changes will be needed to some of the Server Certification partner documentation. These changes will be implemented as part of the updates for the Ubuntu 26.04 release.

Tests

Testing was done by running network.py manually, with commands like the following:

sudo /usr/lib/checkbox-provider-base/bin/network.py test -i eno1 -t iperf --iperf3 --scan-timeout 36 --fail-threshold 80 --overall-fail-threshold 90 --cpu-load-fail-threshold 90 --runtime 30 --num_runs 2 --target 192.168.1.2

This was a shorter run than the usual test (which takes an hour to complete), for ease of testing. The --fail-threshold and --overall-fail-threshold values were adjusted so that the machine's naturally tested speeds passed or failed and observing the results, which matched expectations; for instance, when speeds were about 94%, setting --fail-threshold to 80 and --overall-fail-threshold to 95 caused no re-runs of the individual runs, but the overall test failed, as expected. When --overall-fail-threshold was reduced to 90, the test passed.

In addition, the complete set of tests was run in Checkbox, having replaced both files. The results are here:

https://certification.canonical.com/hardware/201409-15506/submission/476574/

The relevant run was:

https://certification.canonical.com/hardware/201409-15506/submission/476574/test/74015/result/56526890/

These results are not notably different from runs with the previous version of the script; but there is a new line that provides the overall result at the end of the test output.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 7.14286% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.64%. Comparing base (3fb3ba9) to head (4681619).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/network.py 7.14% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2378      +/-   ##
==========================================
- Coverage   57.66%   57.64%   -0.02%     
==========================================
  Files         465      465              
  Lines       47166    47179      +13     
  Branches     8398     8400       +2     
==========================================
  Hits        27198    27198              
- Misses      19088    19098      +10     
- Partials      880      883       +3     
Flag Coverage Δ
provider-base 32.50% <7.14%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rodwsmith rodwsmith force-pushed the change-network-defaults branch from 4681619 to d3b4094 Compare March 10, 2026 15:24
@rodwsmith rodwsmith force-pushed the change-network-defaults branch from d3b4094 to c6faf90 Compare March 10, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant