From: Alex Zhuravlev Date: Thu, 18 Jul 2019 06:22:59 +0000 (+0400) Subject: LU-12562 tests: sanity/256 to use /tmp for the temporary file X-Git-Tag: 2.12.57~2 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=43c6f8742da8780110832610105818fbcd00d6e4 LU-12562 tests: sanity/256 to use /tmp for the temporary file otherwise the test being running from a read-only build tree fails. Test-Parameters: trivial Change-Id: Ia61202ee92d39e6b0bab21e09bb4fd50fa8e6749 Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/35554 Tested-by: jenkins Reviewed-by: James Nunez Tested-by: Maloo Reviewed-by: Wei Liu Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index ec3d67e..aee7a8f 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -3082,10 +3082,10 @@ test_31n() { run_test 31n "check link count of unlinked file" link_one() { - local TEMPNAME=$(mktemp $1_XXXXXX) - mlink $TEMPNAME $1 2> /dev/null && - echo "$BASHPID: link $TEMPNAME to $1 succeeded" - munlink $TEMPNAME + local tempfile=$(mktemp $1_XXXXXX) + mlink $tempfile $1 2> /dev/null && + echo "$BASHPID: link $tempfile to $1 succeeded" + munlink $tempfile } test_31o() { # LU-2901 @@ -13830,7 +13830,8 @@ test_161d() { ps -p $pid [[ $? -eq 0 ]] || error "create should be blocked" - local tempfile=$(mktemp) + local tempfile="$(mktemp --tmpdir $tfile.XXXXXX)" + stack_trap "rm -f $tempfile" fid=$(changelog_extract_field "CREAT" "$tfile" "t=") cat $MOUNT/.lustre/fid/$fid 2>/dev/null >$tempfile || error "cat failed" # some delay may occur during ChangeLog publishing and file read just @@ -17483,7 +17484,8 @@ test_256() { #after mount new plainllog is used touch $DIR/$tdir/{11..19} - local tmpfile=$(mktemp -u $tfile.XXXXXX) + local tmpfile="$(mktemp --tmpdir -u $tfile.XXXXXX)" + stack_trap "rm -f $tmpfile" cat_sl=$(do_facet $SINGLEMDS "sync; \ $DEBUGFS -c -R 'dump changelog_catalog $tmpfile' $mdt_dev; \ llog_reader $tmpfile | grep -c type=1064553b") @@ -17495,7 +17497,7 @@ test_256() { cat_sl=$(do_facet $SINGLEMDS "sync; \ $DEBUGFS -c -R 'dump changelog_catalog $tmpfile' $mdt_dev; \ - llog_reader $tmpfile | grep -c type=1064553b; rm -f $tmpfile") + llog_reader $tmpfile | grep -c type=1064553b") if (( cat_sl == 2 )); then error "Empty plain llog was not deleted from changelog catalog"