From: Emoly Liu Date: Wed, 23 Sep 2015 09:02:46 +0000 (+0800) Subject: LU-7086 tests: resolve /sbin symlink in test-framework.sh X-Git-Tag: 2.7.63~39 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F16606%2F3;p=fs%2Flustre-release.git LU-7086 tests: resolve /sbin symlink in test-framework.sh 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 Change-Id: I287ccd81ae4187a381a7f94dee30338d20dd6155 Reviewed-on: http://review.whamcloud.com/16606 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Yang Sheng Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index e499d7f..e2ad9ce 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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 ||