set -e
ONLY=${ONLY:-"$*"}
-# bug number for skipped test: 1557 2366
-ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"8 10 "}
+# bug number for skipped test: 1768 1557
+ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"4 8 14b"}
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
[ "$ALWAYS_EXCEPT$EXCEPT" ] && echo "Skipping tests: $ALWAYS_EXCEPT $EXCEPT"
fi
}
+[ "$SANITYLOG" ] && rm -f $SANITYLOG || true
+
error () {
log "FAIL: $TESTNAME $@"
- exit 1
+ if [ "$SANITYLOG" ]; then
+ echo "FAIL: $TESTNAME $@" >> $SANITYLOG
+ else
+ exit 1
+ fi
}
pass() {
chmod 755 $DIR1
$CHECKSTAT -t dir -p 0755 $DIR2 || error
}
-run_test 2c "check cached attribute updates on 2 mtpt's root ==="
+run_test 2d "check cached attribute updates on 2 mtpt's root ==="
test_3() {
( cd $DIR1 ; ln -s this/is/good lnk )
[ "$MTPT" -eq 1 ] && MTPT=2 || MTPT=1
done
[ "`cat $DIR1/f9`" = "abcdefghijkl" ] || \
- error "`od -a $DIR1/f10` != abcdefghijkl"
+ error "`od -a $DIR1/f9` != abcdefghijkl"
}
run_test 9 "append of file with sub-page size on multiple mounts"
-test_10() {
+test_10a() {
MTPT=1
OFFSET=0
> $DIR2/f10
[ "`cat $DIR1/f10`" = "abcdefghijkl" ] || \
error "`od -a $DIR1/f10` != abcdefghijkl"
}
-run_test 10 "write of file with sub-page size on multiple mounts "
+run_test 10a "write of file with sub-page size on multiple mounts "
+
+test_10b() {
+ yes "R" | dd of=$DIR1/f10b bs=3k count=1 || error "dd $DIR1"
+
+ 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
+ yes "R" | dd of=$TMP/f10b bs=3k count=1 || error "dd random"
+ truncate $TMP/f10b 4096 || error "truncate 4096"
+ cmp $TMP/f10b $TMP/f10b-lustre || error "file miscompare"
+}
+run_test 10b "write of file with sub-page size on multiple mounts "
test_11() {
mkdir $DIR1/d11
multiop $DIR1/d11/f O_c &
MULTIPID=$!
+ usleep 200
cp -p /bin/ls $DIR1/d11/f
$DIR2/d11/f
RC=$?
}
run_test 13 "test directory page revocation ===================="
+test_14() {
+ mkdir $DIR1/d14
+ cp -p /bin/ls $DIR1/d14/ls
+ exec 100>> $DIR1/d14/ls
+ $DIR2/d14/ls && error || true
+ exec 100<&-
+}
+run_test 14 "execution of file opened for write should return -ETXTBSY=="
+
+test_14a() {
+ mkdir -p $DIR1/d14
+ cp -p `which multiop` $DIR1/d14/multiop
+ $DIR1/d14/multiop $TMP/test14.junk O_c &
+ MULTIPID=$!
+ sleep 1
+ multiop $DIR2/d14/multiop Oc && error "expected error, got success"
+ kill -USR1 $MULTIPID || return 2
+ wait $MULTIPID || return 3
+}
+run_test 14a "open(RDWR) of file being executed should return -ETXTBSY"
+
+test_14b() {
+ mkdir -p $DIR1/d14
+ cp -p `which multiop` $DIR1/d14/multiop
+ $DIR1/d14/multiop $TMP/test14.junk O_c &
+ MULTIPID=$!
+ sleep 1
+ truncate $DIR2/d14/multiop 0 && error "expected error, got success"
+ kill -USR1 $MULTIPID || return 2
+ wait $MULTIPID || return 3
+}
+run_test 14b "truncate of file being executed should return -ETXTBSY"
+
+test_15() { # bug 974 - ENOSPC
+ env
+ sh oos2.sh $MOUNT1 $MOUNT2
+}
+run_test 15 "test out-of-space with multiple writers ==========="
+
log "cleanup: ======================================================"
rm -rf $DIR1/[df][0-9]* $DIR1/lnk || true
+
echo '=========================== finished ==============================='
+[ -f "$SANITYLOG" ] && cat $SANITYLOG && exit 1 || true