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>
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 @@
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 @@
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 @@
parse_ltp_output "${OUTPUT}/LTP_${LOG_FILE}.log"
# Cleanup
- rm -rf ${LTP_TMPDIR}
+ rm -rf "${LTP_TMPDIR}"
}
# Test run.