Skip to content

Commit

Permalink
[release-v1.58] Adapt test suite for Filesystem only advanced storage (
Browse files Browse the repository at this point in the history
…#3102)

* Skip some block volume tests on storage that doesn't support them

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>

* Fix wrong PVC size unit

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>

---------

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
Co-authored-by: Alex Kalenyuk <akalenyu@redhat.com>
  • Loading branch information
kubevirt-bot and akalenyu committed Mar 11, 2024
1 parent d5ad9b7 commit 0cae433
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tests/cloner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2685,6 +2685,9 @@ var _ = Describe("all clone tests", func() {
if !f.IsSnapshotStorageClassAvailable() {
Skip("Clone from volumesnapshot does not work without snapshot capable storage")
}
if volumeMode == v1.PersistentVolumeBlock && !f.IsBlockVolumeStorageClassAvailable() {
Skip("Storage Class for block volume is not available")
}

targetNs := f.Namespace
if crossNamespace {
Expand Down Expand Up @@ -2757,6 +2760,9 @@ var _ = Describe("all clone tests", func() {
var i int
var err error

if volumeMode == v1.PersistentVolumeBlock && !f.IsBlockVolumeStorageClassAvailable() {
Skip("Storage Class for block volume is not available")
}
targetNs := f.Namespace
if crossNamespace {
targetNamespace, err = f.CreateNamespace("cdi-cross-ns-snapshot-clone-test", nil)
Expand Down
3 changes: 3 additions & 0 deletions tests/csiclone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ var _ = Describe("[vendor:cnv-qe@redhat.com][level:component][crit:high][rfe_id:
if !f.IsCSIVolumeCloneStorageClassAvailable() {
Skip("CSI Volume Clone is not applicable")
}
if !f.IsBlockVolumeStorageClassAvailable() {
Skip("Storage Class for block volume is not available")
}

By(fmt.Sprintf("configure storage profile %s", f.CsiCloneSCName))
Expect(
Expand Down
8 changes: 7 additions & 1 deletion tests/datavolume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ var _ = Describe("[vendor:cnv-qe@redhat.com][level:component]DataVolume tests",

By("Create PVC")
annotations := map[string]string{"cdi.kubevirt.io/storage.populatedFor": dataVolumeName}
pvc := utils.NewPVCDefinition(dataVolumeName, "100m", annotations, nil)
pvc := utils.NewPVCDefinition(dataVolumeName, "100Mi", annotations, nil)
pvc = f.CreateBoundPVCFromDefinition(pvc)

By("Verifying Succeed with PVC Bound")
Expand Down Expand Up @@ -2383,6 +2383,9 @@ var _ = Describe("[vendor:cnv-qe@redhat.com][level:component]DataVolume tests",
})

It("[test_id:6101]Clone pod should not have size corrected on block", func() {
if !f.IsBlockVolumeStorageClassAvailable() {
Skip("Storage Class for block volume is not available")
}
SetFilesystemOverhead(f, "0.50", "0.50")
requestedSize := resource.MustParse("100Mi")
// volumeMode Block, so no overhead applied
Expand Down Expand Up @@ -2410,6 +2413,9 @@ var _ = Describe("[vendor:cnv-qe@redhat.com][level:component]DataVolume tests",
})

It("[test_id:6487]Clone pod should not have size corrected on block, when no volumeMode on DV", func() {
if !f.IsBlockVolumeStorageClassAvailable() {
Skip("Storage Class for block volume is not available")
}
SetFilesystemOverhead(f, "0.50", "0.50")
requestedSize := resource.MustParse("100Mi")
// volumeMode Block, so no overhead applied
Expand Down
3 changes: 3 additions & 0 deletions tests/smartclone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ var _ = Describe("[vendor:cnv-qe@redhat.com][level:component]SmartClone tests",
if !f.IsSnapshotStorageClassAvailable() {
Skip("Smart Clone is not applicable")
}
if !f.IsBlockVolumeStorageClassAvailable() {
Skip("Storage Class for block volume is not available")
}
dataVolume, expectedMd5 := createDataVolume("dv-smart-clone-test-1", utils.DefaultPvcMountPath, v1.PersistentVolumeBlock, f.SnapshotSCName, f)
f.ExpectEvent(dataVolume.Namespace).Should(ContainSubstring(controller.SnapshotForSmartCloneInProgress))
if !f.IsBindingModeWaitForFirstConsumer(&cloneStorageClassName) {
Expand Down

0 comments on commit 0cae433

Please sign in to comment.