]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
qa: Add tests to validate syncing of images using rbd-mirror
authorRamana Raja <rraja@redhat.com>
Thu, 25 May 2023 16:48:12 +0000 (16:48 +0000)
committerRamana Raja <rraja@redhat.com>
Thu, 14 Mar 2024 13:47:48 +0000 (09:47 -0400)
commitf13e6294e5ce8c023a84c32201e449e65cfe57b1
treea7f442b3a793b96c5e39064ad996c406a6a75fe2
parent6dd500c146ac050c03f9e6d9690a0798066a0612
qa: Add tests to validate syncing of images using rbd-mirror

Introduce functional tests to validate that the images under
workloads are correctly mirrored between two clusters using snapshot
based mirroring.

Run workload on a primary image using a krbd or nbd client. Take
mirror snapshots of the image under workload. Unmount the mapped image
and calculate its MD5 checksum before demoting it. After demotion,
wait for the mirror status of the image to be 'up+unknown' in both
the clusters. This is to make sure that the non-primary image in the
other cluster is ready to be promoted. Now promote the non-primary
image in the other cluster. Map the promoted image and calculate its
MD5 checksum. Verify that the checksums of the demoted and promoted
images in the two clusters are the same.

The above test is run as part of two different workunits:
 - a workunit that validates the syncing of multiple mirrored images
   with workloads running on them
 - another workunit that validates the syncing of a single mirrored
   image with workload running on it and the image is set as primary
   alternatively between the two clusters, as it happens during
   failover and failback scenarios.

Fixes: https://tracker.ceph.com/issues/61617
Signed-off-by: Ramana Raja <rraja@redhat.com>
Co-authored-by: Ilya Dryomov <idryomov@redhat.com>
Co-authored-by: Christopher Hoffman <choffman@redhat.com>
(cherry picked from commit b7aae5c3c5a1dd24c4cb7ceb499292af00bae680)

Cherry-pick notes:
- In qa/workunits/rbd/compare_mirror_images.sh, replace
  `wait_for_replaying_status_in_pool_dir` with `wait_for_status_in_pool_dir`
  Commit 3fd8a03 that added `wait_for_replaying_status_in_pool_dir`
  not backported
qa/suites/rbd/mirror/workloads/compare-mirror-image-alternate-primary-krbd.yaml [new file with mode: 0644]
qa/suites/rbd/mirror/workloads/compare-mirror-image-alternate-primary-nbd.yaml [new file with mode: 0644]
qa/suites/rbd/mirror/workloads/compare-mirror-images-krbd.yaml [new file with mode: 0644]
qa/suites/rbd/mirror/workloads/compare-mirror-images-nbd.yaml [new file with mode: 0644]
qa/workunits/rbd/compare_mirror_image_alternate_primary.sh [new file with mode: 0755]
qa/workunits/rbd/compare_mirror_images.sh [new file with mode: 0755]