Skip to content

Commit

Permalink
add external e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
boddumanohar committed Apr 24, 2021
1 parent 9811fe4 commit 145de26
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,21 @@ e2e-teardown:

.PHONY: e2e-test
e2e-test:
go test -v -timeout=0 ./test/e2e ${GINKGO_FLAGS}
go test -v -timeout=0 ./test/e2e ${GINKGO_FLAGS}

.PHONY: setup-external-e2e
setup-external-e2e:
curl -sL https://storage.googleapis.com/kubernetes-release/release/v1.19.0/kubernetes-test-linux-amd64.tar.gz --output e2e-tests.tar.gz
tar -xvf e2e-tests.tar.gz
rm e2e-tests.tar.gz
mkdir /tmp/csi-nfs
cp ./kubernetes/test/bin/e2e.test /tmp/csi-nfs/e2e.test
rm -r kubernetes
cp ./examples/kubernetes/storageclass-nfs.yaml /tmp/csi-nfs/storageclass.yaml
cp ./test/e2e-external/testdriver.yaml /tmp/csi-nfs/testdriver.yaml
./deploy/install-driver.sh
kubectl apply -f deploy/example/nfs-provisioner/nfs-server.yaml

.PHONY: run-external-e2e
run-external-e2e: setup-external-e2e
bash ./test/e2e-external/run.sh
19 changes: 19 additions & 0 deletions test/e2e-external/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@@
# Kubernetes tests

This directory imports tests from kubernetes/kubernetes and enables:

* External CSI tests, https://github.com/kubernetes/kubernetes/tree/master/test/e2e/storage/external

# Prerequisites
- kubernetes 1.17+

# Run
* External CSI tests: `FOCUS=External.Storage`.

```sh
ginkgo -p --progress --v -focus='External.Storage' \
-skip='\[Disruptive\]' /tmp/csi-nfs/e2e.test -- \
-storage.testdriver=/tmp/csi-nfs/testdriver.yaml \
--kubeconfig=$KUBECONFIG
```
19 changes: 19 additions & 0 deletions test/e2e-external/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2020 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/bash
ginkgo -p --progress --v -focus='External.Storage' \
-skip='\[Disruptive\]' /tmp/csi-nfs/e2e.test -- \
-storage.testdriver=/tmp/csi-nfs/testdriver.yaml \
--kubeconfig=$KUBECONFIG
13 changes: 13 additions & 0 deletions test/e2e-external/testdriver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Manifest for Kubernetes external tests.
# See https://github.com/kubernetes/kubernetes/tree/master/test/e2e/storage/external

ShortName: nfs
StorageClass:
FromFile: /tmp/csi-nfs/storageclass.yaml
DriverInfo:
Name: nfs.csi.k8s.io
Capabilities:
persistence: true
exec: true
multipods: true
RWX: true

0 comments on commit 145de26

Please sign in to comment.