system tests: add basic crash report sanity test
[platform/core/system/crash-worker.git] / tests / system / report_basic / report_basic.sh.template
1 #!/bin/bash
2
3 # Check the report type change in the config file
4
5 if [ -z "${CRASH_WORKER_SYSTEM_TESTS}" ]; then
6     CRASH_WORKER_SYSTEM_TESTS="@CRASH_SYSTEM_TESTS_PATH@"
7 fi
8
9 . ${CRASH_WORKER_SYSTEM_TESTS}/utils/minicore-utils.sh
10
11 CRASH_MANAGER_CONF=/etc/crash-manager.conf
12
13 clean_crash_dump
14 clean_temp
15
16 sleep 777 &
17 sleep 2
18 kill -6 $!
19
20 wait_for_app crash-manager
21
22 pushd ${CRASH_DUMP_PATH}
23 name=$(echo *)
24 name=${name%.zip}
25
26 test -f ${name}.zip || exit_with_code "FAIL: crash report not found" 1
27 unzip ${name}.zip || exit_with_code "FAIL: unable to extract archive" 1
28
29 # assumes default configuration - with coredump
30 test -s ${name}/${name}.coredump.tar || test -f ${name}/${name}.coredump || exit_with_code "FAIL: coredump corrupt or not found" 1
31
32 test -s ${name}/${name}.log || exit_with_code "FAIL: log corrupt or not found" 1
33 test -s ${name}/${name}.so_info || exit_with_code "FAIL: info corrupt or not found" 1
34 test -s ${name}/${name}.info || exit_with_code "FAIL: info corrupt or not found" 1
35
36 for i in ${CRASH_TEMP_PATH}/*; do
37     test -a "${i}" && exit_with_code "FAIL: temp directory not cleaned up" 1
38 done
39
40 exit_with_code "SUCCESS" 0