tests: MBO WNM token wrap around
authorJouni Malinen <j@w1.fi>
Thu, 30 Jun 2016 09:52:50 +0000 (12:52 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 30 Jun 2016 09:53:05 +0000 (12:53 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_mbo.py

index ba34b68..1923bd3 100644 (file)
@@ -122,6 +122,23 @@ def test_mbo_cell_capa_update_pmf(dev, apdev):
     if sta['mbo_cell_capa'] != '3':
         raise Exception("mbo_cell_capa not updated properly")
 
+def test_mbo_wnm_token_wrap(dev, apdev):
+    """MBO WNM token wrap around"""
+    ssid = "test-wnm-mbo"
+    params = { 'ssid': ssid, 'mbo': '1' }
+    hapd = hostapd.add_ap(apdev[0], params)
+    bssid = apdev[0]['bssid']
+
+    dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412")
+
+    # Trigger transmission of 256 WNM-Notification frames to wrap around the
+    # 8-bit mbo_wnm_token counter.
+    for i in range(128):
+        if "OK" not in dev[0].request("SET mbo_cell_capa 1"):
+            raise Exception("Failed to set STA as cellular data capable")
+        if "OK" not in dev[0].request("SET mbo_cell_capa 3"):
+            raise Exception("Failed to set STA as cellular data not-capable")
+
 @remote_compatible
 def test_mbo_non_pref_chan(dev, apdev):
     """MBO non-preferred channel list"""