$(INSTALL_DATA) shell/*.sh $(DATADIR)/shell
$(INSTALL_DATA) api/*.sh $(DATADIR)/api
$(INSTALL_PROGRAM) api/*.{t,py} $(DATADIR)/api
+ $(INSTALL_PROGRAM) dbus/*.py $(DATADIR)/dbus/
$(INSTALL_DATA) lib/paths-installed $(DATADIR)/lib/paths
cd lib && $(INSTALL_DATA) \
$(LIB_FLAVOURS) \
$(RM) $@-t
cat lib/paths-common > $@-t
echo 'installed_testsuite=1' >> $@-t
+ echo 'test_data_dir="@datadir@/lvm2-testsuite"' >> $@-t
echo 'export PATH=@libexecdir@/lvm2-testsuite:@datadir@/lvm2-testsuite/lib:@datadir@/lvm2-testsuite/api:$$PATH' >> $@-t
mv $@-t $@
lib/paths: lib/paths-common
$(RM) $@-t
cat lib/paths-common > $@-t
+ echo 'test_data_dir="$(abs_top_builddir)/test"' >> $@-t
echo 'top_srcdir="$(top_srcdir)"' >> $@-t
echo 'abs_top_builddir="$(abs_top_builddir)"' >> $@-t
echo 'abs_top_srcdir="$(abs_top_srcdir)"' >> $@-t
install -m 644 $abs_top_builddir/scripts/com.redhat.lvmdbus1.conf /etc/dbus-1/system.d/.
fi
-# Setup the python path so we can run
-export PYTHONPATH=$abs_top_builddir/daemons
-
aux prepare_lvmdbusd
-$abs_top_builddir/test/dbus/lvmdbustest.py -v
+$test_data_dir/dbus/lvmdbustest.py -v
}
prepare_lvmdbusd() {
+ local daemon=
rm -f debug.log_LVMDBUSD_out
+ kill_sleep_kill_ LOCAL_LVMDBUSD 0
+
echo "checking lvmdbusd is NOT running..."
if ps -elf | grep lvmdbusd | grep python3; then
echo "Cannot run while existing lvmdbusd process exists"
echo ok
# skip if we don't have our own lvmdbusd...
- # NOTE: this is always present - additional checks are needed:
- [[ -x $abs_top_builddir/daemons/lvmdbusd/lvmdbusd ]] || skip
+ if test -z "${installed_testsuite+varset}"; then
+ # NOTE: this is always present - additional checks are needed:
+ daemon="$abs_top_builddir/daemons/lvmdbusd/lvmdbusd"
+ # Setup the python path so we can run
+ export PYTHONPATH=$abs_top_builddir/daemons
+ else
+ daemon="$(which lvmdbusd)"
+ fi
+ [[ -n $daemon && -x $daemon ]] || skip "The daemon is missing"
which python3 >/dev/null || skip "Missing python3"
python3 -c "import pyudev, dbus, gi.repository" || skip "Missing python modules"
- kill_sleep_kill_ LOCAL_LVMDBUSD 0
-
echo "preparing lvmdbusd..."
- $abs_top_builddir/daemons/lvmdbusd/lvmdbusd --debug --udev > debug.log_LVMDBUSD_out 2>&1 &
+ "$daemon" --debug --udev > debug.log_LVMDBUSD_out 2>&1 &
local pid=$!
sleep 1