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')