tests: Extend test_autogo_2cli to test client removal
authorJouni Malinen <j@w1.fi>
Sun, 1 Sep 2013 14:58:17 +0000 (17:58 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 1 Sep 2013 18:35:10 +0000 (21:35 +0300)
Signed-hostap: Jouni Malinen <j@w1.fi>

tests/hwsim/test_p2p_autogo.py

index 1d1dab1..d62da59 100644 (file)
@@ -44,9 +44,18 @@ def test_autogo_2cli(dev):
     connect_cli(dev[0], dev[1])
     connect_cli(dev[0], dev[2])
     hwsim_utils.test_connectivity_p2p(dev[1], dev[2])
-    dev[2].remove_group()
-    dev[1].remove_group()
+    dev[0].global_request("P2P_REMOVE_CLIENT " + dev[1].p2p_dev_addr())
+    ev = dev[1].wait_event(["P2P-GROUP-REMOVED"], timeout=2)
+    if ev is None:
+        raise Exception("Group removal event timed out")
+    if "reason=GO_ENDING_SESSION" not in ev:
+        raise Exception("Unexpected group removal reason")
     dev[0].remove_group()
+    ev = dev[2].wait_event(["P2P-GROUP-REMOVED"], timeout=2)
+    if ev is None:
+        raise Exception("Group removal event timed out")
+    if "reason=GO_ENDING_SESSION" not in ev:
+        raise Exception("Unexpected group removal reason")
 
 def test_autogo_tdls(dev):
     """P2P autonomous GO and two clients using TDLS"""