From: Karol Lewandowski Date: Tue, 26 Feb 2019 15:34:22 +0000 (+0100) Subject: system tests: ensure needed variables are always available X-Git-Tag: submit/tizen/20190301.131043~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F61%2F200561%2F3;p=platform%2Fcore%2Fsystem%2Fcrash-worker.git system tests: ensure needed variables are always available Change-Id: Ia4700100cfc849976dd7fa6c84b92b66f393d7d9 --- diff --git a/tests/system/utils/minicore-utils.sh b/tests/system/utils/minicore-utils.sh index 7100150..6e42d2f 100644 --- a/tests/system/utils/minicore-utils.sh +++ b/tests/system/utils/minicore-utils.sh @@ -60,17 +60,12 @@ function tzplatform_var { } function clean_crash_dump { - export CRASH_DUMP_PATH=`tzplatform_var TZ_SYS_CRASH` killall crash-manager killall minicoredumper sleep 1 - if [ -z ${CRASH_DUMP_PATH} ]; then - exit_with_code "Couldn't get TZ_SYS_CRASH or TZ_SYS_CRASH is empty" 1 - fi - if [ ! -d ${CRASH_DUMP_PATH} ]; then exit_with_code "${CRASH_DUMP_PATH} does not exist" 1 fi @@ -80,15 +75,9 @@ function clean_crash_dump { function clean_logdump { - export LOGDUMP_RESULT_PATH=`tzplatform_var TZ_SYS_CRASH_ROOT`/debug - killall log_dump sleep 1 - if [ "x${LOGDUMP_RESULT_PATH}" = 'x/debug' ]; then - exit_with_code "Couldn't get TZ_SYS_CRASH_ROOT" 1 - fi - if [ -d ${LOGDUMP_RESULT_PATH} ]; then rm -rf ${LOGDUMP_RESULT_PATH}/* fi @@ -96,12 +85,6 @@ function clean_logdump { function clean_temp { - export CRASH_TEMP_PATH=`tzplatform_var TZ_SYS_CRASH_ROOT`/temp - - if [ "x${CRASH_TEMP_PATH}" = 'x/temp' ]; then - exit_with_code "Couldn't get TZ_SYS_CRASH_ROOT" 1 - fi - if [ -d ${CRASH_TEMP_PATH} ]; then rm -rf ${CRASH_TEMP_PATH}/* fi @@ -149,3 +132,23 @@ function untar_file { tar xf ${2} popd } + +function __export_vars__ { + + export CRASH_TEMP_PATH=`tzplatform_var TZ_SYS_CRASH_ROOT`/temp + if [ "x${CRASH_TEMP_PATH}" = 'x/temp' ]; then + exit_with_code "Couldn't get TZ_SYS_CRASH_ROOT" 1 + fi + + export LOGDUMP_RESULT_PATH=`tzplatform_var TZ_SYS_CRASH_ROOT`/debug + if [ "x${LOGDUMP_RESULT_PATH}" = 'x/debug' ]; then + exit_with_code "Couldn't get TZ_SYS_CRASH_ROOT" 1 + fi + + export CRASH_DUMP_PATH=`tzplatform_var TZ_SYS_CRASH` + if [ -z ${CRASH_DUMP_PATH} ]; then + exit_with_code "Couldn't get TZ_SYS_CRASH or TZ_SYS_CRASH is empty" 1 + fi +} + +__export_vars__