The repo has created Make commands for all the tests. Please clone the repo and run the following commands from the root level of the repo.
make unit-test
make sanity-test
The E2E test for the Lustre CSI driver relies on the k8s external e2e test suites. You can run it locally within your own GCP project. Below is an example of running the E2E test against a self-deployed Lustre CSI Driver.
-
Configure your gcloud:
gcloud auth login gcloud config set <your-project> gcloud auth application-default login
-
Download kubetest2:
go install sigs.k8s.io/kubetest2@latest go install sigs.k8s.io/kubetest2/kubetest2-gke@latest go install sigs.k8s.io/kubetest2/kubetest2-tester-ginkgo@latest
-
Download the service account for Lustre (skip this step if you want to use a GKE managed Lustre CSI Driver).
export PROJECT=$(gcloud config get-value project 2>&1 | head -n 1) ./deploy/base/setup/gsa_setup.sh
-
Build the e2e test binary:
make test-k8s-integration
-
Run the e2e test:
test/run-k8s-integration-local.sh | tee log
You can control the test through the following parameters:
pkg-dir
: the absolute directory of the repo.do-network-setup
: default value istrue
. Set it tofalse
if you don't want to automatically setup and then cleanup a VPC network during the e2e test.bringup-cluster
: default value istrue
. Set it tofalse
if you want to use an existing GKE cluster.test-version
: version of k8s binary to download and use for the e2e test. Example values include 1.29, 1.30, etc.num-nodes
: default value is-1
. The number of nodes in the test GKE cluster. You have to set it to a positive integer.image-type
: default value iscos_containerd
. The node image type to use for the cluster.deploy-overlay-name
: default value isdev
. Set the kustomize overlay name for manual installation.do-driver-build
: default value isfalse
. Set it totrue
if you want to build the driver from source, install the driver and uninstall it after the test.use-gke-driver
: default value istrue
. Set it tofalse
if you wish to test your local code changes using a self-deployed CSI Driver.test-focus
: default value isExternal.Storage
. Test focus for k8s external e2e tests.parallel
: default value is1
. The number of parallel tests setting for ginkgo parallelism.gke-cluster-version
: GKE cluster version. This parameter only takes effect whenbringup-cluster
is set totrue
.gke-node-version
: GKE node version. This parameter only takes effect whenbringup-cluster
is set totrue
.gke-cluster-name
: GKE cluster name to be used in the test.gce-zone
: GKE cluster zone for zonal cluster.gce-region
: GKE cluster region for regional clusters.cluster-network
: default value islustre-network
. The VPC network name to be used in the test.