-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct wrong check of resulting image sparsiness
The first issue is that we look at content size since 2168, which is not beneficial in the sparseness check as opposed to disk usage. The second issue is that the check we have in tests for sparsiness is not honest because of the "equal to" part. The virtual size has to be strictly greater than the content (as the content is displayed by tools that understand sparseness). The third issue is that we almost always resize which results in significantly larger virtual size. What we really care about is comparing against the original virtual size of the image. Signed-off-by: Alex Kalenyuk <[email protected]>
- Loading branch information
Showing
5 changed files
with
15 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,7 @@ var _ = Describe("[rfe_id:1115][crit:high][vendor:[email protected]][level:compo | |
By("Verify the image contents") | ||
Expect(f.VerifyBlankDisk(f.Namespace, pvc)).To(BeTrue()) | ||
By("Verifying the image is sparse") | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath)).To(BeTrue()) | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath, utils.UploadFileSize)).To(BeTrue()) | ||
By("Verifying permissions are 660") | ||
Expect(f.VerifyPermissions(f.Namespace, pvc)).To(BeTrue(), "Permissions on disk image are not 660") | ||
if utils.DefaultStorageCSIRespectsFsGroup { | ||
|
@@ -1659,7 +1659,7 @@ var _ = Describe("Import populator", func() { | |
Expect(ok).To(BeTrue()) | ||
} else { | ||
By("Verifying the image is sparse") | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath)).To(BeTrue()) | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath, utils.UploadFileSize)).To(BeTrue()) | ||
} | ||
|
||
if utils.DefaultStorageCSIRespectsFsGroup { | ||
|
@@ -1722,7 +1722,7 @@ var _ = Describe("Import populator", func() { | |
Expect(err).ToNot(HaveOccurred()) | ||
Expect(md5).To(Equal(expectedMD5)) | ||
By("Verifying the image is sparse") | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultPvcMountPath)).To(BeTrue()) | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultPvcMountPath, utils.UploadFileSize)).To(BeTrue()) | ||
|
||
By("Verify 100.0% annotation") | ||
progress, ok, err := utils.WaitForPVCAnnotation(f.K8sClient, f.Namespace.Name, pvc, controller.AnnPopulatorProgress) | ||
|
@@ -1799,7 +1799,7 @@ var _ = Describe("Import populator", func() { | |
Expect(err).ToNot(HaveOccurred()) | ||
Expect(md5).To(Equal(utils.TinyCoreMD5)) | ||
By("Verifying the image is sparse") | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath)).To(BeTrue()) | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath, utils.UploadFileSize)).To(BeTrue()) | ||
sourceMD5 := md5 | ||
|
||
By("Retaining PV") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,7 +195,7 @@ var _ = Describe("[rfe_id:138][crit:high][vendor:[email protected]][level:compon | |
Expect(err).ToNot(HaveOccurred()) | ||
Expect(same).To(BeTrue()) | ||
By("Verifying the image is sparse") | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath)).To(BeTrue()) | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath, utils.UploadFileSize)).To(BeTrue()) | ||
if utils.DefaultStorageCSIRespectsFsGroup { | ||
// CSI storage class, it should respect fsGroup | ||
By("Checking that disk image group is qemu") | ||
|
@@ -411,7 +411,7 @@ var _ = Describe("[rfe_id:138][crit:high][vendor:[email protected]][level:compon | |
Expect(err).ToNot(HaveOccurred()) | ||
Expect(same).To(BeTrue()) | ||
By("Verifying the image is sparse") | ||
Expect(f.VerifySparse(f.Namespace, archivePVC, pathInPvc)).To(BeTrue()) | ||
Expect(f.VerifySparse(f.Namespace, archivePVC, pathInPvc, utils.UploadFileSize)).To(BeTrue()) | ||
} | ||
} else { | ||
checkFailureNoValidToken(archivePVC) | ||
|
@@ -525,7 +525,7 @@ var _ = Describe("[rfe_id:138][crit:high][vendor:[email protected]][level:compon | |
Expect(err).ToNot(HaveOccurred()) | ||
Expect(same).To(BeTrue()) | ||
By("Verifying the image is sparse") | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath)).To(BeTrue()) | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath, utils.UploadFileSize)).To(BeTrue()) | ||
if utils.DefaultStorageCSIRespectsFsGroup { | ||
// CSI storage class, it should respect fsGroup | ||
By("Checking that disk image group is qemu") | ||
|
@@ -599,7 +599,7 @@ var _ = Describe("[rfe_id:138][crit:high][vendor:[email protected]][level:compon | |
Expect(err).ToNot(HaveOccurred()) | ||
Expect(same).To(BeTrue()) | ||
By("Verifying the image is sparse") | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath)).To(BeTrue()) | ||
Expect(f.VerifySparse(f.Namespace, pvc, utils.DefaultImagePath, utils.UploadFileSize)).To(BeTrue()) | ||
if utils.DefaultStorageCSIRespectsFsGroup { | ||
// CSI storage class, it should respect fsGroup | ||
By("Checking that disk image group is qemu") | ||
|
@@ -730,7 +730,7 @@ var _ = Describe("[rfe_id:138][crit:high][vendor:[email protected]][level:compon | |
Expect(err).ToNot(HaveOccurred()) | ||
Expect(same).To(BeTrue()) | ||
By("Verifying the image is sparse") | ||
Expect(f.VerifySparse(f.Namespace, pvc, pathInPvc)).To(BeTrue()) | ||
Expect(f.VerifySparse(f.Namespace, pvc, pathInPvc, utils.UploadFileSize)).To(BeTrue()) | ||
} | ||
} else { | ||
checkFailureNoValidToken(pvcPrime) | ||
|