From 243b242e1ed781290ea25d8787cd04425236c4fc Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 9 May 2002 20:27:41 +0000 Subject: [PATCH] Insmod extN if we are using a filesystem of that type. --- lustre/tests/common.sh | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lustre/tests/common.sh b/lustre/tests/common.sh index b37a87c..f8eee90 100644 --- a/lustre/tests/common.sh +++ b/lustre/tests/common.sh @@ -21,6 +21,15 @@ else echo "Cannot find /dev/loop0 or /dev/loop/0" 1>&2 && exit -1 fi +do_insmod() { + MODULE=$LUSTRE/$1 + + [ "$MODULE" ] || fail "usage: $0 " + [ -f $MODULE ] || fail "$0: module '$MODULE' not found" + + lsmod | grep -q `basename $MODULE` || insmod $MODULE || exit -1 +} + # Return the next unused loop device on stdout and in the $LOOPDEV # environment variable. next_loop_dev() { @@ -46,7 +55,11 @@ new_fs () { MKFSOPT="-b 4096" [ "$1" = "ext3" ] && MKFS="mkfs.ext2 -j" - [ "$1" = "extN" ] && MKFS="mkfs.ext2 -j" && EFILE="$1_ext3.gz" + if [ "$1" = "extN" ]; then + MKFS="mkfs.ext2 -j" + EFILE="$1_ext3.gz" + do_insmod extN/extN.o + fi if [ -b "$2" ]; then [ $# -lt 2 -o $# -gt 3 ] && \ @@ -78,11 +91,13 @@ new_fs () { } # Set up to use an existing filesystem. We take the same parameters as -# new_fs, even though we only use the parameter, to make it easy -# to convert between new_fs and old_fs in testing scripts. +# new_fs, even though we only use the and parameters, to +# make it easy to convert between new_fs and old_fs in testing scripts. old_fs () { [ -e $2 ] || exit -1 + [ "$1" = "extN" ] && do_insmod extN/extN.o + if [ -b "$2" ]; then LOOPDEV=$2 # Not really a loop device else @@ -121,15 +136,6 @@ setup_opts() { [ -z "$OSC_RSH" ] && OSC_RSH="eval" } -do_insmod() { - MODULE=$LUSTRE/$1 - - [ "$MODULE" ] || fail "usage: $0 " - [ -f $MODULE ] || fail "$0: module '$MODULE' not found" - - lsmod | grep -q `basename $MODULE` || insmod $MODULE || exit -1 -} - setup_portals() { if [ -z "$NETWORK" -o -z "$LOCALHOST" -o -z "$SERVER" ]; then echo "$0: NETWORK or LOCALHOST or SERVER is not set" 1>&2 -- 1.8.3.1