diff --git a/tests/hwsim/bss-2-dup.conf b/tests/hwsim/bss-2-dup.conf new file mode 100644 index 000000000..9f63c9ddc --- /dev/null +++ b/tests/hwsim/bss-2-dup.conf @@ -0,0 +1,11 @@ +driver=nl80211 + +hw_mode=g +channel=1 +ieee80211n=1 + +interface=wlan3-2 +bssid=02:00:00:00:03:00 +ctrl_interface=/var/run/hostapd + +ssid=bss-2 diff --git a/tests/hwsim/test_ap_dynamic.py b/tests/hwsim/test_ap_dynamic.py index 33db463cf..c95ff602b 100644 --- a/tests/hwsim/test_ap_dynamic.py +++ b/tests/hwsim/test_ap_dynamic.py @@ -504,3 +504,32 @@ def _test_ap_iapp(dev, apdev): hapd.disable() hapd2.disable() + +def test_ap_duplicate_bssid(dev, apdev): + """Duplicate BSSID""" + params = { "ssid": "test" } + hapd = hostapd.add_ap(apdev[0], params, no_enable=True) + hapd.enable() + ifname2 = apdev[0]['ifname'] + '-2' + ifname3 = apdev[0]['ifname'] + '-3' + # "BSS 'wlan3-2' may not have BSSID set to the MAC address of the radio" + try: + hostapd.add_bss(apdev[0], ifname2, 'bss-2-dup.conf') + raise Exception("BSS add succeeded unexpectedly") + except Exception, e: + if "Could not add hostapd BSS" in str(e): + pass + else: + raise + + hostapd.add_bss(apdev[0], ifname3, 'bss-3.conf') + + dev[0].connect("test", key_mgmt="NONE", scan_freq="2412") + dev[0].request("DISCONNECT") + dev[0].wait_disconnected() + + hapd.set("bssid", "02:00:00:00:03:02") + hapd.disable() + # "Duplicate BSSID 02:00:00:00:03:02 on interface 'wlan3-3' and 'wlan3'." + if "FAIL" not in hapd.request("ENABLE"): + raise Exception("ENABLE with duplicate BSSID succeeded unexpectedly")