]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Open mode connection and SELECT_NETWORK to change network
authorJouni Malinen <j@w1.fi>
Sun, 1 Mar 2015 13:56:11 +0000 (15:56 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 1 Mar 2015 13:56:11 +0000 (15:56 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_open.py

index ebada4c3bff106021e7c335fc4220692189b9f24..e8b5c184aa07bc76efdae9a8578489f644018426 100644 (file)
@@ -390,3 +390,29 @@ def test_ap_open_disconnect_in_ps(dev, apdev, params):
                 state = 2
         if state != 2:
             raise Exception("Didn't observe TIM bit getting set and unset (state=%d)" % state)
+
+def test_ap_open_select_network(dev, apdev):
+    """Open mode connection and SELECT_NETWORK to change network"""
+    hapd1 = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "open" })
+    bssid1 = apdev[0]['bssid']
+    hapd2 = hostapd.add_ap(apdev[1]['ifname'], { "ssid": "open2" })
+    bssid2 = apdev[1]['bssid']
+
+    id1 = dev[0].connect("open", key_mgmt="NONE", scan_freq="2412",
+                         only_add_network=True)
+    id2 = dev[0].connect("open2", key_mgmt="NONE", scan_freq="2412")
+    hwsim_utils.test_connectivity(dev[0], hapd2)
+
+    dev[0].select_network(id1)
+    dev[0].wait_connected()
+    res = dev[0].request("BLACKLIST")
+    if bssid1 in res or bssid2 in res:
+        raise Exception("Unexpected blacklist entry")
+    hwsim_utils.test_connectivity(dev[0], hapd1)
+
+    dev[0].select_network(id2)
+    dev[0].wait_connected()
+    hwsim_utils.test_connectivity(dev[0], hapd2)
+    res = dev[0].request("BLACKLIST")
+    if bssid1 in res or bssid2 in res:
+        raise Exception("Unexpected blacklist entry(2)")