e2e: validate images in trash for volumegroupsnapshot test

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M 2024-12-04 11:09:24 +05:30 committed by mergify[bot]
parent 51d0a08112
commit 88b7e0d668
2 changed files with 16 additions and 0 deletions

View File

@ -214,6 +214,14 @@ func validateOmapCount(f *framework.Framework, count int, driver, pool, mode str
radosLsKeysCmd: "rados listomapkeys csi.groups.default " + cephfsOptions(pool), radosLsKeysCmd: "rados listomapkeys csi.groups.default " + cephfsOptions(pool),
radosLsKeysCmdFilter: fmt.Sprintf("rados listomapkeys csi.groups.default %s | wc -l", 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 { for _, cmds := range radosListCommands {

View File

@ -176,6 +176,14 @@ func (rvgs *rbdVolumeGroupSnapshot) ValidateResourcesForCreate(vgs *groupsnapapi
func (rvgs *rbdVolumeGroupSnapshot) ValidateResourcesForDelete() error { func (rvgs *rbdVolumeGroupSnapshot) ValidateResourcesForDelete() error {
validateOmapCount(rvgs.framework, 0, rbdType, defaultRBDPool, volumesType) 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 return nil
} }