Skip to content

Conversation

@tomli380576
Copy link
Contributor

@tomli380576 tomli380576 commented Sep 12, 2025

WARNING: This modifies com.canonical.certification::sru-server

This test is only intended for PCs running 24.04 and later. Please lmk if the test job should be placed somewhere else.

A new pair environment variables (MLO_SSID, MLO_PSK) has been added for this test. Default values for both of them have been added here: https://github.com/canonical/ce-oem-dut-checkbox-configuration/pull/278/

Caution

Since some of the labs don't have a MLO wifi AP yet, please don't merge this PR immediately after approval. I'll update in this thread once I can be sure that all labs have an MLO AP.
Update: If the mlo_ssid_specified workaround is acceptable, we can merge this without waiting for all the labs to be ready.
Update 2: safe to merge after approval. Labs that don't have a Wifi7 AP can set the manifest entry to false

Description

This PR adds a WiFi MLO (multi-link operation) test for the upcoming wifi-7 capable cards. For simplicity this PR only uses nmcli to connect/disconnect and does not take networkd into account.

Resolved issues

Documentation

What this test does is basically:

  1. Connect to a wifi AP that supports MLO with nmcli
  2. If connection worked, check if iw dev prints multiple links under the "MLD with links" section
Interface wlp0s20f3
	ifindex 2
	wdev 0x1
	addr c8:6e:08:17:85:4a
	ssid cert-be-wpa3-tel-l10
	type managed
	wiphy 0
	multicast TXQ:
		qsz-byt	qsz-pkt	flows	drops	marks	overlmt	hashcol	tx-bytes	tx-packets
		0	0	0	0	0	0	0	0		0
	MLD with links:
	 - link ID  1 link addr ea:ab:77:e3:d8:e7
	 - link ID  2 link addr 92:4f:25:02:8a:eb
	   channel 85 (6375 MHz), width: 320 MHz, center1: 6265 MHz
  1. Disconnect and remove the connection

The file is called wifi 7 test because there are more features in wifi 7 than what's implemented here. MLO happens to be a high priority one so it's included first. MLO and connection type are the only checks that can fail the entire test case for now; the connection bandwidth and 4096QAM checks only print warnings because 320mhz is not a required feature and 4096QAM is too sensitive to the environment.

Manifest?

I think we don't need a new manifest such as "has_mlo_support" here because according to Cisco's guide, MLO is a required feature of wifi7. So if we have wireless_sta_protocol.interface_be == 'supported', then we can safely assume that MLO is supported by the DUT. If the test fails, either there's a real issue with the DUT's wifi stack or the environment isn't set up correctly

Tests

Unit tests

https://certification.canonical.com/hardware/202508-37862/submission/450483/
https://certification.canonical.com/hardware/202508-37862/submission/451747/

@codecov
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

❌ Patch coverage is 91.86047% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 30.02%. Comparing base (1ad5e7a) to head (14e360d).

Files with missing lines Patch % Lines
providers/base/bin/wifi_7_test.py 91.08% 9 Missing and 5 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2109       +/-   ##
===========================================
- Coverage   52.86%   30.02%   -22.84%     
===========================================
  Files         395      149      -246     
  Lines       42636    16401    -26235     
  Branches     7906     2812     -5094     
===========================================
- Hits        22538     4924    -17614     
+ Misses      19295    11345     -7950     
+ Partials      803      132      -671     
Flag Coverage Δ
checkbox-ng ?
checkbox-support ?
contrib-provider-ce-oem ?
provider-base 29.98% <91.86%> (+0.65%) ⬆️
provider-certification-client ?
provider-certification-server ?
provider-dss ?
provider-genio ?
provider-gpgpu ?
provider-iiotg ?
provider-resource ?
provider-sru ?
release-tools ?

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.

@tomli380576 tomli380576 marked this pull request as ready for review September 19, 2025 05:03
@tomli380576 tomli380576 changed the title Add a simple WiFi MLO test Add a simple WiFi MLO test (New) Sep 19, 2025
@tomli380576 tomli380576 marked this pull request as draft September 19, 2025 05:21
@tomli380576 tomli380576 marked this pull request as ready for review September 19, 2025 06:17
@tomli380576 tomli380576 marked this pull request as draft September 19, 2025 06:49
@tomli380576 tomli380576 marked this pull request as ready for review September 19, 2025 06:55
Copy link
Contributor

@seankingyang seankingyang left a comment

Choose a reason for hiding this comment

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

I left some suggestion.
Most of the script logics are good for me, and i think if we only grab one time (after 5 sec negotiation) may easy fail when the lab env is not stable.

To make the script more reliable, let's change how we check the connection.
Instead of checking only once, we should keep trying for 30 seconds. The first time the check passes, the script should exit and report success.
This will prevent the script from failing due to temporary network issues.

@tomli380576 tomli380576 marked this pull request as draft September 22, 2025 02:05
@tomli380576
Copy link
Contributor Author

I left some suggestion. Most of the script logics are good for me, and i think if we only grab one time (after 5 sec negotiation) may easy fail when the lab env is not stable.

