From e5a66bf51fd4c6ca328db6c239b327b82cefcfae Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 25 Feb 2021 14:00:53 -0800 Subject: [PATCH] auto-t: testNetconfig stop dhcpd correctly Use stop_process instead of kill as this removes the process from the test context. --- autotests/testNetconfig/connection_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autotests/testNetconfig/connection_test.py b/autotests/testNetconfig/connection_test.py index caab090c..fad0e82b 100644 --- a/autotests/testNetconfig/connection_test.py +++ b/autotests/testNetconfig/connection_test.py @@ -70,8 +70,9 @@ class Test(unittest.TestCase): @classmethod def tearDownClass(cls): IWD.clear_storage() - cls.dhcpd_pid.kill() - os.system('rm -rf /tmp/dhcpd.leases') + ctx.stop_process(cls.dhcpd_pid) + cls.dhcpd_pid = None + os.remove('/tmp/dhcpd.leases') if __name__ == '__main__': unittest.main(exit=True)