core-admin/run-tests

28 lines
892 B
Plaintext
Raw Normal View History

#!/bin/sh --
set -eu
sudo dnf -y install lvm2 python3-inotify python3-sphinx python3-docutils python3-PyYAML python3-jinja2 python3-lxml python3-pylint python3-coverage btrfs-progs vim-common
CLEANUP_LVM=
if sudo --non-interactive $(dirname "$0")/ci/lvm-manage setup-lvm vg$$/pool; then
export DEFAULT_LVM_POOL=vg$$/pool
CLEANUP_LVM=yes
fi
: "${PYTHON:=python3}"
: "${TESTPYTHONPATH:=test-packages}"
if [ -d ../core-qrexec/qrexec ] && ! $PYTHON -c 'import qrexec' 2>/dev/null; then
PYTHONPATH="${PYTHONPATH-}:../core-qrexec"
fi
PYTHONPATH="${TESTPYTHONPATH}:${PYTHONPATH}"
export PYTHONPATH
"${PYTHON}" setup.py egg_info --egg-base "${TESTPYTHONPATH}"
"${PYTHON}" -m coverage run --rcfile=ci/coveragerc -m qubes.tests.run "$@"
retcode=$?
if [ -n "$CLEANUP_LVM" ]; then
sudo --non-interactive $(dirname "$0")/ci/lvm-manage cleanup-lvm "$DEFAULT_LVM_POOL"
fi
exit $retcode