From: Karol Lewandowski Date: Wed, 27 Feb 2019 10:52:23 +0000 (+0100) Subject: system tests: ensure core pattern is always restored X-Git-Tag: submit/tizen/20190301.131043~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8e38f244da44dae3bc23bf367f919b8c500057e;p=platform%2Fcore%2Fsystem%2Fcrash-worker.git system tests: ensure core pattern is always restored Change-Id: Id8cd30af058da8cbc23844ec7314d8a488644807 --- 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 bdfeb115..367d518f 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 8a579efb..0b088563 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 e3c38e1e..8eacf37c 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 596b3cc6..5705d130 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 c799e18a..aa4cf288 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`