Whamcloud - gitweb
LU-13379 tests: don't use localrecov for older servers
[fs/lustre-release.git] / lustre / tests / cfg / local.sh
index 7b013ad..df6c5c3 100644 (file)
 FSNAME=${FSNAME:-lustre}
 
 # facet hosts
-mds_HOST=${mds_HOST:-`hostname`}
+mds_HOST=${mds_HOST:-$(hostname)}
 mdsfailover_HOST=${mdsfailover_HOST}
-mds1_HOST=${mds1_HOST:-$mds_HOST}
-mds1failover_HOST=${mds1failover_HOST:-$mdsfailover_HOST}
-mgs_HOST=${mgs_HOST:-$mds1_HOST}
-ost_HOST=${ost_HOST:-`hostname`}
+mgs_HOST=${mgs_HOST:-$mds_HOST}
+ost_HOST=${ost_HOST:-$(hostname)}
 ostfailover_HOST=${ostfailover_HOST}
 CLIENTS=""
+# FILESET variable is used by sanity.sh to verify fileset
+# feature, tests should pass even under subdirectory namespace.
+FILESET=${FILESET:-""}
+[[ -z "$FILESET" ]] || [[ "${FILESET:0:1}" = "/" ]] || FILESET="/$FILESET"
 
 TMP=${TMP:-/tmp}
 
 DAEMONSIZE=${DAEMONSIZE:-500}
 MDSCOUNT=${MDSCOUNT:-1}
-[ $MDSCOUNT -gt 4 ] && MDSCOUNT=4
-[ $MDSCOUNT -gt 1 ] && IAMDIR=yes
-for num in $(seq $MDSCOUNT); do
-    eval mds${num}_HOST=\$\{mds${num}_HOST:-$mds_HOST\}
-    eval mds${num}failover_HOST=\$\{mds${num}failover_HOST:-$mdsfailover_HOST\}
-done
 MDSDEVBASE=${MDSDEVBASE:-$TMP/${FSNAME}-mdt}
-MDSSIZE=${MDSSIZE:-200000}
-MDSOPT=${MDSOPT:-"--mountfsoptions=errors=remount-ro,iopen_nopriv,user_xattr,acl"}
+MDSSIZE=${MDSSIZE:-250000}
+#
+# Format options of facets can be specified with these variables:
+#
+#   - <facet_type>OPT
+#
+# Arguments for "--mkfsoptions" shall be specified with these
+# variables:
+#
+#   - <fstype>_MKFS_OPTS
+#   - <facet_type>_FS_MKFS_OPTS
+#
+# A number of other options have their own specific variables.  See
+# mkfs_opts().
+#
+MDSOPT=${MDSOPT:-}
+MDS_FS_MKFS_OPTS=${MDS_FS_MKFS_OPTS:-}
+MDS_MOUNT_OPTS=${MDS_MOUNT_OPTS:-}
+# <facet_type>_MOUNT_FS_OPTS is the mount options specified when formatting
+# the underlying device by argument "--mountfsoptions"
+MDS_MOUNT_FS_OPTS=${MDS_MOUNT_FS_OPTS:-}
 
-MGSDEV=${MGSDEV:-$MDSDEV1}
 MGSSIZE=${MGSSIZE:-$MDSSIZE}
+MGSOPT=${MGSOPT:-}
+MGS_FS_MKFS_OPTS=${MGS_FS_MKFS_OPTS:-}
+MGS_MOUNT_OPTS=${MGS_MOUNT_OPTS:-}
+MGS_MOUNT_FS_OPTS=${MGS_MOUNT_FS_OPTS:-}
 
 OSTCOUNT=${OSTCOUNT:-2}
 OSTDEVBASE=${OSTDEVBASE:-$TMP/${FSNAME}-ost}
-OSTSIZE=${OSTSIZE:-200000}
-OSTOPT=""
+OSTSIZE=${OSTSIZE:-400000}
+OSTOPT=${OSTOPT:-}
+OST_FS_MKFS_OPTS=${OST_FS_MKFS_OPTS:-}
+OST_MOUNT_OPTS=${OST_MOUNT_OPTS:-}
+OST_MOUNT_FS_OPTS=${OST_MOUNT_FS_OPTS:-}
+OST_INDEX_LIST=${OST_INDEX_LIST:-}
 # Can specify individual ost devs with
 # OSTDEV1="/dev/sda"
 # on specific hosts with
 # ost1_HOST="uml2"
+# ost1_JRN="/dev/sdb1"
+#
+# For ZFS, ost devices can be specified via either or both of the following:
+# OSTZFSDEV1="${FSNAME}-ost1/ost1"
+# OSTDEV1="/dev/sdb1"
+#
+# OST indices can be specified as follows:
+# OSTINDEX1="1"
+# OSTINDEX2="2"
+# OSTINDEX3="4"
+# ......
+# or
+# OST_INDEX_LIST="[1,2,4-6,8]" # [n-m,l-k,...], where n < m and l < k, etc.
+#
+# The default index value of an individual OST is its facet number minus 1.
+# More specific ones override more general ones. See facet_index().
 
 NETTYPE=${NETTYPE:-tcp}
