From 75ee44f2e6d5151cb24b14dda2e0e900384588ca Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 15 Apr 2014 00:23:55 +0300 Subject: [PATCH] tests: P2P group interface ifdown Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2p_autogo.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/hwsim/test_p2p_autogo.py b/tests/hwsim/test_p2p_autogo.py index 8c8a69425..3df813e91 100644 --- a/tests/hwsim/test_p2p_autogo.py +++ b/tests/hwsim/test_p2p_autogo.py @@ -317,3 +317,20 @@ def test_autogo_extra_cred(dev): connect_cli(dev[0], dev[1]) dev[0].remove_group() dev[1].wait_go_ending_session() + +def test_autogo_ifdown(dev): + """P2P autonomous GO and external ifdown""" + wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5') + wpas.interface_add("wlan5") + res = autogo(wpas) + wpas.dump_monitor() + wpas.interface_remove("wlan5") + wpas.interface_add("wlan5") + res = autogo(wpas) + wpas.dump_monitor() + subprocess.call(['sudo', 'ifconfig', res['ifname'], 'down']) + ev = wpas.wait_global_event(["P2P-GROUP-REMOVED"], timeout=10) + if ev is None: + raise Exception("Group removal not reported") + if res['ifname'] not in ev: + raise Exception("Unexpected group removal event: " + ev)