]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
multisite/test: running the multisite test script with custom devices 45537/head
authorYuval Lifshitz <ylifshit@redhat.com>
Mon, 21 Mar 2022 16:00:48 +0000 (18:00 +0200)
committerYuval Lifshitz <ylifshit@redhat.com>
Mon, 21 Mar 2022 16:08:53 +0000 (18:08 +0200)
following environment variables should be set to allow that:

DEV_LIST: comma separated list of devices that should be used by each
clusteri as bluestore block devices.
for example in: DEV_LIST=/dev/nvme7n1,/dev/nvme6n1
the device /dev/nvme7n1 to be used by cluster "c1, while /dev/nvme6n1
will be used by cluster "c2".

DB_DEV_LIST: similar mechanism for DB
WAL_DEV_LIST: similar mechanism for WAL

note that if any of these variables is missing, or has less values than
clusters, the default device would be used.

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

index e7f5a862bdf220eff109f11d75bef9299ea2df7f..18caf23a19008708274d045ec8575a9d3f235d83 100644 (file)
@@ -160,3 +160,36 @@ function call_rgw_admin {
   shift 1
   x $(rgw_admin $cid) "$@"
 }
+
+function get_mstart_parameters {
+  [ $# -ne 1 ] && echo "get_mstart_parameters() needs 1 param" && exit 1
+  # bash arrays start from zero
+  index="$1"
+       index=$((index-1))
+  if [ -n "$DEV_LIST" ]; then
+    IFS=', ' read -r -a dev_list <<< "$DEV_LIST"
+    if [ ${#dev_list[@]} -gt "$index" ]; then
+      local dev_name=${dev_list["$index"]}
+      parameters="--bluestore-devs $dev_name"
+    fi
+  fi
+
+  if [ -n "$DB_DEV_LIST" ]; then
+    IFS=', ' read -r -a db_dev_list <<< "$DB_DEV_LIST"
+    if [ ${#db_dev_list[@]} -gt "$index" ]; then
+      local dev_name=${db_dev_list["$index"]}
+      parameters="$parameters"" -o bluestore_block_db_path=$dev_name"
+    fi
+  fi
+  
+  if [ -n "$WAL_DEV_LIST" ]; then
+    IFS=', ' read -r -a wal_dev_list <<< "$WAL_DEV_LIST"
+    if [ ${#wal_dev_list[@]} -gt "$index" ]; then
+      local dev_name=${wal_dev_list["$index"]}
+      parameters="$parameters"" -o bluestore_block_wal_path=$dev_name"
+    fi
+  fi
+
+  echo "$parameters"
+}
+
index 6e7b582aae39195ade58e455e2eeb0f706131466..eb3b13b1fa1042cb3e76ba1822dfae867421b6c8 100755 (executable)
@@ -19,7 +19,7 @@ system_access_key="1234567890"
 system_secret="pencil"
 
 # bring up first cluster
-x $(start_ceph_cluster c1) -n
+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
@@ -33,7 +33,7 @@ echo realm_status=$output
 
 i=2
 while [ $i -le $num_clusters ]; do
-  x $(start_ceph_cluster c$i) -n
+  x $(start_ceph_cluster c$i) -n $(get_mstart_parameters $i)
 
   # 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