From: Elena Gryaznova Date: Mon, 20 Dec 2010 16:00:58 +0000 (+0300) Subject: b=23049 set path to truncate X-Git-Tag: 1.8.5.52~17 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=1bb2e2f8d5f7686c75a1e788089286ae731eba7e;p=fs%2Flustre-release.git b=23049 set path to truncate i=Brian.Murrell --- diff --git a/lustre/tests/metadata-updates.sh b/lustre/tests/metadata-updates.sh index 1799d5e..cca2c64 100755 --- a/lustre/tests/metadata-updates.sh +++ b/lustre/tests/metadata-updates.sh @@ -90,7 +90,7 @@ do_truncate () { do_nodes $NODES_TO_USE "set $TRACE; TESTFILE=$TESTDIR/\\\$(hostname)/$FILE; -truncate \\\$TESTFILE 0" || return ${PIPESTATUS[0]} +$TRUNCATE \\\$TESTFILE 0" || return ${PIPESTATUS[0]} FILE_SIZE=0 return 0 diff --git a/lustre/tests/replay-vbr.sh b/lustre/tests/replay-vbr.sh index 602c662..36c7c66 100644 --- a/lustre/tests/replay-vbr.sh +++ b/lustre/tests/replay-vbr.sh @@ -392,7 +392,7 @@ test_0q() { do_node $CLIENT1 mcreate $file pre=$(get_version $CLIENT1 $file) - do_node $CLIENT1 truncate $file 1 + do_node $CLIENT1 $TRUNCATE $file 1 post=$(get_version $CLIENT1 $file) if (($pre != $post)); then error "version changed unexpectedly: pre $pre, post $post" @@ -412,7 +412,7 @@ test_0r() { replay_barrier mds do_node $CLIENT2 chmod 666 $file - do_node $CLIENT1 truncate $file 1 + do_node $CLIENT1 $TRUNCATE $file 1 sleep 1 mtime_pre=$(do_node $CLIENT1 stat --format=%Y $file) do_node $CLIENT1 touch $file @@ -671,7 +671,7 @@ test_2b() { do_node $CLIENT2 chmod 666 $DIR1/$tfile-b # R do_node $CLIENT2 chgrp $RUNAS_GID $DIR2/$tfile-a # U do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $DIR/$tfile-a # J - do_node $CLIENT2 truncate $DIR2/$tfile-b 1 # U + do_node $CLIENT2 $TRUNCATE $DIR2/$tfile-b 1 # U do_node $CLIENT2 chgrp $RUNAS_GID $DIR1/$tfile-b # R do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $DIR/$tfile-b # R zconf_umount $CLIENT2 $MOUNT2 diff --git a/lustre/tests/runtests b/lustre/tests/runtests index ad0778b..6c2c9d1 100755 --- a/lustre/tests/runtests +++ b/lustre/tests/runtests @@ -53,7 +53,7 @@ if [ $COUNT -gt 10 -o $COUNT -eq 0 ]; then rm $HOSTS || error "can't remove $HOSTS" 9 cp /etc/hosts $HOSTS.2 || error "can't cp /etc/hosts to $HOSTS.2" 7 log "truncating $HOSTS.2 to $TRUNCSIZE bytes" - truncate $HOSTS.2 $TRUNCSIZE + $TRUNCATE $HOSTS.2 $TRUNCSIZE fi DST=$MOUNT/runtest.$$ diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index a526068..e6c211d 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -42,7 +42,6 @@ MCREATE=${MCREATE:-mcreate} OPENFILE=${OPENFILE:-openfile} OPENUNLINK=${OPENUNLINK:-openunlink} READS=${READS:-"reads"} -TRUNCATE=${TRUNCATE:-truncate} MUNLINK=${MUNLINK:-munlink} SOCKETSERVER=${SOCKETSERVER:-socketserver} SOCKETCLIENT=${SOCKETCLIENT:-socketclient} @@ -2152,7 +2151,7 @@ test_43b() { cp -p `which multiop` $DIR/d43/multiop MULTIOP_PROG=$DIR/d43/multiop multiop_bg_pause $TMP/test43.junk O_c || return 1 MULTIOP_PID=$! - truncate $DIR/d43/multiop 0 && error "expected error, got success" + $TRUNCATE $DIR/d43/multiop 0 && error "expected error, got success" kill -USR1 $MULTIOP_PID || return 2 wait $MULTIOP_PID || return 3 rm $TMP/test43.junk @@ -3368,7 +3367,7 @@ test_69() { #define OBD_FAIL_OST_ENOENT 0x217 do_facet ost1 lctl set_param fail_loc=0x217 - truncate $f 1 # vmtruncate() will ignore truncate() error. + $TRUNCATE $f 1 # vmtruncate() will ignore truncate() error. $DIRECTIO write $f 0 2 && error "write succeeded, expect -ENOENT" do_facet ost1 lctl set_param fail_loc=0 diff --git a/lustre/tests/sanityN.sh b/lustre/tests/sanityN.sh index 741b40b..b15482c 100644 --- a/lustre/tests/sanityN.sh +++ b/lustre/tests/sanityN.sh @@ -23,7 +23,6 @@ SETSTRIPE=${SETSTRIPE:-lstripe} MCREATE=${MCREATE:-mcreate} OPENFILE=${OPENFILE:-openfile} OPENUNLINK=${OPENUNLINK:-openunlink} -TRUNCATE=${TRUNCATE:-truncate} export TMP=${TMP:-/tmp} MOUNT_2=${MOUNT_2:-"yes"} CHECK_GRANT=${CHECK_GRANT:-"yes"} @@ -144,7 +143,7 @@ run_test 4 "fstat validation on multiple mount points ==========" test_5() { mcreate $DIR1/f5 - truncate $DIR2/f5 100 + $TRUNCATE $DIR2/f5 100 $CHECKSTAT -t file -s 100 $DIR1/f5 || error rm $DIR1/f5 } @@ -204,13 +203,13 @@ test_10b() { yes "R" | head -c 4000 >$TMP/f10b-seed dd if=$TMP/f10b-seed of=$DIR1/f10b bs=3k count=1 || error "dd $DIR1" - truncate $DIR1/f10b 4096 || error "truncate 4096" + $TRUNCATE $DIR1/f10b 4096 || error "truncate 4096" dd if=$DIR2/f10b of=$TMP/f10b-lustre bs=4k count=1 || error "dd $DIR2" # create a test file locally to compare dd if=$TMP/f10b-seed of=$TMP/f10b bs=3k count=1 || error "dd random" - truncate $TMP/f10b 4096 || error "truncate 4096" + $TRUNCATE $TMP/f10b 4096 || error "truncate 4096" cmp $TMP/f10b $TMP/f10b-lustre || error "file miscompare" rm $TMP/f10b $TMP/f10b-lustre $TMP/f10b-seed } @@ -280,7 +279,7 @@ test_14b() { # bug 3192, 7040 cp -p `which multiop` $DIR1/d14/multiop || error "cp failed" MULTIOP_PROG=$DIR1/d14/multiop multiop_bg_pause $TMP/test14.junk O_c || return 1 MULTIOP_PID=$! - truncate $DIR2/d14/multiop 0 && kill -9 $MULTIOP_PID && \ + $TRUNCATE $DIR2/d14/multiop 0 && kill -9 $MULTIOP_PID && \ error "expected truncate error, got success" kill -USR1 $MULTIOP_PID || return 2 wait $MULTIOP_PID || return 3 diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index e87e031..1cac5b3 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -134,6 +134,9 @@ init_test_env() { [ ! -f "$LST" ] && export LST=$(which lst) export SGPDDSURVEY=${SGPDDSURVEY:-"$LUSTRE/../lustre-iokit/sgpdd-survey/sgpdd-survey")} [ ! -f "$SGPDDSURVEY" ] && export SGPDDSURVEY=$(which sgpdd-survey) + # Ubuntu, at least, has a truncate command in /usr/bin + # so fully path our truncate command. + export TRUNCATE=${TRUNCATE:-$LUSTRE/tests/truncate} export MDSRATE=${MDSRATE:-"$LUSTRE/tests/mpi/mdsrate"} [ ! -f "$MDSRATE" ] && export MDSRATE=$(which mdsrate 2> /dev/null) if ! echo $PATH | grep -q $LUSTRE/tests/racer; then