From: Jouni Malinen Date: Wed, 18 Dec 2019 15:12:23 +0000 (+0200) Subject: tests: Clear IP configuration from sigma_dut explicitly X-Git-Tag: hostap_2_10~2159 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=46cb161a8153c0bc8e85f83afcdad67e70f4935d;p=thirdparty%2Fhostap.git 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 --- 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):