3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

auto-t: update AdHoc tests to use AdHocDevice

This commit is contained in:
James Prestwood 2020-09-14 14:04:06 -07:00 committed by Denis Kenzior
parent 29eb08ead2
commit eeca2b3f38
2 changed files with 28 additions and 9 deletions

View File

@ -17,11 +17,21 @@ class Test(unittest.TestCase):
self.assertIsNotNone(dev1)
self.assertIsNotNone(dev2)
dev1.start_adhoc("AdHocNetwork", "secret123")
dev2.start_adhoc("AdHocNetwork", "secret123")
adhoc1 = dev1.start_adhoc("AdHocNetwork", "secret123")
dev1.adhoc_wait_for_connected(dev2.address)
dev2.adhoc_wait_for_connected(dev1.address)
condition = 'obj.started == True'
wd.wait_for_object_condition(adhoc1, condition)
adhoc2 = dev2.start_adhoc("AdHocNetwork", "secret123")
condition = 'obj.started == True'
wd.wait_for_object_condition(adhoc1, condition)
condition = '"%s" in obj.connected_peers' % dev2.address
wd.wait_for_object_condition(adhoc1, condition)
condition = '"%s" in obj.connected_peers' % dev1.address
wd.wait_for_object_condition(adhoc2, condition)
testutil.test_iface_operstate(dev1.name)
testutil.test_iface_operstate(dev2.name)

View File

@ -18,12 +18,21 @@ class Test(unittest.TestCase):
self.assertIsNotNone(dev1)
self.assertIsNotNone(dev2)
dev1.start_adhoc("AdHocNetwork")
sleep(1)
dev2.start_adhoc("AdHocNetwork")
adhoc1 = dev1.start_adhoc("AdHocNetwork")
dev1.adhoc_wait_for_connected(dev2.address)
dev2.adhoc_wait_for_connected(dev1.address)
condition = 'obj.started == True'
wd.wait_for_object_condition(adhoc1, condition)
adhoc2 = dev2.start_adhoc("AdHocNetwork")
condition = 'obj.started == True'
wd.wait_for_object_condition(adhoc1, condition)
condition = '"%s" in obj.connected_peers' % dev2.address
wd.wait_for_object_condition(adhoc1, condition)
condition = '"%s" in obj.connected_peers' % dev1.address
wd.wait_for_object_condition(adhoc2, condition)
testutil.test_iface_operstate(dev1.name)
testutil.test_iface_operstate(dev2.name)