]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Clear IP configuration from sigma_dut explicitly
authorJouni Malinen <jouni@codeaurora.org>
Wed, 18 Dec 2019 15:12:23 +0000 (17:12 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 18 Dec 2019 15:12:23 +0000 (17:12 +0200)
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 <jouni@codeaurora.org>
tests/hwsim/test_sigma_dut.py

index 68db114da1c71a1ba8efafd22f36bef8c8c3b7b0..7ab6d1da15fe5a8741c2a3d6d9e635a4a5390aac 100644 (file)
@@ -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):