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

auto-t: Ad-Hoc - remove iwd instance on failure

This commit is contained in:
Tim Kourt 2019-03-15 14:48:56 -07:00 committed by Denis Kenzior
parent 2b544541bc
commit b4485f3e1b
3 changed files with 25 additions and 13 deletions

View File

@ -12,16 +12,13 @@ import testutil
class Test(unittest.TestCase):
def test_connection_success(self):
wd = IWD(True)
def validate_connection(self, wd):
dev1, dev2 = wd.list_devices(2)
self.assertIsNotNone(dev1)
self.assertIsNotNone(dev2)
dev1.start_adhoc("AdHocNetwork", "secret123")
sleep(1)
dev2.start_adhoc("AdHocNetwork", "secret123")
dev1.adhoc_wait_for_connected(dev2.address)
@ -31,7 +28,13 @@ class Test(unittest.TestCase):
testutil.test_iface_operstate(dev2.name)
testutil.test_ifaces_connected(dev1.name, dev2.name)
del wd
def test_connection_success(self):
wd = IWD(True)
try:
self.validate_connection(wd)
finally:
del wd
@classmethod
def setUpClass(cls):

View File

@ -12,9 +12,7 @@ import testutil
class Test(unittest.TestCase):
def test_connection_success(self):
wd = IWD(True)
def validate_connection(self, wd):
dev1, dev2 = wd.list_devices(2)
self.assertIsNotNone(dev1)
@ -23,6 +21,7 @@ class Test(unittest.TestCase):
dev1.start_adhoc("AdHocNetwork", "secret123")
sleep(1)
dev2.start_adhoc("AdHocNetwork", "InvalidPassword")
#TODO: This test is unfinished.
# dev1.adhoc_wait_for_connected(dev2.address)
# dev2.adhoc_wait_for_connected(dev1.address)
@ -31,7 +30,13 @@ class Test(unittest.TestCase):
# testutil.test_iface_operstate(dev2.name)
# testutil.test_ifaces_connected(dev1.name, dev2.name)
del wd
def test_connection_failure(self):
wd = IWD(True)
try:
self.validate_connection(wd)
finally:
del wd
@classmethod
def setUpClass(cls):

View File

@ -12,9 +12,7 @@ import testutil
class Test(unittest.TestCase):
def test_connection_success(self):
wd = IWD(True)
def validate_connection(self, wd):
dev1, dev2 = wd.list_devices(2)
self.assertIsNotNone(dev1)
@ -31,7 +29,13 @@ class Test(unittest.TestCase):
#testutil.test_iface_operstate(dev2.name)
#testutil.test_ifaces_connected(dev1.name, dev2.name)
del wd
def test_connection_success(self):
wd = IWD(True)
try:
self.validate_connection(wd)
finally:
del wd
@classmethod
def setUpClass(cls):