auto-t: GTC

1) Renamed the test to reflect the usage of PEAP
2) Prevented the creation of an extra instance of iwd
3) Refactored to start catching the exceptions and properly
   dispose an instance of iwd
4) Switched to list_devices with wait option
This commit is contained in:
Tim Kourt 2018-05-21 13:35:02 -07:00 committed by Denis Kenzior
parent 68bc64c8cd
commit 5bc6e986e4
5 changed files with 15 additions and 17 deletions

View File

@ -1,6 +1,6 @@
[SETUP]
num_radios=3
start_iwd=1
num_radios=2
start_iwd=0
max_test_exec_interval_sec=60
tmpfs_extra_stuff=../misc/certs:eap-user-peap-gtc.text

View File

@ -11,13 +11,8 @@ from iwd import NetworkType
class Test(unittest.TestCase):
def test_connection_success(self):
ssid_to_connect = 'ssidEAP-PEAPv1-GTC'
wd = IWD(True)
wd.wait(1)
devices = wd.list_devices();
def validate_connection(self, wd):
devices = wd.list_devices(True);
self.assertIsNotNone(devices)
device = devices[0]
@ -31,15 +26,9 @@ class Test(unittest.TestCase):
wd.wait_for_object_condition(device, condition)
ordered_networks = device.get_ordered_networks()
ordered_network = None
for o_n in ordered_networks:
if o_n.name == ssid_to_connect:
ordered_network = o_n
break
self.assertEqual(ordered_network.name, ssid_to_connect)
ordered_network = ordered_networks[0]
self.assertEqual(ordered_network.name, 'ssidEAP-PEAPv1-GTC')
self.assertEqual(ordered_network.type, NetworkType.eap)
condition = 'not obj.connected'
@ -55,6 +44,15 @@ class Test(unittest.TestCase):
condition = 'not obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
def test_connection_success(self):
wd = IWD(True)
try:
self.validate_connection(wd)
except:
del wd
raise
del wd
@classmethod