]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Skip rrm_link_measurement tests if kernel support is not available
authorJouni Malinen <j@w1.fi>
Sat, 28 Jan 2017 22:48:16 +0000 (00:48 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 28 Jan 2017 23:32:25 +0000 (01:32 +0200)
rrm_link_measurement and rrm_link_measurement_oom test cases were
causing incorrect failures when executed with a kernel version that does
not modify mac80211_hwsim to support TX power insertion. Fix this by
checking for that capability and skipping the test cases if the kernel
does not support this.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_rrm.py

index 970cd82e644930348e0a0fdcce4218c3599a9116..09117a7044c84b88dcb0b94c9a5d98c614205e32 100644 (file)
@@ -23,6 +23,11 @@ def check_rrm_support(dev):
     if rrm & 0x5 != 0x5 and rrm & 0x10 != 0x10:
         raise HwsimSkip("Required RRM capabilities are not supported")
 
+def check_tx_power_support(dev):
+    rrm = int(dev.get_driver_status_field("capa.rrm_flags"), 16)
+    if rrm & 0x8 != 0x8:
+        raise HwsimSkip("Required RRM capabilities are not supported")
+
 nr="00112233445500000000510107"
 lci="01000800101298c0b512926666f6c2f1001c00004104050000c00012"
 civic="01000b0011223344556677889900998877665544332211aabbccddeeff"
@@ -1553,6 +1558,7 @@ def test_rrm_req_proto(dev, apdev):
 
 def test_rrm_link_measurement(dev, apdev):
     """Radio measurement request - link measurement"""
+    check_tx_power_support(dev[0])
     params = { "ssid": "rrm", "rrm_beacon_report": "1" }
     hapd = hostapd.add_ap(apdev[0]['ifname'], params)
     bssid = hapd.own_addr()
@@ -1573,6 +1579,7 @@ def test_rrm_link_measurement(dev, apdev):
 
 def test_rrm_link_measurement_oom(dev, apdev):
     """Radio measurement request - link measurement OOM"""
+    check_tx_power_support(dev[0])
     params = { "ssid": "rrm", "rrm_beacon_report": "1" }
     hapd = hostapd.add_ap(apdev[0]['ifname'], params)
     bssid = hapd.own_addr()