Whamcloud - gitweb
LU-7086 tests: resolve /sbin symlink in test-framework.sh 06/16606/3
authorEmoly Liu <emoly.liu@intel.com>
Wed, 23 Sep 2015 09:02:46 +0000 (17:02 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 28 Oct 2015 13:51:33 +0000 (13:51 +0000)
In rhel7 and other new distros, /sbin is linked to /usr/sbin, so
the mount check in load_modules_local() is not matched anymore.
To avoid multiple bind mounts, this patch checks /sbin symlink
before using it directly.

Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: I287ccd81ae4187a381a7f94dee30338d20dd6155
Reviewed-on: http://review.whamcloud.com/16606
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/test-framework.sh

index e499d7f..e2ad9ce 100755 (executable)
@@ -594,7 +594,7 @@ load_modules_local() {
        # 'mount' doesn't look in $PATH, just sbin
        local mount_lustre=$LUSTRE/utils/mount.lustre
        if [ -f $mount_lustre ]; then
-               local sbin_mount=/sbin/mount.lustre
+               local sbin_mount=$(readlink -f /sbin)/mount.lustre
                if grep -qw "$sbin_mount" /proc/mounts; then
                        cmp -s $mount_lustre $sbin_mount || umount $sbin_mount
                fi
@@ -658,7 +658,7 @@ unload_modules() {
                fi
        fi
 
-       local sbin_mount=/sbin/mount.lustre
+       local sbin_mount=$(readlink -f /sbin)/mount.lustre
        if grep -qe "$sbin_mount " /proc/mounts; then
                umount $sbin_mount || true
                [ -s $sbin_mount ] && ! grep -q "STUB MARK" $sbin_mount ||