From bf16d438237166c9379b8388a1be71b2dec4dd4d Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Mon, 16 Mar 2015 11:36:38 +0100 Subject: 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 Reviewed-on: http://review.gluster.org/9896 Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY Reviewed-by: Vijay Bellur --- tests/basic/mount-nfs-auth.t | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'tests') 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 -- cgit