mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
controller: address hotspot protocol review findings
- Reset a saved protocol the newly probed device does not support instead of offering it (both UIs); a successful probe is authoritative, the saved value is only kept when probing fails. - Ignore out-of-order protocol probe responses when switching devices quickly (both UIs). - Verify the WPA2 rollback after a failed WPA3 activation; report that the hotspot may be down instead of claiming the revert succeeded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
8687816b84
commit
2baa9cbd2e
5 changed files with 67 additions and 12 deletions
|
|
@ -730,6 +730,19 @@ class TestEnableHotspot:
|
|||
modify_calls = [c[0][0] for c in calls if 'modify' in c[0][0]]
|
||||
assert len(modify_calls) == 2 and "wpa-psk" in modify_calls[1]
|
||||
|
||||
def test_wpa3_failed_revert_is_reported(self):
|
||||
"""If reverting to WPA2 also fails, the error must not claim the hotspot was reverted."""
|
||||
ok = mock.Mock(returncode=0, stdout="", stderr="")
|
||||
device_ready = mock.Mock(returncode=0, stdout="wlan0:disconnected\n", stderr="")
|
||||
sae_failed = mock.Mock(returncode=1, stdout="", stderr="Error: SAE not supported")
|
||||
revert_failed = mock.Mock(returncode=1, stdout="", stderr="Error: connection not found")
|
||||
# radio, poll, hotspot, modify(sae) fails, revert modify fails.
|
||||
result, _ = self._run_enable('wpa3', [ok, device_ready, ok, sae_failed, revert_failed])
|
||||
|
||||
assert result["success"] is False
|
||||
assert "reverted" not in result["error"].lower()
|
||||
assert "wpa3" in result["error"].lower()
|
||||
|
||||
def test_wpa2_modify_failure_still_succeeds(self):
|
||||
"""A failure setting WPA2 explicitly is not fatal; nmcli already created a WPA2 hotspot."""
|
||||
ok = mock.Mock(returncode=0, stdout="", stderr="")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue