ceph-csi/e2e
Rakshith R afc08c531c e2e: test creation of additional groupSnaps to test minSnapLimit
Signed-off-by: Rakshith R <rar@redhat.com>
2024-12-17 15:15:42 +00:00
..
templates e2e: add deployment example for ROX used by multiple pods mounting same device 2021-11-23 13:13:41 +00:00
ceph_user.go e2e: address golangci-lint issues 2024-04-09 06:55:23 +00:00
cephfs_helper.go e2e: cephfs rados namespace test 2024-10-21 14:11:27 +00:00
cephfs.go e2e: test creation of additional groupSnaps to test minSnapLimit 2024-12-17 15:15:42 +00:00
clone.go rebase: update kubernetes to 1.26.1 2023-02-03 08:55:43 +00:00
configmap.go e2e: cephfs rados namespace test 2024-10-21 14:11:27 +00:00
deploy-vault.go e2e: address golangci-lint issues 2024-04-09 06:55:23 +00:00
deployment.go e2e: remove vsg flag present in older snapshotter 2024-12-17 10:55:39 +00:00
e2e_test.go e2e: Add test-cephfs-fscrypt flag 2022-11-23 12:21:02 +00:00
errors_test.go build: address 'copyloopvar' linter warning 2024-04-29 14:36:48 +00:00
errors.go e2e: retry when a pod does not have a host assigned (yet) 2024-06-06 19:23:15 +00:00
kms.go build: address gofmt warnings 2023-06-05 04:49:46 +00:00
log.go e2e: pass context.TODO() to k8s.e2e functions 2023-06-06 12:21:43 +00:00
migration.go build: address gofmt warnings 2023-06-05 04:49:46 +00:00
namespace.go e2e: address golangci-lint issues 2024-04-09 06:55:23 +00:00
nfs.go rebase: update external-snapshotter to v8 2024-09-12 13:07:13 +00:00
node.go e2e: remove multiple labels to node 2023-11-03 18:24:54 +00:00
pod.go e2e: log stderror in execCommandInPodAndAllowFail 2024-10-29 17:30:49 +00:00
pvc.go ci: log pvc events 2024-09-12 13:07:13 +00:00
rbd_helper.go rbd: added rbd info to validateRBDImageCount func 2024-11-22 15:33:40 +00:00
rbd.go e2e: test creation of additional groupSnaps to test minSnapLimit 2024-12-17 15:15:42 +00:00
README.md ci: fix mdl related failures 2022-11-17 08:25:10 +00:00
resize.go e2e: address golangci-lint issues 2024-04-09 06:55:23 +00:00
snapshot.go rebase: update external-snapshotter to v8 2024-09-12 13:07:13 +00:00
staticpvc.go e2e: add e2e to test static pvc 2024-01-12 18:27:45 +00:00
upgrade-cephfs.go e2e: address golangci-lint issues 2024-04-09 06:55:23 +00:00
upgrade-rbd.go e2e: address golangci-lint issues 2024-04-09 06:55:23 +00:00
upgrade.go e2e: add Copyright header of e2e files 2021-12-23 03:47:00 +00:00
utils.go e2e: remove vsg flag present in older snapshotter 2024-12-17 10:55:39 +00:00
volumegroupsnapshot_base.go e2e: test creation of additional groupSnaps to test minSnapLimit 2024-12-17 15:15:42 +00:00
volumegroupsnapshot.go e2e: test creation of additional groupSnaps to test minSnapLimit 2024-12-17 15:15:42 +00:00

End-to-End Testing

Introduction

End-to-end (e2e) in cephcsi provides a mechanism to test the end-to-end behavior of the system, These tests will interact with live instances of ceph cluster just like how a user would.

The primary objectives of the e2e tests are to ensure a consistent and reliable behavior of the cephcsi code base and to catch hard-to-test bugs before users do when unit and integration tests are insufficient.

The Test framework is designed to install Rook, run cephcsi tests, and uninstall Rook.

The e2e test are built on top of Ginkgo and Gomega

Install Kubernetes

The cephcsi also provides a script for starting Kubernetes using minikube so users can quickly spin up a Kubernetes cluster.

the following parameters are available to configure kubernetes cluster

flag description
up Starts a local kubernetes cluster and prepare a disk for rook
down Stops a running local kubernetes cluster
clean Deletes a local kubernetes cluster
ssh Log into or run a command on a minikube machine with SSH
deploy-rook Deploy rook to minikube
create-block-pool Creates a rook block pool (named $ROOK_BLOCK_POOL_NAME)
delete-block-pool Deletes a rook block pool (named $ROOK_BLOCK_POOL_NAME)
clean-rook Deletes a rook from minikube
cephcsi Copy built docker images to kubernetes cluster
k8s-sidecar Copy kubernetes sidecar docker images to kubernetes cluster

following environment variables can be exported to customize kubernetes deployment

ENV Description Default
MINIKUBE_VERSION minikube version to install latest
KUBE_VERSION kubernetes version to install latest
MEMORY Amount of RAM allocated to the minikube VM in MB 4096
VM_DRIVER VM driver to create virtual machine virtualbox
CEPHCSI_IMAGE_REPO Repo URL to pull cephcsi images quay.io/cephcsi
K8S_IMAGE_REPO Repo URL to pull kubernetes sidecar images registry.k8s.io/sig-storage
K8S_FEATURE_GATES Feature gates to enable on kubernetes cluster BlockVolume=true,CSIBlockVolume=true,VolumeSnapshotDataSource=true
ROOK_BLOCK_POOL_NAME Block pool name to create in the rook instance newrbdpool
  • creating kubernetes cluster

    From the ceph-csi root directory, run:

    ./scripts/minikube.sh up
    
  • Teardown kubernetes cluster

    ./scripts/minikube.sh clean
    

Deploy Rook

The cephcsi E2E tests expects that you already have rook running in your cluster.

Thanks to minikube script for the handy deploy-rook option.

./scripts/minikube.sh deploy-rook

Test parameters

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")
clusterid Use the Ceph cluster id in the StorageClasses and SnapshotClasses (default: ceph fsid detected)
nfs-driver Name of the driver to use for provisioning NFS-volumes (default: "nfs.csi.ceph.com")

E2E for snapshot

After the support for snapshot/clone has been added to ceph-csi, you need to follow these steps before running e2e.

  • Install snapshot controller and snapshot CRD

    ./scripts/install-snapshot.sh install
    

    Once you are done running e2e please perform the cleanup by running following:

    ./scripts/install-snapshot.sh cleanup
    

Running E2E

Note:- Prior to running the tests, you may need to copy the kubernetes configuration file to$HOME/.kube/configwhich is required to communicate with kubernetes cluster or you can passkubeconfigflag while running tests.

Functional tests are run by the go test command.

go test ./e2e/ -timeout=20m -v -mod=vendor

To run specific tests, you can specify options

go test ./e2e/ --test-cephfs=false --test-rbd=false --upgrade-testing=true

To run e2e for specific tests with make, use

make run-e2e E2E_ARGS="--test-cephfs=false --test-rbd=true --upgrade-testing=false"

You can also invoke functional tests with make command

make func-test TESTOPTIONS="-deploy-timeout=10 -timeout=30m -v"