]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Start WNM-Sleep Mode in wnm_action_proto*
authorJouni Malinen <j@w1.fi>
Sun, 25 Oct 2015 21:01:21 +0000 (23:01 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 10 Nov 2015 16:40:54 +0000 (18:40 +0200)
This is needed to avoid test case failures with additional state
validation in wpa_supplicant.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_wnm.py

index 824ae60110be9cc495bd20fa1738726345621da4..1fed942266d876a7d220cce4c30e44502640953a 100644 (file)
@@ -675,9 +675,12 @@ def test_wnm_bss_tm_global(dev, apdev):
 def test_wnm_action_proto(dev, apdev):
     """WNM Action protocol testing"""
     params = { "ssid": "test-wnm" }
+    params['wnm_sleep_mode'] = '1'
     hapd = hostapd.add_ap(apdev[0]['ifname'], params)
     bssid = apdev[0]['bssid']
     dev[0].connect("test-wnm", key_mgmt="NONE", scan_freq="2412")
+    dev[0].request("WNM_SLEEP enter")
+    time.sleep(0.1)
     hapd.set("ext_mgmt_frame_handling", "1")
 
     msg = {}
@@ -874,10 +877,13 @@ def test_wnm_action_proto_pmf(dev, apdev):
     params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
     params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
     params["ieee80211w"] = "2"
+    params['wnm_sleep_mode'] = '1'
     hapd = hostapd.add_ap(apdev[0]['ifname'], params)
     bssid = apdev[0]['bssid']
     dev[0].connect(ssid, psk="12345678", key_mgmt="WPA-PSK-SHA256",
                    proto="WPA2", ieee80211w="2", scan_freq="2412")
+    dev[0].request("WNM_SLEEP enter")
+    time.sleep(0.1)
     hapd.set("ext_mgmt_frame_handling", "1")
 
     msg = {}
@@ -973,10 +979,13 @@ def test_wnm_action_proto_no_pmf(dev, apdev):
     """WNM Action protocol testing (PMF disabled)"""
     ssid = "test-wnm-no-pmf"
     params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
+    params['wnm_sleep_mode'] = '1'
     hapd = hostapd.add_ap(apdev[0]['ifname'], params)
     bssid = apdev[0]['bssid']
     dev[0].connect(ssid, psk="12345678", key_mgmt="WPA-PSK",
                    proto="WPA2", ieee80211w="0", scan_freq="2412")
+    dev[0].request("WNM_SLEEP enter")
+    time.sleep(0.1)
     hapd.set("ext_mgmt_frame_handling", "1")
 
     msg = {}