X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=d78ded23afe8bb3a2cc2102db34fed6e48789c53;hb=4191e0cdd0d96b848c1235471179d25d37a889dc;hp=c60de0975a7b81d5755f3fa32f44ca16da5e70cf;hpb=bc9cc327983c45e6255e0d6475b8bdbdcd82c938;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index c60de09..d78ded2 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -1573,6 +1573,16 @@ test_27g() { } run_test 27g "$LFS getstripe with no objects" +test_27ga() { + test_mkdir $DIR/$tdir + touch $DIR/$tdir/$tfile || error "touch failed" + ln -s bogus $DIR/$tdir/$tfile.2 || error "ln failed" + $LFS getstripe -m $DIR/$tdir/$tfile $DIR/$tdir/$tfile.2 + local rc=$? + (( rc == 2 )) || error "getstripe did not return ENOENT" +} +run_test 27ga "$LFS getstripe with missing file (should return error)" + test_27i() { test_mkdir $DIR/$tdir touch $DIR/$tdir/$tfile || error "touch failed" @@ -1611,6 +1621,9 @@ run_test 27l "check setstripe permissions (should return error)" test_27m() { [[ $OSTCOUNT -lt 2 ]] && skip_env "needs >= 2 OSTs" + [ -n "$RCLIENTS" -o -n "$MOUNT_2" ] && + skip_env "multiple clients -- skipping" + ORIGFREE=$($LCTL get_param -n lov.$FSNAME-clilov-*.kbytesavail | head -n1) if [[ $ORIGFREE -gt $MAXFREE ]]; then @@ -4156,15 +4169,13 @@ run_test 43A "execution of file opened for write should return -ETXTBSY" test_43a() { test_mkdir $DIR/$tdir - cp -p $(which $MULTIOP) $DIR/$tdir/multiop || - cp -p multiop $DIR/$tdir/multiop - MULTIOP_PROG=$DIR/$tdir/multiop multiop_bg_pause $TMP/$tfile.junk O_c || - error "multiop open $TMP/$tfile.junk failed" - rm $TMP/$tfile.junk # delete junk file on close (not part of test) - MULTIOP_PID=$! - $MULTIOP $DIR/$tdir/multiop Oc && error "expected error, got success" - kill -USR1 $MULTIOP_PID || error "kill -USR1 PID $MULTIOP_PID failed" - wait $MULTIOP_PID || error "wait PID $MULTIOP_PID failed" + cp -p $(which sleep) $DIR/$tdir/sleep || error "can't copy" + $DIR/$tdir/sleep 60 & + SLEEP_PID=$! + # Make sure exec of $tdir/sleep wins race with truncate + sleep 1 + $MULTIOP $DIR/$tdir/sleep Oc && error "expected error, got success" + kill $SLEEP_PID } run_test 43a "open(RDWR) of file being executed should return -ETXTBSY" @@ -4172,15 +4183,13 @@ test_43b() { [ $PARALLEL == "yes" ] && skip "skip parallel run" test_mkdir $DIR/$tdir - cp -p $(which $MULTIOP) $DIR/$tdir/multiop || - cp -p multiop $DIR/$tdir/multiop - MULTIOP_PROG=$DIR/$tdir/multiop multiop_bg_pause $TMP/$tfile.junk O_c || - error "multiop open $TMP/$tfile.junk failed" - rm $TMP/$tfile.junk # delete junk file on close (not part of test) - MULTIOP_PID=$! - $TRUNCATE $DIR/$tdir/multiop 0 && error "expected error, got success" - kill -USR1 $MULTIOP_PID || error "kill -USR1 PID $MULTIOP_PID failed" - wait $MULTIOP_PID || error "wait PID $MULTIOP_PID failed" + cp -p $(which sleep) $DIR/$tdir/sleep || error "can't copy" + $DIR/$tdir/sleep 60 & + SLEEP_PID=$! + # Make sure exec of $tdir/sleep wins race with truncate + sleep 1 + $TRUNCATE $DIR/$tdir/sleep 0 && error "expected error, got success" + kill $SLEEP_PID } run_test 43b "truncate of file being executed should return -ETXTBSY" @@ -6529,7 +6538,7 @@ test_61a() { run_test 61a "mmap() writes don't make sync hang ================" test_61b() { - mmap_mknod_test $tfile || error "mmap_mknod_test failed" + mmap_mknod_test $DIR/$tfile || error "mmap_mknod_test failed" } run_test 61b "mmap() of unstriped file is successful"