diff options
author | Naresh Kamboju <naresh.kamboju@linaro.org> | 2017-07-11 14:50:32 +0530 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2017-07-11 14:04:55 +0000 |
commit | ff5f6c3a49336b1d7fa5f13f0a12a5fb64e302ad (patch) | |
tree | 084f6ed403761fe43c6af9e92abf0878c0cb4e3d | |
parent | 3a42795ea49f45fb35ac99211cd361e4a5ff4c1a (diff) |
linux: ltp: use mkdir -m 777 to create LTP TMPBASE directory
runltp script uses -d parameter to set the tmp base directory.
Behind the scene, it's using already mktemp -d to create a unique
directory.
Simply create a base directory as expected by runltp script, with
permission set to 777 for tests that call tst_tmpdir() and try to
write to it as user nobody.
It's fixing also the following error:
chdir03 2 TBROK : chdir03.c:153:
rmdir(/home/root/ltp-tmp.ePFn/ltp-Jey9cImTdA/chdhhnMyQ/3141)
failed: errno=ENOENT(2): No such file or directory
Change-Id: Ic3349fdb51919d220070af5ddcf50f031a57a3b4
Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
-rwxr-xr-x | automated/linux/ltp/ltp.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/automated/linux/ltp/ltp.sh b/automated/linux/ltp/ltp.sh index 4f70a35..1c6d92f 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=$(mktemp -d ${HOME}/ltp-tmp.XXXX) +LTP_TMPDIR="${HOME}/ltp-tmp" LTP_PATH=/opt/ltp @@ -79,6 +79,8 @@ parse_ltp_output() { run_ltp() { # shellcheck disable=SC2164 cd "${LTP_PATH}" + # shellcheck disable=SC2174 + mkdir -m 777 -p "${LTP_TMPDIR}" pipe0_status "./runltp -p -q -f ${TST_CMDFILES} \ -l ${OUTPUT}/LTP_${LOG_FILE}.log \ @@ -89,7 +91,7 @@ run_ltp() { parse_ltp_output "${OUTPUT}/LTP_${LOG_FILE}.log" # Cleanup - rm -rf ${LTP_TMPDIR} + rm -rf "${LTP_TMPDIR}" } # Test run. |