diff --git a/tests/libtest.sh b/tests/libtest.sh index c5053b28..a72f3095 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -19,17 +19,22 @@ SRCDIR=$(dirname $0) _cleanup_tmpdir () { - if test -f ${test_tmpdir}.test; then - rm ${test_tmpdir} -rf + if test -f ${test_tmpdir}/.test; then + rm ${test_tmpdir} -rf fi } + +# If we're running as a local test (i.e. through `make check`), then +# UNINSTALLEDTESTS=1. Otherwise (i.e. as an installed test), it's undefined, in +# which case we're already in a tmpdir. if test -n "${UNINSTALLEDTESTS:-}"; then test_tmpdir=$(mktemp -d test.XXXXXX) touch ${test_tmpdir}/.test trap _cleanup_tmpdir EXIT cd ${test_tmpdir} export PATH=${builddir}:${PATH} -fi +fi + test_tmpdir=$(pwd) export G_DEBUG=fatal-warnings diff --git a/tests/setup-session.sh.in b/tests/setup-session.sh.in index 044c3d60..26ad661a 100755 --- a/tests/setup-session.sh.in +++ b/tests/setup-session.sh.in @@ -19,12 +19,14 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -test_tmpdir=$(pwd) +set -e + +. $(dirname $0)/libtest.sh exec_binary="@LIBEXECDIR@/rpm-ostreed" -mkdir sysroot -mkdir session-services +mkdir -p sysroot +mkdir -p session-services # Create a busconfig file with a custom cat > session.conf <