summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2019-03-12 22:44:25 +0100
committerLennart Poettering <lennart@poettering.net>2019-03-13 10:30:25 +0100
commit3f50fff536d715aee5e5195ec60e2af047b73c7f (patch)
tree6d9886f8ed9856a0e2f594aa5cd25b4c2a961b82
parentMerge pull request #11861 from yuwata/network-verify-2 (diff)
downloadsystemd-3f50fff536d715aee5e5195ec60e2af047b73c7f.tar.xz
systemd-3f50fff536d715aee5e5195ec60e2af047b73c7f.zip
test: don't overwrite TESTDIR if already set
Diffstat (limited to '')
-rw-r--r--test/test-functions9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test-functions b/test/test-functions
index d8a3502a4a..2f88be058b 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -817,8 +817,13 @@ inst_libs() {
import_testdir() {
[[ -e $STATEFILE ]] && . $STATEFILE
- if [[ -z "$TESTDIR" ]] || [[ ! -d "$TESTDIR" ]]; then
- TESTDIR=$(mktemp --tmpdir=/var/tmp -d -t systemd-test.XXXXXX)
+ if [[ ! -d "$TESTDIR" ]]; then
+ if [[ -z "$TESTDIR" ]]; then
+ TESTDIR=$(mktemp --tmpdir=/var/tmp -d -t systemd-test.XXXXXX)
+ else
+ mkdir -p "$TESTDIR"
+ fi
+
echo "TESTDIR=\"$TESTDIR\"" > $STATEFILE
export TESTDIR
fi