From c87639ad04a3c1a0d1fccbf426ad040d36505693 Mon Sep 17 00:00:00 2001 From: Shreyas Siravara Date: Thu, 22 Oct 2015 12:29:04 -0700 Subject: gNFSd: Auto re-register NFS/Mount programs with rpcbind periodically Summary: Every once in a while rpcbind crashes and the NFS endpoints go bye-bye. This diff makes it such that we should almost never encounter the case where we have NFS up and rpcbind down causing bad endpoints and hanging mounts for our customers. Test Plan: Added prove tests + tested on dev server Reviewers: dph, moox, rwareing Reviewed By: rwareing Differential Revision: https://phabricator.fb.com/D2571724 Tasks: 8803558 Change-Id: I35acb2d731185a7b20020cb57bdd4d879e978df4 Signature: t1:2571724:1445555327:3276a4dcc4da71346b09d4aeb46c69dddcc7c5ba Reviewed-on: https://review.gluster.org/17961 Smoke: Gluster Build System Reviewed-by: Shreyas Siravara CentOS-regression: Gluster Build System --- tests/basic/accept-v6v4.t | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) mode change 100644 => 100755 tests/basic/accept-v6v4.t (limited to 'tests/basic') diff --git a/tests/basic/accept-v6v4.t b/tests/basic/accept-v6v4.t old mode 100644 new mode 100755 index 7128c12c6be..ce3a1bae7f9 --- a/tests/basic/accept-v6v4.t +++ b/tests/basic/accept-v6v4.t @@ -119,4 +119,30 @@ EXPECT "Y" check_ip_port $V6 $NFSD_PORT "v4" EXPECT "Y" check_nfs $V6 "v6" EXPECT "Y" check_nfs $V4 "v4" +# Test a rpcbind crash +pkill -9 rpcbind && service rpcbind start +sleep 15 + +# Test that the port re-registered +rpcinfo=$(rpcinfo -s | grep nfs | grep -v nfs_acl) + +function check_rpcinfo { + support=$1 + type=$2 + + if [ ! $support ]; then + echo "Y" + return + fi + + if [ "$type" == "v6" ]; then + echo $(echo $rpcinfo | grep tcp6 && echo "Y" || echo "N") + else + echo $(echo $rpcinfo | grep tcp && echo "Y" || echo "N") + fi +} + +EXPECT "Y" check_rpcinfo $IPV4_SUPPORT "v4" +EXPECT "Y" check_rpcinfo $IPV6_SUPPORT "v6" + cleanup; -- cgit