]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: update to mirror group snapshot tests
authorJohn Agombar <agombar@uk.ibm.com>
Mon, 28 Apr 2025 12:29:46 +0000 (13:29 +0100)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Wed, 30 Apr 2025 04:47:40 +0000 (10:17 +0530)
Updated tests:
• test_odf_failover_failback - Update retry_promote screnario to limit retries to
  10000 attempts

Disabled tests:
• test_create_group_with_images_then_mirror_with_regular_snapshots scenario 1
  test sometimes fails as removed regular snapshot remains on secondary cluster
  after new mirror group snapshot is sync complete

Helpers:
- get_pool_image_count() $XMLSTARLET variable shouldn't be used anymore

Signed-off-by: John Agombar <agombar@uk.ibm.com>
qa/workunits/rbd/rbd_mirror_group_simple.sh
qa/workunits/rbd/rbd_mirror_helpers.sh

index f2c969388b1d78b2559b31353d76ec479d8fc7e8..5264c55ae14d568369ed4bb7ddad28cda8b65e9e 100755 (executable)
@@ -1586,7 +1586,8 @@ declare -a test_create_group_with_images_then_mirror_with_regular_snapshots_1=("
 declare -a test_create_group_with_images_then_mirror_with_regular_snapshots_2=("${CLUSTER2}" "${CLUSTER1}" "${pool0}" "${group0}" "${image_prefix}" 2 'leave_snap')
 declare -a test_create_group_with_images_then_mirror_with_regular_snapshots_3=("${CLUSTER2}" "${CLUSTER1}" "${pool0}" "${group0}" "${image_prefix}" 2 'force_disable')
 
-test_create_group_with_images_then_mirror_with_regular_snapshots_scenarios=3
+# TODO scenario 1 is sometimes failing so is disabled - see issue on line 45
+test_create_group_with_images_then_mirror_with_regular_snapshots_scenarios='2 3'
 
 test_create_group_with_images_then_mirror_with_regular_snapshots()
 {
@@ -3200,9 +3201,16 @@ test_odf_failover_failback()
 
   # promote original primary again
   if [ "${scenario}" = 'retry_promote' ]; then
+    local i=0
     while true; do
       { mirror_group_promote_try "${primary_cluster}" "${pool}/${group0}" && break; } || :
+      if [ "$i" -lt 10000 ]; then 
+        i=$((i+1))
+      else
+        fail "promote command failed after $i attempts"
+      fi  
     done
+    echo "promote command succeeded after $i attempts"
   else
     mirror_group_promote "${primary_cluster}" "${pool}/${group0}"
   fi  
@@ -3716,8 +3724,8 @@ run_all_tests()
   run_test_all_scenarios test_multiple_mirror_group_snapshot_unlink_time
   run_test_all_scenarios test_force_promote_delete_group
   run_test_all_scenarios test_create_group_stop_daemon_then_recreate
-  # TODO these next 2 tests are disabled as they fails with incorrect state/description in mirror group status - issue 50
   run_test_all_scenarios test_enable_mirroring_when_duplicate_group_exists
+  # TODO this next test is disabled as it fails with incorrect state/description in mirror group status - issue 50
   #run_test_all_scenarios test_enable_mirroring_when_duplicate_image_exists
   run_test_all_scenarios test_odf_failover_failback
   run_test_all_scenarios test_resync_marker
index b611dd2eeb73ccdc3692dcbbd94502d219b646cc..1000e222593f42217a3f91acbb652b846a843cb5 100755 (executable)
@@ -1989,9 +1989,9 @@ get_pool_image_count()
     
     run_cmd "rbd --cluster ${cluster} ls ${pool} --format xml --pretty-format"
     if [ "${image}" = '*' ]; then
-        _pool_image_count="$($XMLSTARLET sel -t -v "count(//images/name)" < "$CMD_STDOUT")"
+        _pool_image_count="$(xmlstarlet sel -t -v "count(//images/name)" < "$CMD_STDOUT")"
     else
-        _pool_image_count="$($XMLSTARLET sel -t -v "count(//images[name='${image}'])" < "$CMD_STDOUT")"
+        _pool_image_count="$(xmlstarlet sel -t -v "count(//images[name='${image}'])" < "$CMD_STDOUT")"
     fi
 }