tests: More SET_NEIGHBOR and REMOVE_NEIGHBOR error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2016-12-27 20:46:10 +02:00
parent d8fae7bc12
commit d620ae2f54

View file

@ -69,6 +69,14 @@ def test_rrm_neighbor_db(dev, apdev):
if "FAIL" not in hapd.request("SET_NEIGHBOR 00:11:22:33:44:55 ssid=\"test1\" nr=" + nr[:-1]): if "FAIL" not in hapd.request("SET_NEIGHBOR 00:11:22:33:44:55 ssid=\"test1\" nr=" + nr[:-1]):
raise Exception("Set neighbor succeeded unexpectedly") raise Exception("Set neighbor succeeded unexpectedly")
# Invalid lci
if "FAIL" not in hapd.request("SET_NEIGHBOR 00:11:22:33:44:55 ssid=\"test1\" nr=" + nr + " lci=1"):
raise Exception("Set neighbor succeeded unexpectedly")
# Invalid civic
if "FAIL" not in hapd.request("SET_NEIGHBOR 00:11:22:33:44:55 ssid=\"test1\" nr=" + nr + " civic=1"):
raise Exception("Set neighbor succeeded unexpectedly")
# No entry yet in database # No entry yet in database
if "FAIL" not in hapd.request("REMOVE_NEIGHBOR 00:11:22:33:44:55 ssid=\"test1\""): if "FAIL" not in hapd.request("REMOVE_NEIGHBOR 00:11:22:33:44:55 ssid=\"test1\""):
raise Exception("Remove neighbor succeeded unexpectedly") raise Exception("Remove neighbor succeeded unexpectedly")
@ -121,6 +129,18 @@ def test_rrm_neighbor_db(dev, apdev):
if "OK" not in hapd.request("REMOVE_NEIGHBOR 00:11:22:33:44:55 ssid=\"test3\""): if "OK" not in hapd.request("REMOVE_NEIGHBOR 00:11:22:33:44:55 ssid=\"test3\""):
raise Exception("Remove neighbor failed") raise Exception("Remove neighbor failed")
# Invalid remove - bad BSSID
if "FAIL" not in hapd.request("REMOVE_NEIGHBOR 00:11:22:33:44:5 ssid=\"test1\""):
raise Exception("Remove neighbor succeeded unexpectedly")
# Invalid remove - bad SSID
if "FAIL" not in hapd.request("REMOVE_NEIGHBOR 00:11:22:33:44:55 ssid=\"test1"):
raise Exception("Remove neighbor succeeded unexpectedly")
# Invalid remove - missing SSID
if "FAIL" not in hapd.request("REMOVE_NEIGHBOR 00:11:22:33:44:55"):
raise Exception("Remove neighbor succeeded unexpectedly")
def test_rrm_neighbor_rep_req(dev, apdev): def test_rrm_neighbor_rep_req(dev, apdev):
"""wpa_supplicant ctrl_iface NEIGHBOR_REP_REQUEST""" """wpa_supplicant ctrl_iface NEIGHBOR_REP_REQUEST"""
nr1="00112233445500000000510107" nr1="00112233445500000000510107"