auto-t: add a DGAF Disable hotspot test
This commit is contained in:
parent
ba5f4616d2
commit
09f4bd9210
|
@ -14,11 +14,7 @@ import testutil
|
||||||
|
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_connection_success(self):
|
def validate_connection(self, wd, hapd, dgaf_disable=False):
|
||||||
wd = self.wd
|
|
||||||
|
|
||||||
hapd = HostapdCLI(config='ssidHotspot.conf')
|
|
||||||
|
|
||||||
psk_agent = PSKAgent('abc', ('domain\\user', 'testpasswd'))
|
psk_agent = PSKAgent('abc', ('domain\\user', 'testpasswd'))
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
|
@ -38,7 +34,16 @@ class Test(unittest.TestCase):
|
||||||
wd.wait_for_object_condition(device, condition)
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
testutil.test_iface_operstate()
|
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()
|
device.disconnect()
|
||||||
|
|
||||||
|
@ -47,6 +52,20 @@ class Test(unittest.TestCase):
|
||||||
|
|
||||||
wd.unregister_psk_agent(psk_agent)
|
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
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
IWD.copy_to_hotspot('example.conf')
|
IWD.copy_to_hotspot('example.conf')
|
||||||
|
|
Loading…
Reference in New Issue