Fix dbus_notify system test and return the result of tests 00/245700/3
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Wed, 14 Oct 2020 08:49:29 +0000 (10:49 +0200)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Mon, 26 Oct 2020 11:36:24 +0000 (12:36 +0100)
Change-Id: I1fa460e024bcb7eeba0c9bdde42903edb91dd8a4

tests/system/dbus_notify/dbus_notify.sh.template
tests/system/dbus_notify_legacy/dbus_notify_legacy.sh.template
tests/system/run.sh.template

index 4da2362..cb73ede 100644 (file)
@@ -59,6 +59,7 @@ trap cleanup 0
 
 sleep 3
 wait_for_app crash-manager
+sleep 1
 
 for TMPFILE in $TMP1 $TMP2; do
        PATTERN="path=/Org/Tizen/System/Crash/Crash; interface=org\.tizen\.system\.crash\.Crash; member=ProcessCrashed"
@@ -99,9 +100,9 @@ for TMPFILE in $TMP1 $TMP2; do
                fi
 
                if [ "${TMPFILE}" = ${TMP1} ]; then
-                 if egrep -A1 "string \"sys.callstack_native_hash" $TMPFILE | egrep 'variant.*string \"57b32ee3a2bb53a816dd102657ca210d84b9b9ac9a765f811f8131011b40a2a9'; then
-                         score=$(($score + 1))
-                 fi
+                       if egrep -A1 "string \"sys.callstack_native_hash" $TMPFILE | egrep 'variant.*string'; then
+                               score=$(($score + 1))
+                       fi
                fi
 
                if [ $score -eq ${MAX_SCORE} ]; then
index 946e9c3..e76c109 100644 (file)
@@ -50,31 +50,29 @@ cleanup()
 trap cleanup 0
 
 sleep 3
+wait_for_app crash-manager
+sleep 1
 
 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
+score=0
+if egrep "$PATTERN" $TMPFILE; then
+       if egrep "string \"kenny" $TMPFILE; then
+               score=$(($score + 1))
        fi
 
-       sleep 1
-done
+       # 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
 
 fail "legacy dbus signal does not match"
index 6e37c2f..39b4918 100644 (file)
@@ -14,6 +14,7 @@ function run_test {
     YELLOW="\033[1;33m"
     NORMAL="\033[0m"
     TEST=${1}
+    test_result=0
     echo -ne "${TEST}:\t"
     echo "===================================" >> ${LOG_FILE}
     echo "Test ${TEST}:" >> ${LOG_FILE}
@@ -27,22 +28,28 @@ function run_test {
         ${FAIL_CODE})
         echo -e "${RED}FAIL${NORMAL}"
         echo "FAIL" >> ${LOG_FILE}
+        test_result=1
         ;;
         ${SKIP_CODE})
         echo -e "${YELLOW}SKIP${NORMAL}"
         echo "SKIP" >> ${LOG_FILE}
         ;;
     esac
+    return ${test_result}
 }
 
 if [ -f ${LOG_FILE} ]; then
     rm ${LOG_FILE}
 fi
 
+tests_result=0
 for DIR in ${CRASH_WORKER_SYSTEM_TESTS}/*/; do
     test_name=`basename ${DIR}`
 
     if [ -x ${CRASH_WORKER_SYSTEM_TESTS}/${test_name}/${test_name}.sh ]; then
-        run_test ${test_name}
+        if ! run_test ${test_name}; then
+            tests_result=1
+        fi
     fi
 done
+exit ${tests_result}