Whamcloud - gitweb
Branch b1_6
authorscjody <scjody>
Fri, 11 May 2007 19:47:17 +0000 (19:47 +0000)
committerscjody <scjody>
Fri, 11 May 2007 19:47:17 +0000 (19:47 +0000)
Fix sanity test 78:

1. Detects write failures and failing the test.
2. Writes a file small enough not to fill up any OST.
3. Unlinks the file at the end of the test.

b=12326
i=adilger
i=shadow

lustre/tests/sanity.sh

index 39db040..e1aec5c 100644 (file)
@@ -3097,8 +3097,13 @@ test_78() { # bug 10901
        F78SIZE=$(($(awk '/MemFree:/ { print $2 }' /proc/meminfo) / 1024))
        [ $F78SIZE -gt 512 ] && F78SIZE=512
        [ $F78SIZE -gt $((MAXFREE / 1024)) ] && F78SIZE=$((MAXFREE / 1024))
-       $SETSTRIPE $DIR/$tfile 0 -1 -1
-       $DIRECTIO rdwr $DIR/$tfile 0 $F78SIZE 1048576
+       SMALLESTOST=`lfs df $DIR |grep OST | awk '{print $4}' |sort -n |head -1`
+       [ $F78SIZE -gt $((SMALLESTOST * $OSTCOUNT / 1024)) ] && \
+               F78SIZE=$((SMALLESTOST * $OSTCOUNT / 1024))
+       $SETSTRIPE $DIR/$tfile 0 -1 -1 || error "setstripe failed"
+       $DIRECTIO rdwr $DIR/$tfile 0 $F78SIZE 1048576 || error "rdwr failed"
+
+       rm -f $DIR/$tfile
 }
 run_test 78 "handle large O_DIRECT writes correctly ============"