mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-23 12:44:09 +01:00
auto-t: SAE - remove iwd instance on failure
This commit is contained in:
parent
b4485f3e1b
commit
bda956f2b2
@ -11,8 +11,7 @@ from iwd import NetworkType
|
|||||||
|
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_connection_success(self):
|
def validate_connection(self, wd):
|
||||||
wd = IWD(True)
|
|
||||||
|
|
||||||
devices = wd.list_devices(4)
|
devices = wd.list_devices(4)
|
||||||
self.assertIsNotNone(devices)
|
self.assertIsNotNone(devices)
|
||||||
@ -46,7 +45,13 @@ 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)
|
||||||
|
|
||||||
del wd
|
def test_connection_success(self):
|
||||||
|
wd = IWD(True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.validate_connection(wd)
|
||||||
|
finally:
|
||||||
|
del wd
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
@ -11,11 +11,9 @@ from iwd import NetworkType
|
|||||||
|
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_connection_success(self):
|
def validate_connection(self, wd):
|
||||||
networks = []
|
networks = []
|
||||||
|
|
||||||
wd = IWD(True)
|
|
||||||
|
|
||||||
psk_agent = PSKAgent(["secret123"] * 4)
|
psk_agent = PSKAgent(["secret123"] * 4)
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
@ -61,7 +59,13 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd.unregister_psk_agent(psk_agent)
|
wd.unregister_psk_agent(psk_agent)
|
||||||
|
|
||||||
del wd
|
def test_connection_success(self):
|
||||||
|
wd = IWD(True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.validate_connection(wd)
|
||||||
|
finally:
|
||||||
|
del wd
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
@ -13,15 +13,13 @@ import testutil
|
|||||||
|
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_connection_success(self):
|
def validate_connection(self, wd):
|
||||||
hostapd_if = None
|
hostapd_if = None
|
||||||
|
|
||||||
for hostapd in list(hostapd_map.values()):
|
for hostapd in list(hostapd_map.values()):
|
||||||
if hostapd.config == 'ssidSAE.conf':
|
if hostapd.config == 'ssidSAE.conf':
|
||||||
hostapd_if = hostapd.name
|
hostapd_if = hostapd.name
|
||||||
|
|
||||||
wd = IWD(True)
|
|
||||||
|
|
||||||
psk_agent = PSKAgent("secret123")
|
psk_agent = PSKAgent("secret123")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
@ -67,7 +65,13 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd.unregister_psk_agent(psk_agent)
|
wd.unregister_psk_agent(psk_agent)
|
||||||
|
|
||||||
del wd
|
def test_connection_success(self):
|
||||||
|
wd = IWD(True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.validate_connection(wd)
|
||||||
|
finally:
|
||||||
|
del wd
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
@ -11,8 +11,7 @@ from iwd import NetworkType
|
|||||||
|
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_connection_success(self):
|
def validate_connection(self, wd):
|
||||||
wd = IWD(True)
|
|
||||||
|
|
||||||
psk_agent = PSKAgent("InvalidSecret")
|
psk_agent = PSKAgent("InvalidSecret")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
@ -41,7 +40,13 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd.unregister_psk_agent(psk_agent)
|
wd.unregister_psk_agent(psk_agent)
|
||||||
|
|
||||||
del wd
|
def test_connection_success(self):
|
||||||
|
wd = IWD(True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.validate_connection(wd)
|
||||||
|
finally:
|
||||||
|
del wd
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
@ -13,15 +13,13 @@ import testutil
|
|||||||
|
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_connection_success(self):
|
def validate_connection(self, wd):
|
||||||
hostapd_if = None
|
hostapd_if = None
|
||||||
|
|
||||||
for hostapd in list(hostapd_map.values()):
|
for hostapd in list(hostapd_map.values()):
|
||||||
if hostapd.config == 'ssidSAE-20.conf':
|
if hostapd.config == 'ssidSAE-20.conf':
|
||||||
hostapd_if = hostapd.name
|
hostapd_if = hostapd.name
|
||||||
|
|
||||||
wd = IWD(True)
|
|
||||||
|
|
||||||
psk_agent = PSKAgent("secret123")
|
psk_agent = PSKAgent("secret123")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
@ -67,7 +65,13 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd.unregister_psk_agent(psk_agent)
|
wd.unregister_psk_agent(psk_agent)
|
||||||
|
|
||||||
del wd
|
def test_connection_success(self):
|
||||||
|
wd = IWD(True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.validate_connection(wd)
|
||||||
|
finally:
|
||||||
|
del wd
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
Loading…
Reference in New Issue
Block a user