From 2abfec05c9e7aaed9cf52999638d905c11071571 Mon Sep 17 00:00:00 2001 From: Forrest Thomas Date: Tue, 1 Sep 2020 15:53:09 -0700 Subject: [PATCH] add e2e contour tests for inconsistent naming between service name and selector --- test/e2e-contour-tests.sh | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/test/e2e-contour-tests.sh b/test/e2e-contour-tests.sh index 8c03498f..4b06f534 100755 --- a/test/e2e-contour-tests.sh +++ b/test/e2e-contour-tests.sh @@ -85,6 +85,59 @@ spec: logCmdOutput: "true" EOF +cat <>> Waiting for primary to be ready' retries=50 count=0 @@ -104,6 +157,19 @@ kubectl -n test get httpproxy podinfo -oyaml | grep 'projectcontour.io/ingress.c echo '✔ Canary initialization test passed' +passed=$(kubectl -n test get svc/podinfo -o jsonpath='{.spec.selector.app}' 2>&1 | { grep podinfo-primary || true; }) +if [ -z "$passed" ]; then + echo -e '\u2716 podinfo selector test failed' + exit 1 +fi +passed=$(kubectl -n test get svc/podinfo-service-canary -o jsonpath='{.spec.selector.app}' 2>&1 | { grep podinfo || true; }) +if [ -z "$passed" ]; then + echo -e '\u2716 podinfo-service selector test failed' + exit 1 +fi + +echo '✔ Canary service custom metadata test passed' + echo '>>> Triggering canary deployment' kubectl -n test set image deployment/podinfo podinfod=stefanprodan/podinfo:3.1.1