mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-29 05:39:24 +01:00
auto-t: Fixed AP test to work with multiple sub-tests
The single AP test worked fine, but adding a failure test caused some problems. Since the kernel is never restarted between tests it maintains old stale scan results from the previous test. This was causing an assert to sometimes fail in the second test being run because it was returning > 1 ordered networks. This change iterates through the ordered network list and chooses the appropriate network rather than assuming get_ordered_networks() will always return only one network object
This commit is contained in:
parent
7fedc2bf66
commit
69fe274c7d
@ -25,8 +25,14 @@ class Test(unittest.TestCase):
|
||||
wd.wait_for_object_condition(dev, condition)
|
||||
|
||||
ordered_networks = dev.get_ordered_networks()
|
||||
self.assertEqual(len(ordered_networks), 1)
|
||||
ordered_network = ordered_networks[0]
|
||||
|
||||
ordered_network = None
|
||||
for network in ordered_networks:
|
||||
if network.name == 'TestAP1':
|
||||
ordered_network = network
|
||||
break
|
||||
|
||||
self.assertNotEqual(ordered_network, None)
|
||||
self.assertEqual(ordered_network.name, 'TestAP1')
|
||||
self.assertEqual(ordered_network.type, NetworkType.psk)
|
||||
|
||||
|
@ -25,8 +25,14 @@ class Test(unittest.TestCase):
|
||||
wd.wait_for_object_condition(dev, condition)
|
||||
|
||||
ordered_networks = dev.get_ordered_networks()
|
||||
self.assertEqual(len(ordered_networks), 1)
|
||||
ordered_network = ordered_networks[0]
|
||||
|
||||
ordered_network = None
|
||||
for network in ordered_networks:
|
||||
if network.name == 'TestAP1':
|
||||
ordered_network = network
|
||||
break
|
||||
|
||||
self.assertNotEqual(ordered_network, None)
|
||||
self.assertEqual(ordered_network.name, 'TestAP1')
|
||||
self.assertEqual(ordered_network.type, NetworkType.psk)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user