Skip to content

Commit

Permalink
Add test_k8s_e2e_capz.sh
Browse files Browse the repository at this point in the history
* test_k8s_e2e_capz.sh is for tests with capz
* It fits TOT capz, test-infra and kubernetes
* Add exec permission for test_k8s_e2e*.sh

Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
  • Loading branch information
lzhecheng committed Jan 28, 2022
1 parent dd8d6a6 commit e09df67
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ update: update-dependencies update-gofmt update-mocks ## Update go formats, mock
test-e2e: ## Run k8s e2e tests.
hack/test_k8s_e2e.sh $(TEST_E2E_ARGS)

test-e2e-capz: ## Run k8s e2e tests with capz
hack/test_k8s_e2e_capz.sh $(TEST_E2E_ARGS)

test-ccm-e2e: ## Run cloud provider e2e tests.
go test ./tests/e2e/ -timeout 0 -v -ginkgo.v $(CCM_E2E_ARGS)

Expand Down
Empty file modified hack/test_k8s_e2e.sh
100644 → 100755
Empty file.
52 changes: 52 additions & 0 deletions hack/test_k8s_e2e_capz.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

# Copyright 2022 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.

set -e

REPO_ROOT=$(realpath $(dirname ${BASH_SOURCE})/..)

# Check KUBECONFIG env var is set or not
# If not, then check if kubeconfig is under cloud-provider-azure repo's root
# If still not, then exist 1
if [ -z "$KUBECONFIG" ]; then
if [ -f "${REPO_ROOT}/kubernetes" ]; then
export KUBECONFIG="${REPO_ROOT}/kubeconfig"
else
echo "KUBECONFIG not set"
exit 1
fi
fi

K8S_ORG_PATH="$GOPATH/src/k8s.io/kubernetes"
mkdir -p "${K8S_ORG_PATH}"
if [ ! -d "${K8S_ORG_PATH}/kubernetes" ]; then
echo "Kubernetes repo not exists, clone one"
cd "${K8S_ORG_PATH}"
git clone https://github.com/kubernetes/kubernetes.git
fi

cd "${K8S_ORG_PATH}/kubernetes"
make WHAT='test/e2e/e2e.test'
make WHAT=cmd/kubectl
make ginkgo

export KUBERNETES_PROVIDER=azure
export KUBERNETES_CONFORMANCE_TEST=y
export KUBERNETES_CONFORMANCE_PROVIDER=azure
export CLOUD_CONFIG=$GOPATH/src/sigs.k8s.io/cloud-provider-azure/tests/k8s-azure/manifest/azure.json

# Set GINKGO_ARGS env var with your preferred ginkgo options like ginkgo.focus and ginkgo.skip.
./hack/ginkgo-e2e.sh ${GINKGO_ARGS}

0 comments on commit e09df67

Please sign in to comment.