diff mbox series

[v2,4/4] auto-t: add test for the new OweDisable driver quirk

Message ID 20241023182912.128388-4-prestwoj@gmail.com (mailing list archive)
State New
Headers show
Series [v2,1/4] wiphy: add OweDisable driver quirk | expand

Checks

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

Commit Message

James Prestwood Oct. 23, 2024, 6:29 p.m. UTC
Tests that when OWE is disabled IWD will still connect to the legacy
open network.
---
 autotests/testOWE-disabled/connection_test.py | 51 +++++++++++++++++++
 autotests/testOWE-disabled/hw.conf            |  7 +++
 autotests/testOWE-disabled/main.conf          |  2 +
 autotests/testOWE-disabled/ssidOWE.conf       | 15 ++++++
 autotests/testOWE-disabled/ssidOpen.conf      |  9 ++++
 autotests/testOWE-disabled/transition.open    |  0
 6 files changed, 84 insertions(+)
 create mode 100644 autotests/testOWE-disabled/connection_test.py
 create mode 100644 autotests/testOWE-disabled/hw.conf
 create mode 100644 autotests/testOWE-disabled/main.conf
 create mode 100644 autotests/testOWE-disabled/ssidOWE.conf
 create mode 100644 autotests/testOWE-disabled/ssidOpen.conf
 create mode 100644 autotests/testOWE-disabled/transition.open
diff mbox series

Patch

diff --git a/autotests/testOWE-disabled/connection_test.py b/autotests/testOWE-disabled/connection_test.py
new file mode 100644
index 00000000..849cb58a
--- /dev/null
+++ b/autotests/testOWE-disabled/connection_test.py
@@ -0,0 +1,51 @@ 
+#!/usr/bin/python3
+
+import unittest
+import sys
+
+sys.path.append('../util')
+from iwd import IWD, Network
+from hostapd import HostapdCLI
+import testutil
+
+class Test(unittest.TestCase):
+    def test_autoconnect_to_open(self):
+        IWD.copy_to_storage("transition.open")
+
+        wd = IWD(True)
+
+        devices = wd.list_devices(1)
+        device = devices[0]
+        device.autoconnect = True
+
+        condition = 'obj.state == DeviceState.connected'
+        wd.wait_for_object_condition(device, condition)
+
+        testutil.test_iface_operstate()
+
+        network = Network(device.connected_network)
+
+        self.assertEqual(network.name, "transition")
+        self.assertIn(device.address, self.hapd.list_sta())
+
+        device.disconnect()
+
+    def setUp(self):
+        self.hapd = HostapdCLI(config="ssidOpen.conf")
+        pass
+
+    def tearDown(self):
+        IWD.clear_storage()
+
+        self.wd = None
+
+    @classmethod
+    def setUpClass(cls):
+        pass
+
+    @classmethod
+    def tearDownClass(cls):
+        IWD.clear_storage()
+
+if __name__ == '__main__':
+    unittest.main(exit=True)
diff --git a/autotests/testOWE-disabled/hw.conf b/autotests/testOWE-disabled/hw.conf
new file mode 100644
index 00000000..42b12d59
--- /dev/null
+++ b/autotests/testOWE-disabled/hw.conf
@@ -0,0 +1,7 @@ 
+[SETUP]
+num_radios=3
+start_iwd=0
+
+[HOSTAPD]
+rad0=ssidOpen.conf
+rad1=ssidOWE.conf
diff --git a/autotests/testOWE-disabled/main.conf b/autotests/testOWE-disabled/main.conf
new file mode 100644
index 00000000..2554c011
--- /dev/null
+++ b/autotests/testOWE-disabled/main.conf
@@ -0,0 +1,2 @@ 
+[DriverQuirks]
+OweDisable=mac80211_hwsim
\ No newline at end of file
diff --git a/autotests/testOWE-disabled/ssidOWE.conf b/autotests/testOWE-disabled/ssidOWE.conf
new file mode 100644
index 00000000..72809fa6
--- /dev/null
+++ b/autotests/testOWE-disabled/ssidOWE.conf
@@ -0,0 +1,15 @@ 
+ssid=owe-hidden
+bssid=02:00:00:00:f1:00
+channel=1
+ignore_broadcast_ssid=1
+ieee80211w=1
+
+wpa=2
+wpa_key_mgmt=OWE
+rsn_pairwise=CCMP
+vendor_elements=dd15506f9a1c02000000f0000a7472616e736974696f6e
+
+# You would conventionally use these options but hostapd does not include an
+# IE for the OWE network, hence vendor_elements must be used directly
+#owe_transition_ssid="transition"
+#owe_transition_bssid=02:00:00:00:f0:00
diff --git a/autotests/testOWE-disabled/ssidOpen.conf b/autotests/testOWE-disabled/ssidOpen.conf
new file mode 100644
index 00000000..096b52c4
--- /dev/null
+++ b/autotests/testOWE-disabled/ssidOpen.conf
@@ -0,0 +1,9 @@ 
+channel=1
+ssid=transition
+bssid=02:00:00:00:f0:00
+vendor_elements=dd15506f9a1c02000000f1000a6f77652d68696464656e
+
+# You would conventionally use these options but hostapd does not include an
+# IE for the OWE network, hence vendor_elements must be used directly
+#owe_transition_ssid="owe-hidden"
+#owe_transition_bssid=02:00:00:00:f1:00
diff --git a/autotests/testOWE-disabled/transition.open b/autotests/testOWE-disabled/transition.open
new file mode 100644
index 00000000..e69de29b