]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
multisite/test: running the multisite test script with multiple RGWs per zone 45687/head
authorYuval Lifshitz <ylifshit@redhat.com>
Tue, 29 Mar 2022 13:21:46 +0000 (16:21 +0300)
committerYuval Lifshitz <ylifshit@redhat.com>
Tue, 29 Mar 2022 13:21:46 +0000 (16:21 +0300)
the RGW_PER_ZONE environment variables should be set to allow that
if not set, we assume 1 RGW per zone

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/test/rgw/test-rgw-common.sh
src/test/rgw/test-rgw-multisite.sh

index 18caf23a19008708274d045ec8575a9d3f235d83..da263c6d9669045e841d73dd59859cdfaad53720 100644 (file)
@@ -93,7 +93,7 @@ function init_first_zone {
   realm=$2
   zg=$3
   zone=$4
-  endpoints=$url:$5
+  endpoints=$5
 
   access_key=$6
   secret=$7
@@ -117,7 +117,7 @@ function init_zone_in_existing_zg {
   zg=$3
   zone=$4
   master_zg_zone1_port=$5
-  endpoints=$url:$6
+  endpoints=$6
 
   access_key=$7
   secret=$8
@@ -136,7 +136,7 @@ function init_first_zone_in_slave_zg {
   zg=$3
   zone=$4
   master_zg_zone1_port=$5
-  endpoints=$url:$6
+  endpoints=$6
 
   access_key=$7
   secret=$8
index eb3b13b1fa1042cb3e76ba1822dfae867421b6c8..60e2a69ae19fced77c98e0cab01bd8c21b9e8745 100755 (executable)
@@ -21,9 +21,29 @@ system_secret="pencil"
 # bring up first cluster
 x $(start_ceph_cluster c1) -n $(get_mstart_parameters 1)
 
-# create realm, zonegroup, zone, start rgw
-init_first_zone c1 $realm_name $zg ${zg}-1 8001 $system_access_key $system_secret
-x $(rgw c1 8001 "$@")
+if [ -n "$RGW_PER_ZONE" ]; then
+  rgws="$RGW_PER_ZONE"
+else
+  rgws=1
+fi
+
+url=http://localhost
+
+i=1
+while [ $i -le $rgws ]; do
+  port=$((8100+i))
+  endpoints="$endpoints""$url:$port,"
+  i=$((i+1))
+done
+
+# create realm, zonegroup, zone, start rgws
+init_first_zone c1 $realm_name $zg ${zg}-1 $endpoints $system_access_key $system_secret
+i=1
+while [ $i -le $rgws ]; do
+  port=$((8100+i))
+  x $(rgw c1 "$port" "$@")
+  i="$((i+1))"
+done
 
 output=`$(rgw_admin c1) realm get`
 
@@ -31,14 +51,25 @@ echo realm_status=$output
 
 # bring up next clusters
 
+endpoints=""
 i=2
 while [ $i -le $num_clusters ]; do
   x $(start_ceph_cluster c$i) -n $(get_mstart_parameters $i)
+  j=1
+  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 ${zg}-${i} 8001 $((8000+$i)) $zone_port $system_access_key $system_secret
-  x $(rgw c$i $((8000+$i)) "$@")
-
+  init_zone_in_existing_zg c$i $realm_name $zg ${zg}-${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
   i=$((i+1))
 done