public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v2] auto-t: add SAE-H2E test for setting the default ECC group
@ 2024-08-12 20:14 James Prestwood
  2024-08-12 21:20 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: James Prestwood @ 2024-08-12 20:14 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

---
 autotests/testSAE/default_group_test.py       | 26 ++++++++++++-------
 .../profiles/ssidSAE-H2E.psk.default_group    |  5 ++++
 2 files changed, 22 insertions(+), 9 deletions(-)
 create mode 100644 autotests/testSAE/profiles/ssidSAE-H2E.psk.default_group

v2:
 * Include H2E profile, forgot on v1

diff --git a/autotests/testSAE/default_group_test.py b/autotests/testSAE/default_group_test.py
index d72c96ca..3b7812c3 100644
--- a/autotests/testSAE/default_group_test.py
+++ b/autotests/testSAE/default_group_test.py
@@ -13,7 +13,7 @@ import testutil
 
 class Test(unittest.TestCase):
 
-    def validate_connection(self, wd, rejected=False):
+    def validate_connection(self, wd, hostapd, rejected=False):
         devices = wd.list_devices(1)
         self.assertIsNotNone(devices)
         device = devices[0]
@@ -29,14 +29,14 @@ class Test(unittest.TestCase):
         wd.wait(2)
 
         testutil.test_iface_operstate(intf=device.name)
-        testutil.test_ifaces_connected(if0=device.name, if1=self.hostapd.ifname)
+        testutil.test_ifaces_connected(if0=device.name, if1=hostapd.ifname)
 
         if not rejected:
             self.assertEqual(device.event_ocurred("ecc-group-rejected"), False)
 
-        print(self.hostapd._get_status())
+        print(hostapd._get_status())
 
-        sta_status = self.hostapd.sta_status(device.address)
+        sta_status = hostapd.sta_status(device.address)
 
         print(sta_status)
 
@@ -51,22 +51,27 @@ class Test(unittest.TestCase):
     #   - Connect, try only group 19
     def test_auto_selection(self):
         IWD.copy_to_storage("profiles/ssidSAE.psk.default", name="ssidSAE.psk")
-        self.validate_connection(self.wd, rejected=True)
+        self.validate_connection(self.wd, self.hostapd, rejected=True)
 
-        self.validate_connection(self.wd, rejected=False)
+        self.validate_connection(self.wd, self.hostapd, rejected=False)
 
     # Try group 19 first
     def test_default_group_enabled(self):
         IWD.copy_to_storage("profiles/ssidSAE.psk.default_group", name="ssidSAE.psk")
-        self.validate_connection(self.wd)
+        self.validate_connection(self.wd, self.hostapd)
+
+    # Try group 19 first, with H2E
+    def test_default_group_enabled_h2e(self):
+        IWD.copy_to_storage("profiles/ssidSAE-H2E.psk.default_group", name="ssidSAE-H2E.psk")
+        self.validate_connection(self.wd, self.hostapd_h2e)
 
     # Same as auto-selection but won't retain the default group setting
     def test_default_group_disabled(self):
         IWD.copy_to_storage("profiles/ssidSAE.psk.most_secure", name="ssidSAE.psk")
-        self.validate_connection(self.wd, rejected=True)
+        self.validate_connection(self.wd, self.hostapd, rejected=True)
 
         # IWD should then retry but use only group 19
-        self.validate_connection(self.wd, rejected=True)
+        self.validate_connection(self.wd, self.hostapd, rejected=True)
 
     def setUp(self):
         self.hostapd.default()
@@ -88,6 +93,9 @@ class Test(unittest.TestCase):
         cls.hostapd = HostapdCLI(config='ssidSAE.conf')
         cls.hostapd.default()
 
+        cls.hostapd_h2e = HostapdCLI(config='ssidSAE-H2E.conf')
+        cls.hostapd_h2e.default()
+
     @classmethod
     def tearDownClass(cls):
         pass
diff --git a/autotests/testSAE/profiles/ssidSAE-H2E.psk.default_group b/autotests/testSAE/profiles/ssidSAE-H2E.psk.default_group
new file mode 100644
index 00000000..2a016107
--- /dev/null
+++ b/autotests/testSAE/profiles/ssidSAE-H2E.psk.default_group
@@ -0,0 +1,5 @@
+[Security]
+Passphrase=secret123
+
+[Settings]
+UseDefaultEccGroup=true
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] auto-t: add SAE-H2E test for setting the default ECC group
  2024-08-12 20:14 [PATCH v2] auto-t: add SAE-H2E test for setting the default ECC group James Prestwood
@ 2024-08-12 21:20 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2024-08-12 21:20 UTC (permalink / raw)
  To: James Prestwood, iwd

Hi James,

On 8/12/24 3:14 PM, James Prestwood wrote:
> ---
>   autotests/testSAE/default_group_test.py       | 26 ++++++++++++-------
>   .../profiles/ssidSAE-H2E.psk.default_group    |  5 ++++
>   2 files changed, 22 insertions(+), 9 deletions(-)
>   create mode 100644 autotests/testSAE/profiles/ssidSAE-H2E.psk.default_group
> 
> v2:
>   * Include H2E profile, forgot on v1
> 

Applied, thanks.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-12 21:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12 20:14 [PATCH v2] auto-t: add SAE-H2E test for setting the default ECC group James Prestwood
2024-08-12 21:20 ` Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox