From 0a714ba01bbcdb43fa2d07e88652be2b8fb1c52f Mon Sep 17 00:00:00 2001 From: grev Date: Fri, 18 Sep 2009 21:12:52 +0000 Subject: [PATCH] b=20748 i=Alexey.Lyashkov skip test_55 for client only testing; new client_only fn --- lustre/tests/acceptance-small.sh | 5 ----- lustre/tests/conf-sanity.sh | 6 +++--- lustre/tests/sanity.sh | 2 +- lustre/tests/test-framework.sh | 10 +++++++++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh index 7729d78f..67cd60b 100755 --- a/lustre/tests/acceptance-small.sh +++ b/lustre/tests/acceptance-small.sh @@ -110,11 +110,6 @@ for NAME in $CONFIGS; do export NAME MOUNT START CLEAN . $LUSTRE/tests/cfg/$NAME.sh - if [ ! -f /lib/modules/$(uname -r)/kernel/fs/lustre/mds.ko -a \ - ! -f `dirname $0`/../mds/mds.ko ]; then - export CLIENTMODSONLY=true - fi - assert_env mds_HOST MDS_MKFS_OPTS assert_env ost_HOST OST_MKFS_OPTS OSTCOUNT assert_env FSNAME MOUNT MOUNT2 diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index c7affc90..3c233eb 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -973,7 +973,7 @@ cleanup_32() { test_32a() { # this test is totally useless on a client-only system - [ -n "$CLIENTONLY" -o -n "$CLIENTMODSONLY" ] && skip "client only testing" && return 0 + client_only && skip "client only testing" && return 0 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; } [ -z "$TUNEFS" ] && skip_env "No tunefs" && return 0 @@ -1031,7 +1031,7 @@ run_test 32a "Upgrade from 1.8 (not live)" test_32b() { # this test is totally useless on a client-only system - [ -n "$CLIENTONLY" -o -n "$CLIENTMODSONLY" ] && skip "client only testing" && return 0 + client_only && skip "client only testing" && return 0 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; } [ -z "$TUNEFS" ] && skip_env "No tunefs" && return @@ -1310,7 +1310,7 @@ test_36() { # 12743 run_test 36 "df report consistency on OSTs with different block size" test_37() { - [ -n "$CLIENTONLY" -o -n "$CLIENTMODSONLY" ] && skip "client only testing" && return 0 + client_only && skip "client only testing" && return 0 LOCAL_MDSDEV="$TMP/mdt.img" SYM_MDSDEV="$TMP/sym_mdt.img" diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 6c15e9e..613b508 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2590,7 +2590,7 @@ check_fstype() { test_55() { rm -rf $DIR/d55 mkdir $DIR/d55 - check_fstype && skip_env "can't find fs $FSTYPE" && return + client_only && skip "Not a server" && return mount -t $FSTYPE -o loop,iopen $EXT2_DEV $DIR/d55 || error "mounting" touch $DIR/d55/foo $IOPENTEST1 $DIR/d55/foo $DIR/d55 || error "running $IOPENTEST1" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index c8009c7..cab0776 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -175,6 +175,10 @@ init_test_env() { export RLUSTRE=${RLUSTRE:-$LUSTRE} export RPWD=${RPWD:-$PWD} export I_MOUNTED=${I_MOUNTED:-"no"} + if [ ! -f /lib/modules/$(uname -r)/kernel/fs/lustre/mds.ko -a \ + ! -f `dirname $0`/../mds/mds.ko ]; then + export CLIENTMODSONLY=yes + fi # command line @@ -257,7 +261,7 @@ load_modules_local() { load_module osc/osc load_module lov/lov load_module mgc/mgc - if [ -z "$CLIENTONLY" ] && [ -z "$CLIENTMODSONLY" ]; then + if ! client_only; then grep -q crc16 /proc/kallsyms || { modprobe crc16 2>/dev/null || true; } grep -q jbd /proc/kallsyms || { modprobe jbd 2>/dev/null || true; } [ "$FSTYPE" = "ldiskfs" ] && load_module ../ldiskfs/ldiskfs/ldiskfs @@ -2598,6 +2602,10 @@ get_random_entry () { echo ${nodes[i]} } +client_only () { + [ "$CLIENTONLY" ] || [ "$CLIENTMODSONLY" = yes ] +} + is_patchless () { lctl get_param version | grep -q patchless -- 1.8.3.1