From ff8801d12b26f0990eba0b466a6ec1bb3d19c7b3 Mon Sep 17 00:00:00 2001 From: Philip Ottesen Date: Mon, 18 Apr 2022 17:08:06 -0400 Subject: [PATCH] tests: adding integration test for rollout status --- test/cmd/generic-resources.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/cmd/generic-resources.sh b/test/cmd/generic-resources.sh index b983118d463..2461eba7711 100755 --- a/test/cmd/generic-resources.sh +++ b/test/cmd/generic-resources.sh @@ -383,6 +383,17 @@ run_recursive_resources_tests() { # Post-condition: nginx0 & nginx1 should both have paused set to nothing, and since nginx2 is malformed, it should error kube::test::get_object_assert deployment "{{range.items}}{{.spec.paused}}:{{end}}" "::" kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + ## Fetch rollout status for multiple resources + output_message=$(! kubectl rollout status -f hack/testdata/recursive/deployment/deployment --timeout=1s 2>&1 "${kube_flags[@]:?}") + # Post-condition: nginx1 should both exist and nginx2 should error + kube::test::if_has_string "${output_message}" "Waiting for deployment \"nginx1-deployment\" rollout to finish" + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + ## Fetch rollout status for deployments recursively + output_message=$(! kubectl rollout status -f hack/testdata/recursive/deployment -R --timeout=1s 2>&1 "${kube_flags[@]:?}") + # Post-condition: nginx0 & nginx1 should both exist, nginx2 should error + kube::test::if_has_string "${output_message}" "Waiting for deployment \"nginx0-deployment\" rollout to finish" + kube::test::if_has_string "${output_message}" "Waiting for deployment \"nginx1-deployment\" rollout to finish" + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" ## Retrieve the rollout history of the deployments recursively output_message=$(! kubectl rollout history -f hack/testdata/recursive/deployment --recursive 2>&1 "${kube_flags[@]}") # Post-condition: nginx0 & nginx1 should both have a history, and since nginx2 is malformed, it should error