auto-t: update blacklist test to use 'enable' on rules
James Prestwood
PATCH 1/4 auto-t: update blacklist test to use 'enable' on rules
--- autotests/testBSSBlacklist/connection_test.py | 3 +++ 1 file changed, 3 insertions(+)
autotests/testBSSBlacklist/connection_test.py +3 -0
@@ -110,8 +110,11 @@ class Test(unittest.TestCase): # Have both APs drop all packets, both should get blacklisted rule0.drop = True + rule0.enable = True rule1.drop = True + rule1.enable = True rule2.drop = True + rule2.enable = True with self.assertRaises(iwd.FailedEx): ordered_network.network_object.connect()
Signature · 1 line
2.31.1
James Prestwood
PATCH 2/4 auto-t: fix testConnectAutoconnect
There was no open ssid provisioning file, which was fine as the first test should have created one. But to be safe, include one explicitly and use the proper setUp/tearDown functions.
--- autotests/testConnectAutoconnect/open_network_test.py | 4 ++++ autotests/testConnectAutoconnect/ssidOpen.open | 1 + 2 files changed, 5 insertions(+) create mode 100644 autotests/testConnectAutoconnect/ssidOpen.open
autotests/testConnectAutoconnect/open_network_test.py +4 -0
@@ -24,6 +24,10 @@ class TestOpenNetwork(unittest.TestCase): tca.validate('ssidOpen', False) tca.validate('ssidOpen', True) + def setUp(self): + IWD.copy_to_storage('ssidOpen.open') + + def tearDown(self): IWD.clear_storage() if __name__ == '__main__':
autotests/testConnectAutoconnect/ssidOpen.open new file +1 -0
@@ -0,0 +1 @@ +
Signature · 1 line
2.31.1
James Prestwood
PATCH 3/4 network: fix autoconnect for Open networks
In reply to James PrestwoodThis code path was never tested and used to ensure a OWE transition candidate gets selected over an open one (e.g. if all the BSS's are blacklisted). But this logic was incorrect and the path was being taken for BSS's that did not contain the owe_trans element, basically all BSS's. For RSN's this was somewhat fine since the final check would set a candidate, but for open BSS's the loop would start over and potentially complete the loop without ever returning a candidate. If fallback was false, NULL would be returned.
To fix this only take the OWE transition path if its an OWE transition BSS, i.e. inverse the logic.
--- src/network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/network.c +1 -1
@@ -1136,7 +1136,7 @@ struct scan_bss *network_bss_select(struct network *network, candidate = bss;/* OWE Transition BSS */ -if (!bss->owe_trans) { +if (bss->owe_trans) {/* Don't want to connect to the Open BSS if possible */ if (!bss->rsne)continue ;
Signature · 1 line
2.31.1
James Prestwood
PATCH 4/4 auto-t: use tearDownClass in hidden network test
In reply to James PrestwoodA failure in this test could leave stale network profiles, which may cause future tests to fail.
--- autotests/testHiddenNetworks/open_network_test.py | 2 ++ autotests/testHiddenNetworks/wpa_network_test.py | 2 ++ 2 files changed, 4 insertions(+)
autotests/testHiddenNetworks/open_network_test.py +2 -0
@@ -24,6 +24,8 @@ class TestOpenNetwork(unittest.TestCase): tca.validate('ssidHiddenOpen', False) tca.validate('ssidHiddenOpen', True) + @classmethod + def tearDownClass(cls): IWD.clear_storage() if __name__ == '__main__':
autotests/testHiddenNetworks/wpa_network_test.py +2 -0
@@ -25,6 +25,8 @@ class TestWpaNetwork(unittest.TestCase): tca.validate('ssidHiddenWPA', False, None, True) tca.validate('ssidHiddenWPA', True, None, True) + @classmethod + def tearDownClass(cls): IWD.clear_storage() if __name__ == '__main__':
Signature · 1 line
2.31.1
Denis Kenzior
Hi James,
Quoted 4 lines · James Prestwood
--- autotests/testBSSBlacklist/connection_test.py | 3 +++ 1 file changed, 3 insertions(+)
All applied, thanks.
Regards,
-Denis