Whamcloud - gitweb
b=11694
[fs/lustre-release.git] / lustre / tests / sanity.sh
index 88e48b8..bae0863 100644 (file)
@@ -1074,11 +1074,12 @@ test_27u() { # bug 4900
         createmany -o $DIR/d27u/t- 1000
         sysctl -w lustre.fail_loc=0
 
-        $GETSTRIPE $DIR/d27u > $TMP/files
-        OBJS=`cat $TMP/files | awk -vobjs=0 '($1 == 0) { objs += 1 } END { print objs;}'`
+        TLOG=$DIR/$tfile.getstripe
+        $GETSTRIPE $DIR/d27u > $TLOG 
+        OBJS=`awk -vobj=0 '($1 == 0) { obj += 1 } END { print obj;}' $TLOG`
         unlinkmany $DIR/d27u/t- 1000
         [ $OBJS -gt 0 ] && \
-                error "Found $OBJS objects were created on OST-0" || pass
+                error "$OBJS objects created on OST-0.  See $TLOG" || pass
 }
 run_test 27u "skip object creation on OSC w/o objects =========="
 
@@ -2670,6 +2671,26 @@ test_60c() {
 }
 run_test 60c "unlink file when mds full"
 
+test_60d() {
+       SAVEPRINTK=$(sysctl -n lnet.printk)
+
+       # verify "lctl mark" is even working"
+       MESSAGE="test message ID $RANDOM $$"
+       $LCTL mark "$MESSAGE" || error "$LCTL mark failed"
+       dmesg | grep -q "$MESSAGE" || error "didn't find debug marker in log"
+
+       sysctl -w lnet.printk=0 || error "set lnet.printk failed"
+       sysctl -n lnet.printk | grep emerg || error "lnet.printk dropped emerg"
+
+       MESSAGE="new test message ID $RANDOM $$"
+       # Assume here that libcfs_debug_mark_buffer() uses D_WARNING
+       $LCTL mark "$MESSAGE" || error "$LCTL mark failed"
+       dmesg | grep -q "$MESSAGE" && error "D_WARNING wasn't masked" || true
+
+       sysctl -w lnet.printk="$SAVEPRINTK"
+}
+run_test 60d "test printk console message masking"
+
 test_61() {
        f="$DIR/f61"
        dd if=/dev/zero of=$f bs=`page_size` count=1
@@ -2790,7 +2811,7 @@ test_65e() {
        mkdir -p $DIR/d65
 
        $SETSTRIPE $DIR/d65 || error "setstripe"
-        $GETSTRIPE -v $DIR/d65 | grep "has no stripe info" || error "no stripe info failed"
+        $GETSTRIPE -v $DIR/d65 | grep "Default" || error "no stripe info failed"
        touch $DIR/d65/f6
        $LVERIFY $DIR/d65 $DIR/d65/f6 || error "lverify failed"
 }
@@ -2806,7 +2827,7 @@ test_65g() {
         mkdir -p $DIR/d65
         $SETSTRIPE $DIR/d65 -s $(($STRIPESIZE * 2)) -i 0 -c 1 || error "setstripe"
         $SETSTRIPE -d $DIR/d65 || error "setstripe"
-        $GETSTRIPE -v $DIR/d65 | grep "has no stripe info" || \
+        $GETSTRIPE -v $DIR/d65 | grep "Default" || \
                error "delete default stripe failed"
 }
 run_test 65g "directory setstripe -d ==========================="