tests: Static MAC ACL
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
a4292b3f3b
commit
656a3ef276
2 changed files with 33 additions and 0 deletions
1
tests/hwsim/hostapd.macaddr
Normal file
1
tests/hwsim/hostapd.macaddr
Normal file
|
@ -0,0 +1 @@
|
|||
02:00:00:00:00:00
|
|
@ -71,3 +71,35 @@ def test_ap_country(dev, apdev):
|
|||
hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
|
||||
finally:
|
||||
subprocess.call(['sudo', 'iw', 'reg', 'set', '00'])
|
||||
|
||||
def test_ap_acl_accept(dev, apdev):
|
||||
"""MAC ACL accept list"""
|
||||
ssid = "acl"
|
||||
params = {}
|
||||
params['ssid'] = ssid
|
||||
params['accept_mac_file'] = "hostapd.macaddr"
|
||||
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
|
||||
dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412")
|
||||
dev[1].connect(ssid, key_mgmt="NONE", scan_freq="2412")
|
||||
dev[0].request("REMOVE_NETWORK all")
|
||||
dev[1].request("REMOVE_NETWORK all")
|
||||
hapd.request("SET macaddr_acl 1")
|
||||
dev[1].dump_monitor()
|
||||
dev[1].connect(ssid, key_mgmt="NONE", scan_freq="2412", wait_connect=False)
|
||||
dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412")
|
||||
ev = dev[1].wait_event(["CTRL-EVENT-CONNECTED"], timeout=1)
|
||||
if ev is not None:
|
||||
raise Exception("Unexpected association")
|
||||
|
||||
def test_ap_acl_deny(dev, apdev):
|
||||
"""MAC ACL deny list"""
|
||||
ssid = "acl"
|
||||
params = {}
|
||||
params['ssid'] = ssid
|
||||
params['deny_mac_file'] = "hostapd.macaddr"
|
||||
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
|
||||
dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412", wait_connect=False)
|
||||
dev[1].connect(ssid, key_mgmt="NONE", scan_freq="2412")
|
||||
ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=1)
|
||||
if ev is not None:
|
||||
raise Exception("Unexpected association")
|
||||
|
|
Loading…
Reference in a new issue