-MGSNID=${MGSNID:-`h2$NETTYPE $mgs_HOST`}
+MGSNID=${MGSNID:-$(h2nettype $mgs_HOST)}
+
+#
+# Back end file system type(s) of facets can be specified with these
+# variables:
+#
+#   1. <facet>_FSTYPE
+#   2. <facet_type>FSTYPE
+#   3. FSTYPE
+#
+# More specific ones override more general ones.  See facet_fstype().
+#
 FSTYPE=${FSTYPE:-ldiskfs}
-STRIPE_BYTES=${STRIPE_BYTES:-1048576}
-STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0}
-SINGLEMDS=${SINGLEMDS:-"mds1"}
+
+LDISKFS_MKFS_OPTS=${LDISKFS_MKFS_OPTS:-}
+ZFS_MKFS_OPTS=${ZFS_MKFS_OPTS:-}
+
+LOAD_MODULES_REMOTE=${LOAD_MODULES_REMOTE:-false}
+
+DEF_STRIPE_SIZE=${DEF_STRIPE_SIZE:-}   # filesystem default stripe size in bytes
+DEF_STRIPE_COUNT=${DEF_STRIPE_COUNT:-} # filesystem default stripe count
 TIMEOUT=${TIMEOUT:-20}
-PTLDEBUG=${PTLDEBUG:-0x33f0404}
-DEBUG_SIZE=${DEBUG_SIZE:-10}
-if [ `grep processor /proc/cpuinfo | wc -l` -gt 5 ]; then
-    DEBUG_SIZE=$((`grep processor /proc/cpuinfo | wc -l` * 2))   # promise 2MB for every cpu
+PTLDEBUG=${PTLDEBUG:-"vfstrace rpctrace dlmtrace neterror ha config \
+                     ioctl super lfsck"}
+SUBSYSTEM=${SUBSYSTEM:-"all"}
+
+# promise 2MB for every cpu
+if [ -f /sys/devices/system/cpu/possible ]; then
+    _debug_mb=$((($(cut -d "-" -f 2 /sys/devices/system/cpu/possible)+1)*2))
+else
+    _debug_mb=$(($(getconf _NPROCESSORS_CONF)*2))
 fi
-SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff}
+
+DEBUG_SIZE=${DEBUG_SIZE:-$_debug_mb}
 
 ENABLE_QUOTA=${ENABLE_QUOTA:-""}
 QUOTA_TYPE="ug3"
 QUOTA_USERS=${QUOTA_USERS:-"quota_usr quota_2usr sanityusr sanityusr1"}
