]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Use more enforced order for the RSN IBSS steps
authorJouni Malinen <j@w1.fi>
Sun, 25 Aug 2013 20:10:37 +0000 (23:10 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 25 Aug 2013 20:10:37 +0000 (23:10 +0300)
test_ibss_rsn has been failing pretty frequently due to various issues
in getting all connections up. Try to address this initially by avoiding
concurrent operations and explicitly waiting for 4-way handshake
completion before testing data connection. Once this test case is
workign more robustly, a more difficult case with concurrent operations
can be added as a separate test case.

Signed-hostap: Jouni Malinen <j@w1.fi>

tests/hwsim/test_ibss.py

index 17a0b1bcaaaac868fcc2821b1b587410489159e8..d9a95dacf24ea96ed9fc40b8db367f02a316808e 100644 (file)
@@ -17,10 +17,17 @@ def connect_ibss_cmd(dev, id):
     dev.select_network(id)
 
 def wait_ibss_connection(dev):
+    logger.info(dev.ifname + " waiting for IBSS start/join to complete")
     ev = dev.wait_event(["CTRL-EVENT-CONNECTED"], timeout=20)
     if ev is None:
         raise Exception("Connection to the IBSS timed out")
-    dev.dump_monitor()
+
+def wait_4way_handshake(dev1, dev2):
+    logger.info(dev1.ifname + " waiting for 4-way handshake completion with " + dev2.ifname + " " + dev2.p2p_interface_addr())
+    ev = dev1.wait_event(["IBSS-RSN-COMPLETED " + dev2.p2p_interface_addr()],
+                         timeout=20)
+    if ev is None:
+        raise Exception("4-way handshake in IBSS timed out")
 
 def add_ibss(dev, ssid, psk=None, proto=None, key_mgmt=None, pairwise=None, group=None):
     id = dev.add_network()
@@ -55,12 +62,15 @@ def test_ibss_rsn(dev):
 
     id = add_ibss_rsn(dev[1], ssid)
     connect_ibss_cmd(dev[1], id)
+    wait_ibss_connection(dev[1])
+    wait_4way_handshake(dev[0], dev[1])
+    wait_4way_handshake(dev[1], dev[0])
 
     id = add_ibss_rsn(dev[2], ssid)
     connect_ibss_cmd(dev[2], id)
-
-    wait_ibss_connection(dev[1])
     wait_ibss_connection(dev[2])
+    wait_4way_handshake(dev[0], dev[2])
+    wait_4way_handshake(dev[2], dev[0])
 
     # Allow some time for all peers to complete key setup
     time.sleep(3)