From 6a87f019afdba71fd1d0fb4d0b62a3f782afcf1a Mon Sep 17 00:00:00 2001 From: rread Date: Thu, 13 Nov 2003 01:27:35 +0000 Subject: [PATCH] - return replay-ost-single to runable state now just need to pass - commonize the zconf mount/umount --- lustre/tests/replay-ost-single.sh | 40 +++++++++++++++++++++++++++++++++++---- lustre/tests/test-framework.sh | 24 +++++++++++++++++++++++ 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index 9217cc2..490a51b 100755 --- a/lustre/tests/replay-ost-single.sh +++ b/lustre/tests/replay-ost-single.sh @@ -10,7 +10,7 @@ init_test_env # XXX I wish all this stuff was in some default-config.sh somewhere mds_HOST=${mds_HOST:-`hostname`} ost_HOST=${ost_HOST:-`hostname`} -ostfailover_HOST=${ostfailover_HOST:-`hostname`} +ostfailover_HOST=${ostfailover_HOST} client_HOST=${client_HOST:-`hostname`} NETTYPE=${NETTYPE:-tcp} @@ -21,8 +21,9 @@ DIR=${DIR:-$MOUNT} MDSDEV=${MDSDEV:-/tmp/mds-`hostname`} MDSSIZE=${MDSSIZE:-100000} OSTDEV=${OSTDEV:-/tmp/ost-`hostname`} +OSTFAILOVERDEV=${OSTFAILOVERDEV:-$OSTDEV} OSTSIZE=${OSTSIZE:-100000} -UPCALL=${UPCALL:-$PWD/replay-single-upcall.sh} +UPCALL=${UPCALL:-$PWD/replay-ost-upcall.sh} FSTYPE=${FSTYPE:-ext3} TIMEOUT=${TIMEOUT:-5} @@ -38,16 +39,47 @@ gen_config() { do_lmc --add mds --node mds_facet --mds mds1 --dev $MDSDEV --size $MDSSIZE do_lmc --add lov --mds mds1 --lov lov1 --stripe_sz $STRIPE_BYTES --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0 do_lmc --add ost --lov lov1 --failover --node ost_facet --ost ost1 --dev $OSTDEV --size $OSTSIZE + if [ ! -z "$ostfailover_HOST" ]; then + add_facet ostfailover + do_lmc --add ost --lov lov1 --node ostfailover_facet --ost ost1 --dev $OSTFAILOVERDEV --size $OSTSIZE + fi do_lmc --add mtpt --node client_facet --path $MOUNT --mds mds1 --ost lov1 } +cleanup() { + # make sure we are using the primary MDS, so the config log will + # be able to clean up properly. + activeost=`facet_active ost` + if [ $activeost != "ost" ]; then + fail ost + fi + zconf_umount $MOUNT + stop mds ${FORCE} $MDSLCONFARGS + stop ost ${FORCE} --dump cleanup.log +} + +if [ "$ONLY" == "cleanup" ]; then + sysctl -w portals.debug=0 + cleanup + exit +fi build_test_filter +rm ostactive + gen_config -start mds --reformat $MDSLCONFARGS + start ost --reformat $OSTLCONFARGS -start client --gdb $CLIENTLCONFARGS +PINGER=`cat /proc/fs/lustre/pinger` + +if [ "$PINGER" != "on" ]; then + echo "ERROR: Lustre must be built with --enable-pinger for replay-dual" + stop ost + exit 1 +fi +start mds --reformat $MDSLCONFARGS +zconf_mount $MOUNT mkdir -p $DIR diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index a67cfb8..bc9b5c4 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -47,6 +47,30 @@ stop() { do_facet $facet $LCONF --select ${facet}1=${active}_facet --node ${active}_facet $@ --cleanup $XMLCONFIG } +zconf_mount() { + mnt=$1 + + [ -d $mnt ] || mkdir $mnt + + if [ -x /sbin/mount.lustre ] ; then + mount -t lustre `facet_host mds`:/mds1/client_facet $mnt + else + insmod $LUSTRE/llite/llite.o || : + $LUSTRE/utils/llmount `facet_host mds`:/mds1/client_facet $mnt + fi + + [ -d /r ] && $LCTL modules > /r/tmp/ogdb-`hostname` + + echo $TIMEOUT > /proc/sys/lustre/timeout + echo $UPCALL > /proc/sys/lustre/upcall +} + +zconf_umount() { + mnt=$1 + umount $mnt || : + rmmod llite || : +} + replay_barrier() { local facet=$1 do_facet $facet sync -- 1.8.3.1