mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 10:13:34 +08:00
test/test-functions: add variables for several dir locations
This commit is contained in:
parent
1918406900
commit
42f3b48c97
@ -43,6 +43,12 @@ if ! ROOTLIBDIR=$(pkg-config --variable=systemdutildir systemd); then
|
||||
ROOTLIBDIR=/usr/lib/systemd
|
||||
fi
|
||||
|
||||
# The calling test.sh scripts have TEST_BASE_DIR set via their Makefile, but we don't need them to provide it
|
||||
TEST_BASE_DIR=${TEST_BASE_DIR:-$(realpath $(dirname "$BASH_SOURCE"))}
|
||||
TEST_UNITS_DIR="$TEST_BASE_DIR/units"
|
||||
SOURCE_DIR=$(realpath "$TEST_BASE_DIR/..")
|
||||
TOOLS_DIR="$SOURCE_DIR/tools"
|
||||
|
||||
PATH_TO_INIT=$ROOTLIBDIR/systemd
|
||||
[ "$SYSTEMD_JOURNALD" ] || SYSTEMD_JOURNALD=$(which -a $BUILD_DIR/systemd-journald $ROOTLIBDIR/systemd-journald 2>/dev/null | grep '^/' -m1)
|
||||
[ "$SYSTEMD_JOURNAL_REMOTE" ] || SYSTEMD_JOURNAL_REMOTE=$(which -a $BUILD_DIR/systemd-journal-remote $ROOTLIBDIR/systemd-journal-remote 2>/dev/null | grep '^/' -m1)
|
||||
@ -50,7 +56,13 @@ PATH_TO_INIT=$ROOTLIBDIR/systemd
|
||||
[ "$SYSTEMD_NSPAWN" ] || SYSTEMD_NSPAWN=$(which -a $BUILD_DIR/systemd-nspawn systemd-nspawn 2>/dev/null | grep '^/' -m1)
|
||||
[ "$JOURNALCTL" ] || JOURNALCTL=$(which -a $BUILD_DIR/journalctl journalctl 2>/dev/null | grep '^/' -m1)
|
||||
|
||||
STATEDIR="${BUILD_DIR:-.}/test/$(basename $(dirname $(realpath $0)))"
|
||||
TESTFILE=${BASH_SOURCE[1]}
|
||||
if [ -z "$TESTFILE" ]; then
|
||||
echo "ERROR: test-functions must be sourced from one of the TEST-*/test.sh scripts" >&2
|
||||
exit 1
|
||||
fi
|
||||
TESTNAME=$(basename $(dirname $(realpath $TESTFILE)))
|
||||
STATEDIR="$BUILD_DIR/test/$TESTNAME"
|
||||
STATEFILE="$STATEDIR/.testdir"
|
||||
IMAGESTATEDIR="$STATEDIR/.."
|
||||
TESTLOG="$STATEDIR/test.log"
|
||||
|
Loading…
Reference in New Issue
Block a user