ci: add script to run external-storage e2e tests

The run-k8s-external-storage-e2e.sh script downloads the kubernetes-test
components, creates a configuration for RBD and CephFS drivers and runs
the external-storage tests on the current cluster.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-08-26 16:39:59 +02:00 committed by mergify[bot]
parent 86375adf9e
commit 4b04e2b426

25
run-k8s-external-storage-e2e.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
#
# Download the Kubernetes test suite, extract it and run the external-storage suite.
#
# Requirements:
# - KUBE_VERSION needs to be set in the environment (format: "v1.18.5")
# exit on failure
set -e
[ -n "${KUBE_VERSION}" ] || { echo "KUBE_VERSION not set" ; exit 1 ; }
# download and extract the tests
curl -LO "https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/kubernetes-test-linux-amd64.tar.gz"
tar xzf kubernetes-test-linux-amd64.tar.gz kubernetes/test/bin/ginkgo kubernetes/test/bin/e2e.test
for driver in /opt/build/go/src/github.com/ceph/ceph-csi/scripts/k8s-storage/driver-*.yaml
do
kubernetes/test/bin/ginkgo \
-focus="External.Storage.*.csi.ceph.com" \
-skip='\[Feature:|\[Disruptive\]' \
kubernetes/test/bin/e2e.test \
-- \
-storage.testdriver="${driver}"
done