e2e: validate RBD snapshot under temporary clone image is present

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M
2025-02-20 19:12:04 +05:30
committed by mergify[bot]
parent 0ed0af120b
commit 2af7269551
3 changed files with 54 additions and 0 deletions

View File

@ -185,6 +185,20 @@ func createORDeleteRbdResources(action kubectlAction) {
}
}
func validateRBDSnapshotCount(f *framework.Framework, count int, pool, image string) error {
snapshotList, err := listRBDSnapshots(f, pool, image)
if err != nil {
return fmt.Errorf("failed to list RBD snapshots: %w", err)
}
if len(snapshotList) != count {
return fmt.Errorf("RBD snapshots count not matching, snapshot count for image %s/%s %d, expected %d"+
"snapshots in cluster: %v",
pool, image, len(snapshotList), count, snapshotList)
}
return nil
}
func validateRBDImageCount(f *framework.Framework, count int, pool string) {
imageList, err := listRBDImages(f, pool)
if err != nil {