diff --git a/e2e/README.md b/e2e/README.md index 90e0620d4..3436aca6b 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -87,22 +87,23 @@ Thanks to [minikube](../scripts/minikube.sh) script for the handy `deploy-rook` In addition to standard go tests parameters, the following custom parameters are available while running tests: -| flag | description | -| ----------------- | ----------------------------------------------------------------------------- | -| deploy-timeout | Timeout to wait for created kubernetes resources (default: 10 minutes) | -| deploy-cephfs | Deploy cephFS CSI driver as part of E2E (default: true) | -| deploy-rbd | Deploy rbd CSI driver as part of E2E (default: true) | -| test-cephfs | Test cephFS CSI driver as part of E2E (default: true) | -| upgrade-testing | Perform upgrade testing (default: false) | -| upgrade-version | Target version for upgrade testing (default: "v3.5.1") | -| test-rbd | Test rbd CSI driver as part of E2E (default: true) | -| cephcsi-namespace | The namespace in which cephcsi driver will be created (default: "default") | -| rook-namespace | The namespace in which rook operator is installed (default: "rook-ceph") | -| kubeconfig | Path to kubeconfig containing embedded authinfo (default: $HOME/.kube/config) | -| timeout | Panic test binary after duration d (default 0, timeout disabled) | -| v | Verbose: print additional output | -| is-openshift | Run in OpenShift compatibility mode, skips certain new feature tests | -| filesystem | Name of the CephFS filesystem (default: "myfs") | +| flag | description | +| ----------------- | ------------------------------------------------------------------------------------------------- | +| deploy-timeout | Timeout to wait for created kubernetes resources (default: 10 minutes) | +| deploy-cephfs | Deploy cephFS CSI driver as part of E2E (default: true) | +| deploy-rbd | Deploy rbd CSI driver as part of E2E (default: true) | +| test-cephfs | Test cephFS CSI driver as part of E2E (default: true) | +| upgrade-testing | Perform upgrade testing (default: false) | +| upgrade-version | Target version for upgrade testing (default: "v3.5.1") | +| test-rbd | Test rbd CSI driver as part of E2E (default: true) | +| cephcsi-namespace | The namespace in which cephcsi driver will be created (default: "default") | +| rook-namespace | The namespace in which rook operator is installed (default: "rook-ceph") | +| kubeconfig | Path to kubeconfig containing embedded authinfo (default: $HOME/.kube/config) | +| timeout | Panic test binary after duration d (default 0, timeout disabled) | +| v | Verbose: print additional output | +| is-openshift | Run in OpenShift compatibility mode, skips certain new feature tests | +| filesystem | Name of the CephFS filesystem (default: "myfs") | +| clusterid | Use the Ceph cluster id in the StorageClasses and SnapshotClasses (default: `ceph fsid` detected) | ## E2E for snapshot diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 9199430e2..fec5cc5cd 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -45,6 +45,7 @@ func init() { flag.StringVar(&rookNamespace, "rook-namespace", "rook-ceph", "namespace in which rook is deployed") flag.BoolVar(&isOpenShift, "is-openshift", false, "disables certain checks on OpenShift") flag.StringVar(&fileSystemName, "filesystem", "myfs", "CephFS filesystem to use") + flag.StringVar(&clusterID, "clusterid", "", "Ceph cluster ID to use (defaults to `ceph fsid` detection)") setDefaultKubeconfig() // Register framework flags, then handle flags diff --git a/e2e/utils.go b/e2e/utils.go index c7eb0a9b4..beab0c655 100644 --- a/e2e/utils.go +++ b/e2e/utils.go @@ -79,6 +79,7 @@ var ( radosNamespace string poll = 2 * time.Second isOpenShift bool + clusterID string ) func getMons(ns string, c kubernetes.Interface) ([]string, error) { @@ -122,6 +123,10 @@ func getMonsHash(mons string) string { } func getClusterID(f *framework.Framework) (string, error) { + if clusterID != "" { + return clusterID, nil + } + fsID, stdErr, err := execCommandInToolBoxPod(f, "ceph fsid", rookNamespace) if err != nil { return "", fmt.Errorf("failed getting clusterID through toolbox: %w", err)