summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bugs/nfs/bug-1166862.t (renamed from tests/bugs/bug-1166862.t)22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/bugs/bug-1166862.t b/tests/bugs/nfs/bug-1166862.t
index 9d0796a9f45..c8f63d50b0c 100755
--- a/tests/bugs/bug-1166862.t
+++ b/tests/bugs/nfs/bug-1166862.t
@@ -8,18 +8,18 @@
# count the lines of a file, return 0 if the file does not exist
function count_lines()
{
- if [ -e "$1" ]
+ if [ -n "$1" ]
then
- wc -l < $1
+ $@ 2>/dev/null | wc -l
else
echo 0
fi
}
-. $(dirname $0)/../include.rc
-. $(dirname $0)/../nfs.rc
-. $(dirname $0)/../volume.rc
+. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../nfs.rc
+. $(dirname $0)/../../volume.rc
cleanup
@@ -39,13 +39,13 @@ EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available
TEST $CLI volume set $V0 nfs.mount-rmtab /-
# before mounting the rmtab should be empty
-EXPECT '0' count_lines $GLUSTERD_WORKDIR/nfs/rmtab
+EXPECT '0' count_lines cat $GLUSTERD_WORKDIR/nfs/rmtab
TEST mount_nfs $H0:/$V0 $N0 nolock
-EXPECT '0' count_lines $GLUSTERD_WORKDIR/nfs/rmtab
+EXPECT '0' count_lines cat $GLUSTERD_WORKDIR/nfs/rmtab
# showmount should list one client
-EXPECT '1' showmount --no-headers $H0
+EXPECT '1' count_lines showmount --no-headers $H0
# unmount
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0
@@ -54,13 +54,13 @@ EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0
TEST $CLI volume reset $V0 nfs.mount-rmtab
# before mounting the rmtab should be empty
-EXPECT '0' count_lines $GLUSTERD_WORKDIR/nfs/rmtab
+EXPECT '0' count_lines cat $GLUSTERD_WORKDIR/nfs/rmtab
TEST mount_nfs $H0:/$V0 $N0 nolock
-EXPECT '2' count_lines $GLUSTERD_WORKDIR/nfs/rmtab
+EXPECT '2' count_lines cat $GLUSTERD_WORKDIR/nfs/rmtab
# removing a mount
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0
-EXPECT '0' count_lines $GLUSTERD_WORKDIR/nfs/rmtab
+EXPECT '0' count_lines cat $GLUSTERD_WORKDIR/nfs/rmtab
cleanup