From aa15e642e1769dc8a1f92ae285e1492fc57cf557 Mon Sep 17 00:00:00 2001 From: Praveen M Date: Wed, 4 Dec 2024 11:09:24 +0530 Subject: [PATCH] e2e: validate images in trash for volumegroupsnapshot test Signed-off-by: Praveen M (cherry picked from commit 88b7e0d6684fc333445554f241f9dfd38397d15e) --- e2e/utils.go | 8 ++++++++ e2e/volumegroupsnapshot.go | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/e2e/utils.go b/e2e/utils.go index c02fc9d1c..d0319aa2f 100644 --- a/e2e/utils.go +++ b/e2e/utils.go @@ -214,6 +214,14 @@ func validateOmapCount(f *framework.Framework, count int, driver, pool, mode str radosLsKeysCmd: "rados listomapkeys csi.groups.default " + cephfsOptions(pool), radosLsKeysCmdFilter: fmt.Sprintf("rados listomapkeys csi.groups.default %s | wc -l", cephfsOptions(pool)), }, + { + volumeMode: groupSnapsType, + driverType: rbdType, + radosLsCmd: "rados ls" + rbdOptions(pool), + radosLsCmdFilter: fmt.Sprintf("rados ls %s | grep -v default | grep -c ^csi.volume.group.", rbdOptions(pool)), + radosLsKeysCmd: "rados listomapkeys csi.groups.default " + rbdOptions(pool), + radosLsKeysCmdFilter: fmt.Sprintf("rados listomapkeys csi.groups.default %s | wc -l", rbdOptions(pool)), + }, } for _, cmds := range radosListCommands { diff --git a/e2e/volumegroupsnapshot.go b/e2e/volumegroupsnapshot.go index 9ec6f70ec..513f6d607 100644 --- a/e2e/volumegroupsnapshot.go +++ b/e2e/volumegroupsnapshot.go @@ -201,6 +201,14 @@ func (rvgs *rbdVolumeGroupSnapshot) ValidateResourcesForCreate(vgs *groupsnapapi func (rvgs *rbdVolumeGroupSnapshot) ValidateResourcesForDelete() error { validateOmapCount(rvgs.framework, 0, rbdType, defaultRBDPool, volumesType) + validateOmapCount(rvgs.framework, 0, rbdType, defaultRBDPool, snapsType) + validateOmapCount(rvgs.framework, 0, rbdType, defaultRBDPool, groupSnapsType) + validateRBDImageCount(rvgs.framework, 0, defaultRBDPool) + + err := waitToRemoveImagesFromTrash(rvgs.framework, defaultRBDPool, deployTimeout) + if err != nil { + return err + } return nil }