mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
auto-t: testEAD: stop ead when test finishes
This commit is contained in:
parent
90b695cfdf
commit
904238b6ec
@ -3,6 +3,7 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
sys.path.append('../util')
|
sys.path.append('../util')
|
||||||
from iwd import IWD
|
from iwd import IWD
|
||||||
@ -14,7 +15,7 @@ class Test(unittest.TestCase):
|
|||||||
def test_connection_success(self):
|
def test_connection_success(self):
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env['STATE_DIRECTORY'] = '/tmp/ead'
|
env['STATE_DIRECTORY'] = '/tmp/ead'
|
||||||
ctx.start_process(['ead', '-i', 'eth1', '-d'], env=env)
|
p = ctx.start_process(['ead', '-i', 'eth1', '-d'], env=env)
|
||||||
|
|
||||||
ead = EAD()
|
ead = EAD()
|
||||||
|
|
||||||
@ -26,6 +27,7 @@ class Test(unittest.TestCase):
|
|||||||
condition = 'obj.authenticated == True'
|
condition = 'obj.authenticated == True'
|
||||||
ead.wait_for_object_condition(adapter, condition)
|
ead.wait_for_object_condition(adapter, condition)
|
||||||
|
|
||||||
|
ctx.stop_process(p)
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
os.mkdir('/tmp/ead')
|
os.mkdir('/tmp/ead')
|
||||||
@ -36,5 +38,7 @@ class Test(unittest.TestCase):
|
|||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
IWD.clear_storage(storage_dir='/tmp/ead')
|
IWD.clear_storage(storage_dir='/tmp/ead')
|
||||||
|
|
||||||
|
shutil.rmtree('/tmp/ead')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main(exit=True)
|
unittest.main(exit=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user