tests: Skip new ap_ciphers tests cleanly for missing mac80211 debugfs

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2017-10-19 23:32:26 +03:00 committed by Jouni Malinen
parent 1613e0121c
commit c9dc89968d

View file

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