mirror of
https://github.com/kubevirt/containerized-data-importer.git
synced 2025-06-03 06:30:22 +00:00
[release-v1.57] Adjust tests for WFFC ceph lane (#2843)
* Adjust tests for WFFC ceph lane - We now support namespace transfer with WFFC due to using populators underneath - AnnCloneType/SourceInUse only appear when target binds - CloneFromSnapshotSourceInProgress only appears on non WFFC storage ATM Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com> * Specify wffc storage class variation of ceph explicitly for snapshot/csiclone/block Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com> * Increase test timeout Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com> --------- Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com> Co-authored-by: Alex Kalenyuk <akalenyu@redhat.com>
This commit is contained in:
parent
f59fb71ed1
commit
ac42b10752
@ -24,4 +24,7 @@ export RANDOM_CR=true
|
||||
export KUBEVIRT_STORAGE=rook-ceph-default
|
||||
export CEPH_WFFC=true
|
||||
export CDI_E2E_SKIP=Destructive
|
||||
export SNAPSHOT_SC=rook-ceph-block-wffc
|
||||
export BLOCK_SC=rook-ceph-block-wffc
|
||||
export CSICLONE_SC=rook-ceph-block-wffc
|
||||
automation/test.sh
|
||||
|
@ -93,7 +93,7 @@ if [ $retry_counter -eq $MAX_CDI_WAIT_RETRY ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test_command="${TESTS_OUT_DIR}/tests.test -test.timeout 360m ${test_args}"
|
||||
test_command="${TESTS_OUT_DIR}/tests.test -test.timeout 420m ${test_args}"
|
||||
echo "$test_command"
|
||||
(
|
||||
cd ${CDI_DIR}/tests
|
||||
|
@ -1519,6 +1519,7 @@ var _ = Describe("all clone tests", func() {
|
||||
|
||||
dataVolume, err := utils.CreateDataVolumeFromDefinition(f.CdiClient, f.Namespace.Name, targetDV)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
f.ForceBindPvcIfDvIsWaitForFirstConsumer(dataVolume)
|
||||
Expect(utils.GetCloneType(f.CdiClient, dataVolume)).To(Equal("csi-clone"))
|
||||
})
|
||||
})
|
||||
@ -3170,6 +3171,7 @@ func validateCloneType(f *framework.Framework, dv *cdiv1.DataVolume) {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
isCrossNamespaceClone := sourcePVC.Namespace != targetPVC.Namespace
|
||||
usesPopulator := targetPVC.Spec.DataSourceRef != nil && targetPVC.Spec.DataSourceRef.Kind == "VolumeCloneSource"
|
||||
|
||||
if sourcePVC.Spec.StorageClassName != nil {
|
||||
storageProfile, err := f.CdiClient.CdiV1beta1().StorageProfiles().Get(context.TODO(), *sourcePVC.Spec.StorageClassName, metav1.GetOptions{})
|
||||
@ -3194,7 +3196,7 @@ func validateCloneType(f *framework.Framework, dv *cdiv1.DataVolume) {
|
||||
targetPVC.Spec.StorageClassName != nil &&
|
||||
*sourcePVC.Spec.StorageClassName == *targetPVC.Spec.StorageClassName &&
|
||||
*sourcePVC.Spec.StorageClassName == f.SnapshotSCName &&
|
||||
(!isCrossNamespaceClone || bindingMode == storagev1.VolumeBindingImmediate) &&
|
||||
(!isCrossNamespaceClone || bindingMode == storagev1.VolumeBindingImmediate || usesPopulator) &&
|
||||
(allowsExpansion || sourcePVC.Status.Capacity.Storage().Cmp(*targetPVC.Status.Capacity.Storage()) == 0) {
|
||||
cloneType = "snapshot"
|
||||
}
|
||||
@ -3203,7 +3205,7 @@ func validateCloneType(f *framework.Framework, dv *cdiv1.DataVolume) {
|
||||
targetPVC.Spec.StorageClassName != nil &&
|
||||
*sourcePVC.Spec.StorageClassName == *targetPVC.Spec.StorageClassName &&
|
||||
*sourcePVC.Spec.StorageClassName == f.CsiCloneSCName &&
|
||||
(!isCrossNamespaceClone || bindingMode == storagev1.VolumeBindingImmediate) &&
|
||||
(!isCrossNamespaceClone || bindingMode == storagev1.VolumeBindingImmediate || usesPopulator) &&
|
||||
(allowsExpansion || sourcePVC.Status.Capacity.Storage().Cmp(*targetPVC.Status.Capacity.Storage()) == 0) {
|
||||
|
||||
cloneType = "csi-clone"
|
||||
|
@ -114,7 +114,10 @@ var _ = Describe("[vendor:cnv-qe@redhat.com][level:component]SmartClone tests",
|
||||
}
|
||||
dataVolume, expectedMd5 := createDataVolume("dv-smart-clone-test-1", utils.DefaultImagePath, v1.PersistentVolumeFilesystem, f.SnapshotSCName, f)
|
||||
f.ExpectEvent(dataVolume.Namespace).Should(ContainSubstring(controller.SnapshotForSmartCloneInProgress))
|
||||
if !f.IsBindingModeWaitForFirstConsumer(&cloneStorageClassName) {
|
||||
// We don't hit this event for WFFC targets ATM
|
||||
f.ExpectEvent(dataVolume.Namespace).Should(ContainSubstring(controller.CloneFromSnapshotSourceInProgress))
|
||||
}
|
||||
// Wait for operation Succeeded
|
||||
waitForDvPhase(cdiv1.Succeeded, dataVolume, f)
|
||||
f.ExpectEvent(dataVolume.Namespace).Should(ContainSubstring(controller.CloneSucceeded))
|
||||
@ -128,7 +131,10 @@ var _ = Describe("[vendor:cnv-qe@redhat.com][level:component]SmartClone tests",
|
||||
}
|
||||
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) {
|
||||
// We don't hit this event for WFFC targets ATM
|
||||
f.ExpectEvent(dataVolume.Namespace).Should(ContainSubstring(controller.CloneFromSnapshotSourceInProgress))
|
||||
}
|
||||
// Wait for operation Succeeded
|
||||
waitForDvPhase(cdiv1.Succeeded, dataVolume, f)
|
||||
f.ExpectEvent(dataVolume.Namespace).Should(ContainSubstring(controller.CloneSucceeded))
|
||||
@ -159,15 +165,18 @@ var _ = Describe("[vendor:cnv-qe@redhat.com][level:component]SmartClone tests",
|
||||
By(fmt.Sprintf("creating new datavolume %s", dataVolume.Name))
|
||||
dataVolume, err = utils.CreateDataVolumeFromDefinition(f.CdiClient, f.Namespace.Name, dataVolume)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
f.ForceBindPvcIfDvIsWaitForFirstConsumer(dataVolume)
|
||||
|
||||
f.ExpectEvent(dataVolume.Namespace).Should(ContainSubstring(cc.CloneSourceInUse))
|
||||
err = f.K8sClient.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.DeleteOptions{})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
f.ExpectEvent(dataVolume.Namespace).Should(ContainSubstring(controller.SnapshotForSmartCloneInProgress))
|
||||
if !f.IsBindingModeWaitForFirstConsumer(&cloneStorageClassName) {
|
||||
// We don't hit this event for WFFC targets ATM
|
||||
f.ExpectEvent(dataVolume.Namespace).Should(ContainSubstring(controller.CloneFromSnapshotSourceInProgress))
|
||||
}
|
||||
// Wait for operation Succeeded
|
||||
f.ForceBindPvcIfDvIsWaitForFirstConsumer(dataVolume)
|
||||
waitForDvPhase(cdiv1.Succeeded, dataVolume, f)
|
||||
f.ExpectEvent(dataVolume.Namespace).Should(ContainSubstring(controller.CloneSucceeded))
|
||||
// Verify PVC's content
|
||||
|
Loading…
Reference in New Issue
Block a user