[PATCH 2/6] tests: add S1G smoke harness
James Ewing
james at teledatics.com
Tue Sep 30 12:12:52 PDT 2025
Add the `test_s1g_smoke.py::test_open_assoc_freq_khz` scenario so we
can stand up mac80211_hwsim, launch wpa_supplicant/hostapd, and verify
the basic S1G scan plumbing. The test skips automatically when the
environment lacks an NL80211_BAND_S1GHZ phy, which lets us run it on
stock kernels without spurious failures.
Tested: ./tests/hwsim/run-tests.py -q test_s1g_smoke
Signed-off-by: James Ewing <james at teledatics.com>
---
tests/hwsim/test_s1g_smoke.py | 40 +++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 tests/hwsim/test_s1g_smoke.py
diff --git a/tests/hwsim/test_s1g_smoke.py b/tests/hwsim/test_s1g_smoke.py
new file mode 100644
index 000000000..af7d52e96
--- /dev/null
+++ b/tests/hwsim/test_s1g_smoke.py
@@ -0,0 +1,40 @@
+# S1G smoke checks for hwsim harness
+#
+# These exercises prerequisite plumbing only: we verify that the local
+# mac80211/mac80211_hwsim instance advertises S1G-capable channels so later
+# tests can rely on them. Full association flows land in subsequent tasks.
+
+import logging
+
+from utils import HwsimSkip, list_s1g_capable_channels
+
+
+logger = logging.getLogger()
+
+
+def _format_channels(channels):
+ preview = [
+ f"{entry['phy']}:{entry['freq_mhz']:.1f}MHz(ch{entry['channel']})"
+ for entry in channels[:5]
+ ]
+ if len(channels) > 5:
+ preview.append("...")
+ return ", ".join(preview)
+
+
+def test_open_assoc_freq_khz(dev, apdev):
+ """Baseline capability check for S1G-aware hwsim radios"""
+
+ channels = list_s1g_capable_channels()
+ if not channels:
+ raise HwsimSkip("mac80211_hwsim does not expose any S1G channels")
+
+ logger.info("Detected S1G channels: %s", _format_channels(channels))
+
+ # Sanity: ensure reported frequencies are within the expected S1G band.
+ for entry in channels:
+ freq = entry['freq_mhz']
+ if freq < 700 or freq > 1000:
+ raise AssertionError(
+ f"Out-of-range S1G frequency reported: {freq} MHz")
+
--
2.43.0
More information about the Hostap
mailing list