Whamcloud - gitweb
smash the HEAD with the contents of b_cmd. HEAD_PRE_CMD_SMASH and
[fs/lustre-release.git] / lustre / tests / sanityN.sh
index 37f3c96..756ffdb 100644 (file)
@@ -3,8 +3,8 @@
 set -e
 
 ONLY=${ONLY:-"$*"}
-# bug number for skipped test: 1557
-ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"8"}
+# 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"
@@ -214,7 +214,7 @@ test_9() {
                [ "$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"
 
@@ -234,7 +234,6 @@ test_10a() {
 run_test 10a "write of file with sub-page size on multiple mounts "
 
 test_10b() {
-       set -vx
        yes "R" | dd of=$DIR1/f10b bs=3k count=1 || error "dd $DIR1"
 
        truncate $DIR1/f10b 4096 || error "truncate 4096"
@@ -284,11 +283,44 @@ test_13() {       # bug 2451 - directory coherency
 }
 run_test 13 "test directory page revocation ===================="
 
-test_14() {    # bug 974 - ENOSPC
+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 14 "test out-of-space with multiple writers ==========="
+run_test 15 "test out-of-space with multiple writers ==========="
 
 log "cleanup: ======================================================"
 rm -rf $DIR1/[df][0-9]* $DIR1/lnk || true