Skip to content

Commit

Permalink
e2e: validate PVC-PVC clone creation with deleted parent snap
Browse files Browse the repository at this point in the history
This commit modifies a test case to check creation of
PVC-PVC clone of a restored PVC when parent snapshot
is deleted.

Signed-off-by: Rakshith R <[email protected]>
  • Loading branch information
Rakshith-R committed Mar 29, 2024
1 parent 8e57efa commit 08fc0e2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions e2e/rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3609,6 +3609,27 @@ var _ = Describe("RBD", func() {
validateOmapCount(f, 1, rbdType, defaultRBDPool, volumesType)
validateOmapCount(f, 0, rbdType, defaultRBDPool, snapsType)

// create pvc-pvc clone
smartClonePVC, err := loadPVC(pvcSmartClonePath)
if err != nil {
framework.Failf("failed to load smart clone PVC: %v", err)
}

smartClonePVC.Name = fmt.Sprintf("%s-%d", smartClonePVC.Name, i)
smartClonePVC.Namespace = f.UniqueName
smartClonePVC.Spec.DataSource.Name = pvcClone.Name
err = createPVCAndvalidatePV(f.ClientSet, smartClonePVC, deployTimeout)
if err != nil {
framework.Failf("failed to create smart clone PVC %q: %v",
smartClonePVC.Name, err)
}

err = deletePVCAndValidatePV(f.ClientSet, smartClonePVC, deployTimeout)
if err != nil {
framework.Failf("failed to delete smart clone PVC %q: %v",
smartClonePVC.Name, err)
}

app.Spec.Volumes[0].PersistentVolumeClaim.ClaimName = pvcClone.Name
// create application
err = createApp(f.ClientSet, app, deployTimeout)
Expand Down

0 comments on commit 08fc0e2

Please sign in to comment.