From 46cb161a8153c0bc8e85f83afcdad67e70f4935d Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 18 Dec 2019 17:12:23 +0200 Subject: [PATCH] tests: Clear IP configuration from sigma_dut explicitly The 127.0.0.11/24 address that could have been left on the wlan0 interface resulted in some test case sequence failures. Fix this by explicitly clearing that address when terminating sigma_dut. Signed-off-by: Jouni Malinen --- tests/hwsim/test_sigma_dut.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/hwsim/test_sigma_dut.py b/tests/hwsim/test_sigma_dut.py index 68db114da..7ab6d1da1 100644 --- a/tests/hwsim/test_sigma_dut.py +++ b/tests/hwsim/test_sigma_dut.py @@ -100,14 +100,18 @@ def start_sigma_dut(ifname, debug=False, hostapd_logdir=None, cert_path=None, break except: time.sleep(0.05) - return sigma + return {'cmd': sigma, 'ifname': ifname} def stop_sigma_dut(sigma): - sigma.terminate() - sigma.wait() - out, err = sigma.communicate() + cmd = sigma['cmd'] + cmd.terminate() + cmd.wait() + out, err = cmd.communicate() logger.debug("sigma_dut stdout: " + str(out.decode())) logger.debug("sigma_dut stderr: " + str(err.decode())) + subprocess.call(["ip", "addr", "del", "dev", sigma['ifname'], + "127.0.0.11/24"], + stderr=open('/dev/null', 'w')) def sigma_dut_wait_connected(ifname): for i in range(50):