summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2016-05-19 12:53:09 +0200
committerJeff Darcy <jdarcy@redhat.com>2016-05-23 06:20:39 -0700
commit6c936a0da3f5f56dd711169f7eb8d335bbb8cdc7 (patch)
tree60078d56701396ffaca73c62ad471818b7a2b85c /tests/bugs
parent5cf7a32be8d614e8cd89a01ac06e830cbd693929 (diff)
nfs: strip trailing / when clients do subdir mounts
Mounting a volume over NFS with a subdir followed by a / does not work: # mount -t nfs -o vers=3 storage.example.com:/media/installation/ /mnt mount.nfs: an incorrect mount option was specified In the nfs.log: [client-rpc-fops.c:2930:client3_3_lookup_cbk] 0-media-client-0: remote operation failed. Path: /installation/ (00000000-0000-0000-0000-000000000000) [Invalid argument] [client-rpc-fops.c:2930:client3_3_lookup_cbk] 0-media-client-1: remote operation failed. Path: /installation/ (00000000-0000-0000-0000-000000000000) [Invalid argument] [mount3.c:1134:mnt3_resolve_subdir_cbk] 0-nfs: path=/installation/ (Invalid argument) [Invalid argument] It is not possible to resolve paths with a trailing /. Stripping trailing /'s from the subdir to mount is sufficient to make it work again. Change-Id: I4075d4cd351438de58e1ff81f0fb65a1ff076da4 BUG: 1337597 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/14421 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/nfs/subdir-trailing-slash.t31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/bugs/nfs/subdir-trailing-slash.t b/tests/bugs/nfs/subdir-trailing-slash.t
new file mode 100644
index 00000000000..a00959443d0
--- /dev/null
+++ b/tests/bugs/nfs/subdir-trailing-slash.t
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# Verify that mounting a subdir over NFS works, even with a trailing /
+#
+# For example:
+# mount -t nfs server.example.com:/volume/subdir/
+#
+
+. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
+. $(dirname $0)/../../nfs.rc
+
+
+cleanup;
+TEST glusterd
+TEST pidof glusterd
+
+TEST $CLI volume create $V0 $H0:$B0/$V0
+TEST $CLI volume set $V0 nfs.disable false
+
+TEST $CLI volume start $V0
+EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available
+
+TEST mount_nfs $H0:/$V0 $N0 nolock
+TEST mkdir -p $N0/subdir
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0
+
+TEST mount_nfs $H0:/$V0/subdir/ $N0 nolock
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0
+
+cleanup