]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Skip radius_acct_unreachable3 when not running under VM
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 2 Mar 2015 14:30:13 +0000 (16:30 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 2 Mar 2015 14:30:13 +0000 (16:30 +0200)
It looks like the IP routing table changes used here to trigger
unreachability and following reachability of the server do not work very
well with full IP routing configuration, so run this test case only when
executed under vm-run.sh.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_radius.py
tests/hwsim/utils.py

index 75540fc77ef74e6f6743d61345d873c592dab65e..891d6819f198f38739a957efeb35bef8f48aa4c8 100644 (file)
@@ -16,7 +16,7 @@ import threading
 import time
 
 import hostapd
-from utils import HwsimSkip
+from utils import HwsimSkip, require_under_vm
 
 def connect(dev, ssid, wait_connect=True):
     dev.connect(ssid, key_mgmt="WPA-EAP", scan_freq="2412",
@@ -124,6 +124,7 @@ def test_radius_acct_unreachable2(dev, apdev):
 
 def test_radius_acct_unreachable3(dev, apdev):
     """RADIUS Accounting server initially unreachable, but then available"""
+    require_under_vm()
     subprocess.call(['ip', 'ro', 'replace', 'blackhole', '192.168.213.18'])
     as_hapd = hostapd.Hostapd("as")
     as_mib_start = as_hapd.get_mib(param="radius_server")
index cd71365ba26a80e2c9f79ff98fa22edb88ecca14..43dd331774446f751ed1d826f0b1a1e24ef20252 100644 (file)
@@ -33,3 +33,9 @@ class alloc_fail(object):
         if type is None:
             if self._dev.request("GET_ALLOC_FAIL") != "0:%s" % self._funcs:
                 raise Exception("Allocation failure did not trigger")
+
+def require_under_vm():
+    with open('/proc/1/cmdline', 'r') as f:
+        cmd = f.read()
+        if "inside.sh" not in cmd:
+            raise HwsimSkip("Not running under VM")