Skip to content

Commit

Permalink
e2e: Support any storage class name
Browse files Browse the repository at this point in the history
We have configuration allowing any storage class name, but the code was
hard-coding the names "rook-ceph-block" and "rook-cephfs", limiting the
e2e tests to drenv environment.

Add a Name key to each PVCSpec entry, eliminating the code to create a
suffix. We use the name to crate the name of the test.

Part-of: RamenDR#1635
Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs committed Dec 11, 2024
1 parent f01b873 commit 4b542b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
8 changes: 5 additions & 3 deletions e2e/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ channelname: "ramen-gitops"
channelnamespace: "ramen-samples"
giturl: "https://github.com/RamenDR/ocm-ramen-samples.git"
pvcspecs:
- storageclassname: rook-cephfs
accessmodes: ReadWriteMany
- storageclassname: rook-ceph-block
- name: rbd
storageclassname: rook-ceph-block
accessmodes: ReadWriteOnce
- name: cephfs
storageclassname: rook-cephfs
accessmodes: ReadWriteMany
18 changes: 1 addition & 17 deletions e2e/exhaustive_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package e2e_test

import (
"fmt"
"strings"
"testing"

"github.com/ramendr/ramen/e2e/deployers"
Expand Down Expand Up @@ -33,30 +32,15 @@ var (
Deployers = []types.Deployer{subscription, appset, discoveredApps}
)

func generateSuffix(storageClassName string) string {
suffix := storageClassName

if strings.ToLower(storageClassName) == "rook-ceph-block" {
suffix = "rbd"
}

if strings.ToLower(storageClassName) == "rook-cephfs" {
suffix = "cephfs"
}

return suffix
}

func generateWorkloads([]types.Workload) {
pvcSpecs := util.GetPVCSpecs()
for _, pvcSpec := range pvcSpecs {
// add storageclass name to deployment name
suffix := generateSuffix(pvcSpec.StorageClassName)
deployment := &workloads.Deployment{
Path: GITPATH,
Revision: GITREVISION,
AppName: APPNAME,
Name: fmt.Sprintf("Deploy-%s", suffix),
Name: fmt.Sprintf("Deploy-%s", pvcSpec.Name),
PVCSpec: pvcSpec,
}
Workloads = append(Workloads, deployment)
Expand Down
1 change: 1 addition & 0 deletions e2e/util/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

type PVCSpec struct {
Name string
StorageClassName string
AccessModes string
}
Expand Down

0 comments on commit 4b542b2

Please sign in to comment.