[PATCH 02/14] tests: Skip wpas_ap_dfs() test if DFS is not supported

Ilan Peer ilan.peer
Wed Oct 14 08:43:08 PDT 2015


From: Avraham Stern <avraham.stern at intel.com>

Skip wpas_ap_dfs on kernel builds that do not support DFS.

Signed-off-by: Avraham Stern <avraham.stern at intel.com>
---
 tests/hwsim/test_wpas_ap.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/hwsim/test_wpas_ap.py b/tests/hwsim/test_wpas_ap.py
index 53de399..50ebce5 100644
--- a/tests/hwsim/test_wpas_ap.py
+++ b/tests/hwsim/test_wpas_ap.py
@@ -4,6 +4,7 @@
 # This software may be distributed under the terms of the BSD license.
 # See README for more details.
 
+import os
 import time
 import logging
 logger = logging.getLogger()
@@ -302,6 +303,13 @@ def _test_wpas_ap_dfs(dev):
         # For now, assume DFS is not supported by all kernel builds.
         raise HwsimSkip("CAC did not start - assume not supported")
 
+    state = dev[0].get_status_field("wpa_state")
+    if state != "DFS":
+	logger.info("Interface state not DFS: " + state)
+	if not os.path.exists("dfs"):
+	    raise HwsimSkip("Assume DFS testing not supported")
+	raise Exception("Failed to start DFS AP")
+
     ev = dev[0].wait_event(["DFS-CAC-COMPLETED"], timeout=70)
     if ev is None:
         raise Exception("CAC did not complete")
-- 
1.9.1




More information about the Hostap mailing list