From 8f9ab85d3c79f06c9db6b7b44368857a4714d455 Mon Sep 17 00:00:00 2001 From: Emoly Liu Date: Wed, 23 Sep 2015 17:02:46 +0800 Subject: [PATCH] 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 --- lustre/tests/test-framework.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 || -- 1.8.3.1