From: Andreas Dilger Date: Sat, 18 Jan 2014 05:30:16 +0000 (-0700) Subject: LU-1538 tests: unmount /sbin/mount.lustre bind mount X-Git-Tag: 2.5.58~74 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F12%2F8912%2F4;p=fs%2Flustre-release.git LU-1538 tests: unmount /sbin/mount.lustre bind mount If the lustre/utils/mount.lustre file has changed since it was bind mounted on /sbin/mount.lustre, unmount it and mount the new one there, to avoid strange problems when testing from a local tree Signed-off-by: Andreas Dilger Change-Id: Ie5360dae9f33553acb914c8ce549e848c1500c1e Reviewed-on: http://review.whamcloud.com/8912 Tested-by: Jenkins Reviewed-by: Nathaniel Clark Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 8089b1e..9b1b47e 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -531,20 +531,25 @@ load_modules_local() { load_module osp/osp fi - - load_module llite/lustre - llite_lloop_enabled && load_module llite/llite_lloop - [ -d /r ] && OGDB=${OGDB:-"/r/tmp"} - OGDB=${OGDB:-$TMP} - rm -f $OGDB/ogdb-$HOSTNAME - $LCTL modules > $OGDB/ogdb-$HOSTNAME - - # 'mount' doesn't look in $PATH, just sbin - if [ -f $LUSTRE/utils/mount.lustre ] && \ - ! grep -qe "/sbin/mount\.lustre " /proc/mounts; then - [ ! -f /sbin/mount.lustre ] && touch /sbin/mount.lustre - mount --bind $LUSTRE/utils/mount.lustre /sbin/mount.lustre || true - fi + load_module llite/lustre + llite_lloop_enabled && load_module llite/llite_lloop + [ -d /r ] && OGDB=${OGDB:-"/r/tmp"} + OGDB=${OGDB:-$TMP} + rm -f $OGDB/ogdb-$HOSTNAME + $LCTL modules > $OGDB/ogdb-$HOSTNAME + + # 'mount' doesn't look in $PATH, just sbin + local MOUNT_LUSTRE=$LUSTRE/utils/mount.lustre + if [ -f $MOUNT_LUSTRE ]; then + if grep -qe "/sbin/mount\.lustre " /proc/mounts; then + cmp $MOUNT_LUSTRE /sbin/mount.lustre || + umount /sbin/mount.lustre + fi + if ! grep -qe "/sbin/mount\.lustre " /proc/mounts; then + [ ! -f /sbin/mount.lustre ] && touch /sbin/mount.lustre + mount --bind $MOUNT_LUSTRE /sbin/mount.lustre + fi + fi } load_modules () { @@ -4070,18 +4075,22 @@ check_and_cleanup_lustre() { [ "$ENABLE_QUOTA" ] && restore_quota || true fi - if [ "$I_UMOUNTED2" = "yes" ]; then - restore_mount $MOUNT2 || error "restore $MOUNT2 failed" - fi + if [ "$I_UMOUNTED2" = "yes" ]; then + restore_mount $MOUNT2 || error "restore $MOUNT2 failed" + fi - if [ "$I_MOUNTED2" = "yes" ]; then - cleanup_mount $MOUNT2 - fi + if [ "$I_MOUNTED2" = "yes" ]; then + cleanup_mount $MOUNT2 + fi - if [ "$I_MOUNTED" = "yes" ]; then - cleanupall -f || error "cleanup failed" - unset I_MOUNTED - fi + if [ "$I_MOUNTED" = "yes" ]; then + cleanupall -f || error "cleanup failed" + unset I_MOUNTED + fi + + if grep -qe "/sbin/mount\.lustre " /proc/mounts; then + umount /sbin/mount.lustre + fi } #######