feat(reliability): PSK uplink security-mode fallback chain (sae-mixed/sae/psk2 with PMF)

This commit is contained in:
2026-08-23 08:19:20 -06:00
parent 501fa455ce
commit 2ef07a28fc
2 changed files with 56 additions and 15 deletions
+27
View File
@@ -298,3 +298,30 @@ class RfPlanTest(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
class PskModeChainTest(RfPlanTest):
def test_chain_tries_next_mode_on_failure(self):
# first mode (sae-mixed) never associates; second (sae) does
self.iw_fail_left = 5 # fail all link polls of attempt 1
result = mk8_rfplan.set_role('uplink', ssid='Net', psk='secret')
self.assertTrue(result['ok'], result)
self.assertEqual(result['mode'], 'sae')
reloads = [c for c in self.cmds if c.startswith('wifi reload')]
self.assertEqual(len(reloads), 2)
def test_chain_exhaustion_reports_modes(self):
self.iw_fail_left = 99
result = mk8_rfplan.set_role('uplink', ssid='Net', psk='secret')
self.assertFalse(result['ok'])
self.assertEqual(result['tried_modes'],
['sae-mixed', 'sae', 'psk2'])
def test_first_mode_success_records_mode(self):
result = mk8_rfplan.set_role('uplink', ssid='Net', psk='secret')
self.assertTrue(result['ok'])
self.assertEqual(result['mode'], 'sae-mixed')
self.assertIn('uci set wireless.wlan1up.ieee80211w=1', self.cmds)
if __name__ == '__main__':
unittest.main()