Merge pull request #116569 from tukwila/validate_testVols

check if test volumes created
This commit is contained in:
Kubernetes Prow Robot 2023-03-15 12:20:31 -07:00 committed by GitHub
commit 20e8b20b75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,12 +201,20 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() {
} }
setupStorageClass(ctx, config, &testMode) setupStorageClass(ctx, config, &testMode)
testVols := setupLocalVolumesPVCsPVs(ctx, config, testVolType, config.randomNode, 1, testMode) testVols := setupLocalVolumesPVCsPVs(ctx, config, testVolType, config.randomNode, 1, testMode)
if len(testVols) > 0 {
testVol = testVols[0] testVol = testVols[0]
} else {
framework.Failf("Failed to get a test volume")
}
}) })
ginkgo.AfterEach(func(ctx context.Context) { ginkgo.AfterEach(func(ctx context.Context) {
if testVol != nil {
cleanupLocalVolumes(ctx, config, []*localTestVolume{testVol}) cleanupLocalVolumes(ctx, config, []*localTestVolume{testVol})
cleanupStorageClass(ctx, config) cleanupStorageClass(ctx, config)
} else {
framework.Failf("no test volume to cleanup")
}
}) })
ginkgo.Context("One pod requesting one prebound PVC", func() { ginkgo.Context("One pod requesting one prebound PVC", func() {