3 # Test cases for HT operations with hostapd
4 # Copyright (c) 2013, Jouni Malinen <j@w1.fi>
6 # This software may be distributed under the terms of the BSD license.
7 # See README for more details.
11 logger = logging.getLogger()
15 def test_ap_ht40_scan(dev, apdev):
17 params = { "ssid": "test-ht40",
19 "ht_capab": "[HT40-]"}
20 hapd = hostapd.add_ap(apdev[0]['ifname'], params)
22 state = hapd.get_status_field("state")
23 if state != "HT_SCAN":
25 state = hapd.get_status_field("state")
26 if state != "HT_SCAN":
27 raise Exception("Unexpected interface state - expected HT_SCAN")
29 ev = hapd.wait_event(["AP-ENABLED"], timeout=10)
31 raise Exception("AP setup timed out")
33 state = hapd.get_status_field("state")
34 if state != "ENABLED":
35 raise Exception("Unexpected interface state - expected ENABLED")
37 freq = hapd.get_status_field("freq")
39 raise Exception("Unexpected frequency")
40 pri = hapd.get_status_field("channel")
42 raise Exception("Unexpected primary channel")
43 sec = hapd.get_status_field("secondary_channel")
45 raise Exception("Unexpected secondary channel")
47 dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)