diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2019-03-12 22:44:25 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-03-13 10:30:25 +0100 |
commit | 3f50fff536d715aee5e5195ec60e2af047b73c7f (patch) | |
tree | 6d9886f8ed9856a0e2f594aa5cd25b4c2a961b82 | |
parent | Merge pull request #11861 from yuwata/network-verify-2 (diff) | |
download | systemd-3f50fff536d715aee5e5195ec60e2af047b73c7f.tar.xz systemd-3f50fff536d715aee5e5195ec60e2af047b73c7f.zip |
test: don't overwrite TESTDIR if already set
Diffstat (limited to '')
-rw-r--r-- | test/test-functions | 9 |
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 |