Whamcloud - gitweb
LU-1031: add grouplock test to sanity.sh
[fs/lustre-release.git] / lustre / tests / test-framework.sh
index c21e281..6980a99 100644 (file)
@@ -1,5 +1,6 @@
 #!/bin/bash
-# vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
+# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
+# vim:shiftwidth=4:softtabstop=4:tabstop=4:
 
 trap 'print_summary && touch $TF_FAIL && \
     echo "test-framework exiting on error"' ERR
@@ -377,7 +378,6 @@ load_modules_local() {
     load_module obdclass/obdclass
     load_module ptlrpc/ptlrpc
     load_module ptlrpc/gss/ptlrpc_gss
-    [ "$USE_QUOTA" = "yes" -a "$LQUOTA" != "no" ] && load_module quota/lquota $LQUOTAOPTS
     load_module fld/fld
     load_module fid/fid
     load_module lmv/lmv
@@ -395,6 +395,7 @@ load_modules_local() {
                 { modprobe exportfs 2> /dev/null || true; }
             load_module ../ldiskfs/ldiskfs/ldiskfs
         fi
+        [ "$USE_QUOTA" = "yes" -a "$LQUOTA" != "no" ] && load_module quota/lquota $LQUOTAOPTS
         load_module mgs/mgs
         load_module mds/mds
         load_module mdd/mdd
@@ -403,7 +404,11 @@ load_modules_local() {
         load_module cmm/cmm
         load_module osd-ldiskfs/osd_ldiskfs
         load_module ost/ost
-        load_module obdfilter/obdfilter
+               if [ "x$USE_OFD" = "xyes" ]; then
+                       load_module ofd/ofd
+               else
+                       load_module obdfilter/obdfilter
+               fi
     fi
 
 
@@ -649,27 +654,41 @@ set_default_debug_facet () {
 
 # Facet functions
 mount_facets () {
-    local facets=${1:-$(get_facets)}
-    local facet
+       local facets=${1:-$(get_facets)}
+       local facet
 
-    for facet in ${facets//,/ }; do
-        mount_facet $facet || error "Restart of $facet failed!"
-    done
+       for facet in ${facets//,/ }; do
+               mount_facet $facet
+               local RC=$?
+               [ $RC -eq 0 ] && continue
+
+               if [ "$TESTSUITE.$TESTNAME" = "replay-dual.test_0a" ]; then
+                       skip "Restart of $facet failed!." && touch $LU482_FAILED
+               else
+                       error "Restart of $facet failed!"
+               fi
+               return $RC
+       done
 }
 
 mount_facet() {
-    local facet=$1
-    shift
-    local dev=$(facet_active $facet)_dev
-    local opt=${facet}_opt
-    local mntpt=$(facet_mntpt $facet)
-
-    echo "Starting ${facet}: ${!opt} $@ ${!dev} $mntpt"
-    do_facet ${facet} "mkdir -p $mntpt; mount -t lustre ${!opt} $@ ${!dev} $mntpt"
-    RC=${PIPESTATUS[0]}
-    if [ $RC -ne 0 ]; then
-        echo "mount -t lustre $@ ${!dev} $mntpt"
-        echo "Start of ${!dev} on ${facet} failed ${RC}"
+       local facet=$1
+       shift
+       local dev=$(facet_active $facet)_dev
+       local opt=${facet}_opt
+       local mntpt=$(facet_mntpt $facet)
+
+       echo "Starting ${facet}: ${!opt} $@ ${!dev} $mntpt"
+       # for testing LU-482 error handling in mount_facets() and test_0a()
+       if [ -f $TMP/test-lu482-trigger ]; then
+               RC=2
+       else
+               do_facet ${facet} "mkdir -p $mntpt; mount -t lustre ${!opt} \
+                                  $@ ${!dev} $mntpt"
+               RC=${PIPESTATUS[0]}
+       fi
+       if [ $RC -ne 0 ]; then
+               echo "Start of ${!dev} on ${facet} failed ${RC}"
     else
         set_default_debug_facet $facet
 
@@ -869,7 +888,7 @@ sanity_mount_check_nodes () {
     local rc=0
     for mnt in $mnts ; do
         do_nodes $nodes "running=\\\$(grep -c $mnt' ' /proc/mounts);
-mpts=\\\$(mount | grep -w -c $mnt);
+mpts=\\\$(mount | grep -c $mnt' ');
 if [ \\\$running -ne \\\$mpts ]; then
     echo \\\$(hostname) env are INSANE!;
     exit 1;
@@ -939,7 +958,7 @@ fi;
 exit \\\$rc" || return ${PIPESTATUS[0]}
 
     echo "Started clients $clients: "
-    do_nodes $clients "mount | grep -w $mnt"
+    do_nodes $clients "mount | grep $mnt' '"
 
     set_default_debug_nodes $clients
 
@@ -3816,7 +3835,7 @@ fi"
 # Run multiop in the background, but wait for it to print
 # "PAUSING" to its stdout before returning from this function.
 multiop_bg_pause() {
-    MULTIOP_PROG=${MULTIOP_PROG:-multiop}
+    MULTIOP_PROG=${MULTIOP_PROG:-$MULTIOP}
     FILE=$1
     ARGS=$2
 
@@ -4107,10 +4126,7 @@ wait_import_state() {
 # the value depends on configure options, and it is not stored in /proc.
 # obd_support.h:
 # #define CONNECTION_SWITCH_MIN 5U
-# #ifndef CRAY_XT3
 # #define INITIAL_CONNECT_TIMEOUT max(CONNECTION_SWITCH_MIN,obd_timeout/20)
-# #else
-# #define INITIAL_CONNECT_TIMEOUT max(CONNECTION_SWITCH_MIN,obd_timeout/2)
 
 request_timeout () {
     local facet=$1