]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Additional coverage for miscellaneous ctrl_iface commands
authorJouni Malinen <j@w1.fi>
Sat, 13 Dec 2014 17:30:21 +0000 (19:30 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 14 Dec 2014 00:28:02 +0000 (02:28 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_rfkill.py
tests/hwsim/test_wpas_ctrl.py

index 5043dea5f5799ad779d892509b1b65dc9f179332..6c66258b8efa59268b2aaa9f7939cf95e7a66ebf 100644 (file)
@@ -42,6 +42,13 @@ def test_rfkill_open(dev, apdev):
         if ev is None:
             raise Exception("Missing disconnection event on rfkill block")
 
+        if "FAIL" not in dev[0].request("REASSOCIATE"):
+            raise Exception("REASSOCIATE accepted while disabled")
+        if "FAIL" not in dev[0].request("REATTACH"):
+            raise Exception("REATTACH accepted while disabled")
+        if "FAIL" not in dev[0].request("RECONNECT"):
+            raise Exception("RECONNECT accepted while disabled")
+
         logger.info("rfkill unblock")
         subprocess.call(['sudo', 'rfkill', 'unblock', id])
         ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=10)
index a70a3fe087f4b340871db3e4d96b2ccc2b88642a..8d30a3aec508f18d03c054b42c6330dd5a05e54f 100644 (file)
@@ -1275,3 +1275,23 @@ def test_wpas_ctrl_vendor_elem(dev, apdev):
             raise Exception("Invalid VENDOR_ELEM_REMOVE command accepted: " + cmd)
     if "OK" not in dev[0].request("VENDOR_ELEM_REMOVE 1 000100"):
         raise Exception("VENDOR_ELEM_REMOVE failed")
+
+def test_wpas_ctrl_misc(dev, apdev):
+    """wpa_supplicant ctrl_iface and miscellaneous commands"""
+    if "OK" not in dev[0].request("RELOG"):
+        raise Exception("RELOG failed")
+    if dev[0].request("IFNAME") != dev[0].ifname:
+        raise Exception("IFNAME returned unexpected response")
+    if "FAIL" not in dev[0].request("REATTACH"):
+        raise Exception("REATTACH accepted while disabled")
+    if "OK" not in dev[2].request("RECONFIGURE"):
+        raise Exception("RECONFIGURE failed")
+    if "FAIL" in dev[0].request("INTERFACE_LIST"):
+        raise Exception("INTERFACE_LIST failed")
+    if "UNKNOWN COMMAND" not in dev[0].request("FOO"):
+        raise Exception("Unknown command accepted")
+
+    if "FAIL" not in dev[0].global_request("INTERFACE_REMOVE foo"):
+        raise Exception("Invalid INTERFACE_REMOVE accepted")
+    if "FAIL" not in dev[0].global_request("SET foo"):
+        raise Exception("Invalid global SET accepted")