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 sys
|
||||
import os
|
||||
import shutil
|
||||
|
||||
sys.path.append('../util')
|
||||
from iwd import IWD
|
||||
@ -14,7 +15,7 @@ class Test(unittest.TestCase):
|
||||
def test_connection_success(self):
|
||||
env = os.environ.copy()
|
||||
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()
|
||||
|
||||
@ -26,6 +27,7 @@ class Test(unittest.TestCase):
|
||||
condition = 'obj.authenticated == True'
|
||||
ead.wait_for_object_condition(adapter, condition)
|
||||
|
||||
ctx.stop_process(p)
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
os.mkdir('/tmp/ead')
|
||||
@ -36,5 +38,7 @@ class Test(unittest.TestCase):
|
||||
def tearDownClass(cls):
|
||||
IWD.clear_storage(storage_dir='/tmp/ead')
|
||||
|
||||
shutil.rmtree('/tmp/ead')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main(exit=True)
|
||||
|
Loading…
Reference in New Issue
Block a user