diff --git a/tests/hwsim/run-all.sh b/tests/hwsim/run-all.sh index 75c3a58b5..bee753bb6 100755 --- a/tests/hwsim/run-all.sh +++ b/tests/hwsim/run-all.sh @@ -134,7 +134,7 @@ if [ "$(id -u)" != 0 ]; then else SUDO= fi -${SUDO} ./run-tests.py -D --logdir "$LOGDIR" $TRACE_ARGS -q $DB $RUN_TEST_ARGS || errors=1 +${SUDO} env VM=$VM ./run-tests.py -D --logdir "$LOGDIR" $TRACE_ARGS -q $DB $RUN_TEST_ARGS || errors=1 ./stop.sh diff --git a/tests/hwsim/utils.py b/tests/hwsim/utils.py index d01e1fbbf..7e3608284 100644 --- a/tests/hwsim/utils.py +++ b/tests/hwsim/utils.py @@ -79,10 +79,8 @@ def wait_fail_trigger(dev, cmd, note="Failure not triggered", max_iter=40, time.sleep(timeout) 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") + if os.getenv('VM') != 'VM': + raise HwsimSkip("Not running under VM") def iface_is_in_bridge(bridge, ifname): fname = "/sys/class/net/"+ifname+"/brport/bridge"