mirror of
https://github.com/systemd/systemd.git
synced 2025-02-27 01:57:35 +03:00
test: $STATEDIR should not point to /usr/lib/systemd/tests when NO_BUILD=1
When testing the binaries from the host, make sure to not store the state data below /usr but use a dedicated directory in /var/tmp/ instead. The working directories of the tests, initially located in /var/tmp, are also moved in a dedicated directory /var/tmp/systemd-tests.
This commit is contained in:
parent
89de1d983e
commit
0c566150c8
@ -133,7 +133,14 @@ if [ -z "$TESTFILE" ]; then
|
||||
exit 1
|
||||
fi
|
||||
TESTNAME="$(basename "$(dirname "$(realpath "$TESTFILE")")")"
|
||||
STATEDIR="$BUILD_DIR/test/$TESTNAME"
|
||||
|
||||
WORKDIR="/var/tmp/systemd-tests"
|
||||
if get_bool "${NO_BUILD:=}"; then
|
||||
STATEDIR="$WORKDIR/$TESTNAME"
|
||||
else
|
||||
STATEDIR="$BUILD_DIR/test/$TESTNAME"
|
||||
fi
|
||||
|
||||
STATEFILE="$STATEDIR/.testdir"
|
||||
IMAGESTATEDIR="$STATEDIR/.."
|
||||
TESTLOG="$STATEDIR/test.log"
|
||||
@ -2228,7 +2235,7 @@ import_testdir() {
|
||||
LOOPDEV="$_LOOPDEV"
|
||||
if [[ ! -d "$TESTDIR" ]]; then
|
||||
if [[ -z "$TESTDIR" ]]; then
|
||||
TESTDIR="$(mktemp --tmpdir=/var/tmp -d -t systemd-test.XXXXXX)"
|
||||
TESTDIR="$(mktemp --tmpdir=$WORKDIR -d -t systemd-test.XXXXXX)"
|
||||
else
|
||||
mkdir -p "$TESTDIR"
|
||||
fi
|
||||
@ -3190,6 +3197,7 @@ do_test() {
|
||||
[[ -d $usrlibdir ]] && libdirs+=" $usrlibdir" && break
|
||||
done
|
||||
|
||||
mkdir -p "$WORKDIR"
|
||||
mkdir -p "$STATEDIR"
|
||||
|
||||
import_testdir
|
||||
|
Loading…
x
Reference in New Issue
Block a user