Browse Source

tests: OLBC state clearing on timeout

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 11 years ago
parent
commit
9645dbe9b2
1 changed files with 16 additions and 1 deletions
  1. 16 1
      tests/hwsim/test_ap_ht.py

+ 16 - 1
tests/hwsim/test_ap_ht.py

@@ -360,7 +360,8 @@ def test_olbc(dev, apdev):
     """OLBC detection"""
     params = { "ssid": "test-olbc",
                "channel": "6",
-               "ht_capab": "[HT40-]" }
+               "ht_capab": "[HT40-]",
+               "ap_table_expiration_time": "2" }
     hapd = hostapd.add_ap(apdev[0]['ifname'], params)
     status = hapd.get_status()
     if status['olbc'] != '0' or status['olbc_ht'] != '0':
@@ -376,6 +377,20 @@ def test_olbc(dev, apdev):
     if status['olbc'] != '1' or status['olbc_ht'] != '1':
         raise Exception("Missing OLBC information")
 
+    hapd_global = hostapd.HostapdGlobal()
+    hapd_global.remove(apdev[1]['ifname'])
+
+    logger.info("Waiting for OLBC state to time out")
+    cleared = False
+    for i in range(0, 15):
+        time.sleep(1)
+        status = hapd.get_status()
+        if status['olbc'] == '0' and status['olbc_ht'] == '0':
+            cleared = True
+            break
+    if not cleared:
+        raise Exception("OLBC state did nto time out")
+
 def test_olbc_5ghz(dev, apdev):
     """OLBC detection on 5 GHz"""
     try: