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")