From 1b3926ef73f18b82d4525fe5f1741add7349b358 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 3 Nov 2013 21:00:49 +0200 Subject: [PATCH] tests: Add a test case for HT40 co-ex scan Signed-hostap: Jouni Malinen --- tests/hwsim/test_ap_ht.py | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tests/hwsim/test_ap_ht.py diff --git a/tests/hwsim/test_ap_ht.py b/tests/hwsim/test_ap_ht.py new file mode 100644 index 000000000..5ab6fe9ee --- /dev/null +++ b/tests/hwsim/test_ap_ht.py @@ -0,0 +1,47 @@ +#!/usr/bin/python +# +# Test cases for HT operations with hostapd +# Copyright (c) 2013, Jouni Malinen +# +# This software may be distributed under the terms of the BSD license. +# See README for more details. + +import time +import logging +logger = logging.getLogger() + +import hostapd + +def test_ap_ht40_scan(dev, apdev): + """HT40 co-ex scan""" + params = { "ssid": "test-ht40", + "channel": "5", + "ht_capab": "[HT40-]"} + hapd = hostapd.add_ap(apdev[0]['ifname'], params) + + state = hapd.get_status_field("state") + if state != "HT_SCAN": + time.wait(0.1) + state = hapd.get_status_field("state") + if state != "HT_SCAN": + raise Exception("Unexpected interface state - expected HT_SCAN") + + ev = hapd.wait_event(["AP-ENABLED"], timeout=10) + if not ev: + raise Exception("AP setup timed out") + + state = hapd.get_status_field("state") + if state != "ENABLED": + raise Exception("Unexpected interface state - expected ENABLED") + + freq = hapd.get_status_field("freq") + if freq != "2432": + raise Exception("Unexpected frequency") + pri = hapd.get_status_field("channel") + if pri != "5": + raise Exception("Unexpected primary channel") + sec = hapd.get_status_field("secondary_channel") + if sec != "-1": + raise Exception("Unexpected secondary channel") + + dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)