tests: Make *_key_lifetime_in_memory more robust
authorJouni Malinen <j@w1.fi>
Sat, 31 Jan 2015 16:06:06 +0000 (18:06 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 31 Jan 2015 16:06:06 +0000 (18:06 +0200)
It was possible for the GTK-found-in-memory case to be triggered due to
a retransmission of EAPOL-Key msg 3/4 especially when running test cases
under heavy load (i.e., timeout on hostapd due to not receiving the 4/4
response quickly enough). Make this false failure report less likely by
waiting a bit longer after the connection has been completed before
fetching the process memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_eap.py
tests/hwsim/test_ap_ft.py
tests/hwsim/test_ap_psk.py
tests/hwsim/test_erp.py
tests/hwsim/test_sae.py

index fa19f63..d00ec04 100644 (file)
@@ -2651,7 +2651,7 @@ def test_wpa2_eap_ttls_pap_key_lifetime_in_memory(dev, apdev, params):
     id = eap_connect(dev[0], apdev[0], "TTLS", "pap-secret",
                      anonymous_identity="ttls", password=password,
                      ca_cert="auth_serv/ca.pem", phase2="auth=PAP")
-    time.sleep(0.1)
+    time.sleep(1)
     buf = read_process_memory(pid, password)
 
     dev[0].request("DISCONNECT")
index 18e8dd6..19d77f9 100644 (file)
@@ -479,7 +479,7 @@ def test_ft_psk_key_lifetime_in_memory(dev, apdev, params):
 
     dev[0].connect(ssid, psk=passphrase, key_mgmt="FT-PSK", proto="WPA2",
                    scan_freq="2412")
-    time.sleep(0.1)
+    time.sleep(1)
 
     buf = read_process_memory(pid, pmk)
 
index dcf25ad..e0c7c96 100644 (file)
@@ -912,7 +912,7 @@ def test_wpa2_psk_key_lifetime_in_memory(dev, apdev, params):
     get_key_locations(buf, pmk, "PMK")
 
     dev[0].connect_network(id, timeout=20)
-    time.sleep(0.1)
+    time.sleep(1)
 
     buf = read_process_memory(pid, pmk)
 
index db0a7d7..0886444 100644 (file)
@@ -241,7 +241,7 @@ def test_erp_key_lifetime_in_memory(dev, apdev, params):
                    ca_cert="auth_serv/ca.pem", phase2="auth=PAP",
                    erp="1", scan_freq="2412")
 
-    time.sleep(0.1)
+    time.sleep(1)
     buf = read_process_memory(pid, password)
 
     dev[0].request("DISCONNECT")
index 93194d3..dadf35a 100644 (file)
@@ -208,7 +208,7 @@ def test_sae_key_lifetime_in_memory(dev, apdev, params):
     id = dev[0].connect("test-sae", psk=password, key_mgmt="SAE",
                         scan_freq="2412")
 
-    time.sleep(0.1)
+    time.sleep(1)
     buf = read_process_memory(pid, password)
 
     dev[0].request("DISCONNECT")