diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2015-02-02 00:19:29 +0100 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2015-02-03 09:50:45 +0100 |
commit | 3486cb6cfa3d32a95c0daf02c7510fdf372507bf (patch) | |
tree | ad8b2eacacc695fd387afa5c39c4ed11b07bfe77 /test | |
parent | 4be4833ece2856e0cacc09f8f8b2c02b320751fa (diff) |
tests: determine rootlibdir from pkg-config
Prefer asking pkg-config for the rootlibdir, to also support systems with
--enable-split-usr. Fall back to the hardcoded /usr/lib/systemd if that fails.
Diffstat (limited to 'test')
-rw-r--r-- | test/test-functions | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/test-functions b/test/test-functions index 91f3ecd52b..a0f1bf4eb2 100644 --- a/test/test-functions +++ b/test/test-functions @@ -7,6 +7,11 @@ export PATH KERNEL_VER=${KERNEL_VER-$(uname -r)} KERNEL_MODS="/lib/modules/$KERNEL_VER/" +if ! ROOTLIBDIR=$(pkg-config --variable=systemdutildir systemd); then + echo "WARNING! Cannot determine rootlibdir from pkg-config, assuming /usr/lib/systemd" >&2 + ROOTLIBDIR=/usr/lib/systemd +fi + BASICTOOLS="sh bash setsid loadkeys setfont login sulogin gzip sleep echo mount umount cryptsetup date dmsetup modprobe" DEBUGTOOLS="df free ls stty cat ps ln ip route dmesg dhclient mkdir cp ping dhclient strace less grep id tty touch du sort" @@ -47,7 +52,7 @@ run_qemu() { systemd.log_level=debug \ raid=noautodetect \ loglevel=2 \ -init=/usr/lib/systemd/systemd \ +init=$ROOTLIBDIR/systemd \ ro \ console=ttyS0 \ selinux=0 \ @@ -72,7 +77,7 @@ $KERNEL_APPEND \ run_nspawn() { set -x - ../../systemd-nspawn --boot --directory=$TESTDIR/nspawn-root /usr/lib/systemd/systemd $KERNEL_APPEND + ../../systemd-nspawn --boot --directory=$TESTDIR/nspawn-root $ROOTLIBDIR/systemd $KERNEL_APPEND } setup_basic_environment() { @@ -240,8 +245,8 @@ install_libnss() { } install_dbus() { - inst /usr/lib/systemd/system/dbus.socket - inst /usr/lib/systemd/system/dbus.service + inst $ROOTLIBDIR/system/dbus.socket + inst $ROOTLIBDIR/system/dbus.service find \ /etc/dbus-1 -xtype f \ |