From: Jouni Malinen Date: Mon, 2 Mar 2015 14:30:13 +0000 (+0200) Subject: tests: Skip radius_acct_unreachable3 when not running under VM X-Git-Tag: hostap_2_4~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96cbb7b56196e4e10e73449bea0f600b6c5b661b;p=thirdparty%2Fhostap.git 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 --- 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")