All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 11/12] auto-t: Add test for extended key IDs
@ 2021-10-04 16:49 James Prestwood
  0 siblings, 0 replies; only message in thread
From: James Prestwood @ 2021-10-04 16:49 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 3143 bytes --]

---
 .../testWPA2-ext-key-id/connection_test.py    | 65 +++++++++++++++++++
 autotests/testWPA2-ext-key-id/hw.conf         |  5 ++
 autotests/testWPA2-ext-key-id/ssidCCMP.conf   | 11 ++++
 3 files changed, 81 insertions(+)
 create mode 100644 autotests/testWPA2-ext-key-id/connection_test.py
 create mode 100644 autotests/testWPA2-ext-key-id/hw.conf
 create mode 100644 autotests/testWPA2-ext-key-id/ssidCCMP.conf

diff --git a/autotests/testWPA2-ext-key-id/connection_test.py b/autotests/testWPA2-ext-key-id/connection_test.py
new file mode 100644
index 00000000..6361d9bd
--- /dev/null
+++ b/autotests/testWPA2-ext-key-id/connection_test.py
@@ -0,0 +1,65 @@
+#!/usr/bin/python3
+
+import unittest
+import sys
+
+sys.path.append('../util')
+import iwd
+from iwd import IWD
+from iwd import PSKAgent
+from iwd import NetworkType
+from hostapd import HostapdCLI
+import testutil
+
+class Test(unittest.TestCase):
+
+    def test_connection_success(self):
+        hapd = HostapdCLI('ssidCCMP.conf')
+        wd = IWD()
+
+        psk_agent = PSKAgent("secret123")
+        wd.register_psk_agent(psk_agent)
+
+        devices = wd.list_devices(1)
+        device = devices[0]
+
+        ordered_network = device.get_ordered_network('ssidCCMP')
+
+        self.assertEqual(ordered_network.type, NetworkType.psk)
+
+        condition = 'not obj.connected'
+        wd.wait_for_object_condition(ordered_network.network_object, condition)
+
+        ordered_network.network_object.connect()
+
+        condition = 'obj.state == DeviceState.connected'
+        wd.wait_for_object_condition(device, condition)
+
+        testutil.test_iface_operstate()
+        testutil.test_ifaces_connected()
+
+        # Rekey 5 times just to make sure the key ID can be toggled back and
+        # forth without causing problems.
+        for i in range(5):
+            hapd.rekey(device.address)
+
+            testutil.test_iface_operstate()
+            testutil.test_ifaces_connected()
+
+        device.disconnect()
+
+        condition = 'not obj.connected'
+        wd.wait_for_object_condition(ordered_network.network_object, condition)
+
+        wd.unregister_psk_agent(psk_agent)
+
+    @classmethod
+    def setUpClass(cls):
+        pass
+
+    @classmethod
+    def tearDownClass(cls):
+        IWD.clear_storage()
+
+if __name__ == '__main__':
+    unittest.main(exit=True)
diff --git a/autotests/testWPA2-ext-key-id/hw.conf b/autotests/testWPA2-ext-key-id/hw.conf
new file mode 100644
index 00000000..fad15b88
--- /dev/null
+++ b/autotests/testWPA2-ext-key-id/hw.conf
@@ -0,0 +1,5 @@
+[SETUP]
+num_radios=2
+
+[HOSTAPD]
+rad0=ssidCCMP.conf
diff --git a/autotests/testWPA2-ext-key-id/ssidCCMP.conf b/autotests/testWPA2-ext-key-id/ssidCCMP.conf
new file mode 100644
index 00000000..b52bfb7c
--- /dev/null
+++ b/autotests/testWPA2-ext-key-id/ssidCCMP.conf
@@ -0,0 +1,11 @@
+hw_mode=g
+channel=1
+ssid=ssidCCMP
+
+wpa=2
+wpa_pairwise=CCMP
+wpa_passphrase=secret123
+
+ieee80211w=2
+wpa_key_mgmt=WPA-PSK-SHA256
+extended_key_id=1
-- 
2.31.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-04 16:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-04 16:49 [PATCH 11/12] auto-t: Add test for extended key IDs James Prestwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.