This repository contains the Kubernetes E2E test framework set up in
such a way that it runs the Kubernetes volume tests for the
example hostpath driver.
No cloud-specific code gets imported, so tests can only be run against
a cluster that has already been set up. Set the the usual
KUBECONFIG=<config file> and then run go test -v ./test/e2e or
ginkgo ./test/e2e.
Adding -provider=local suppresses a message about the flag not being
set and treating the run as "conformance test", but has no other
effect in practice.
The
upstream documentation
uses hack/e2e.go as wrapper around the test execution. This is not
necessary for the test suite defined in this repository.
New tests can be written in their own packages under test/e2e and
then need to be added to the import list in test/e2e_test.go.
- Launch a local kube cluster:
ALLOW_PRIVILEGED=1 hack/local-up-cluster.sh
In a seperate shell:
- Set KubeConfig environment variable:
export KUBECONFIG=<config file> - A JSON config file like this is required for the tests to run.
- Create an environment variable named
DRIVER_MANIFESTthat has the path to your JSON config file (export DRIVER_MANIFEST=driver_manifest.jsonto run e2e tests on hostpath CSI driver) - Run tests:
go test -v ./test/e2e(might need to turn GOCACHE off sometimesGOCACHE=off go test -v ./test/e2e)