From 904238b6ec1fb6e696e43c8c3021aa0c29e39f17 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 25 Feb 2021 14:00:50 -0800 Subject: [PATCH] auto-t: testEAD: stop ead when test finishes --- autotests/testEAD/connection_test.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autotests/testEAD/connection_test.py b/autotests/testEAD/connection_test.py index bdf242b6..7f23f0d6 100644 --- a/autotests/testEAD/connection_test.py +++ b/autotests/testEAD/connection_test.py @@ -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)