Skip to content

Commit

Permalink
Merge pull request kubernetes#114791 from mauriciopoppe/automated-che…
Browse files Browse the repository at this point in the history
…rry-pick-of-#114217-upstream-release-1.26

Automated cherry pick of kubernetes#114217: Fix issues in volumesnapshot test for ephemeral storage
  • Loading branch information
k8s-ci-robot authored Jan 4, 2023
2 parents cae683a + da22a8f commit a991dff
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/e2e/storage/testsuites/snapshottable.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,8 @@ func (s *snapshottableTestSuite) DefineTests(driver storageframework.TestDriver,
}

restoredPod = StartInPodWithVolumeSource(ctx, cs, volSrc, restoredPVC.Namespace, "restored-pvc-tester", "sleep 300", config.ClientNodeSelection)
cleanupSteps = append(cleanupSteps, func() {
StopPod(ctx, cs, restoredPod)
})
ginkgo.DeferCleanup(e2epod.DeletePodWithWait, cs, restoredPod)

framework.ExpectNoError(e2epod.WaitTimeoutForPodRunningInNamespace(cs, restoredPod.Name, restoredPod.Namespace, f.Timeouts.PodStartSlow))
if pattern.VolType != storageframework.GenericEphemeralVolume {
commands := e2evolume.GenerateReadFileCmd(datapath)
Expand All @@ -263,14 +262,16 @@ func (s *snapshottableTestSuite) DefineTests(driver storageframework.TestDriver,
}

ginkgo.By("should delete the VolumeSnapshotContent according to its deletion policy")

// Delete both Snapshot and restored Pod/PVC at the same time because different storage systems
// have different ordering of deletion. Some may require delete the restored PVC first before
// Snapshot deletion and some are opposite.
err = storageutils.DeleteSnapshotWithoutWaiting(dc, vs.GetNamespace(), vs.GetName())
framework.ExpectNoError(err)

framework.Logf("deleting restored pod %q/%q", restoredPod.Namespace, restoredPod.Name)
err = cs.CoreV1().Pods(restoredPod.Namespace).Delete(context.TODO(), restoredPod.Name, metav1.DeleteOptions{})
framework.ExpectNoError(err)
deleteVolumeSnapshot(f, dc, sr, pattern, vscontent)

})

ginkgo.It("should check snapshot fields, check restore correctly works after modifying source data, check deletion (persistent)", func(ctx context.Context) {
Expand Down

0 comments on commit a991dff

Please sign in to comment.