diff options
Diffstat (limited to 'src/test/rgw/test-rgw-multisite.sh')
-rwxr-xr-x | src/test/rgw/test-rgw-multisite.sh | 58 |
1 files changed, 51 insertions, 7 deletions
diff --git a/src/test/rgw/test-rgw-multisite.sh b/src/test/rgw/test-rgw-multisite.sh index a005b19e3da..d3a1b265ca6 100755 --- a/src/test/rgw/test-rgw-multisite.sh +++ b/src/test/rgw/test-rgw-multisite.sh @@ -1,11 +1,12 @@ #!/usr/bin/env bash -[ $# -lt 1 ] && echo "usage: $0 <num-clusters> [rgw parameters...]" && exit 1 +[ $# -lt 1 ] && echo "usage: $0 <num-zones> <num-zonegroups>[rgw parameters...]" && exit 1 -num_clusters=$1 +num_zones=$1 +num_zonegroups=$2 shift -[ $num_clusters -lt 1 ] && echo "clusters num must be at least 1" && exit 1 +[ $num_zones -lt 1 ] && echo "clusters num must be at least 1" && exit 1 . "`dirname $0`/test-rgw-common.sh" . "`dirname $0`/test-rgw-meta-sync.sh" @@ -53,7 +54,7 @@ echo realm_status=$output endpoints="" i=2 -while [ $i -le $num_clusters ]; do +while [ $i -le $num_zones ]; do x $(start_ceph_cluster c$i) -n $(get_mstart_parameters $i) j=1 endpoints="" @@ -74,10 +75,53 @@ while [ $i -le $num_clusters ]; do i=$((i+1)) done -i=2 -while [ $i -le $num_clusters ]; do - wait_for_meta_sync c1 c$i $realm_name +endpoints="" +k=2 +while [ $k -le $num_zonegroups ]; do + x $(start_ceph_cluster c$i) -n $(get_mstart_parameters $i) + j=1 + endpoints="" + while [ $j -le $rgws ]; do + port=$((8000+i*100+j)) + endpoints="$endpoints""$url:$port," + j=$((j+1)) + done + # create new zone, start rgw + init_first_zone_in_peer_zg c$i $realm_name zg${k} zg${k}-${i} 8101 $endpoints $system_access_key $system_secret + j=1 + while [ $j -le $rgws ]; do + port=$((8000+i*100+j)) + x $(rgw c$i "$port" "$@") + j="$((j+1))" + done +# bring up next clusters in zonegroup k i=$((i+1)) + + endpoints="" + l=2 + while [ $l -le $num_zones ]; do + x $(start_ceph_cluster c$i) -n $(get_mstart_parameters $i) + j=1 + endpoints="" + while [ $j -le $rgws ]; do + port=$((8000+i*100+j)) + endpoints="$endpoints""$url:$port," + j=$((j+1)) + done + + # create new zone, start rgw + init_zone_in_existing_zg c$i $realm_name zg${k} zg${k}-${i} 8101 $endpoints $zone_port $system_access_key $system_secret + j=1 + while [ $j -le $rgws ]; do + port=$((8000+i*100+j)) + x $(rgw c$i "$port" "$@") + j="$((j+1))" + done + l=$((l+1)) + i=$((i+1)) + done + + k=$((k+1)) done |