It is possible to execute the tests directly inside the a VM without
necessarily running the repository wrapper script to do so. In these
cases, passing the VM flag using an environment variable allows
correctly flagging this fact to the tests.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
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
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"