From: grev Date: Fri, 6 Nov 2009 21:02:09 +0000 (+0000) Subject: b=21115 X-Git-Tag: v1_8_2_03~1^2~15 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=26bb4bdea72ec7a9b82a8287dce9327d2676461f;p=fs%2Flustre-release.git b=21115 i=Robert.Read t-f: mount the same config on all clients --- diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh index 51e5b61..3b1e3d7 100755 --- a/lustre/tests/acceptance-small.sh +++ b/lustre/tests/acceptance-small.sh @@ -54,7 +54,7 @@ setup_if_needed() { local MOUNTED=$(mounted_lustre_filesystems) if $(echo $MOUNTED | grep -w -q $MOUNT); then - check_config $MOUNT + check_config_clients $MOUNT init_facets_vars init_param_vars return @@ -280,15 +280,7 @@ for NAME in $CONFIGS; do if [ "$SANITYN" != "no" ]; then title sanityN - $DEBUG_OFF - - mkdir -p $MOUNT2 - mount_client $MOUNT2 - #echo "can't mount2 for '$NAME', skipping sanityN.sh" - START=: CLEAN=: bash sanityN.sh - [ "$(mount | grep $MOUNT2)" ] && umount $MOUNT2 - - $DEBUG_ON + bash sanityN.sh $CLEANUP $SETUP SANITYN="done" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 682cf82..b4a8da4 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1533,9 +1533,7 @@ nfs_client_mode () { return 1 } -check_config () { - nfs_client_mode && return - +check_config_client () { local mntpt=$1 local mounted=$(mount | grep " $mntpt ") @@ -1575,6 +1573,16 @@ check_config () { # Please use correct config or set mds_HOST correctly!" # fi +} + +check_config_clients () { + local clients=${CLIENTS:-$HOSTNAME} + local mntpt=$1 + + nfs_client_mode && return + + do_rpc_nodes $clients check_config_client $mntpt + sanity_mount_check || error "environments are insane!" } @@ -1608,17 +1616,30 @@ check_and_setup_lustre() { # MOUNT2 is mounted, MOUNT_2 is not set if ! [ "$MOUNT_2" ]; then - zconf_umount `hostname` $MOUNT2 + cleanup_mount $MOUNT2 export I_UMOUNTED2=yes # MOUNT2 is mounted, MOUNT_2 is set else - check_config $MOUNT2 + # FIXME: what to do if check_config failed? + # i.e. if: + # 1) remote client has mounted other Lustre fs ? + # 2) it has insane env ? + # let's try umount MOUNT2 on all clients and mount it again: + if ! check_config_clients $MOUNT2; then + cleanup_mount $MOUNT2 + restore_mount $MOUNT2 + export I_MOUNTED2=yes + fi fi fi if $do_check; then - check_config $MOUNT + # FIXME: what to do if check_config failed? + # i.e. if: + # 1) remote client has mounted other Lustre fs? + # 2) lustre is mounted on remote_clients atall ? + check_config_clients $MOUNT init_facets_vars init_param_vars @@ -1632,6 +1653,20 @@ check_and_setup_lustre() { fi } +restore_mount () { + local clients=${CLIENTS:-$HOSTNAME} + local mntpt=$1 + + zconf_mount_clients $clients $mntpt +} + +cleanup_mount () { + local clients=${CLIENTS:-$HOSTNAME} + local mntpt=$1 + + zconf_umount_clients $clients $mntpt +} + cleanup_and_setup_lustre() { if [ "$ONLY" == "cleanup" -o "`mount | grep $MOUNT`" ]; then lctl set_param debug=0 || true @@ -1649,9 +1684,13 @@ check_and_cleanup_lustre() { [ "$ENABLE_QUOTA" ] && restore_quota_type || true fi if [ "$I_UMOUNTED2" = "yes" ]; then - mount_client $MOUNT2 || error "restore $MOUNT2 failed" + restore_mount $MOUNT2 || error "restore $MOUNT2 failed" fi + if [ "$I_MOUNTED2" = "yes" ]; then + cleanup_mount $MOUNT2 + fi + zconf_umount_clients $clients $MOUNT2 if [ "$I_MOUNTED" = "yes" ]; then cleanupall -f || error "cleanup failed" fi