-
-MKFSOPT=""
-[ "x$MDSJOURNALSIZE" != "x" ] &&
-    MKFSOPT=$MKFSOPT" -J size=$MDSJOURNALSIZE"
-[ "x$MDSISIZE" != "x" ] &&
-    MKFSOPT=$MKFSOPT" -i $MDSISIZE"
-[ "x$MKFSOPT" != "x" ] &&
-    MKFSOPT="--mkfsoptions=\\\"$MKFSOPT\\\""
-[ "x$SECLEVEL" != "x" ] &&
-    MKFSOPT=$MKFSOPT" --param mdt.sec_level=$SECLEVEL"
-[ "x$MDSCAPA" != "x" ] &&
-    MKFSOPT=$MKFSOPT" --param mdt.capa=$MDSCAPA"
-[ "x$mdsfailover_HOST" != "x" ] &&
-    MDSOPT=$MDSOPT" --failnode=`h2$NETTYPE $mdsfailover_HOST`"
-[ "x$STRIPE_BYTES" != "x" ] &&
-    MDSOPT=$MDSOPT" --param lov.stripesize=$STRIPE_BYTES"
-[ "x$STRIPES_PER_OBJ" != "x" ] &&
-    MDSOPT=$MDSOPT" --param lov.stripecount=$STRIPES_PER_OBJ"
-[ "x$L_GETIDENTITY" != "x" ] &&
-    MDSOPT=$MDSOPT" --param mdt.identity_upcall=$L_GETIDENTITY"
-
-MDSn_MKFS_OPTS=$MDS_MKFS_OPTS
-MDS_MKFS_OPTS="--mdt --fsname=$FSNAME --device-size=$MDSSIZE --param sys.timeout=$TIMEOUT $MKFSOPT $MDSOPT $MDS_MKFS_OPTS"
-if [[ $mds1_HOST == $mgs_HOST ]] && [[ $MDSDEV1 == $MGSDEV ]]; then
-    MDS_MKFS_OPTS="--mgs $MDS_MKFS_OPTS"
-else
-    MDS_MKFS_OPTS="--mgsnode=$MGSNID $MDS_MKFS_OPTS"
-    mgs_MKFS_OPTS="--mgs --device-size=$MGSSIZE"
-fi
-MDSn_MKFS_OPTS="--mgsnode=$MGSNID --mdt --fsname=$FSNAME --device-size=$MDSSIZE --param sys.timeout=$TIMEOUT $MKFSOPT $MDSOPT $MDSn_MKFS_OPTS"
-
-MKFSOPT=""
-[ "x$OSTJOURNALSIZE" != "x" ] &&
-    MKFSOPT=$MKFSOPT" -J size=$OSTJOURNALSIZE"
-[ "x$MKFSOPT" != "x" ] &&
-    MKFSOPT="--mkfsoptions=\\\"$MKFSOPT\\\""
-[ "x$SECLEVEL" != "x" ] &&
-    MKFSOPT=$MKFSOPT" --param ost.sec_level=$SECLEVEL"
-[ "x$OSSCAPA" != "x" ] &&
-    MKFSOPT=$MKFSOPT" --param ost.capa=$OSSCAPA"
-[ "x$ostfailover_HOST" != "x" ] &&
-    OSTOPT=$OSTOPT" --failnode=`h2$NETTYPE $ostfailover_HOST`"
-OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$TIMEOUT $MKFSOPT $OSTOPT $OST_MKFS_OPTS"
-
-MDS_MOUNT_OPTS=${MDS_MOUNT_OPTS:-"-o loop,user_xattr,acl"}
-OST_MOUNT_OPTS=${OST_MOUNT_OPTS:-"-o loop"}
+# "error: conf_param: No such device" issue in every test suite logs
+# sanity-quota test_32 hash_lqs_cur_bits is not set properly
+LQUOTAOPTS=${LQUOTAOPTS:-"hash_lqs_cur_bits=3"}
 
 #client
 MOUNT=${MOUNT:-/mnt/${FSNAME}}
 MOUNT1=${MOUNT1:-$MOUNT}
 MOUNT2=${MOUNT2:-${MOUNT}2}
-MOUNTOPT=${MOUNTOPT:-"user_xattr,acl,flock"}
+MOUNT3=${MOUNT3:-${MOUNT}3}
+# Comma-separated option list used as "mount [...] -o $MOUNT_OPTS [...]"
+MOUNT_OPTS=${MOUNT_OPTS:-"user_xattr,flock"}
+# Mount flags (e.g. "-n") used as "mount [...] $MOUNT_FLAGS [...]"
+MOUNT_FLAGS=${MOUNT_FLAGS:-""}
 DIR=${DIR:-$MOUNT}
 DIR1=${DIR:-$MOUNT1}
 DIR2=${DIR2:-$MOUNT2}
+DIR3=${DIR3:-$MOUNT3}
 
 if [ $UID -ne 0 ]; then
         log "running as non-root uid $UID"
         RUNAS_ID="$UID"
+        RUNAS_GID=`id -g $USER`
         RUNAS=""
 else
         RUNAS_ID=${RUNAS_ID:-500}
-        RUNAS=${RUNAS:-"runas -u $RUNAS_ID"}
+        RUNAS_GID=${RUNAS_GID:-$RUNAS_ID}
+        RUNAS=${RUNAS:-"runas -u $RUNAS_ID -g $RUNAS_GID"}
 fi
 
 PDSH=${PDSH:-no_dsh}
@@ -125,7 +149,25 @@ POWER_UP=${POWER_UP:-"powerman --on"}
 SLOW=${SLOW:-no}
 FAIL_ON_ERROR=${FAIL_ON_ERROR:-true}
 
-MPIRUN=$(which mpirun 2>/dev/null) || true
+MPIRUN=${MPIRUN:-$(which mpirun 2>/dev/null || true)}
 MPI_USER=${MPI_USER:-mpiuser}
 SHARED_DIR_LOGS=${SHARED_DIR_LOGS:-""}
-
+MACHINEFILE_OPTION=${MACHINEFILE_OPTION:-"-machinefile"}
+
+# This is used by a small number of tests to share state between the client
+# running the tests, or in some cases between the servers (e.g. lfsck.sh).
+# It needs to be a non-lustre filesystem that is available on all the nodes.
+SHARED_DIRECTORY=${SHARED_DIRECTORY:-$TMP}     # bug 17839 comment 65
+
+#
+# In order to test multiple remote HSM agents, a new facet type named "AGT" and
+# the following associated variables are added:
+#
+# AGTCOUNT: number of agents
+# AGTDEV{N}: target HSM mount point (root path of the backend)
+# agt{N}_HOST: hostname of the agent agt{N}
+# SINGLEAGT: facet of the single agent
+#
+# Please refer to init_agt_vars() in sanity-hsm.sh for the default values of
+# these variables.
+#