Skip to content

Commit 15614bf

Browse files
committed
Add conformance test script
1 parent 21180b5 commit 15614bf

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

hack/conformance_tests.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/sh
2+
# This script executes the Kubernetes conformance tests in accordance with:
3+
# https://github.com/cncf/k8s-conformance/blob/master/instructions.md
4+
#
5+
# Usage:
6+
# conformance_tests.sh <path to minikube> <flags>
7+
#
8+
# Example:
9+
# conformance_tests.sh ./out/minikube --vm-driver=hyperkit
10+
set -ex -o pipefail
11+
12+
readonly PROFILE_NAME="k8sconformance"
13+
readonly MINIKUBE=${1:-./out/minikube}
14+
shift || true
15+
readonly START_ARGS=$*
16+
17+
# Requires a fully running Kubernetes cluster.
18+
"${MINIKUBE}" delete -p "${PROFILE_NAME}" || true
19+
"${MINIKUBE}" start -p "${PROFILE_NAME}" $START_ARGS
20+
"${MINIKUBE}" status -p "${PROFILE_NAME}"
21+
kubectl get pods --all-namespaces
22+
23+
go get -u -v github.com/heptio/sonobuoy
24+
sonobuoy run --wait
25+
outdir="$(mktemp -d)"
26+
sonobuoy retrieve "${outdir}"
27+
28+
cwd=$(pwd)
29+
30+
cd "${outdir}"
31+
mkdir ./results; tar xzf *.tar.gz -C ./results
32+
33+
version=$(${MINIKUBE} version | cut -d" " -f3)
34+
35+
mkdir minikube-${version}
36+
cd minikube-${version}
37+
38+
cat <<EOF >PRODUCT.yaml
39+
vendor: minikube
40+
name: minikube
41+
version: ${version}
42+
website_url: https://github.com/kubernetes/minikube
43+
repo_url: https://github.com/kubernetes/minikube
44+
documentation_url: https://github.com/kubernetes/minikube/blob/master/docs/README.md
45+
product_logo_url: https://raw.githubusercontent.com/kubernetes/minikube/master/images/logo/logo.svg
46+
type: installer
47+
description: minikube runs a local Kubernetes cluster on macOS, Linux, and Windows.
48+
EOF
49+
50+
cat <<EOF >README.md
51+
./hack/conformance_tests.sh $MINIKUBE $START_ARGS
52+
EOF
53+
54+
cp ../results/plugins/e2e/results/* .
55+
cd ..
56+
cp -r minikube-${version} ${cwd}

0 commit comments

Comments
 (0)