From 9ed2719d1909f99ca530f864addc94bf07c6e9e1 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Sun, 30 Jun 2019 10:36:37 +0300 Subject: [PATCH] Add canary rollback test to Linkerd e2e --- test/e2e-linkerd-tests.sh | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/test/e2e-linkerd-tests.sh b/test/e2e-linkerd-tests.sh index 400903a5..f5e623cb 100755 --- a/test/e2e-linkerd-tests.sh +++ b/test/e2e-linkerd-tests.sh @@ -91,3 +91,59 @@ until ${ok}; do done echo '✔ Canary promotion test passed' + +cat <>> Triggering canary deployment' +kubectl -n test set image deployment/podinfo podinfod=quay.io/stefanprodan/podinfo:1.4.2 + +echo '>>> Waiting for canary rollback' +retries=50 +count=0 +ok=false +until ${ok}; do + kubectl -n test get canary/podinfo | grep 'Failed' && ok=true || ok=false + sleep 10 + kubectl -n linkerd logs deployment/flagger --tail 1 + count=$(($count + 1)) + if [[ ${count} -eq ${retries} ]]; then + kubectl -n linkerd logs deployment/flagger + echo "No more retries left" + exit 1 + fi +done + +echo '✔ Canary rollback test passed' \ No newline at end of file