Whamcloud - gitweb
b=12560
authorgrev <grev>
Tue, 31 Jul 2007 14:42:40 +0000 (14:42 +0000)
committergrev <grev>
Tue, 31 Jul 2007 14:42:40 +0000 (14:42 +0000)
i=Adilger
i=Brian

Add skip() function to print the skipped tests.
Skip test_99b if /tmp has wrong w permissions.

lustre/tests/sanity.sh

index 9e824be..48ceec3 100644 (file)
@@ -185,12 +185,12 @@ run_test() {
        fi
         testname=EXCEPT_$1
         if [ ${!testname}x != x ]; then
-                 echo "skipping excluded test $1"
+                 TESTNAME=test_$1 skip "skipping excluded test $1"
                  return 0
         fi
         testname=EXCEPT_$base
         if [ ${!testname}x != x ]; then
-                 echo "skipping excluded test $1 (base $base)"
+                 TESTNAME=test_$1 skip "skipping excluded test $1 (base $base)"
                  return 0
         fi
         run_one $1 "$2"
@@ -214,6 +214,12 @@ pass() {
        echo PASS $@
 }
 
+skip () {
+       log "$0: SKIP: $TESTNAME $@"
+       [ "$SANITYLOG" ] && echo "$0: SKIP: $TESTNAME $@" >> $SANITYLOG
+
+}
+
 mounted_lustre_filesystems() {
        awk '($3 ~ "lustre" && $1 ~ ":") { print $2 }' /proc/mounts
 }
@@ -3227,6 +3233,7 @@ run_test 99a "cvs init ========================================="
 
 test_99b() {
        [ ! -d $DIR/d99cvsroot ] && test_99a
+       $RUNAS [ ! -w /tmp ] && skip "/tmp has wrong w permission -- skipping" && return
        cd /etc/init.d || error "cd /etc/init.d failed"
        # some versions of cvs import exit(1) when asked to import links or
        # files they can't read.  ignore those files.
@@ -4386,5 +4393,5 @@ fi
 
 
 echo '=========================== finished ==============================='
-[ -f "$SANITYLOG" ] && cat $SANITYLOG && exit 1 || true
+[ -f "$SANITYLOG" ] && cat $SANITYLOG && grep -q FAIL $SANITYLOG && exit 1 || true
 echo "$0: completed"