diff --git a/build.env b/build.env index fa48af57035..846f3d8452c 100644 --- a/build.env +++ b/build.env @@ -15,7 +15,8 @@ CSI_IMAGE_VERSION=canary CSI_UPGRADE_VERSION=v3.12.1 # Ceph version to use -BASE_IMAGE=quay.io/ceph/ceph:v19 +BASE_IMAGE=quay.ceph.io/ceph-ci/ceph:main +#BASE_IMAGE=quay.io/ceph/ceph:v19 CEPH_VERSION=squid # standard Golang options diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 21a94f79060..cf331103124 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -59,7 +59,7 @@ func init() { framework.AfterReadingAllFlags(&framework.TestContext) fmt.Println("timeout for deploytimeout ", deployTimeout) - testRBD = false + testRBD = true testNFS = false } diff --git a/e2e/rbd.go b/e2e/rbd.go index d47469a8b7b..cd62a6bc463 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -550,6 +550,49 @@ var _ = Describe("RBD", func() { validateOmapCount(f, 0, rbdType, defaultRBDPool, volumesType) }) + By("test volumeGroupSnapshot", func() { + supported, err := librbdSupportsVolumeGroupSnapshot(f) + if err != nil { + framework.Failf("failed to check for VolumeGroupSnapshot support: %v", err) + } + if !supported { + Skip("librbd does not support required VolumeGroupSnapshot function(s)") + } + + scName := "csi-rbd-sc" + snapshotter, err := newRBDVolumeGroupSnapshot(f, f.UniqueName, scName, false, deployTimeout, 10) + if err != nil { + framework.Failf("failed to create RBDVolumeGroupSnapshot: %v", err) + } + + snapTestErr := snapshotter.TestVolumeGroupSnapshot() + err = retryKubectlInput(f.UniqueName, kubectlGet, "volumegroupsnapshot", deployTimeout, "-oyaml") + if err != nil { + framework.Logf("failed to get volumegroupsnapshot: %v", err) + } + + err = retryKubectlInput(f.UniqueName, kubectlGet, "volumegroupsnapshotcontent", deployTimeout, "-oyaml") + if err != nil { + framework.Logf("failed to get volumegroupsnapshot: %v", err) + } + + err = retryKubectlInput(f.UniqueName, kubectlGet, "volumesnapshot", deployTimeout, "-oyaml") + if err != nil { + framework.Logf("failed to get volumesnapshot: %v", err) + } + + err = retryKubectlInput(f.UniqueName, kubectlGet, "volumesnapshotcontent", deployTimeout, "-oyaml") + if err != nil { + framework.Logf("failed to get volumesnapshotcontent: %v", err) + } + + if snapTestErr != nil { + framework.Failf("failed to test volumeGroupSnapshot: %v", snapTestErr) + } + + framework.Logf("[Debug] volumeGroupSnapshot test passed") + return + }) By("reattach the old PV to a new PVC and check if PVC metadata is updated on RBD image", func() { reattachPVCNamespace := f.Namespace.Name + "-2" pvc, err := loadPVC(pvcPath) @@ -4871,27 +4914,6 @@ var _ = Describe("RBD", func() { } }) - By("test volumeGroupSnapshot", func() { - supported, err := librbdSupportsVolumeGroupSnapshot(f) - if err != nil { - framework.Failf("failed to check for VolumeGroupSnapshot support: %v", err) - } - if !supported { - Skip("librbd does not support required VolumeGroupSnapshot function(s)") - } - - scName := "csi-rbd-sc" - snapshotter, err := newRBDVolumeGroupSnapshot(f, f.UniqueName, scName, false, deployTimeout, 3) - if err != nil { - framework.Failf("failed to create RBDVolumeGroupSnapshot: %v", err) - } - - err = snapshotter.TestVolumeGroupSnapshot() - if err != nil { - framework.Failf("failed to test volumeGroupSnapshot: %v", err) - } - }) - // delete RBD provisioner secret err := deleteCephUser(f, keyringRBDProvisionerUsername) if err != nil { diff --git a/e2e/volumegroupsnapshot_base.go b/e2e/volumegroupsnapshot_base.go index 619fc84be17..60c7370027f 100644 --- a/e2e/volumegroupsnapshot_base.go +++ b/e2e/volumegroupsnapshot_base.go @@ -453,7 +453,7 @@ func (v volumeGroupSnapshotterBase) DeleteVolumeGroupSnapshotClass(groupSnapshot } func (v *volumeGroupSnapshotterBase) testVolumeGroupSnapshot(vol VolumeGroupSnapshotter) error { - for i := 0; i < 20; i++ { + for i := 0; i < 15; i++ { pvcLabels := map[string]string{"pvc": "vgsc"} pvcs, err := v.CreatePVCs(v.namespace, pvcLabels) if err != nil { @@ -483,20 +483,20 @@ func (v *volumeGroupSnapshotterBase) testVolumeGroupSnapshot(vol VolumeGroupSnap return fmt.Errorf("failed to create clones: %w", err) } // create pods using the cloned PVCs - pods, err := v.CreatePods(clonePVCs) - if err != nil { - return fmt.Errorf("failed to create pods: %w", err) - } + // pods, err := v.CreatePods(clonePVCs) + // if err != nil { + // return fmt.Errorf("failed to create pods: %w", err) + // } // validate the resources in the backend err = vol.ValidateResourcesForCreate(volumeGroupSnapshot) if err != nil { return fmt.Errorf("failed to validate resources for create: %w", err) } // Delete the pods - err = v.DeletePods(pods) - if err != nil { - return fmt.Errorf("failed to delete pods: %w", err) - } + // err = v.DeletePods(pods) + // if err != nil { + // return fmt.Errorf("failed to delete pods: %w", err) + // } // Delete the clones err = v.DeletePVCs(clonePVCs) if err != nil {