From 3d62b3f45ef7210e451fc6bea1adb0dc2278113f Mon Sep 17 00:00:00 2001 From: Nick Santos Date: Fri, 4 Dec 2020 01:22:47 -0500 Subject: [PATCH] test: add e2e tests for setting kubernetes version (#68) --- test/kind-cluster-network/cluster.yaml | 2 +- test/kind-cluster-network/e2e.sh | 10 ++++++++++ test/minikube-cluster-network/cluster.yaml | 3 +-- test/minikube-cluster-network/e2e.sh | 9 +++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/test/kind-cluster-network/cluster.yaml b/test/kind-cluster-network/cluster.yaml index 9bccde1..e04d491 100644 --- a/test/kind-cluster-network/cluster.yaml +++ b/test/kind-cluster-network/cluster.yaml @@ -3,4 +3,4 @@ kind: Cluster name: kind-ctlptl-test-cluster product: kind registry: ctlptl-test-registry -kubernetesVersion: v1.19.3 +kubernetesVersion: v1.18.8 diff --git a/test/kind-cluster-network/e2e.sh b/test/kind-cluster-network/e2e.sh index 6fad113..115ba72 100755 --- a/test/kind-cluster-network/e2e.sh +++ b/test/kind-cluster-network/e2e.sh @@ -19,5 +19,15 @@ cat builder.yaml | sed "s/REGISTRY_HOST_PLACEHOLDER/$HOST/" | kubectl apply -f - kubectl wait --for=condition=complete job/ko-builder --timeout=180s cat simple-server.yaml | sed "s/REGISTRY_HOST_PLACEHOLDER/$HOST/" | kubectl apply -f - kubectl wait --for=condition=available deployment/simple-server --timeout=60s + +# Check to see we started the right kubernetes version. +k8sVersion=$(ctlptl get cluster kind-ctlptl-test-cluster -o go-template --template='{{.status.kubernetesVersion}}') + ctlptl delete -f cluster.yaml + +if [[ "$k8sVersion" != "v1.18.8" ]]; then + echo "Expected kubernetes version v1.18.8 but got $k8sVersion" + exit 1 +fi + echo "kind-cluster-network test passed!" diff --git a/test/minikube-cluster-network/cluster.yaml b/test/minikube-cluster-network/cluster.yaml index ee3bc86..e7f73b0 100644 --- a/test/minikube-cluster-network/cluster.yaml +++ b/test/minikube-cluster-network/cluster.yaml @@ -3,5 +3,4 @@ kind: Cluster name: minikube-ctlptl-test-cluster product: minikube registry: ctlptl-test-registry -kubernetesVersion: v1.19.3 - +kubernetesVersion: v1.18.8 diff --git a/test/minikube-cluster-network/e2e.sh b/test/minikube-cluster-network/e2e.sh index 280b4d7..e4324eb 100755 --- a/test/minikube-cluster-network/e2e.sh +++ b/test/minikube-cluster-network/e2e.sh @@ -19,6 +19,15 @@ cat builder.yaml | sed "s/REGISTRY_HOST_PLACEHOLDER/$HOST/g" | kubectl apply -f kubectl wait --for=condition=complete job/ko-builder --timeout=180s cat simple-server.yaml | sed "s/REGISTRY_HOST_PLACEHOLDER/$HOST/g" | kubectl apply -f - kubectl wait --for=condition=available deployment/simple-server --timeout=60s + +# Check to see we started the right kubernetes version. +k8sVersion=$(ctlptl get cluster minikube-ctlptl-test-cluster -o go-template --template='{{.status.kubernetesVersion}}') + ctlptl delete -f cluster.yaml +if [[ "$k8sVersion" != "v1.18.8" ]]; then + echo "Expected kubernetes version v1.18.8 but got $k8sVersion" + exit 1 +fi + echo "minikube-cluster-network test passed!"