diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2012-10-25 17:06:31 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-12-03 03:02:55 -0800 |
commit | fa1607ea596802d3d3177d775eeecb0f0e5d496f (patch) | |
tree | a8bb59c1d459c5f6f1b90364da80b213f48d8d4f /tests/bugs | |
parent | 3cade0a1e9dfc641e5b6db2f044af9f50ff604d6 (diff) |
socket,rdma: before binding to any port check if it is a reserved port
* The list of ports which are reserved is obtained by reading the file
/proc/sys/net/ipv4/ip_local_reserved_ports.
Change-Id: I3a832f53efbb79dd719b34a30cbaf28269f25816
BUG: 762989
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/4131
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/bugs')
-rwxr-xr-x | tests/bugs/bug-762989.t | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/bugs/bug-762989.t b/tests/bugs/bug-762989.t new file mode 100755 index 00000000000..386aec1cd47 --- /dev/null +++ b/tests/bugs/bug-762989.t @@ -0,0 +1,32 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc + +cleanup; + +## reserve port 1023 +older_ports=$(cat /proc/sys/net/ipv4/ip_local_reserved_ports); +echo "1023" > /proc/sys/net/ipv4/ip_local_reserved_ports; + +## Start and create a volume +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info; + +TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; + +TEST $CLI volume start $V0; + +TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 \ +$M0; + +## Wait for volume to register with rpc.mountd +sleep 6; +## check if port 1023 (which has been reserved) is used by the gluster processes +op=$(netstat -antlp | grep gluster | grep 1023); +EXPECT "" echo $op; + +#set the reserved ports to the older values +echo $older_ports > /proc/sys/net/ipv4/ip_local_reserved_ports + +cleanup; |