Skip to content

Commit

Permalink
e2e: run vgs for rbd
Browse files Browse the repository at this point in the history
running vgs test for rbd

Signed-off-by: Madhu Rajanna <[email protected]>
  • Loading branch information
Madhu-1 committed Dec 2, 2024
1 parent c63b4cd commit 3f6dacb
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 32 deletions.
3 changes: 2 additions & 1 deletion build.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func init() {
framework.AfterReadingAllFlags(&framework.TestContext)

fmt.Println("timeout for deploytimeout ", deployTimeout)
testRBD = false
testRBD = true
testNFS = false
}

Expand Down
64 changes: 43 additions & 21 deletions e2e/rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
18 changes: 9 additions & 9 deletions e2e/volumegroupsnapshot_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3f6dacb

Please sign in to comment.