Skip to content

Commit

Permalink
e2e: validate images in trash for volumegroupsnapshot test
Browse files Browse the repository at this point in the history
Signed-off-by: Praveen M <[email protected]>
  • Loading branch information
iPraveenParihar authored and mergify[bot] committed Dec 16, 2024
1 parent 51d0a08 commit 88b7e0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions e2e/volumegroupsnapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,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
}

0 comments on commit 88b7e0d

Please sign in to comment.