# Setup the python path so we can run
export PYTHONPATH=$abs_top_builddir/daemons
+if true; then
+
+aux prepare_lvmdbusd
+$abs_top_builddir/test/dbus/lvmdbustest.py -v
+
+else
+
# Start the dbus service
$abs_top_builddir/daemons/lvmdbusd/lvmdbusd --debug --udev > debug.log_lvmdbusd 2>&1 &
LVM_DBUS_PID=$(ps aux | grep lvmdbus[d] | awk '{print $2}')
if [ "CHK${LVM_DBUS_PID}" == "CHK" ];then
- echo "Failed to start lsmdbusd daemon"
+ echo "Failed to start lvmdbusd daemon"
exit 1
fi
+END
# Run all the unit tests
$abs_top_builddir/test/dbus/lvmdbustest.py -v || fail=$?
wait
exit ${fail:-"0"}
+
+fi
(echo 'request="dump"'; echo '##') | lvmpolld_talk "$@"
}
+prepare_lvmdbusd() {
+ rm -f debug.log_LVMDBUSD_out
+
+ echo "checking lvmdbusd is NOT running..."
+ if ps -elf | grep lvmdbusd | grep python3; then
+ echo "Cannot run while existing lvmdbusd process exists"
+ return 1
+ fi
+ echo ok
+
+ # skip if we don't have our own lvmdbusd...
+ # TODO: lvmdbusd is not in PATH
+ #(which lvmdbusd 2>/dev/null | grep "$abs_builddir") || skip
+ [[ -x $abs_top_builddir/daemons/lvmdbusd/lvmdbusd ]] || skip
+
+ kill_sleep_kill_ LOCAL_LVMDBUSD 0
+
+ echo "preparing lvmdbusd..."
+ $abs_top_builddir/daemons/lvmdbusd/lvmdbusd --debug --udev > debug.log_LVMDBUSD_out 2>&1 &
+ local pid=$!
+
+ sleep 1
+ echo "checking lvmdbusd IS running..."
+ if ! ps -elf | grep lvmdbusd | grep python3; then
+ echo "Failed to start lvmdbusd daemon"
+ return 1
+ fi
+ # TODO: Is there a better check than wait 1 second and check pid?
+ if ! ps -p $pid -o comm= >/dev/null || [[ $(ps -p $pid -o comm=) != python3 ]]; then
+ echo "Failed to start lvmdbusd daemon"
+ return 1
+ fi
+ echo $pid > LOCAL_LVMDBUSD
+ echo ok
+}
+
teardown_devs_prefixed() {
local prefix=$1
local stray=${2:-0}
fi
}
+ kill_sleep_kill_ LOCAL_LVMDBUSD 0
+
+ echo -n .
+
kill_sleep_kill_ LOCAL_LVMPOLLD ${LVM_VALGRIND_LVMPOLLD:-0}
echo -n .