]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Skip new ap_ciphers tests cleanly for missing mac80211 debugfs
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 19 Oct 2017 20:32:26 +0000 (23:32 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 19 Oct 2017 20:32:26 +0000 (23:32 +0300)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_ap_ciphers.py

index 9ea9fcf1e01770727373ac6dbb2926785922544f..3f67962fdb8aced8585efda3505041a2ed23c4d0 100644 (file)
@@ -347,28 +347,34 @@ def test_ap_cipher_bip_req_mismatch(dev, apdev):
 
 def get_rx_spec(phy, gtk=False):
     keys = "/sys/kernel/debug/ieee80211/%s/keys" % (phy)
-    for key in os.listdir(keys):
-        keydir = keys + "/" + key
-        files = os.listdir(keydir)
-        if not gtk and "station" not in files:
-            continue
-        if gtk and "station" in files:
-            continue
-        with open(keydir + "/rx_spec") as f:
-            return f.read()
+    try:
+        for key in os.listdir(keys):
+            keydir = keys + "/" + key
+            files = os.listdir(keydir)
+            if not gtk and "station" not in files:
+                continue
+            if gtk and "station" in files:
+                continue
+            with open(keydir + "/rx_spec") as f:
+                return f.read()
+    except OSError, e:
+        raise HwsimSkip("debugfs not supported in mac80211")
     return None
 
 def get_tk_replay_counter(phy, gtk=False):
     keys = "/sys/kernel/debug/ieee80211/%s/keys" % (phy)
-    for key in os.listdir(keys):
-        keydir = keys + "/" + key
-        files = os.listdir(keydir)
-        if not gtk and "station" not in files:
-            continue
-        if gtk and "station" in files:
-            continue
-        with open(keydir + "/replays") as f:
-            return int(f.read())
+    try:
+        for key in os.listdir(keys):
+            keydir = keys + "/" + key
+            files = os.listdir(keydir)
+            if not gtk and "station" not in files:
+                continue
+            if gtk and "station" in files:
+                continue
+            with open(keydir + "/replays") as f:
+                return int(f.read())
+    except OSError, e:
+        raise HwsimSkip("debugfs not supported in mac80211")
     return None
 
 def test_ap_cipher_replay_protection_ap_ccmp(dev, apdev):