From: @lixiachen Reviewed-by: @pandoublefeng,@robingrosman Signed-off-by: @robingrosmanpull/15248/MERGE
| @@ -15,7 +15,7 @@ | |||||
| # ============================================================================ | # ============================================================================ | ||||
| # This script is the driver of the individual test scenarios | # This script is the driver of the individual test scenarios | ||||
| CURRPATH=$(cd "$(dirname $0)"; pwd) | |||||
| CURRPATH=$(cd "$(dirname $0)" || exit; pwd) | |||||
| echo "----------------------------------------------" | echo "----------------------------------------------" | ||||
| echo "Invalid syntax and cache_admin failure testing" | echo "Invalid syntax and cache_admin failure testing" | ||||
| @@ -47,7 +47,7 @@ HandleRcExit $? 1 1 | |||||
| export SESSION_ID=$session_id | export SESSION_ID=$session_id | ||||
| test_count=$(($test_count+1)) | test_count=$(($test_count+1)) | ||||
| cd ${UT_TEST_DIR} | |||||
| cd ${UT_TEST_DIR} || exit | |||||
| cmd="${UT_TEST_DIR}/ut_tests" | cmd="${UT_TEST_DIR}/ut_tests" | ||||
| echo "Test ${test_count}: ${cmd}" | echo "Test ${test_count}: ${cmd}" | ||||
| MsgEnter "Run test ${test_count}" | MsgEnter "Run test ${test_count}" | ||||
| @@ -62,7 +62,7 @@ fi | |||||
| echo | echo | ||||
| HandleRcExit $rc 1 0 | HandleRcExit $rc 1 0 | ||||
| cd ${CURRPATH} | |||||
| cd ${CURRPATH} || exit | |||||
| StopServer | StopServer | ||||
| HandleRcExit $? 1 0 | HandleRcExit $? 1 0 | ||||
| @@ -18,9 +18,9 @@ | |||||
| # test scenarios for cache op testing. | # test scenarios for cache op testing. | ||||
| # Set any path variables here | # Set any path variables here | ||||
| CURRPATH=$(cd "$(dirname $0)"; pwd) | |||||
| TESTPATH=$(cd "${CURRPATH}/../dataset"; pwd) | |||||
| PROJECT_PATH=$(cd "${CURRPATH}/../../../../"; pwd) | |||||
| CURRPATH=$(cd "$(dirname $0)" || exit; pwd) | |||||
| TESTPATH=$(cd "${CURRPATH}/../dataset" || exit; pwd) | |||||
| PROJECT_PATH=$(cd "${CURRPATH}/../../../../" || exit; pwd) | |||||
| if [ "x${BUILD_PATH}" == "x" ]; then | if [ "x${BUILD_PATH}" == "x" ]; then | ||||
| BUILD_PATH=${PROJECT_PATH}/build | BUILD_PATH=${PROJECT_PATH}/build | ||||
| @@ -202,13 +202,13 @@ PytestCmd() | |||||
| if [ ${rc} -ne 0 ]; then | if [ ${rc} -ne 0 ]; then | ||||
| MsgFail "FAILED" | MsgFail "FAILED" | ||||
| MsgError "pytest call had failure!" "${rc}" "${result}" | MsgError "pytest call had failure!" "${rc}" "${result}" | ||||
| cd ${CURRPATH} | |||||
| cd ${CURRPATH} || exit | |||||
| return 1 | return 1 | ||||
| else | else | ||||
| MsgOk "OK" | MsgOk "OK" | ||||
| fi | fi | ||||
| echo | echo | ||||
| cd ${CURRPATH} | |||||
| cd ${CURRPATH} || exit | |||||
| return 0 | return 0 | ||||
| } | } | ||||