# LDADD = -lldap
# LDADD := -lreadline -ltermcap # -lefence
-pkgexample_scripts = llmount.sh llmountcleanup.sh llecho.sh llechocleanup.sh
-pkgexample_scripts += local.sh echo.sh uml.sh lov.sh
noinst_DATA =
noinst_SCRIPTS = leak_finder.pl llecho.sh llmount.sh llmountcleanup.sh
noinst_SCRIPTS += runfailure-mds runvmstat runfailure-net
noinst_SCRIPTS += runfailure-ost runiozone runregression-net.sh runtests
noinst_SCRIPTS += sanity.sh rundbench
-EXTRA_DIST = $(pkgexample_scripts) $(noinst_SCRIPTS) $(noinst_DATA) \
+EXTRA_DIST = $(noinst_SCRIPTS) $(noinst_DATA) \
sanity.sh rundbench \
acl/run acl/make-tree acl/getfacl-noacl.test acl/cp.test \
acl/setfacl.test acl/permissions.test acl/misc.test \
acl/inheritance.test
if TESTS
-pkgexample_SCRIPTS = $(pkgexample_scripts)
noinst_PROGRAMS = openunlink testreq truncate directio openme writeme
noinst_PROGRAMS += tchmod toexcl fsx test_brw openclose createdestroy
noinst_PROGRAMS += stat createmany chownmany statmany multifstat createtest mlink utime
LUSTRE=${LUSTRE:-`dirname $0`/..}
. $LUSTRE/tests/test-framework.sh
init_test_env $@
-. mountconf.sh
-SETUP=${SETUP:-mcsetup}
-FORMAT=${FORMAT:-mcformat}
-CLEANUP=${CLEANUP:-mcstopall}
+SETUP=${SETUP:-setupall}
+FORMAT=${FORMAT:-formatall}
+CLEANUP=${CLEANUP:-stopall}
for NAME in $CONFIGS; do
export NAME MOUNT START CLEAN
CLIENT=${CLIENT:-client}
FSNAME=lustre
+
+# facet hosts
mds_HOST=${mds_HOST:-$MDSNODE}
mdsfailover_HOST=${mdsfailover_HOST}
mgs_HOST=${mgs_HOST:-$mds_HOST}
-ost_HOST=${ost_HOST:-$OSTNODE}
+ost1_HOST=${ost1_HOST:-$OSTNODE}
ostfailover_HOST=${ostfailover_HOST}
-ost2_HOST=${ost2_HOST:-$ost_HOST}
+ost2_HOST=${ost2_HOST:-$OSTNODE}
TMP=${TMP:-/tmp}
MDSDEV=${MDSDEV:-$TMP/${FSNAME}-mdt}
MDSSIZE=${MDSSIZE:-100000}
MDSOPT=${MDSOPT:-"--mountfsoptions=acl"}
-OSTDEV=${OSTDEV:-$TMP/${FSNAME}-ost0}
+
+OSTCOUNT=${OSTCOUNT:-2}
+OSTDEVBASE=${OSTDEVBASE:-$TMP/${FSNAME}-ost}
OSTSIZE=${OSTSIZE:-200000}
-OSTDEV2=${OSTDEV2:-$TMP/${FSNAME}-ost1}
NETTYPE=${NETTYPE:-tcp}
MGSNID=`h2$NETTYPE $mgs_HOST`
STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0}
TIMEOUT=${TIMEOUT:-20}
UPCALL=${UPCALL:-DEFAULT}
-#PTLDEBUG=${PTLDEBUG:-0x33f0404}
-PTLDEBUG=${PTLDEBUG:-0xffffffff}
+PTLDEBUG=${PTLDEBUG:-0x33f0404}
SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff}
MKFSOPT=""
[ "x$ostfailover_HOST" != "x" ] &&
MOUNTOPT=$MOUNTOPT" --failnode=`h2$NETTYPE $ostfailover_HOST`"
OST_MKFS_OPTS="--ost --device-size=$OSTSIZE --mgsnode=$MGSNID --param obd_timeout=$TIMEOUT $MKFSOPT $MOUNTOPT $OSTOPT"
-OST2_MKFS_OPTS=${OST2_MKFS_OPTS:-${OST_MKFS_OPTS}}
MDS_MOUNT_OPTS="-o loop"
OST_MOUNT_OPTS="-o loop"
-OST2_MOUNT_OPTS="-o loop"
+#client
MOUNT=${MOUNT:-/mnt/${FSNAME}}
MOUNT1=${MOUNT1:-$MOUNT}
MOUNT2=${MOUNT2:-${MOUNT}2}
+MOUNTOPT=${MOUNTOPT:-"user_xattr,acl"}
DIR=${DIR:-$MOUNT}
DIR1=${DIR:-$MOUNT1}
DIR2=${DIR2:-$MOUNT2}
-MOUNTOPT=${MOUNTOPT:-"user_xattr,acl"}
PDSH=${PDSH:-no_dsh}
FAILURE_MODE=${FAILURE_MODE:-SOFT} # or HARD
--- /dev/null
+# oldstyle
+MDSNODE=${MDSNODE:-`hostname`}
+OSTNODE=${OSTNODE:-`hostname`}
+CLIENT=${CLIENT:-client}
+
+FSNAME=lustre
+
+# facet hosts
+mds_HOST=${mds_HOST:-$MDSNODE}
+mdsfailover_HOST=${mdsfailover_HOST}
+mgs_HOST=${mgs_HOST:-$mds_HOST}
+ost1_HOST=${ost1_HOST:-$OSTNODE}
+ostfailover_HOST=${ostfailover_HOST}
+ost2_HOST=${ost2_HOST:-$OSTNODE}
+
+TMP=${TMP:-/tmp}
+MDSDEV=${MDSDEV:-$TMP/${FSNAME}-mdt}
+MDSSIZE=${MDSSIZE:-400000}
+MDSOPT=${MDSOPT:-"--mountfsoptions=user_xattr,acl,"}
+
+OSTCOUNT=${OSTCOUNT:-5}
+OSTDEVBASE=${OSTDEVBASE:-$TMP/${FSNAME}-ost}
+OSTSIZE=${OSTSIZE:-150000}
+
+NETTYPE=${NETTYPE:-tcp}
+MGSNID=`h2$NETTYPE $mgs_HOST`
+FSTYPE=${FSTYPE:-ldiskfs}
+STRIPE_BYTES=${STRIPE_BYTES:-1048576}
+STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-$((OSTCOUNT -1))}
+TIMEOUT=${TIMEOUT:-20}
+UPCALL=${UPCALL:-DEFAULT}
+PTLDEBUG=${PTLDEBUG:-0x33f0404}
+SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff}
+
+MKFSOPT=""
+MOUNTOPT=""
+[ "x$MDSJOURNALSIZE" != "x" ] &&
+ MKFSOPT=$MKFSOPT" -J size=$MDSJOURNALSIZE"
+[ "x$MDSISIZE" != "x" ] &&
+ MKFSOPT=$MKFSOPT" -i $MDSISIZE"
+[ "x$MKFSOPT" != "x" ] &&
+ MKFSOPT="--mkfsoptions=\"$MKFSOPT\""
+[ "x$mdsfailover_HOST" != "x" ] &&
+ MOUNTOPT=$MOUNTOPT" --failnode=`h2$NETTYPE $mdsfailover_HOST`"
+[ "x$STRIPE_BYTES" != "x" ] &&
+ MOUNTOPT=$MOUNTOPT" --param default_stripe_size=$STRIPE_BYTES"
+[ "x$STRIPES_PER_OBJ" != "x" ] &&
+ MOUNTOPT=$MOUNTOPT" --param default_stripe_count=$STRIPES_PER_OBJ"
+MDS_MKFS_OPTS="--mgs --mdt --device-size=$MDSSIZE --param obd_timeout=$TIMEOUT $MKFSOPT $MOUNTOPT $MDSOPT"
+
+MKFSOPT=""
+MOUNTOPT=""
+[ "x$OSTJOURNALSIZE" != "x" ] &&
+ MKFSOPT=$MKFSOPT" -J size=$OSTJOURNALSIZE"
+[ "x$MKFSOPT" != "x" ] &&
+ MKFSOPT="--mkfsoptions=\"$MKFSOPT\""
+[ "x$ostfailover_HOST" != "x" ] &&
+ MOUNTOPT=$MOUNTOPT" --failnode=`h2$NETTYPE $ostfailover_HOST`"
+OST_MKFS_OPTS="--ost --device-size=$OSTSIZE --mgsnode=$MGSNID --param obd_timeout=$TIMEOUT $MKFSOPT $MOUNTOPT $OSTOPT"
+
+MDS_MOUNT_OPTS="-o loop"
+OST_MOUNT_OPTS="-o loop"
+
+#client
+MOUNT=${MOUNT:-/mnt/${FSNAME}}
+MOUNT1=${MOUNT1:-$MOUNT}
+MOUNT2=${MOUNT2:-${MOUNT}2}
+MOUNTOPT=${MOUNTOPT:-"user_xattr,"}
+DIR=${DIR:-$MOUNT}
+DIR1=${DIR:-$MOUNT1}
+DIR2=${DIR2:-$MOUNT2}
+
+PDSH=${PDSH:-no_dsh}
+FAILURE_MODE=${FAILURE_MODE:-SOFT} # or HARD
+POWER_DOWN=${POWER_DOWN:-"powerman --off"}
+POWER_UP=${POWER_UP:-"powerman --on"}
set -e
ONLY=${ONLY:-"$*"}
-# bug number for skipped test: mc mc mc mc mc mc mc mc mc
-ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT 9 10 11 12 13 13b 14 15 18"
+
+# These tests don't apply to mountconf
+MOUNTCONFSKIP="9 10 11 12 13 13b 14 15 18"
+
+# bug number for skipped test:
+ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT $MOUNTCONFSKIP"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
SRCDIR=`dirname $0`
HOSTNAME=`hostname`
. $LUSTRE/tests/test-framework.sh
-
init_test_env $@
-
. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
reformat() {
- grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT
- stop ost -f
- stop ost2 -f
- stop mds -f
- echo Formatting mds, ost, ost2
- add mds $MDS_MKFS_OPTS --reformat $MDSDEV > /dev/null
- add ost $OST_MKFS_OPTS --reformat $OSTDEV > /dev/null
- add ost2 $OST2_MKFS_OPTS --reformat $OSTDEV2 > /dev/null
+ formatall
}
gen_config() {
}
start_ost() {
- echo "start ost service on `facet_active_host ost`"
- start ost $OSTDEV $OST_MOUNT_OPTS || return 95
+ echo "start ost1 service on `facet_active_host ost1`"
+ start ost1 `ostdevname 1` $OST_MOUNT_OPTS || return 95
}
stop_ost() {
- echo "stop ost service on `facet_active_host ost`"
+ echo "stop ost1 service on `facet_active_host ost1`"
# These tests all use non-failover stop
- stop ost -f || return 98
+ stop ost1 -f || return 98
}
start_ost2() {
echo "start ost2 service on `facet_active_host ost2`"
- start ost2 $OSTDEV2 $OST2_MOUNT_OPTS || return 92
+ start ost2 `ostdevname 2` $OST_MOUNT_OPTS || return 92
}
stop_ost2() {
check_mount || return 42
cleanup || return $?
}
-run_test 1 "start up ost twice"
+run_test 1 "start up ost twice (should return errors)"
test_2() {
start_ost
start_ost
start_mds
mount_client $MOUNT || return $?
- if [ -z "`do_facet ost dumpe2fs -h $OSTDEV | grep label_conf_14`" ]; then
+ if [ -z "`do_facet ost1 dumpe2fs -h $OSTDEV | grep label_conf_14`" ]; then
echo "Error: the mkoptions not applied to mke2fs of ost."
return 1
fi
start_mds && return 42
gen_config
}
-run_test 17 "Verify failed mds_postsetup won't fail assertion (2936)"
+run_test 17 "Verify failed mds_postsetup won't fail assertion (2936) (should return errs)"
test_18() {
[ -f $MDSDEV ] && echo "remove $MDSDEV" && rm -f $MDSDEV
cleanup
}
-run_test 21 "start a client before osts"
+run_test 21 "start a client before osts (should return errs)"
+
+test_22() {
+ setup
+ # failover mds
+ stop mds
+ # force client
+ zconf_umount `hostname` $MOUNT -f
+ # enter recovery on mds
+ start_mds
+ mount_client $MOUNT &
+ sleep 5
+ local mount_lustre_pid = `ps -ef | grep mount.lustre | grep -v grep | awk '{print $2}'`
+ echo mount.lustre pid is ${mount_lustre_pid}
+ kill -SIGINT ${mount_lustre_pid}
+ exit 1
+
+ sleep 5
+ stop_mds
+ stop_ost
+}
+run_test 22 "interrupt client during recovery mount delay"
umount_client $MOUNT
#!/bin/sh
-# suggested boilerplate for test script
export PATH=`dirname $0`/../utils:$PATH
-LCONF=${LCONF:-lconf}
-NAME=${NAME:-local}
-LLMOUNT=${LLMOUNT:-llmount}
+LUSTRE=${LUSTRE:-`dirname $0`/..}
+. $LUSTRE/tests/test-framework.sh
+init_test_env $@
+. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
-config=$NAME.xml
-mkconfig=$NAME.sh
-
-if [ "$PORTALS" ]; then
- portals_opt="--portals=$PORTALS"
-fi
-
-if [ "$LUSTRE" ]; then
- lustre_opt="--lustre=$LUSTRE"
-fi
-
-if [ "$LDAPURL" ]; then
- conf_opt="--ldapurl $LDAPURL --config $NAME"
-else
- sh $mkconfig $config || exit 1
- conf_opt="$config"
-fi
-
-[ "$NODE" ] && node_opt="--node $NODE"
-[ "$DEBUG" ] && debug_opt="--ptldebug=$DEBUG"
-[ "$PTLDEBUG" ] && debug_opt="--ptldebug=$PTLDEBUG"
-
-echo llmount: FIXME replace llmount.sh with ". mountconf.sh" and "$SETUP"
-
-exit 1
-
-#${LCONF} $NOMOD $portals_opt $lustre_opt $debug_opt $node_opt ${REFORMAT:---reformat} $@ $conf_opt || {
- # maybe acceptor error, dump tcp port usage
-# netstat -tpn
-# exit 2
-#}
-
-#if [ "$MOUNT2" ]; then
-# $LLMOUNT -v -o user_xattr `hostname`:/mds1/client $MOUNT2 || exit 3
-#fi
+formatall
+setupall
export PATH=`dirname $0`/../utils:$PATH
-LCONF=${LCONF:-lconf}
-NAME=${NAME:-local}
-TMP=${TMP:-/tmp}
+LUSTRE=${LUSTRE:-`dirname $0`/..}
+. $LUSTRE/tests/test-framework.sh
+init_test_env $@
+. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
-config=$NAME.xml
-mkconfig=$NAME.sh
-
-if [ "$PORTALS" ]; then
- portals_opt="--portals=$PORTALS"
-fi
-
-if [ "$LUSTRE" ]; then
- lustre_opt="--lustre=$LUSTRE"
-fi
-
-if [ "$LDAPURL" ]; then
- conf_opt="--ldapurl $LDAPURL --config $NAME"
-else
- if [ ! -f $config ]; then
- sh $mkconfig $config || exit 1
- fi
- conf_opt="$config"
-fi
-
-[ "$NODE" ] && node_opt="--node $NODE"
-
-[ "$MOUNT2" ] && umount $MOUNT2
-
-#${LCONF} $NOMOD $portals_opt $lustre_opt $node_opt --cleanup $@ \
- --dump $TMP/debug $conf_opt
-
-echo FIXME llmountcleanup should be replaced with $CLEANUP
-exit 1
-
-rc=$?
-echo "lconf DONE"
-BUSY=`dmesg | grep -i destruct`
-if [ "$BUSY" ]; then
- echo "$BUSY" 1>&2
- mv $TMP/debug $TMP/debug-busy.`date +%s`
- exit 255
-fi
-LEAK_LUSTRE=`dmesg | tail -n 30 | grep "obd mem.*leaked"`
-LEAK_PORTALS=`dmesg | tail -n 20 | grep "Portals memory leaked"`
-if [ "$LEAK_LUSTRE" -o "$LEAK_PORTALS" ]; then
- echo "$LEAK_LUSTRE" 1>&2
- echo "$LEAK_PORTALS" 1>&2
- mv $TMP/debug $TMP/debug-leak.`date +%s`
- echo "Memory leaks detected"
- exit 254
-fi
-lsmod | grep lnet && echo "modules still loaded" && exit 1
-
-exit $rc
+cleanupall
+++ /dev/null
-#!/bin/bash
-
-export PATH=`dirname $0`/../utils:$PATH
-
-config=${1:-`basename $0 .sh`.xml}
-
-LMC=echo
-TMP=${TMP:-/tmp}
-
-FSNAME=lustre
-HOSTNAME=`hostname`
-MDSDEV=${MDSDEV:-$TMP/mdt-${FSNAME}}
-MDSSIZE=${MDSSIZE:-400000}
-MOUNT=${MOUNT:-/mnt/${FSNAME}}
-MOUNT2=${MOUNT2:-${MOUNT}2}
-NETTYPE=${NETTYPE:-tcp}
-[ "$ACCEPTOR_PORT" ] && PORT_OPT="--port $ACCEPTOR_PORT"
-
-OSTDEV=${OSTDEV:-$TMP/ost0-${FSNAME}}
-OSTSIZE=${OSTSIZE:-400000}
-OSTDEV2=${OSTDEV2:-$TMP/ost1-${FSNAME}}
-
-MDS_MOUNT_OPTS="user_xattr,acl,${MDS_MOUNT_OPTS:-""}"
-CLIENTOPT="user_xattr,${CLIENTOPT:-""}"
-
-# specific journal size for the ost, in MB
-JSIZE=${JSIZE:-0}
-[ "$JSIZE" -gt 0 ] && OST_MKFS_OPTS=$OST_MKFS_OPTS" -J size=$JSIZE"
-MDSISIZE=${MDSISIZE:-0}
-[ "$MDSISIZE" -gt 0 ] && MDS_MKFS_OPTS=$MDS_MKFS_OPTS" -i $MDSISIZE"
-
-STRIPE_BYTES=${STRIPE_BYTES:-1048576}
-STRIPES_PER_OBJ=1 # 0 means stripe over all OSTs
-
-rm -f $config
-
-h2tcp () {
- case $1 in
- client) echo '\*' ;;
- *) echo $1 ;;
- esac
-}
-
-h2elan () {
- case $1 in
- client) echo '\*' ;;
- *) echo $1 | sed "s/[^0-9]*//" ;;
- esac
-}
-
-h2gm () {
- echo `gmlndnid -n$1`
-}
-
-h2iib () {
- case $1 in
- client) echo '\*' ;;
- *) echo $1 | sed "s/[^0-9]*//" ;;
- esac
-}
-
-MGSNID=`h2$NETTYPE $HOSTNAME`
-
-# configure mds server
-[ "x$MDS_MOUNT_OPTS" != "x" ] &&
- MDS_MOUNT_OPTS="--mountfsoptions=$MDS_MOUNT_OPTS"
-[ "x$MDS_MKFS_OPTS" != "x" ] &&
- MDS_MOUNT_OPTS="--mkfsoptions=\"$MDS_MOUNT_OPTS\""
-[ "x$QUOTA_OPTS" != "x" ] &&
- QUOTA_OPTS="--quota $QUOTA_OPTS"
-[ ! -z "$mdsfailover_HOST" ] && MDS_FAIL_OPT="--failnode=$mdsfailover_HOST"
-
-MDS_OPTS="--mgs $MDS_FAIL_OPT --device-size=$MDSSIZE $MDS_MOUNT_OPTS $MDS_MKFS_OPTS"
-echo mkfs.lustre --mdt $MDS_OPTS --reformat $MDSDEV
-
-[ "x$OST_MOUNT_OPTS" != "x" ] &&
- OST_MOUNT_OPTS="--mountfsoptions=$OST_MOUNT_OPTS"
-[ "x$OST_MKFS_OPTS" != "x" ] &&
- OST_MOUNT_OPTS="--mkfsoptions=\"$OST_MOUNT_OPTS\""
-
-OST_OPTS="--mgsnode=`h2$NETTYPE $HOSTNAME` $OST_FAIL_OPT --device-size=$OSTSIZE $OST_MOUNT_OPTS $OST_MKFS_OPTS"
-echo mkfs.lustre --ost $OST_OPTS --reformat $OSTDEV
-
-OST2_OPTS="--mgsnode=`h2$NETTYPE $HOSTNAME` $OST_FAIL_OPT --device-size=$OSTSIZE $OST_MOUNT_OPTS $OST_MKFS_OPTS"
-echo mkfs.lustre --ost $OST2_OPTS --reformat $OSTDEV2
-
+++ /dev/null
-#!/bin/bash
-
-set -e
-
-export PATH=`dirname $0`/../utils:$PATH
-
-config=${1:-`basename $0 .sh`.xml}
-
-LMC="${LMC:-lmc} -m $config"
-TMP=${TMP:-/tmp}
-
-HOSTNAME=`hostname`
-MDSDEV=${MDSDEV:-$TMP/mds1-`hostname`}
-MDSSIZE=${MDSSIZE:-400000}
-FSTYPE=${FSTYPE:-ext3}
-MOUNT=${MOUNT:-/mnt/lustre}
-MOUNT2=${MOUNT2:-${MOUNT}2}
-NETTYPE=${NETTYPE:-tcp}
-[ "$ACCEPTOR_PORT" ] && PORT_OPT="--port $ACCEPTOR_PORT"
-
-OSTCOUNT=${OSTCOUNT:-5}
-# OSTDEVn will still override the device for OST n
-
-OSTSIZE=${OSTSIZE:-150000}
-# 1 to config an echo client instead of llite
-ECHO_CLIENT=${ECHO_CLIENT:-}
-
-STRIPE_BYTES=${STRIPE_BYTES:-1048576}
-STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-$((OSTCOUNT -1))}
-
-MDS_MOUNT_OPTS="user_xattr,acl,${MDS_MOUNT_OPTS:-""}"
-CLIENTOPT="user_xattr,${CLIENTOPT:-""}"
-
-# specific journal size for the ost, in MB
-JSIZE=${JSIZE:-0}
-JARG=""
-[ "$JSIZE" -gt 0 ] && JARG="--journal_size $JSIZE"
-
-rm -f $config
-
-# create nodes
-${LMC} --add node --node $HOSTNAME || exit 10
-${LMC} --add net --node $HOSTNAME --nid $HOSTNAME \
- --nettype $NETTYPE $PORT_OPT || exit 11
-${LMC} --add net --node client --nid '*' --nettype $NETTYPE $PORT_OPT || exit 12
-
-[ "x$QUOTA_OPTS" != "x" ] &&
- QUOTA_OPTS="--quota $QUOTA_OPTS"
-
-# configure mds server
-[ "x$MDS_MOUNT_OPTS" != "x" ] &&
- MDS_MOUNT_OPTS="--mountfsoptions $MDS_MOUNT_OPTS"
-
-${LMC} --format --add mds --node $HOSTNAME --mds mds1 --fstype $FSTYPE \
- --dev $MDSDEV $MDS_MOUNT_OPTS $QUOTA_OPTS --size $MDSSIZE $MDSOPT || exit 20
-
-# configure ost
-${LMC} --add lov --lov lov1 --mds mds1 --stripe_sz $STRIPE_BYTES \
- --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0 $LOVOPT || exit 20
-
-for num in `seq $OSTCOUNT`; do
- OST=ost$num
- DEVPTR=OSTDEV$num
- eval $DEVPTR=${!DEVPTR:=$TMP/$OST-`hostname`}
- ${LMC} --add ost --node $HOSTNAME --lov lov1 --ost $OST --fstype $FSTYPE \
- --dev ${!DEVPTR} --size $OSTSIZE $JARG $OSTOPT $QUOTA_OPTS|| exit 30
-done
-
-
-if [ -z "$ECHO_CLIENT" ]; then
- # create client config
- [ "x$CLIENTOPT" != "x" ] && CLIENTOPT="--clientoptions $CLIENTOPT"
- ${LMC} --add mtpt --node $HOSTNAME --path $MOUNT \
- --mds mds1 --lov lov1 $CLIENTOPT || exit 40
- ${LMC} --add mtpt --node client --path $MOUNT2 \
- --mds mds1 --lov lov1 $CLIENTOPT || exit 41
-else
- ${LMC} --add echo_client --node $HOSTNAME --ost lov1 || exit 42
-fi
+++ /dev/null
-#!/bin/sh
-
-#set -vx
-
-# mountconf setup of MDS and two OSTs
-
-#export PATH=`dirname $0`/../utils:$PATH
-#LUSTRE=${LUSTRE:-`dirname $0`/..}
-#. $LUSTRE/tests/test-framework.sh
-#init_test_env $@
-
-mcstopall() {
- # make sure we are using the primary server, so test-framework will
- # be able to clean up properly.
- activemds=`facet_active mds`
- if [ $activemds != "mds" ]; then
- fail mds
- fi
-
- grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT $*
- stop ost -f
- stop ost2 -f
- stop mds -f
- return 0
-}
-
-mccleanup() {
- echo "mountconf cleanup $*"
- mcstopall $*
- unload_modules
-}
-
-mcformat() {
- mcstopall
- echo Formatting mds, ost, ost2
- add mds $MDS_MKFS_OPTS --reformat $MDSDEV > /dev/null || exit 10
- add ost $OST_MKFS_OPTS --reformat $OSTDEV > /dev/null || exit 10
- add ost2 $OST2_MKFS_OPTS --reformat $OSTDEV2 > /dev/null || exit 10
-}
-export MCFORMAT=${MCFORMAT:-"mcformat"}
-
-mount_client() {
- grep " $1 " /proc/mounts || zconf_mount `hostname` $*
-}
-
-mcsetup() {
- echo Setup mds, ost, ost2
- start mds $MDSDEV $MDS_MOUNT_OPTS
- start ost $OSTDEV $OST_MOUNT_OPTS
- start ost2 $OSTDEV2 $OST2_MOUNT_OPTS
- [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
-
- mount_client $MOUNT
- sleep 5
-}
-
-export MCSETUP=${MCSETUP:-"mcsetup"}
-export MCCLEANUP=${MCCLEANUP:-"mccleanup"}
-
SETUP=${SETUP:-"setup"}
CLEANUP=${CLEANUP:-"cleanup"}
-# for MCSETUP and MCCLEANUP
-. mountconf.sh
-
setup() {
- $MCFORMAT
- $MCSETUP
+ formatall
+ setupall
}
cleanup() {
- $MCCLEANUP > /dev/null || { echo "FAILed to clean up"; exit 20; }
+ cleanupall > /dev/null || { echo "FAILed to clean up"; exit 20; }
}
if [ ! -z "$EVAL" ]; then
stop_read_ahead
#define OBD_FAIL_PTLRPC_BULK_PUT_NET 0x504 | OBD_FAIL_ONCE
- do_facet ost sysctl -w lustre.fail_loc=0x80000504
+ do_facet ost1 sysctl -w lustre.fail_loc=0x80000504
cancel_lru_locks osc
# OST bulk will time out here, client resends
do_facet client "cmp /etc/termcap $MOUNT/termcap" || return 1
sleep 1
cancel_lru_locks osc
#define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
- do_facet ost sysctl -w lustre.fail_loc=0x80000308
+ do_facet ost1 sysctl -w lustre.fail_loc=0x80000308
kill -USR1 $MULTI_PID
wait $MULTI_PID
rc=$?
touch $DIR/$tdir/${tfile}
cancel_lru_locks osc
#define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
- do_facet ost sysctl -w lustre.fail_loc=0x80000308
+ do_facet ost1 sysctl -w lustre.fail_loc=0x80000308
dd if=/etc/hosts of=$DIR/$tdir/$tfile && \
error "didn't fail open enqueue" || true
}
[ "`lsmod | grep mds`" ] && \
echo "skipping test 26 (local MDS)" && return
OST_FILE=$LPROC/obdfilter/ost_svc/num_exports
- OST_EXP="`do_facet ost cat $OST_FILE`"
+ OST_EXP="`do_facet ost1 cat $OST_FILE`"
OST_NEXP1=`echo $OST_EXP | cut -d' ' -f2`
echo starting with $OST_NEXP1 OST exports
# OBD_FAIL_PTLRPC_DROP_RPC 0x505
# might have to wait for the next ping.
echo Waiting for $(($TIMEOUT * 4)) secs
sleep $(($TIMEOUT * 4))
- OST_EXP="`do_facet ost cat $OST_FILE`"
+ OST_EXP="`do_facet ost1 cat $OST_FILE`"
OST_NEXP2=`echo $OST_EXP | cut -d' ' -f2`
echo ending with $OST_NEXP2 OST exports
do_facet client sysctl -w lustre.fail_loc=0x0
MDS_FILE=$LPROC/mds/${mds_svc}/num_exports
MDS_NEXP1="`do_facet mds cat $MDS_FILE | cut -d' ' -f2`"
OST_FILE=$LPROC/obdfilter/${ost_svc}/num_exports
- OST_NEXP1="`do_facet ost cat $OST_FILE | cut -d' ' -f2`"
+ OST_NEXP1="`do_facet ost1 cat $OST_FILE | cut -d' ' -f2`"
echo starting with $OST_NEXP1 OST and $MDS_NEXP1 MDS exports
zconf_umount `hostname` $MOUNT2 -f
# evictor takes up to 2.25x to evict. But if there's a
# might have to wait for the next ping.
echo Waiting for $(($TIMEOUT * 4)) secs
sleep $(($TIMEOUT * 4))
- OST_NEXP2="`do_facet ost cat $OST_FILE | cut -d' ' -f2`"
+ OST_NEXP2="`do_facet ost1 cat $OST_FILE | cut -d' ' -f2`"
MDS_NEXP2="`do_facet mds cat $MDS_FILE | cut -d' ' -f2`"
echo ending with $OST_NEXP2 OST and $MDS_NEXP2 MDS exports
[ $OST_NEXP1 -le $OST_NEXP2 ] && error "client not evicted from OST"
build_test_filter
cleanup() {
- # make sure we are using the primary server, so test-framework will
- # be able to clean up properly.
- activemds=`facet_active mds`
- if [ $activemds != "mds" ]; then
- fail mds
- fi
-
- grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT
- grep " $MOUNT2 " /proc/mounts && zconf_umount `hostname` $MOUNT2
- stop mds -f
- stop ost2 -f
- stop ost -f
+ stopall
}
if [ "$ONLY" == "cleanup" ]; then
setup() {
cleanup
- add mds $MDS_MKFS_OPTS --reformat $MDSDEV
- add ost $OST_MKFS_OPTS --reformat $OSTDEV
- add ost2 $OST2_MKFS_OPTS --reformat $OSTDEV2
- start mds $MDSDEV $MDS_MOUNT_OPTS
- start ost $OSTDEV $OST_MOUNT_OPTS
- start ost2 $OSTDEV2 $OST2_MOUNT_OPTS
- # client actions will get EIO until MDT contacts OSTs, so give it a sec
- sleep 5
- zconf_mount `hostname` $MOUNT
- zconf_mount `hostname` $MOUNT2
+ formatall
+ setupall
+ mount_client $MOUNT2
}
$SETUP
echo "data" > "$MOUNT2/${tfile}-m2"
umount $MOUNT2
- do_facet ost "sysctl -w lustre.fail_loc=0x80000802"
+ do_facet ost1 "sysctl -w lustre.fail_loc=0x80000802"
facet_failover mds
df $MOUNT || return 1
- do_facet ost "sysctl -w lustre.fail_loc=0"
+ do_facet ost1 "sysctl -w lustre.fail_loc=0"
zconf_mount `hostname` $MOUNT2
return 0
LUSTRE=${LUSTRE:-`dirname $0`/..}
. $LUSTRE/tests/test-framework.sh
-
init_test_env $@
-
. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
ostfailover_HOST=${ostfailover_HOST:-$ost_HOST}
# BUG NUMBER: 2766?
ALWAYS_EXCEPT="5 $REPLAY_OST_SINGLE_EXCEPT"
+# It is replay-ost-single, after all
+OSTCOUNT=1
+
gen_config() {
- grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT
- stop ost -f
- stop ost2 -f
- stop mds -f
- echo Formatting mds, ost
- add mds $MDS_MKFS_OPTS --reformat $MDSDEV
- add ost $OST_MKFS_OPTS --reformat $OSTDEV
+ formatall
}
cleanup() {
- # make sure we are using the primary server, so test-framework will
- # be able to clean up properly.
- activeost=`facet_active ost`
- if [ $activeost != "ost" ]; then
- fail ost
- fi
-
- zconf_umount `hostname` $MOUNT
- stop mds
- stop ost
- unload_modules
+ cleanupall
}
if [ "$ONLY" == "cleanup" ]; then
setup() {
gen_config
start mds $MDSDEV $MDS_MOUNT_OPTS
- start ost $OSTDEV $OST_MOUNT_OPTS
+ start ost1 `ostdevname 1` $OST_MOUNT_OPTS
[ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
if [ -z "`grep " $MOUNT " /proc/mounts`" ]; then
# test "-1" needed during initial client->OST connection
log "== test 00: target handle mismatch (bug 5317) === `date +%H:%M:%S`"
#define OBD_FAIL_OST_ALL_REPLY_NET 0x211
- do_facet ost "sysctl -w lustre.fail_loc=0x80000211"
+ do_facet ost1 "sysctl -w lustre.fail_loc=0x80000211"
zconf_mount `hostname` $MOUNT && df $MOUNT && pass || error "mount fail"
fi
}
$SETUP
test_0() {
- fail ost
+ fail ost1
cp /etc/profile $DIR/$tfile
sync
diff /etc/profile $DIR/$tfile
test_1() {
date > $DIR/$tfile
- fail ost
+ fail ost1
$CHECKSTAT -t file $DIR/$tfile || return 1
rm -f $DIR/$tfile
}
for i in `seq 10`; do
echo "tag-$i" > $DIR/$tfile-$i
done
- fail ost
+ fail ost1
for i in `seq 10`; do
grep -q "tag-$i" $DIR/$tfile-$i || error "f2-$i"
done
dd if=/dev/urandom bs=4096 count=1280 | tee $verify > $DIR/$tfile &
ddpid=$!
sync &
- fail ost
+ fail ost1
wait $ddpid || return 1
cmp $verify $DIR/$tfile || return 2
rm -f $verify $DIR/$tfile
done
cmp $verify $DIR/$tfile &
cmppid=$!
- fail ost
+ fail ost1
wait $cmppid || return 1
rm -f $verify $DIR/$tfile
}
PID=$!
sleep 8
- fail ost
+ fail ost1
wait $PID || return 1
rm -f $DIR/$tfile
}
log "before: $before after_dd: $after_dd"
(( $before > $after_dd )) || return 1
rm -f $f
- fail ost
+ fail ost1
$CHECKSTAT -t file $f && return 2 || true
sync
# let the delete happen
(( $before > $after_dd )) || return 1
replay_barrier ost
rm -f $f
- fail ost
+ fail ost1
$CHECKSTAT -t file $f && return 2 || true
sync
# let the delete happen
LUSTRE=${LUSTRE:-`dirname $0`/..}
. $LUSTRE/tests/test-framework.sh
-
init_test_env $@
-
. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
-. mountconf.sh
+
# Skip these tests
# bug number: 2766
build_test_filter
SETUP=${SETUP:-"setup"}
-CLEANUP=${CLEANUP:-"mcstopall"}
+CLEANUP=${CLEANUP:-"stopall"}
if [ "$ONLY" == "cleanup" ]; then
sysctl -w lnet.debug=0 || true
fi
setup() {
- mcformat
- mcsetup
+ formatall
+ setupall
}
$SETUP
test_0b() {
# this test attempts to trigger a race in the precreation code,
# and must run before any other objects are created on the filesystem
- fail ost
+ fail ost1
createmany -o $DIR/$tfile 20 || return 1
unlinkmany $DIR/$tfile 20 || return 2
}
run_test 1 "simple create"
test_1a() {
- do_facet ost "sysctl -w lustre.fail_loc=0"
+ do_facet ost1 "sysctl -w lustre.fail_loc=0"
rm -fr $DIR/$tfile
local old_last_id=`cat $LPROC/obdfilter/*/last_id`
rm -fr $DIR/$tfile
#define OBD_FAIL_OST_CROW_EIO | OBD_FAIL_ONCE
- do_facet ost "sysctl -w lustre.fail_loc=0x80000801"
+ do_facet ost1 "sysctl -w lustre.fail_loc=0x80000801"
rm -fr $DIR/1a1
old_last_id=`cat $LPROC/obdfilter/*/last_id`
rm -fr $DIR/1a1
- do_facet ost "sysctl -w lustre.fail_loc=0"
+ do_facet ost1 "sysctl -w lustre.fail_loc=0"
}
#CROW run_test 1a "CROW object create (check OST last_id)"
replay_barrier mds
# OBD_FAIL_OST_CREATE_NET 0x204
- do_facet ost "sysctl -w lustre.fail_loc=0x80000204"
+ do_facet ost1 "sysctl -w lustre.fail_loc=0x80000204"
fail mds
sleep 10
- do_facet ost "sysctl -w lustre.fail_loc=0"
+ do_facet ost1 "sysctl -w lustre.fail_loc=0"
return 0
}
createmany -o $DIR/$tfile 20 || return 1
# OBD_FAIL_OST_CREATE_NET 0x204
- fail ost
- do_facet ost "sysctl -w lustre.fail_loc=0x80000204"
+ fail ost1
+ do_facet ost1 "sysctl -w lustre.fail_loc=0x80000204"
df $MOUNT || return 2
# let the MDS discover the OST failure, attempt to recover, fail
createmany -o $DIR/$tfile 20 || return 3
unlinkmany $DIR/$tfile 20 || return 4
- do_facet ost "sysctl -w lustre.fail_loc=0"
+ do_facet ost1 "sysctl -w lustre.fail_loc=0"
return 0
}
run_test 47 "MDS->OSC failure during precreate cleanup (2824)"
createmany -o $DIR/$tfile 20 || return 1
# OBD_FAIL_OST_EROFS 0x216
fail mds
- do_facet ost "sysctl -w lustre.fail_loc=0x80000216"
+ do_facet ost1 "sysctl -w lustre.fail_loc=0x80000216"
df $MOUNT || return 2
createmany -o $DIR/$tfile 20 20 || return 2
unlinkmany $DIR/$tfile 40 || return 3
- do_facet ost "sysctl -w lustre.fail_loc=0"
+ do_facet ost1 "sysctl -w lustre.fail_loc=0"
return 0
}
run_test 48 "MDS->OSC failure during precreate cleanup (2824)"
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
-. mountconf.sh
-SETUP=${SETUP:-mcsetup}
-FORMAT=${FORMAT:-mcformat}
-CLEANUP=${CLEANUP:-mcstopall}
+SETUP=${SETUP:-setupall}
+FORMAT=${FORMAT:-formatall}
+CLEANUP=${CLEANUP:-stopall}
fail() {
echo "ERROR: $1" 1>&2
SAVE_PWD=$PWD
-# for MCSETUP and MCCLEANUP
LUSTRE=${LUSTRE:-`dirname $0`/..}
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
-. mountconf.sh
cleanup() {
echo -n "cln.."
- $MCCLEANUP ${FORCE} $* || { echo "FAILed to clean up"; exit 20; }
+ cleanupall ${FORCE} $* || { echo "FAILed to clean up"; exit 20; }
}
CLEANUP=${CLEANUP:-:}
setup() {
echo -n "mnt.."
- $MCSETUP || exit 10
+ setupall || exit 10
echo "done"
}
SETUP=${SETUP:-:}
MOUNTED="`mounted_lustre_filesystems`"
if [ -z "$MOUNTED" ]; then
- $MCFORMAT
- $MCSETUP
+ formatall
+ setupall
MOUNTED="`mounted_lustre_filesystems`"
[ -z "$MOUNTED" ] && error "NAME=$NAME not mounted"
I_MOUNTED=yes
rm -rf $DIR/[Rdfs][1-9]*
fi
if [ "$I_MOUNTED" = "yes" ]; then
- $MCCLEANUP -f || error "cleanup failed"
+ cleanupall -f || error "cleanup failed"
fi
SAVE_PWD=$PWD
-# for MCSETUP and MCCLEANUP
LUSTRE=${LUSTRE:-`dirname $0`/..}
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
-. mountconf.sh
cleanup() {
echo -n "cln.."
grep " $MOUNT2 " /proc/mounts && zconf_umount `hostname` $MOUNT2 ${FORCE}
- $MCCLEANUP ${FORCE} > /dev/null || { echo "FAILed to clean up"; exit 20; }
+ cleanupall ${FORCE} > /dev/null || { echo "FAILed to clean up"; exit 20; }
}
CLEANUP=${CLEANUP:-:}
setup() {
echo -n "mnt.."
- $MCSETUP || exit 10
+ setupall || exit 10
echo "done"
}
SETUP=${SETUP:-:}
}
MOUNTED="`mounted_lustre_filesystems`"
if [ -z "$MOUNTED" ]; then
- $MCFORMAT
- $MCSETUP
+ formatall
+ setupall
mount_client $MOUNT2
MOUNTED="`mounted_lustre_filesystems`"
[ -z "$MOUNTED" ] && error "NAME=$NAME not mounted"
# echo "CONFIG=`canonical_path $CONFIG`" > $LUSTRE/tests/CONFIG
}
+load_module() {
+ EXT=".ko"
+ module=$1
+ shift
+ BASE=`basename $module $EXT`
+ lsmod | grep ${BASE} > /dev/null || insmod ${LUSTRE}/${module}${EXT} $@
+}
+
+load_modules() {
+ echo Loading modules from $LUSTRE
+ load_module ../lnet/libcfs/libcfs
+ # note that insmod will ignore anything in modprobe.conf
+ load_module ../lnet/lnet/lnet $LNETOPTS
+ LNETLND=${LNETLND:-"socklnd/ksocklnd"}
+ load_module ../lnet/klnds/$LNETLND
+ load_module lvfs/lvfs
+ load_module obdclass/obdclass
+ load_module ptlrpc/ptlrpc
+ load_module mdc/mdc
+ load_module osc/osc
+ load_module lov/lov
+ load_module mds/mds
+ load_module ldiskfs/ldiskfs
+ load_module lvfs/fsfilt_ldiskfs
+ load_module ost/ost
+ load_module obdfilter/obdfilter
+ load_module llite/llite
+ load_module mgc/mgc
+ load_module mgs/mgs
+ # 'mount' doesn't look in $PATH
+ cp $LUSTRE/utils/mount.lustre /sbin/.
+}
+
unload_modules() {
lsmod | grep lnet > /dev/null && $LCTL dk $TMP/debug
local MODULES=`$LCTL modules | awk '{ print $2 }'`
}
stop() {
+ local running
facet=$1
shift
+ HOST=`facet_active_host $facet`
+ [ -z $HOST ] && echo stop: no host for $facet && return 0
# the following line fails with VERBOSE set
- local running=`do_facet ${facet} "grep -c /mnt/${facet}' ' /proc/mounts" | awk '{print $(NF)}'`
- if [ $running -ne 0 ]; then
+ #running=`do_facet ${facet} awk '/mnt\/${facet} / {print "FOUND"}' /proc/mounts`
+ running=`do_facet ${facet} "grep -c /mnt/${facet}' ' /proc/mounts" | awk '{print $(NF)}'`
+ if [ ${running} -ne 0 ]; then
echo "Stopping /mnt/${facet} (opts:$@)"
do_facet ${facet} umount -d $@ /mnt/${facet}
fi
}
replay_barrier_nodf() {
- local facet=$1
+ local facet=$1 echo running=${running}
do_facet $facet sync
local svc=${facet}_svc
echo Replay barrier on ${!svc}
ost_evict_client() {
UUID=`cat /proc/fs/lustre/osc/*_MNT_*/uuid | head -n 1`
- do_facet ost "echo $UUID > /proc/fs/lustre/obdfilter/ost_svc/evict_client"
+ do_facet ost1 "echo $UUID > /proc/fs/lustre/obdfilter/ost_svc/evict_client"
}
fail() {
facet=$1
shift
HOST=`facet_active_host $facet`
+ [ -z $HOST ] && echo No host defined for facet ${facet} && exit 1
do_node $HOST $@
}
$MKFS $*
}
+ostdevname() {
+ num=$1
+ DEVNAME=OSTDEV$num
+ #if $OSTDEVn isn't defined, default is $OSTDEVBASE + num
+ eval DEVPTR=${!DEVNAME:=${OSTDEVBASE}${num}}
+ echo -n $DEVPTR
+}
+
+
+########
+## MountConf setup
+
+stopall() {
+ # make sure we are using the primary server, so test-framework will
+ # be able to clean up properly.
+ activemds=`facet_active mds`
+ if [ $activemds != "mds" ]; then
+ fail mds
+ fi
+
+ # assume client mount is local
+ grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT $*
+ grep " $MOUNT2 " /proc/mounts && zconf_umount `hostname` $MOUNT2 $*
+ stop mds -f
+ for num in `seq $OSTCOUNT`; do
+ stop ost$num -f
+ done
+ return 0
+}
+
+cleanupall() {
+ stopall $*
+ unload_modules
+}
+
+formatall() {
+ stopall
+ # We need ldiskfs here, may as well load them all
+ load_modules
+ echo Formatting mds, osts
+ add mds $MDS_MKFS_OPTS --reformat $MDSDEV > /dev/null || exit 10
+ for num in `seq $OSTCOUNT`; do
+ DEVNAME=`ostdevname $num`
+ add ost$num $OST_MKFS_OPTS --reformat $DEVNAME > /dev/null || exit 10
+ done
+}
+
+mount_client() {
+ grep " $1 " /proc/mounts || zconf_mount `hostname` $*
+}
+
+setupall() {
+ echo Setup mdt, osts
+ start mds $MDSDEV $MDS_MOUNT_OPTS
+ for num in `seq $OSTCOUNT`; do
+ DEVNAME=`ostdevname $num`
+ start ost$num $DEVNAME $OST_MOUNT_OPTS
+ done
+ [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
+ mount_client $MOUNT
+ sleep 5
+}
+
#######
# General functions
pause_bulk() {
#define OBD_FAIL_OST_BRW_PAUSE_BULK 0x214
RC=0
- do_facet ost sysctl -w lustre.fail_loc=0x214
+ do_facet ost1 sysctl -w lustre.fail_loc=0x214
do_facet client "$1" || RC=$?
do_facet client "sync"
- do_facet ost sysctl -w lustre.fail_loc=0
+ do_facet ost1 sysctl -w lustre.fail_loc=0
return $RC
}
log() {
echo "$*"
- lsmod | grep lnet > /dev/null || modprobe lnet
+ lsmod | grep lnet > /dev/null || load_modules
$LCTL mark "$*" 2> /dev/null || true
}
+++ /dev/null
-#!/bin/bash
-
-export PATH=`dirname $0`/../utils:$PATH
-
-config=${1:-`basename $0 .sh`.xml}
-LMC=${LMC:-lmc}
-TMP=${TMP:-/tmp}
-
-MDSDEV=${MDSDEV:-$TMP/mds1-`hostname`}
-MDSSIZE=${MDSSIZE:-100000}
-
-OSTDEVBASE=$TMP/ost
-#OSTDEV1=${OSTDEV1:-${OSTDEVBASE}1}
-#OSTDEV2=${OSTDEV2:-${OSTDEVBASE}2}
-#etc
-OSTSIZE=${OSTSIZE:-100000}
-STRIPECNT=${STRIPECNT:-1}
-STRIPE_BYTES=${STRIPE_BYTES:-1048576}
-OSDTYPE=${OSDTYPE:-obdfilter}
-OSTFAILOVER=${OSTFAILOVER:-}
-
-MOUNT=${MOUNT:-/mnt/lustre}
-FSTYPE=${FSTYPE:-ext3}
-
-MDS_MOUNT_OPTS="user_xattr,acl,${MDS_MOUNT_OPTS:-""}"
-CLIENTOPT="user_xattr,${CLIENTOPT:-""}"
-
-NETTYPE=${NETTYPE:-tcp}
-NIDTYPE=${NIDTYPE:-$NETTYPE}
-[ "$ACCEPTOR_PORT" ] && PORT_OPT="--port $ACCEPTOR_PORT"
-
-# NOTE - You can't have different MDS/OST nodes and also have clients on the
-# MDS/OST nodes without using --endlevel and --startlevel during lconf.
-# You can put both MDS/OST on one node and client can be there too.
-# CLIENTS is a space-separated list of client nodes.
-#
-# The rule is that both the MDS and the OST must be set up before any
-# of the clients can be started, so plan accordingly.
-
-# Three separate systems
-MDSNODE=${MDSNODE:-uml1}
-OSTNODES=${OSTNODES:-"uml2 uml2"}
-CLIENTS=${CLIENTS:-"uml3"}
-
-# Single system with additional clients
-#MDSNODE=uml1
-#OSTNODES="uml1 uml1"
-#CLIENTS="$MDSNODE client"
-
-# Two systems with client on MDS, and additional clients (set up OST first)
-#MDSNODE=uml1
-#OSTNODES="uml2 uml2"
-#CLIENTS="$MDSNODE client"
-
-# Two systems with client on OST, and additional clients (set up MDS first)
-#MDSNODE=uml1
-#OSTNODES="uml2 uml2"
-#CLIENTS="$OSTNODES client"
-
-rm -f $config
-
-h2tcp () {
- case $1 in
- client) echo '\*' ;;
- *) echo $1 ;;
- esac
-}
-
-h2elan () {
- case $1 in
- client) echo '\*' ;;
- *) echo $1 | sed "s/[^0-9]*//" ;;
- esac
-}
-
-h2gm () {
- echo `gmlndnid -n$1`
-}
-
-h2iib () {
- case $1 in
- client) echo '\*' ;;
- *) echo $1 | sed "s/[^0-9]*//" ;;
- esac
-}
-
-# create nodes
-echo -n "adding NET for:"
-for NODE in `echo $MDSNODE $OSTNODES $CLIENTS | tr -s " " "\n" | sort -u`; do
- echo -n " $NODE"
- ${LMC} -m $config --add net --node $NODE --nid `h2$NIDTYPE $NODE` \
- --nettype $NETTYPE $PORT_OPT || exit 1
-done
-
-# configure mds server
-[ "x$MDS_MOUNT_OPTS" != "x" ] &&
- MDS_MOUNT_OPTS="--mountfsoptions $MDS_MOUNT_OPTS"
-
-echo; echo "adding MDS on: $MDSNODE"
-${LMC} -m $config --add mds --node $MDSNODE --mds mds1 --fstype $FSTYPE \
- --dev $MDSDEV $MDS_MOUNT_OPTS --size $MDSSIZE $MDSOPT || exit 10
-
-# configure ost
-${LMC} -m $config --add lov --lov lov1 --mds mds1 --stripe_sz $STRIPE_BYTES \
- --stripe_cnt $STRIPECNT --stripe_pattern 0 $LOVOPT || exit 20
-COUNT=1
-echo -n "adding OST on:"
-for NODE in $OSTNODES; do
- eval OSTDEV=\$OSTDEV$COUNT
- echo -n " $NODE"
- OSTDEV=${OSTDEV:-$OSTDEVBASE$COUNT-`hostname`}
- case "$OSDTYPE" in
- obdfilter)
- OSTARGS="--fstype $FSTYPE --dev $OSTDEV --size $OSTSIZE"
- ;;
- obdecho)
- OSTARGS="--osdtype=obdecho"
- ;;
- esac
- ${LMC} -m $config --add ost --node $NODE --lov lov1 $OSTARGS \
- $OSTFAILOVER $OSTOPT || exit 21
- COUNT=`expr $COUNT + 1`
-done
-
-# create client config(s)
-[ "x$CLIENTOPT" != "x" ] && CLIENTOPT="--clientoptions $CLIENTOPT"
-echo; echo -n "adding CLIENT on:"
-for NODE in $CLIENTS; do
- echo -n " $NODE"
- ${LMC} -m $config --add mtpt --node $NODE --path $MOUNT --mds mds1 \
- --lov lov1 $CLIENTOPT || exit 30
-done
-echo