diff mbox series

[11/11] auto-t: add OWE test for auto default group

Message ID 20240227183405.257206-11-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [01/11] doc: Document UseDefaultEccGroup | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Feb. 27, 2024, 6:34 p.m. UTC
---
 autotests/testOWE/connection_test.py | 33 ++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
diff mbox series

Patch

diff --git a/autotests/testOWE/connection_test.py b/autotests/testOWE/connection_test.py
index 1fdc990a..58e6560f 100644
--- a/autotests/testOWE/connection_test.py
+++ b/autotests/testOWE/connection_test.py
@@ -64,6 +64,39 @@  class Test(unittest.TestCase):
         self.assertRaises(Exception, testutil.test_ifaces_connected,
                           (hapd0.ifname, device.name, True, True))
 
+    def test_auto_default_group(self):
+        wd = IWD()
+        hapd = HostapdCLI(config='ssidOWE-1.conf')
+
+        devices = wd.list_devices(1)
+        device = devices[0]
+
+        device.get_ordered_network('ssidOWE')
+
+        device.connect_bssid(hapd.bssid)
+
+        condition = 'obj.state == DeviceState.connected'
+        wd.wait_for_object_condition(device, condition)
+
+        # Should have rejected group 20, but still connected on 19
+        self.assertEqual(device.event_ocurred("ecc-group-rejected"), True)
+
+        testutil.test_iface_operstate()
+        testutil.test_ifaces_connected(device.name, hapd.ifname)
+
+        device.disconnect()
+
+        device.connect_bssid(hapd.bssid)
+
+        condition = 'obj.state == DeviceState.connected'
+        wd.wait_for_object_condition(device, condition)
+
+        # IWD should have used the default group, no rejection
+        self.assertEqual(device.event_ocurred("ecc-group-rejected"), False)
+
+        testutil.test_iface_operstate()
+        testutil.test_ifaces_connected(device.name, hapd.ifname)
+
     @classmethod
     def setUpClass(cls):
         pass