From 045a24273ec461cb48ef784eb91fb24f6cc018c0 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 7 Feb 2021 10:10:46 +0200 Subject: [PATCH] tests: MAC ACL accept list changes Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_params.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/hwsim/test_ap_params.py b/tests/hwsim/test_ap_params.py index 0d14e2b70..07351272a 100644 --- a/tests/hwsim/test_ap_params.py +++ b/tests/hwsim/test_ap_params.py @@ -254,6 +254,29 @@ def test_ap_acl_mgmt(dev, apdev): if filename.startswith('/tmp/'): os.unlink(filename) +def test_ap_acl_accept_changes(dev, apdev): + """MAC ACL accept list changes""" + ssid = "acl" + params = {} + params['ssid'] = ssid + params['macaddr_acl'] = "1" + hapd = hostapd.add_ap(apdev[0], params) + hapd.request("ACCEPT_ACL ADD_MAC " + dev[0].own_addr()) + hapd.request("ACCEPT_ACL ADD_MAC " + dev[1].own_addr()) + dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412") + dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412") + dev[1].scan_for_bss(apdev[0]['bssid'], freq="2412") + dev[1].connect(ssid, key_mgmt="NONE", scan_freq="2412") + hapd.request("ACCEPT_ACL DEL_MAC " + dev[0].own_addr()) + dev[0].wait_disconnected() + dev[0].request("DISCONNECT") + ev = dev[1].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=0.1) + if ev is not None: + raise Exception("Unexpected disconnection") + hapd.request("ACCEPT_ACL CLEAR") + dev[1].wait_disconnected() + dev[1].request("DISCONNECT") + @remote_compatible def test_ap_wds_sta(dev, apdev): """WPA2-PSK AP with STA using 4addr mode"""