fix: push_radio_channel uses 'wifi' (full restart) instead of 'wifi reload'

'wifi reload' only reapplies the running config without physically
changing the channel on many ath9k/ath10k/mt76 hardware+driver
combinations. A full 'wifi' (down + up) cycle is required for channel
changes to take effect.

Also updated the test assertion accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Manivong
2026-06-25 00:01:03 +02:00
co-authored by Claude Sonnet 4.6
parent 512871b1bb
commit 4c41345489
2 changed files with 15 additions and 8 deletions
+8 -6
View File
@@ -1076,11 +1076,13 @@ class TestPushRadioChannel:
driver.push_radio_channel("radio0", 11)
assert any("uci commit wireless" in c for c in issued)
def test_issues_wifi_reload(self, driver):
def test_issues_wifi_restart(self, driver):
"""Must call 'wifi' (full restart) — NOT just 'wifi reload'."""
issued: list[str] = []
driver._send_command = lambda cmd, **kw: issued.append(cmd) or ""
driver.push_radio_channel("radio1", 36)
assert any("wifi reload" in c for c in issued)
# 'wifi' alone is a full restart; 'wifi reload' is insufficient for channel changes
assert any(c.strip() == "wifi" for c in issued)
def test_auto_channel_zero(self, driver):
"""channel=0 should set 'auto' in UCI."""
@@ -1089,11 +1091,11 @@ class TestPushRadioChannel:
driver.push_radio_channel("radio0", 0)
assert any("channel=auto" in c or "channel='auto'" in c for c in issued)
def test_commit_before_reload(self, driver):
"""UCI commit must happen before wifi reload."""
def test_commit_before_restart(self, driver):
"""UCI commit must happen before wifi restart."""
issued: list[str] = []
driver._send_command = lambda cmd, **kw: issued.append(cmd) or ""
driver.push_radio_channel("radio0", 6)
commit_idx = next(i for i, c in enumerate(issued) if "commit" in c)
reload_idx = next(i for i, c in enumerate(issued) if "wifi reload" in c)
assert commit_idx < reload_idx
wifi_idx = next(i for i, c in enumerate(issued) if c.strip() == "wifi")
assert commit_idx < wifi_idx