auto-t: harden testHotspot

This test occationally failed, and it uses the old style of waiting
for connected on the network object instead of the device object.

The hwsim rule was also moved ahead of the IWD() initializer which
ensures that IWD doesn't scan before the rule can be set/processed.
This commit is contained in:
James Prestwood 2020-09-10 16:12:44 -07:00 committed by Denis Kenzior
parent e81b1b77c8
commit 8b41413170
4 changed files with 12 additions and 11 deletions

View File

@ -23,10 +23,8 @@ class Test(unittest.TestCase):
rule0 = hwsim.rules.create()
rule0.source = bss_radio.addresses[0]
rule0.bidirectional = True
# Force the case where ANQP does not finish before Connect() comes in
rule0.delay = 100
wd = IWD(True, '/tmp')
wd = IWD(True)
hapd = HostapdCLI(config='ssidHotspot.conf')
@ -53,12 +51,15 @@ class Test(unittest.TestCase):
condition = 'not obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
# Force the case where ANQP does not finish before Connect() comes in
rule0.delay = 100
ordered_network.network_object.connect()
rule0.delay = 1
condition = 'obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
testutil.test_iface_operstate()
testutil.test_ifaces_connected(device.name, hapd.ifname)

View File

@ -42,8 +42,8 @@ class Test(unittest.TestCase):
ordered_network.network_object.connect()
condition = 'obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
testutil.test_iface_operstate()
testutil.test_ifaces_connected(device.name, hapd.ifname)

View File

@ -42,8 +42,8 @@ class Test(unittest.TestCase):
ordered_network.network_object.connect()
condition = 'obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
testutil.test_iface_operstate()
testutil.test_ifaces_connected(device.name, hapd.ifname)

View File

@ -42,8 +42,8 @@ class Test(unittest.TestCase):
ordered_network.network_object.connect()
condition = 'obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
testutil.test_iface_operstate()
testutil.test_ifaces_connected(device.name, hapd.ifname)