automation: Create temp dir for every test run

Signed-off-by: Ales Musil <amusil@redhat.com>
This commit is contained in:
Ales Musil 2020-03-12 09:29:12 +01:00 committed by Till Maas
parent a56249a393
commit df8bb8e944

View File

@ -27,6 +27,8 @@ PYTEST_OPTIONS="--verbose --verbose \
--cov /usr/lib/python*/site-packages/nmstatectl \
--cov-report=term"
NMSTATE_TEMPDIR=$(mktemp -d /tmp/nmstate-test-XXXX)
: ${CONTAINER_CMD:=podman}
test -t 1 && USE_TTY="-t"
@ -167,6 +169,7 @@ function run_exit {
dump_network_info
collect_artifacts
remove_container
remove_tempdir
}
function open_shell {
@ -227,6 +230,10 @@ function modprobe_ovs {
lsmod | grep -q ^openvswitch || modprobe openvswitch || { echo 1>&2 "Please run 'modprobe openvswitch' as root"; exit 1; }
}
function remove_tempdir {
rm -rf "$NMSTATE_TEMPDIR"
}
options=$(getopt --options "" \
--long customize:,pytest-args:,help,debug-shell,test-type:,el8,copr:,artifacts-dir:\
-- "${@}")