|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Copyright 2021 The Kubernetes Authors. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +set -xe |
| 18 | + |
| 19 | +PROJECT_ROOT=$(git rev-parse --show-toplevel) |
| 20 | + |
| 21 | +install_ginkgo () { |
| 22 | + apt update -y |
| 23 | + apt install -y golang-ginkgo-dev |
| 24 | +} |
| 25 | + |
| 26 | +setup_e2e_binaries() { |
| 27 | + # download k8s external e2e binary for kubernetes v1.19 |
| 28 | + curl -sL https://storage.googleapis.com/kubernetes-release/release/v1.19.0/kubernetes-test-linux-amd64.tar.gz --output e2e-tests.tar.gz |
| 29 | + tar -xvf e2e-tests.tar.gz && rm e2e-tests.tar.gz |
| 30 | + |
| 31 | + # install the csi driver smb |
| 32 | + mkdir -p /tmp/csi-smb && cp deploy/example/storageclass-smb.yaml /tmp/csi-smb/storageclass.yaml |
| 33 | + make e2e-bootstrap |
| 34 | + make install-smb-provisioner |
| 35 | + make create-metrics-svc |
| 36 | +} |
| 37 | + |
| 38 | +print_logs() { |
| 39 | + echo "print out driver logs ..." |
| 40 | + bash ./test/utils/smb_log.sh |
| 41 | +} |
| 42 | + |
| 43 | +install_ginkgo |
| 44 | +setup_e2e_binaries |
| 45 | +trap print_logs EXIT |
| 46 | + |
| 47 | +ginkgo -p --progress --v -focus='External.Storage' \ |
| 48 | + -skip='\[Disruptive\]|\[Slow\]' kubernetes/test/bin/e2e.test -- \ |
| 49 | + -storage.testdriver=$PROJECT_ROOT/test/external-e2e/testdriver.yaml \ |
| 50 | + --kubeconfig=$KUBECONFIG |
0 commit comments