]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/workunits: add scenario to "test_force_promote_delete_group"
authorRamana Raja <rraja@redhat.com>
Mon, 8 Sep 2025 02:50:51 +0000 (22:50 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 28 Sep 2025 18:25:05 +0000 (20:25 +0200)
... in rbd_mirror_group_simple test suite.

After the group and its images are removed from the secondary, the test
can run in one of two scenarios. In Scenario 1, the test confirms that
the group is completely synced from the primary to the secondary. In
Scenario 2, the test disables and re-enables the primary, and then
confirms the group syncs from the primary to the secondary. Currently,
both of the scenarios fail occassionally when trying to confirm that
group is completely synced from the primary to the secondary.

Signed-off-by: Ramana Raja <rraja@redhat.com>
qa/workunits/rbd/rbd_mirror_group_simple.sh

index 99c5b3ae1a586903415e31250c9b2115ed5c8d08..fcbb8d52a0aaff096690fc8904b9b68afc378d74 100755 (executable)
@@ -2736,9 +2736,10 @@ test_force_promote()
   start_mirrors "${secondary_cluster}"
 }
 
-declare -a test_force_promote_delete_group_1=("${CLUSTER2}" "${CLUSTER1}" "${pool0}" "${image_prefix}" 5)
+declare -a test_force_promote_delete_group_1=("${CLUSTER2}" "${CLUSTER1}" "${pool0}" "${image_prefix}" 5 '')
+declare -a test_force_promote_delete_group_2=("${CLUSTER2}" "${CLUSTER1}" "${pool0}" "${image_prefix}" 5 'disable_reenable_primary')
 
-test_force_promote_delete_group_scenarios=1
+test_force_promote_delete_group_scenarios=2
 
 test_force_promote_delete_group()
 {
@@ -2747,6 +2748,7 @@ test_force_promote_delete_group()
   local pool=$1 ; shift
   local image_prefix=$1 ; shift
   local image_count=$(($1*"${image_multiplier}")) ; shift
+  local scenario=$1 ; shift
 
   local group0=test-group0
 
@@ -2762,11 +2764,7 @@ test_force_promote_delete_group()
   wait_for_group_present "${secondary_cluster}" "${pool}" "${group0}" "${image_count}"
   wait_for_group_replay_started "${secondary_cluster}" "${pool}"/"${group0}" "${image_count}"
   wait_for_group_status_in_pool_dir "${secondary_cluster}" "${pool}"/"${group0}" 'up+replaying' "${image_count}"
-
-  if [ -z "${RBD_MIRROR_USE_RBD_MIRROR}" ]; then
-    wait_for_group_status_in_pool_dir "${primary_cluster}" "${pool}"/"${group0}" 'up+stopped' "${image_count}" 
-  fi
-
+  wait_for_group_status_in_pool_dir "${primary_cluster}" "${pool}"/"${group0}" 'up+stopped' "${image_count}"
   wait_for_group_synced "${primary_cluster}" "${pool}"/"${group0}" "${secondary_cluster}" "${pool}"/"${group0}"
 
   # force promote the group on the secondary 
@@ -2810,13 +2808,21 @@ test_force_promote_delete_group()
   group_remove "${secondary_cluster}" "${pool}/${group0}"
   images_remove "${secondary_cluster}" "${pool}/${image_prefix}" "${image_count}"
 
-  # disable and re-enable on original primary
-  mirror_group_disable "${primary_cluster}" "${pool}/${group0}"
-  mirror_group_enable "${primary_cluster}" "${pool}/${group0}"
+  if [ "${scenario}" = 'disable_reenable_primary' ]; then
+    # disable and re-enable on original primary
+    mirror_group_disable "${primary_cluster}" "${pool}/${group0}"
+    mirror_group_enable "${primary_cluster}" "${pool}/${group0}"
+  fi
 
   # confirm that group is mirrored back to secondary
   wait_for_group_present "${primary_cluster}" "${pool}" "${group0}" "${image_count}"
+  # TODO: Both scenarios 1 and 2 fail in the below step sometimes when the
+  # primary group does not get fully mirrored to the secondary.
   wait_for_group_present "${secondary_cluster}" "${pool}" "${group0}" "${image_count}"
+  wait_for_group_replay_started "${secondary_cluster}" "${pool}"/"${group0}" "${image_count}"
+  wait_for_group_status_in_pool_dir "${secondary_cluster}" "${pool}"/"${group0}" 'up+replaying' "${image_count}"
+  wait_for_group_status_in_pool_dir "${primary_cluster}" "${pool}"/"${group0}" 'up+stopped' "${image_count}"
+  wait_for_group_synced "${primary_cluster}" "${pool}"/"${group0}" "${secondary_cluster}" "${pool}"/"${group0}"
 
   # tidy up
   mirror_group_disable "${primary_cluster}" "${pool}/${group0}"