tests: DRIVER_FLAGS command
authorJouni Malinen <j@w1.fi>
Sat, 23 Jul 2016 17:51:55 +0000 (20:51 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 23 Jul 2016 17:51:55 +0000 (20:51 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_wpas_ctrl.py

index aff58b0..96ed551 100644 (file)
@@ -1958,3 +1958,18 @@ def test_wpas_ctrl_p2p_listen_offload(dev, apdev):
     dev[0].request("P2P_LO_START 2412")
     dev[0].request("P2P_LO_START 2412 100 200 3")
     dev[0].request("P2P_LO_STOP")
+
+def test_wpas_ctrl_driver_flags(dev, apdev):
+    """DRIVER_FLAGS command"""
+    params = hostapd.wpa2_params(ssid="test", passphrase="12345678")
+    hapd = hostapd.add_ap(apdev[0], params)
+    hapd_flags = hapd.request("DRIVER_FLAGS")
+    wpas_flags = dev[0].request("DRIVER_FLAGS")
+    if "FAIL" in hapd_flags:
+        raise Exception("DRIVER_FLAGS failed")
+    if hapd_flags != wpas_flags:
+        raise Exception("Unexpected difference in hostapd vs. wpa_supplicant DRIVER_FLAGS output")
+    logger.info("DRIVER_FLAGS: " + hapd_flags)
+    flags = hapd_flags.split('\n')
+    if 'AP' not in flags:
+        raise Exception("AP flag missing from DRIVER_FLAGS")