tests: always clean the test directory

previously the test directory could have been left untouched before executing
a test when `init.sh` was not run - and sometimes it isn't
supposed to be run - which made the test suite highly stateful and thus
behaving surprisingly on multiple runs.
This commit is contained in:
Valentin Gagarin 2024-05-13 14:56:14 +02:00
parent 33ca905cdb
commit 7822ecbadf

View file

@ -1,10 +1,8 @@
test -n "$TEST_ROOT"
if test -d "$TEST_ROOT"; then
chmod -R u+rw "$TEST_ROOT"
# We would delete any daemon socket, so let's stop the daemon first.
killDaemon
rm -rf "$TEST_ROOT"
fi
# We would delete any daemon socket, so let's stop the daemon first.
killDaemon
# Destroy the test directory that may have persisted from previous runs
rm -rf "$TEST_ROOT"
mkdir -p "$TEST_ROOT"
mkdir "$TEST_HOME"