From ce5d69ac416a143e08a974413e7c0b749c5030b2 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 14 Apr 2014 00:38:37 +0300 Subject: [PATCH] tests: Work around mac80211_hwsim survey limitations ap_multi_bss_acs test case was failing if it was executed immediately after a test case that used 5 GHz band since the current mac80211_hwsim channel survey implementation is very limited and reports only a single channel. For this test case, that channel has to be from the 2.4 GHz band. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_acs.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_acs.py b/tests/hwsim/test_ap_acs.py index 246d21135..dd506c130 100644 --- a/tests/hwsim/test_ap_acs.py +++ b/tests/hwsim/test_ap_acs.py @@ -1,5 +1,5 @@ # Test cases for automatic channel selection with hostapd -# Copyright (c) 2013, Jouni Malinen +# Copyright (c) 2013-2014, Jouni Malinen # # This software may be distributed under the terms of the BSD license. # See README for more details. @@ -7,6 +7,7 @@ import logging logger = logging.getLogger() import subprocess +import time import hostapd @@ -55,6 +56,15 @@ def test_ap_acs(dev, apdev): def test_ap_multi_bss_acs(dev, apdev): """hostapd start with a multi-BSS configuration file using ACS""" ifname = apdev[0]['ifname'] + + # make sure the current channel is on 2.4 GHz band as a workaround for the + # limited survey functionality in mac80211_hwsim + hostapd.add_ap(ifname, { "ssid": "test" }) + time.sleep(0.1) + hapd_global = hostapd.HostapdGlobal() + hapd_global.remove(ifname) + + # start the actual test hostapd.add_iface(ifname, 'multi-bss-acs.conf') hapd = hostapd.Hostapd(ifname) hapd.enable()