To make the script more reliable, let's change how we check the connection. Instead of checking only once, we should keep trying for 30 seconds. The first time the check passes, the script should exit and report success. This will prevent the script from failing due to temporary network issues.

Thanks for the catch! I encountered a "connection successful + only 1 link present" situation today and a simple disconnect + reconnect fixed it.

@tomli380576 tomli380576 marked this pull request as ready for review September 25, 2025 04:02
seankingyang
seankingyang previously approved these changes Sep 25, 2025
Copy link
Contributor

@seankingyang seankingyang left a comment

Choose a reason for hiding this comment

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

Thanks for adding the retry logic.
I see you use slugify so the iw output updates on each retry, even if the job is re-run. This is the great idea for debugging.

@pieqq pieqq self-assigned this Sep 26, 2025
clairlin53
clairlin53 previously approved these changes Oct 1, 2025
Copy link
Contributor

@clairlin53 clairlin53 left a comment

Choose a reason for hiding this comment

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

LGTM+1

Copy link
Collaborator

@pieqq pieqq left a comment

Choose a reason for hiding this comment

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

I left a few comments inline below.

One thing I have concerns with is how you do the connection. If I run this on my device, my current WiFi connection to my usual AP will be lost, no? Other jobs like wireless/wireless_connection_* use a different way to handle a test connection, it seems, by creating a specific connection name and using it:

def turn_up_connection(uuid):
# uuid can also be connection name
print_head("Turn up NM connection")
cmd = "nmcli c up {}".format(uuid)
print("Turn up {}".format(uuid))
activate_uuid = get_nm_activate_connection()
if uuid == activate_uuid:
print("{} state is already activated".format(uuid))
return None
try:
print_cmd(cmd)
sp.call(shlex.split(cmd))
except Exception as e:
print("Can't turn on {}: {}".format(uuid, str(e)))
def turn_down_nm_connections():
print_head("Turn off NM all connections")
connections = _get_nm_wireless_connections()
for name, value in connections.items():
uuid = value["uuid"]
print("Turn down connection", name)
cmd = "nmcli c down {}".format(uuid)
print_cmd(cmd)
sp.check_call(shlex.split(cmd))
print("{} {} is down now".format(name, uuid))
print()
def delete_test_ap_ssid_connection():
print_head("Cleaning up TEST_CON connection")
connections = _get_nm_wireless_connections()
if "TEST_CON" not in connections:
print("No TEST_CON connection found, nothing to delete")
return
cmd = "nmcli c delete TEST_CON"
print_cmd(cmd)
sp.check_call(shlex.split(cmd))
print("TEST_CON is deleted")

@tomli380576 tomli380576 marked this pull request as draft October 3, 2025 03:04
@tomli380576 tomli380576 dismissed stale reviews from clairlin53 and seankingyang via d984969 October 3, 2025 05:48
@tomli380576
Copy link
Contributor Author

tomli380576 commented Oct 8, 2025

Hi @pieqq, Thanks for the review! The length of the test grew quite a bit so here's a short summary of what changed:

  1. The problem with existing connections being lost: This is fixed by adding a nmcli c up call for each existing wifi connection after all the tests are done. I didn't add a connection name here like the other nmcli test since the original connection will still be erased if it's the same AP as --mlo-ssid whether the new connection has a name or not. This connection will still be restored at the end, except it calls connect() again instead of nmcli c up. Let me know if you would still like to see a name just for readability.
  2. Resource jobs and checking package versions: I moved the version comparison logic to the resource job which only produces True/False for the pxu engine to consume. One thing I would like to get feedback on is the mlo_ssid_specified condition as it is a temporary workaround for labs that don't have an MLO AP set up. For labs that have an AP ready, we can have them run this test early.
  3. Parser changes: In the output of iw dev <iface> link, the number of words in the tx bitrate or rx bitrate is not guaranteed, so I replaced the fixed index accesses with list searches to handle different connection types. There's also a new connection type Legacy for pre-wifi-4 APs.

@tomli380576 tomli380576 marked this pull request as ready for review October 8, 2025 02:33
@tomli380576 tomli380576 requested a review from pieqq October 8, 2025 02:34
@tomli380576
Copy link
Contributor Author

The CI failures are caused by missing py3.5 and py3.6 packages which should be fixable with a rebase since #2141 was merged. I'll rebase after the review to avoid completely wiping out the commit timeline.

Copy link
Collaborator

@pieqq pieqq left a comment

Choose a reason for hiding this comment

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

The Python code looks good to me.

2 things inline with regards to passing env variable to the Checkbox job, and maybe using a manifest instead of a resource.

@tomli380576 tomli380576 requested a review from pieqq October 20, 2025 04:47
@tomli380576
Copy link
Contributor Author

@tomli380576
Copy link
Contributor Author

Hi @pieqq, I've rebased the branch to make it ready to merge since the only big changes after the last review are in the pxu files. The commit to to diff against is abd2de8. Thanks!

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.

4 participants