]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Allow fallback to 20 MHz in ap_ht40_5ghz_invalid_pair
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 5 Feb 2016 15:51:24 +0000 (17:51 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 5 Feb 2016 15:51:24 +0000 (17:51 +0200)
This test case for enforcing that AP setup fails in case there is need
to fall back to 20 MHz channel due to invalid 40 MHz configuration.
Modify this to allow successful AP startup as long as 40 MHz channel
does not get enabled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_ap_ht.py

index 001e7224a14ed92a191f2af5e16b46ef86dad806..c33cb1aea95318d9be001bcaa31bf9938a65fda7 100644 (file)
@@ -1123,8 +1123,12 @@ def test_ap_ht40_5ghz_invalid_pair(dev, apdev):
                    "country_code": "US",
                    "ht_capab": "[HT40+]"}
         hapd = hostapd.add_ap(apdev[1]['ifname'], params, wait_enabled=False)
-        ev = hapd.wait_event(["AP-DISABLED"], timeout=10)
+        ev = hapd.wait_event(["AP-DISABLED", "AP-ENABLED"], timeout=10)
         if not ev:
             raise Exception("AP setup failure timed out")
+        if "AP-ENABLED" in ev:
+            sec = hapd.get_status_field("secondary_channel")
+            if sec != "0":
+                raise Exception("Invalid 40 MHz channel accepted")
     finally:
         subprocess.call(['iw', 'reg', 'set', '00'])