Skip to content

Commit

Permalink
tests: skip sparse check for imageio/vddk
Browse files Browse the repository at this point in the history
- ImageIO raw images are not passed through any sparsification mechanism
- VDDK ones do, but the fake plugin used for testing lies that they're
  not

Signed-off-by: Alex Kalenyuk <[email protected]>
  • Loading branch information
akalenyu committed Aug 28, 2024
1 parent 7182165 commit 483318c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,10 @@ var _ = Describe("Import populator", func() {
})

DescribeTable("should import fileSystem PVC", func(expectedMD5 string, originalVirtualSize int, volumeImportSourceFunc func(cdiv1.DataVolumeContentType, bool) error, preallocation, webhookRendering bool) {
// ImageIO raw images are not passed through any sparsification mechanism
// VDDK ones do, but the fake plugin used for testing lies that they're not
skipSparseCheckIDs := []string{"[test_id:11007]", "[test_id:11009]"}

pvc = importPopulationPVCDefinition()

if webhookRendering {
Expand All @@ -1664,12 +1668,19 @@ var _ = Describe("Import populator", func() {
Expect(err).ToNot(HaveOccurred())
Expect(md5).To(Equal(expectedMD5))

var excluded bool
for _, id := range skipSparseCheckIDs {
if strings.Contains(CurrentSpecReport().LeafNodeText, id) {
excluded = true
break
}
}
if preallocation {
By("Verifying the image is preallocated")
ok, err := f.VerifyImagePreallocated(f.Namespace, pvc)
Expect(err).ToNot(HaveOccurred())
Expect(ok).To(BeTrue())
} else {
} else if !excluded {
By("Verifying the image is sparse")
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath, int64(originalVirtualSize))).To(BeTrue())
}
Expand Down

0 comments on commit 483318c

Please sign in to comment.