From cbdceec741f5fb782b6a7f86d30daed9f5ed562a Mon Sep 17 00:00:00 2001 From: James Nunez Date: Mon, 9 Dec 2019 11:37:14 -0700 Subject: [PATCH] LU-11607 tests: remove duplicate code lnet-selftest lnet-selftest.sh and test-framework.sh both have a function called is_mounted() that check if the file system is mounted. Since both functions do and return the same thing, let's remove the is_mounted() function from lnet-selftest. Test-Parameters: trivial Test-Parameters: fstype=zfs testlist=lnet-selftest,lnet-selftest Test-Parameters: fstype=ldiskfs testlist=lnet-selftest,lnet-selftest Signed-off-by: James Nunez Change-Id: I05ce84002cfa8ac96ac4f1e8169fb2233b66f378 Reviewed-on: https://review.whamcloud.com/36965 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Serguei Smirnov Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre/tests/lnet-selftest.sh | 6 ------ lustre/tests/test-framework.sh | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lustre/tests/lnet-selftest.sh b/lustre/tests/lnet-selftest.sh index ed8104d..93432e0 100755 --- a/lustre/tests/lnet-selftest.sh +++ b/lustre/tests/lnet-selftest.sh @@ -61,12 +61,6 @@ _restore_mount () { fi } -is_mounted () { - local mntpt=$1 - local mounted=$(mounted_lustre_filesystems) - echo $mounted' ' | grep -w -q $mntpt' ' -} - if local_mode; then lst_SERVERS=`hostname` lst_CLIENTS=`hostname` diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 1566801..27a2251 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -5267,11 +5267,11 @@ check_timeout () { } is_mounted () { - local mntpt=$1 - [ -z $mntpt ] && return 1 - local mounted=$(mounted_lustre_filesystems) + local mntpt=$1 + [ -z $mntpt ] && return 1 + local mounted=$(mounted_lustre_filesystems) - echo $mounted' ' | grep -w -q $mntpt' ' + echo $mounted' ' | grep -w -q $mntpt' ' } is_empty_dir() { -- 1.8.3.1