configure_test("livedumper")
configure_test("extra_script")
configure_test("dbus_notify")
+configure_test("dbus_notify_legacy")
configure_test("output_param")
configure_test("libcrash-service")
configure_test("full_core")
--- /dev/null
+#!/bin/bash
+
+# Check the support for old-style DBus notification signal
+
+if [ -z "${CRASH_WORKER_SYSTEM_TESTS}" ]; then
+ CRASH_WORKER_SYSTEM_TESTS="@CRASH_SYSTEM_TESTS_PATH@"
+fi
+
+. ${CRASH_WORKER_SYSTEM_TESTS}/utils/minicore-utils.sh
+
+# We are looking for following signal - example for `sleep` command:
+#
+# signal time=1420079847.594970 sender=:1.82 -> destination=(null destination) serial=2 path=/Org/Tizen/System/Crash/Crash; interface=org.tizen.system.crash.Crash; member=ProcessCrashed
+# string "sleep"
+# string "/usr/bin/sleep"
+# string "sleep"
+# string "sleep"
+#
+# Note! Regular programs (Unix sleep, tests-provided kenny) are not enough to check all fields of the signal.
+# Complete test, with appid & pkgid checks, would require building proper "Tizen Application".
+
+CONF_DIR=/etc/crash-manager.conf.d
+CONF_FILE=${CONF_DIR}/system-test-dbus-notify-legacy.conf
+
+mount -o rw,remount /
+
+mkdir -p $CONF_DIR
+rm -f $CONF_FILE || :
+cat <<EOF >$CONF_FILE
+[CrashManager]
+UseLegacyNotification=true
+EOF
+
+( ${CRASH_WORKER_SYSTEM_TESTS}/utils/kenny &
+ pid=$!
+ sleep 2
+ kill -6 $pid ) &
+
+TMPFILE=$(mktemp /tmp/dbus_notify.XXXXXX)
+dbus-monitor --system type=signal,path=/Org/Tizen/System/Crash/Crash,interface=org.tizen.system.crash.Crash,member=ProcessCrashed > $TMPFILE &
+monpid=$!
+
+cleanup()
+{
+ kill $monpid
+ rm -f $TMPFILE
+ rm -f $CONF_FILE
+}
+
+trap cleanup 0
+
+sleep 3
+
+PATTERN='path=/Org/Tizen/System/Crash/Crash; interface=org\.tizen\.system\.crash\.Crash; member=ProcessCrashed'
+for i in $(seq 1 10); do
+ score=0
+ if egrep "$PATTERN" $TMPFILE; then
+ if egrep "string \"kenny" $TMPFILE; then
+ score=$(($score + 1))
+ fi
+
+ # legacy signal must not have the report_path and additional metadata
+
+ if ! egrep "string \"/opt/usr/share/crash/dump.*kenny" $TMPFILE; then
+ score=$(($score + 1))
+ fi
+
+ if ! egrep -A1 "string \"sys.signal" $TMPFILE; then
+ score=$(($score + 1))
+ fi
+
+ if [ $score -eq 3 ]; then
+ exit_ok
+ fi
+ fi
+
+ sleep 1
+done
+
+fail "legacy dbus signal does not match"