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
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"
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
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
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.$$
OPENFILE=${OPENFILE:-openfile}
OPENUNLINK=${OPENUNLINK:-openunlink}
READS=${READS:-"reads"}
-TRUNCATE=${TRUNCATE:-truncate}
MUNLINK=${MUNLINK:-munlink}
SOCKETSERVER=${SOCKETSERVER:-socketserver}
SOCKETCLIENT=${SOCKETCLIENT:-socketclient}
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
#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
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"}
test_5() {
mcreate $DIR1/f5
- truncate $DIR2/f5 100
+ $TRUNCATE $DIR2/f5 100
$CHECKSTAT -t file -s 100 $DIR1/f5 || error
rm $DIR1/f5
}
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
}
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
[ ! -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