From 401d591de168fdb648663f01c4c4f8ed60777558 Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Garg Date: Wed, 13 Apr 2016 14:38:11 +0530 Subject: Revert "glusterd: Allocate fresh port on brick (re)start" This reverts commit 34899d7 Commit 34899d7 introduced a change, where restarting a volume or rebooting a node result into fresh allocation of brick port. In production environment generally administrator makes firewall configuration for a range of ports for a volume. With commit 34899d7, on rebooting of node or restarting a volume might result into volume start fail because firewall might block fresh allocated port of a brick and also it will be difficult in testing because of fresh allocation of port. Change-Id: I7a90f69e8c267a013dc906b5228ca76e819d84ad BUG: 1322805 Signed-off-by: Gaurav Kumar Garg Reviewed-on: http://review.gluster.org/13989 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- .../glusterd/1313628-import-brick-ports-always.t | 47 ++++++++++++++++++++++ tests/features/ssl-ciphers.t | 5 --- 2 files changed, 47 insertions(+), 5 deletions(-) create mode 100755 tests/bugs/glusterd/1313628-import-brick-ports-always.t (limited to 'tests') diff --git a/tests/bugs/glusterd/1313628-import-brick-ports-always.t b/tests/bugs/glusterd/1313628-import-brick-ports-always.t new file mode 100755 index 0000000000..d04c429346 --- /dev/null +++ b/tests/bugs/glusterd/1313628-import-brick-ports-always.t @@ -0,0 +1,47 @@ +#!/bin/bash +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../cluster.rc + +## Check that brick ports are always copied on import +## -------------------------------------------------- +## This test checks that the brick ports are copied on import by checking that +## they don't change when the following happens, +## - Stop a volume +## - Stop glusterd +## - Start the stopped volume +## - Start the stopped glusterd + +function get_brick_port() { + local VOL=$1 + local BRICK=$2 + $CLI2 volume status $VOL $BRICK --xml | sed -ne 's/.*\([0-9]*\)<\/port>/\1/p' +} + + +cleanup + +TEST launch_cluster 2 +TEST $CLI1 peer probe $H2 +EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count + +# Create and start volume so that brick port assignment happens +TEST $CLI1 volume create $V0 $H1:$B1/$V0 $H2:$B2/$V0 +TEST $CLI1 volume start $V0 + +# Save port for 2nd brick +BPORT_ORIG=$(get_brick_port $V0 $H2:$B2/$V0) + +# Stop volume, stop 2nd glusterd, start volume, start 2nd glusterd +TEST $CLI1 volume stop $V0 +TEST kill_glusterd 2 + +TEST $CLI1 volume start $V0 +TEST start_glusterd 2 +EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count + +# Get new port and compare with old one +EXPECT_WITHIN $PROCESS_UP_TIMEOUT $BPORT_ORIG get_brick_port $V0 $H2:$B2/$V0 + +$CLI1 volume stop $V0 + +cleanup diff --git a/tests/features/ssl-ciphers.t b/tests/features/ssl-ciphers.t index f5909f320a..9ee7fc6c16 100644 --- a/tests/features/ssl-ciphers.t +++ b/tests/features/ssl-ciphers.t @@ -137,7 +137,6 @@ EXPECT "`pwd`/`dirname $0`/dh1024.pem" volume_option $V0 ssl.dh-param TEST $CLI volume stop $V0 TEST $CLI volume start $V0 EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" online_brick_count -BRICK_PORT=`brick_port $V0` EXPECT "Y" openssl_connect -cipher EDH -connect $H0:$BRICK_PORT # Test the cipher-list option @@ -146,7 +145,6 @@ EXPECT AES256-SHA volume_option $V0 ssl.cipher-list TEST $CLI volume stop $V0 TEST $CLI volume start $V0 EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" online_brick_count -BRICK_PORT=`brick_port $V0` EXPECT "Y" openssl_connect -cipher AES256-SHA -connect $H0:$BRICK_PORT EXPECT "N" openssl_connect -cipher AES128-SHA -connect $H0:$BRICK_PORT @@ -156,7 +154,6 @@ EXPECT EECDH:EDH:!TLSv1 volume_option $V0 ssl.cipher-list TEST $CLI volume stop $V0 TEST $CLI volume start $V0 EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" online_brick_count -BRICK_PORT=`brick_port $V0` EXPECT "N" openssl_connect -cipher AES256-SHA -connect $H0:$BRICK_PORT EXPECT "Y" openssl_connect -cipher EECDH -connect $H0:$BRICK_PORT @@ -165,7 +162,6 @@ EXPECT invalid volume_option $V0 ssl.ec-curve TEST $CLI volume stop $V0 TEST $CLI volume start $V0 EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" online_brick_count -BRICK_PORT=`brick_port $V0` EXPECT "N" openssl_connect -cipher EECDH -connect $H0:$BRICK_PORT TEST $CLI volume set $V0 ssl.ec-curve secp521r1 @@ -173,7 +169,6 @@ EXPECT secp521r1 volume_option $V0 ssl.ec-curve TEST $CLI volume stop $V0 TEST $CLI volume start $V0 EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" online_brick_count -BRICK_PORT=`brick_port $V0` EXPECT "Y" openssl_connect -cipher EECDH -connect $H0:$BRICK_PORT # test revocation -- cgit