mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-20 11:40:40 +01:00
auto-t EAP-PEAP
1) Refactored to start catching the exceptions and properly dispose an instance of iwd 2) Switched to list_devices with wait option
This commit is contained in:
parent
b3b0c3dea5
commit
342ffc5652
@ -11,14 +11,10 @@ from iwd import NetworkType
|
|||||||
|
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_connection_success(self):
|
def validate_connection(self, wd):
|
||||||
ssid_to_connect = 'ssidEAP-PEAP-frag'
|
ssid_to_connect = 'ssidEAP-PEAP-frag'
|
||||||
|
|
||||||
wd = IWD(True, '/tmp/IWD-Frag')
|
devices = wd.list_devices(True);
|
||||||
wd.wait(1)
|
|
||||||
|
|
||||||
devices = wd.list_devices();
|
|
||||||
|
|
||||||
self.assertIsNotNone(devices)
|
self.assertIsNotNone(devices)
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
@ -55,6 +51,15 @@ class Test(unittest.TestCase):
|
|||||||
condition = 'not obj.connected'
|
condition = 'not obj.connected'
|
||||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
def test_connection_success(self):
|
||||||
|
wd = IWD(True, '/tmp/IWD-Frag')
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.validate_connection(wd)
|
||||||
|
except:
|
||||||
|
del wd
|
||||||
|
raise
|
||||||
|
|
||||||
del wd
|
del wd
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -11,14 +11,10 @@ from iwd import NetworkType
|
|||||||
|
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_connection_success(self):
|
def validate_connection(self, wd):
|
||||||
ssid_to_connect = 'ssidEAP-PEAPv0'
|
ssid_to_connect = 'ssidEAP-PEAPv0'
|
||||||
|
|
||||||
wd = IWD(True)
|
devices = wd.list_devices(True);
|
||||||
wd.wait(1)
|
|
||||||
|
|
||||||
devices = wd.list_devices();
|
|
||||||
|
|
||||||
self.assertIsNotNone(devices)
|
self.assertIsNotNone(devices)
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
@ -55,6 +51,15 @@ class Test(unittest.TestCase):
|
|||||||
condition = 'not obj.connected'
|
condition = 'not obj.connected'
|
||||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
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
|
del wd
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -11,14 +11,10 @@ from iwd import NetworkType
|
|||||||
|
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_connection_success(self):
|
def validate_connection(self, wd):
|
||||||
ssid_to_connect = 'ssidEAP-PEAPv1'
|
ssid_to_connect = 'ssidEAP-PEAPv1'
|
||||||
|
|
||||||
wd = IWD(True)
|
devices = wd.list_devices(True);
|
||||||
wd.wait(1)
|
|
||||||
|
|
||||||
devices = wd.list_devices();
|
|
||||||
|
|
||||||
self.assertIsNotNone(devices)
|
self.assertIsNotNone(devices)
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
@ -55,6 +51,15 @@ class Test(unittest.TestCase):
|
|||||||
condition = 'not obj.connected'
|
condition = 'not obj.connected'
|
||||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
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
|
del wd
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user