Browse Source

tests: Extend test_autogo_2cli to test client removal

Signed-hostap: Jouni Malinen <j@w1.fi>
Jouni Malinen 11 years ago
parent
commit
672f3a72e4
1 changed files with 11 additions and 2 deletions
  1. 11 2
      tests/hwsim/test_p2p_autogo.py

+ 11 - 2
tests/hwsim/test_p2p_autogo.py

@@ -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"""