aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hwsim/test_wep.py
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2018-08-21 15:50:55 (GMT)
committerJouni Malinen <j@w1.fi>2018-08-21 15:50:55 (GMT)
commit307324bf79eb003fb98814e66ecbb1a8d5350083 (patch)
tree777890949073a1728a46bfe4e2c21758d3c48858 /tests/hwsim/test_wep.py
parent567df5501cdfda90bfc74215c9614258b5ddba5d (diff)
downloadhostap-307324bf79eb003fb98814e66ecbb1a8d5350083.zip
hostap-307324bf79eb003fb98814e66ecbb1a8d5350083.tar.gz
hostap-307324bf79eb003fb98814e66ecbb1a8d5350083.tar.bz2
tests: AP with WEP and external ifconfig down
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'tests/hwsim/test_wep.py')
-rw-r--r--tests/hwsim/test_wep.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/hwsim/test_wep.py b/tests/hwsim/test_wep.py
index 85ed028..8f2fa21 100644
--- a/tests/hwsim/test_wep.py
+++ b/tests/hwsim/test_wep.py
@@ -123,3 +123,27 @@ def test_wep_ht_vht(dev, apdev):
hapd.request("DISABLE")
subprocess.call(['iw', 'reg', 'set', '00'])
dev[0].flush_scan_cache()
+
+def test_wep_ifdown(dev, apdev):
+ """AP with WEP and external ifconfig down"""
+ hapd = hostapd.add_ap(apdev[0],
+ { "ssid": "wep-open",
+ "wep_key0": '"hello"' })
+ dev[0].flush_scan_cache()
+ id = dev[0].connect("wep-open", key_mgmt="NONE", wep_key0='"hello"',
+ scan_freq="2412")
+ hwsim_utils.test_connectivity(dev[0], hapd)
+ dev[0].request("DISCONNECT")
+ dev[0].wait_disconnected()
+
+ hapd.cmd_execute(['ip', 'link', 'set', 'dev', apdev[0]['ifname'], 'down'])
+ ev = hapd.wait_event(["INTERFACE-DISABLED"], timeout=10)
+ if ev is None:
+ raise Exception("No INTERFACE-DISABLED event")
+ hapd.cmd_execute(['ip', 'link', 'set', 'dev', apdev[0]['ifname'], 'up'])
+ ev = hapd.wait_event(["INTERFACE-ENABLED"], timeout=10)
+ if ev is None:
+ raise Exception("No INTERFACE-ENABLED event")
+ dev[0].select_network(id, freq=2412)
+ dev[0].wait_connected()
+ hwsim_utils.test_connectivity(dev[0], hapd)