From 62d26d10dca70219bdc8a161c9de18de46207fd1 Mon Sep 17 00:00:00 2001 From: Naresh Kamboju Date: Fri, 7 Jul 2017 12:51:17 +0530 Subject: linux: ltp: fix tmpdir and cleanup Signed-off-by: Naresh Kamboju --- automated/linux/ltp/ltp.sh | 18 +++++++----------- automated/linux/ltp/ltp.yaml | 4 +--- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/automated/linux/ltp/ltp.sh b/automated/linux/ltp/ltp.sh index 89b2534..c3af0df 100755 --- a/automated/linux/ltp/ltp.sh +++ b/automated/linux/ltp/ltp.sh @@ -15,7 +15,7 @@ TST_CMDFILES="" SKIPFILE="" # LTP version LTP_VERSION="20170516" -LTP_TMPDIR="" +LTP_TMPDIR=$(mktemp -d ${HOME}/ltp.tmp.XXXX) LTP_PATH=/opt/ltp @@ -24,12 +24,11 @@ usage() { [-S skipfile-lsk-juno] [-s True|False] [-v LTP_VERSION] - [-M Timeout_Multiplier] - [-d LTP_TMPDIR] " 1>&2 + [-M Timeout_Multiplier]" 1>&2 exit 0 } -while getopts "M:T:S:s:v:d:" arg; do +while getopts "M:T:S:s:v:" arg; do case "$arg" in T) TST_CMDFILES="${OPTARG}" @@ -54,11 +53,6 @@ while getopts "M:T:S:s:v:d:" arg; do v) LTP_VERSION="${OPTARG}";; # Slow machines need more timeout Default is 5min and multiply * MINUTES M) export LTP_TIMEOUT_MUL="${OPTARG}";; - # LTP_TMPDIR is needed case of OE builds where /tmp is mounted as tmpfs - d) - mkdir -p "${OPTARG}" - LTP_TMPDIR="-d ${OPTARG}" - ;; esac done @@ -89,11 +83,13 @@ run_ltp() { pipe0_status "./runltp -p -q -f ${TST_CMDFILES} \ -l ${OUTPUT}/LTP_${LOG_FILE}.log \ -C ${OUTPUT}/LTP_${LOG_FILE}.failed \ - ${SKIPFILE} \ - ${LTP_TMPDIR}" "tee ${OUTPUT}/LTP_${LOG_FILE}.out" + -d ${LTP_TMPDIR} \ + ${SKIPFILE}" "tee ${OUTPUT}/LTP_${LOG_FILE}.out" check_return "runltp_${LOG_FILE}" parse_ltp_output "${OUTPUT}/LTP_${LOG_FILE}.log" + # Cleanup + rm -rf ${LTP_TMPDIR} } # Test run. diff --git a/automated/linux/ltp/ltp.yaml b/automated/linux/ltp/ltp.yaml index c91cf08..c4b8df3 100644 --- a/automated/linux/ltp/ltp.yaml +++ b/automated/linux/ltp/ltp.yaml @@ -31,13 +31,11 @@ params: SKIP_INSTALL: false # Slow machines need more timeout Default is 5min and multiply * TIMEOUT_MULTIPLIER TIMEOUT_MULTIPLIER: 1 - # Create LTP temporary files under LTP_TMPDIR while running test - LTP_TMPDIR: "" run: steps: - cd ./automated/linux/ltp/ - - ./ltp.sh -T "${TST_CMDFILES}" -S "${SKIPFILE}" -s "${SKIP_INSTALL}" -v "${LTP_VERSION}" -M "${TIMEOUT_MULTIPLIER}" -d "${LTP_TMPDIR}" + - ./ltp.sh -T "${TST_CMDFILES}" -S "${SKIPFILE}" -s "${SKIP_INSTALL}" -v "${LTP_VERSION}" -M "${TIMEOUT_MULTIPLIER}" - ../../utils/send-to-lava.sh ./output/result.txt parse: -- cgit v1.2.3