tests: AP Channel Switch - invalid channel
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
0215543103
commit
dd73d9a843
1 changed files with 11 additions and 1 deletions
|
@ -17,7 +17,7 @@ def connect(dev, apdev, **kwargs):
|
||||||
"channel": "1" }
|
"channel": "1" }
|
||||||
params.update(kwargs)
|
params.update(kwargs)
|
||||||
ap = hostapd.add_ap(apdev[0]['ifname'], params)
|
ap = hostapd.add_ap(apdev[0]['ifname'], params)
|
||||||
dev.connect("ap-csa", key_mgmt="NONE")
|
dev.connect("ap-csa", key_mgmt="NONE", scan_freq="2412")
|
||||||
return ap
|
return ap
|
||||||
|
|
||||||
def switch_channel(ap, count, freq):
|
def switch_channel(ap, count, freq):
|
||||||
|
@ -119,3 +119,13 @@ def test_ap_csa_ecsa_only(dev, apdev):
|
||||||
hwsim_utils.test_connectivity(dev[0], ap)
|
hwsim_utils.test_connectivity(dev[0], ap)
|
||||||
switch_channel(ap, 10, 2462)
|
switch_channel(ap, 10, 2462)
|
||||||
hwsim_utils.test_connectivity(dev[0], ap)
|
hwsim_utils.test_connectivity(dev[0], ap)
|
||||||
|
|
||||||
|
def test_ap_csa_invalid(dev, apdev):
|
||||||
|
"""AP Channel Switch - invalid channel"""
|
||||||
|
csa_supported(dev[0])
|
||||||
|
ap = connect(dev[0], apdev)
|
||||||
|
|
||||||
|
vals = [ 2461, 4900, 4901, 5181, 5746, 5699, 5895, 5899 ]
|
||||||
|
for val in vals:
|
||||||
|
if "FAIL" not in ap.request("CHAN_SWITCH 1 %d" % val):
|
||||||
|
raise Exception("Invalid channel accepted: %d" % val)
|
||||||
|
|
Loading…
Reference in a new issue