]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: RADIUS MAC ACL and server unreachable
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 8 Feb 2017 15:41:21 +0000 (17:41 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 8 Feb 2017 21:48:20 +0000 (23:48 +0200)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_radius.py

index 6168885a6568495c498ad5770a48b48bb6bfbf20..4bb003b72e54909d4ba9adaa8b3ecedcd82ac451 100644 (file)
@@ -904,6 +904,30 @@ def test_radius_macacl_oom(dev, apdev):
     with alloc_fail(hapd, 2, "=hostapd_allowed_address"):
         dev[2].connect("radius", key_mgmt="NONE", scan_freq="2412")
 
+def test_radius_macacl_unreachable(dev, apdev):
+    """RADIUS MAC ACL and server unreachable"""
+    params = hostapd.radius_params()
+    params['auth_server_port'] = "18139"
+    params["ssid"] = "radius"
+    params["macaddr_acl"] = "2"
+    hapd = hostapd.add_ap(apdev[0], params)
+    bssid = hapd.own_addr()
+
+    dev[0].scan_for_bss(bssid, freq="2412")
+    dev[0].connect("radius", key_mgmt="NONE", scan_freq="2412",
+                   wait_connect=False)
+    ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=3)
+    if ev is not None:
+        raise Exception("Unexpected connection")
+
+    logger.info("Fix authentication server port")
+    hapd.set("auth_server_port", "1812")
+    hapd.disable()
+    hapd.enable()
+    dev[0].wait_connected()
+    dev[0].request("DISCONNECT")
+    dev[0].wait_disconnected()
+
 def test_radius_failover(dev, apdev):
     """RADIUS Authentication and Accounting server failover"""
     subprocess.call(['ip', 'ro', 'replace', '192.168.213.17', 'dev', 'lo'])