summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2015-03-16 11:36:38 +0100
committerVijay Bellur <vbellur@redhat.com>2015-03-18 04:32:07 -0700
commitbf16d438237166c9379b8388a1be71b2dec4dd4d (patch)
tree67d66aff0a0861de0099678c8170ff6505909e5e /tests
parentc73825b4bdb459219f06ec34706c0f2551cb9b0c (diff)
Tests: do not hardcode NFS state directory
tests/basic/mount-nfs-auth.t hardcoded /var/lib/glusterd/nfs/ as the NFS state directory, cuasing failures if glusterfs was configured with state in another location. Fix this by obtaning the directory through a gluster volume get command. The nfs.mount-rmtab key gives us a file inside the directory we are looking for. This fixes tests/basic/mount-nfs-auth.t regression on NetBSD. BUG: 1129939 Change-Id: I19184859c03faf5b9aeb95d080cf90fa581be380 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9896 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/basic/mount-nfs-auth.t21
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/basic/mount-nfs-auth.t b/tests/basic/mount-nfs-auth.t
index 3e466170365..759bb92efbe 100755
--- a/tests/basic/mount-nfs-auth.t
+++ b/tests/basic/mount-nfs-auth.t
@@ -32,35 +32,35 @@ function build_dirs () {
}
function export_allow_this_host () {
- printf "$EXPORT_ALLOW\n" > /var/lib/glusterd/nfs/exports
+ printf "$EXPORT_ALLOW\n" > ${NFSDIR}/exports
}
function export_allow_this_host_with_slash () {
- printf "$EXPORT_ALLOW_SLASH\n" > /var/lib/glusterd/nfs/exports
+ printf "$EXPORT_ALLOW_SLASH\n" > ${NFSDIR}/exports
}
function export_deny_this_host () {
- printf "$EXPORT_DENY\n" > /var/lib/glusterd/nfs/exports
+ printf "$EXPORT_DENY\n" > ${NFSDIR}/exports
}
function export_allow_this_host_l1 () {
- printf "$EXPORT_ALLOW_L1\n" >> /var/lib/glusterd/nfs/exports
+ printf "$EXPORT_ALLOW_L1\n" >> ${NFSDIR}/exports
}
function export_allow_wildcard () {
- printf "$EXPORT_WILDCARD\n" >> /var/lib/glusterd/nfs/exports
+ printf "$EXPORT_WILDCARD\n" >> ${NFSDIR}/exports
}
function export_allow_this_host_ro () {
- printf "$EXPORT_ALLOW_RO\n" > /var/lib/glusterd/nfs/exports
+ printf "$EXPORT_ALLOW_RO\n" > ${NFSDIR}/exports
}
function netgroup_allow_this_host () {
- printf "$NETGROUP_ALLOW\n" > /var/lib/glusterd/nfs/netgroups
+ printf "$NETGROUP_ALLOW\n" > ${NFSDIR}/netgroups
}
function netgroup_deny_this_host () {
- printf "$NETGROUP_DENY\n" > /var/lib/glusterd/nfs/netgroups
+ printf "$NETGROUP_DENY\n" > ${NFSDIR}/netgroups
}
function create_vol () {
@@ -117,6 +117,11 @@ TEST $CLI vol set $V0 nfs.disable off
TEST $CLI vol set $V0 cluster.choose-local off
TEST $CLI vol start $V0
+# Get NFS state directory
+NFSDIR=$( $CLI volume get patchy nfs.mount-rmtab | \
+ awk '/^nfs.mount-rmtab/{print $2}' | \
+ xargs dirname )
+
## Wait for volume to register with rpc.mountd
EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available