From 96cbb7b56196e4e10e73449bea0f600b6c5b661b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 2 Mar 2015 16:30:13 +0200 Subject: [PATCH] tests: Skip radius_acct_unreachable3 when not running under VM 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 --- tests/hwsim/test_radius.py | 3 ++- tests/hwsim/utils.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_radius.py b/tests/hwsim/test_radius.py index 75540fc77..891d6819f 100644 --- a/tests/hwsim/test_radius.py +++ b/tests/hwsim/test_radius.py @@ -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") diff --git a/tests/hwsim/utils.py b/tests/hwsim/utils.py index cd71365ba..43dd33177 100644 --- a/tests/hwsim/utils.py +++ b/tests/hwsim/utils.py @@ -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") -- 2.47.3