diff options
author | Karol Lewandowski <k.lewandowsk@samsung.com> | 2019-02-27 11:52:23 +0100 |
---|---|---|
committer | Karol Lewandowski <k.lewandowsk@samsung.com> | 2019-02-27 13:36:59 +0100 |
commit | c8e38f244da44dae3bc23bf367f919b8c500057e (patch) | |
tree | dd315d45dcc11476b5a3c69ed6809e138f11e249 | |
parent | 203b027bbc9be38590c59e31c3d0ea9d59061559 (diff) | |
download | crash-worker-c8e38f244da44dae3bc23bf367f919b8c500057e.tar.gz crash-worker-c8e38f244da44dae3bc23bf367f919b8c500057e.tar.bz2 crash-worker-c8e38f244da44dae3bc23bf367f919b8c500057e.zip |
system tests: ensure core pattern is always restored
Change-Id: Id8cd30af058da8cbc23844ec7314d8a488644807
5 files changed, 5 insertions, 10 deletions
diff --git a/tests/system/check_minicore_mem/check_minicore_mem.sh.template b/tests/system/check_minicore_mem/check_minicore_mem.sh.template index bdfeb11..367d518 100755 --- a/tests/system/check_minicore_mem/check_minicore_mem.sh.template +++ b/tests/system/check_minicore_mem/check_minicore_mem.sh.template @@ -14,6 +14,7 @@ BASE_DIR='/tmp' MEM_LIMIT='102400' save_core_pattern +trap restore_core_pattern 0 echo "|${CRASH_WORKER_SYSTEM_TESTS}/check_minicore_mem/cp.sh %p %u %g %s %t %h %e ${BASE_DIR} ${CORE_MINI} ${MEM_LIMIT}" > /proc/sys/kernel/core_pattern rm -f ${BASE_DIR}/${CORE_MINI}* @@ -26,8 +27,6 @@ rm -f ${BASE_DIR}/${CORE_MINI}* sleep 2 -restore_core_pattern - wait_for_file ${BASE_DIR}/${CORE_MINI}.tar untar_file ${BASE_DIR} ${CORE_MINI}.tar diff --git a/tests/system/cmp_backtraces/cmp_backtraces.sh.template b/tests/system/cmp_backtraces/cmp_backtraces.sh.template index 8a579ef..0b08856 100755 --- a/tests/system/cmp_backtraces/cmp_backtraces.sh.template +++ b/tests/system/cmp_backtraces/cmp_backtraces.sh.template @@ -21,6 +21,7 @@ THREADS_MINI="threads.mini" BASE_DIR="/tmp" save_core_pattern +trap restore_core_pattern 0 echo "|${CRASH_WORKER_SYSTEM_TESTS}/cmp_backtraces/cp.sh %p %u %g %s %t %h %e ${BASE_DIR} ${CORE_ORIG} ${CORE_MINI}" > /proc/sys/kernel/core_pattern @@ -37,8 +38,6 @@ rm -f ${BASE_DIR}/${THREADS_ORIG} sleep 2 -restore_core_pattern - wait_for_file ${BASE_DIR}/${CORE_ORIG} wait_for_file ${BASE_DIR}/${CORE_MINI}.tar wait_for_app minicoredumper diff --git a/tests/system/critical_process/critical_process.sh.template b/tests/system/critical_process/critical_process.sh.template index e3c38e1..8eacf37 100755 --- a/tests/system/critical_process/critical_process.sh.template +++ b/tests/system/critical_process/critical_process.sh.template @@ -51,13 +51,12 @@ if [ -z ${USER_TEST1} ]; then fi save_core_pattern +trap restore_core_pattern 0 echo "|/usr/bin/crash-manager %p %u %g %s %t %i" > /proc/sys/kernel/core_pattern tlm-client -s --username test1 --password tizen --seat seat0 1> /dev/null 2>&1 sleep 4 -restore_core_pattern - TIMEOUT=240 while true; do if [[ `ls ${CRASH_DUMP_PATH}` =~ sh.*.zip ]]; then diff --git a/tests/system/time_test/time_test.sh.template b/tests/system/time_test/time_test.sh.template index 596b3cc..5705d13 100755 --- a/tests/system/time_test/time_test.sh.template +++ b/tests/system/time_test/time_test.sh.template @@ -21,6 +21,7 @@ MINICORE_TIME_FILE='mc_time' TIME_LIMIT=5 save_core_pattern +trap restore_core_pattern 0 echo "|${CRASH_WORKER_SYSTEM_TESTS}/time_test/cp.sh %p %u %g %s %t %h %e ${TEMP_DIR} ${CORE_ORIG} ${CORE_MINI} ${MINICORE_TIME_FILE}" > /proc/sys/kernel/core_pattern @@ -37,8 +38,6 @@ rm -f ${TEMP_DIR}/${MINICORE_TIME_FILE} sleep 2 -restore_core_pattern - wait_for_file ${TEMP_DIR}/${MINICORE_TIME_FILE} MINICORE_TIME=$(< ${TEMP_DIR}/${MINICORE_TIME_FILE}) diff --git a/tests/system/wait_for_opt_usr/wait_for_opt_usr.sh.template b/tests/system/wait_for_opt_usr/wait_for_opt_usr.sh.template index c799e18..aa4cf28 100755 --- a/tests/system/wait_for_opt_usr/wait_for_opt_usr.sh.template +++ b/tests/system/wait_for_opt_usr/wait_for_opt_usr.sh.template @@ -20,6 +20,7 @@ if ! umount -l ${OPT_MOUNTPOINT}; then fi save_core_pattern +trap restore_core_pattern 0 echo "|/usr/bin/crash-manager %p %u %g %s %t %i" > /proc/sys/kernel/core_pattern @@ -31,8 +32,6 @@ echo "|/usr/bin/crash-manager %p %u %g %s %t %i" > /proc/sys/kernel/core_pattern sleep 20 -restore_core_pattern - echo "${MTAB}" | while read OPT_LINE; do OPT_DEV=`echo ${OPT_LINE} | cut -d' ' -f1` OPT_FS=`echo ${OPT_LINE} | cut -d' ' -f3` |