From ea173088c71bab52c95e8f78cc7fd00341595ac5 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 27 Dec 2016 21:20:57 +0200 Subject: [PATCH] tests: hostapd DUP_NETWORK error cases Signed-off-by: Jouni Malinen --- tests/hwsim/test_hapd_ctrl.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_hapd_ctrl.py b/tests/hwsim/test_hapd_ctrl.py index 1bbe241ca..c90e2c4fc 100644 --- a/tests/hwsim/test_hapd_ctrl.py +++ b/tests/hwsim/test_hapd_ctrl.py @@ -494,7 +494,7 @@ def dup_network(hapd_global, src, dst, param): dst)) def test_hapd_dup_network_global_wpa2(dev, apdev): - """hostapd and DUP_NETWORK command (WPA2""" + """hostapd and DUP_NETWORK command (WPA2)""" passphrase="12345678" src_ssid = "hapd-ctrl-src" dst_ssid = "hapd-ctrl-dst" @@ -520,6 +520,18 @@ def test_hapd_dup_network_global_wpa2(dev, apdev): if "FAIL" in dst_hapd.request("STA " + addr): raise Exception("Could not connect using duplicated wpa params") + tests = [ "a", + "no-such-ifname no-such-ifname", + src_ifname + " no-such-ifname", + src_ifname + " no-such-ifname no-such-param", + src_ifname + " " + dst_ifname + " no-such-param" ] + for t in tests: + if "FAIL" not in hapd_global.request("DUP_NETWORK " + t): + raise Exception("Invalid DUP_NETWORK accepted: " + t) + with alloc_fail(src_hapd, 1, "hostapd_ctrl_iface_dup_param"): + if "FAIL" not in hapd_global.request("DUP_NETWORK %s %s wpa" % (src_ifname, dst_ifname)): + raise Exception("DUP_NETWORK accepted during OOM") + def test_hapd_dup_network_global_wpa(dev, apdev): """hostapd and DUP_NETWORK command (WPA)""" skip_with_fips(dev[0])