All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/5] auto-t: add a DGAF Disable hotspot test
@ 2021-11-04 17:57 James Prestwood
  0 siblings, 0 replies; only message in thread
From: James Prestwood @ 2021-11-04 17:57 UTC (permalink / raw)
  To: iwd

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

---
 autotests/testHotspot/hotspot_test.py | 31 +++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/autotests/testHotspot/hotspot_test.py b/autotests/testHotspot/hotspot_test.py
index 054a1a8f..ed9ee830 100644
--- a/autotests/testHotspot/hotspot_test.py
+++ b/autotests/testHotspot/hotspot_test.py
@@ -14,11 +14,7 @@ import testutil
 
 class Test(unittest.TestCase):
 
-    def test_connection_success(self):
-        wd = self.wd
-
-        hapd = HostapdCLI(config='ssidHotspot.conf')
-
+    def validate_connection(self, wd, hapd, dgaf_disable=False):
         psk_agent = PSKAgent('abc', ('domain\\user', 'testpasswd'))
         wd.register_psk_agent(psk_agent)
 
@@ -38,7 +34,16 @@ class Test(unittest.TestCase):
         wd.wait_for_object_condition(device, condition)
 
         testutil.test_iface_operstate()
-        testutil.test_ifaces_connected(device.name, hapd.ifname)
+
+        if not dgaf_disable:
+            testutil.test_ifaces_connected(device.name, hapd.ifname)
+        else:
+            # This is expected to fail with group traffic
+            with self.assertRaises(Exception):
+                testutil.test_ifaces_connected(device.name, hapd.ifname, expect_fail=True)
+
+            # Now try again without testing group traffic
+            testutil.test_ifaces_connected(device.name, hapd.ifname, group=False)
 
         device.disconnect()
 
@@ -47,6 +52,20 @@ class Test(unittest.TestCase):
 
         wd.unregister_psk_agent(psk_agent)
 
+    def test_hotspot(self):
+        hapd = HostapdCLI(config='ssidHotspot.conf')
+        hapd.set_value('disable_dgaf', '0')
+        hapd.reload()
+
+        self.validate_connection(self.wd, hapd)
+
+    def test_dgaf_disabled(self):
+        hapd = HostapdCLI(config='ssidHotspot.conf')
+        hapd.set_value('disable_dgaf', '1')
+        hapd.reload()
+
+        self.validate_connection(self.wd, hapd, dgaf_disable=True)
+
     @classmethod
     def setUpClass(cls):
         IWD.copy_to_hotspot('example.conf')
-- 
2.31.1

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

only message in thread, other threads:[~2021-11-04 17:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04 17:57 [PATCH 5/5] auto-t: add a DGAF Disable hotspot test 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.