From 1b282801d6a7a0e9104984895911b828da402623 Mon Sep 17 00:00:00 2001 From: Ritu Sood Date: Thu, 1 Aug 2019 12:29:41 +0200 Subject: Add test case for loading vFW Helm chart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test checks vFW lifecycle using the k8splugin. Issue-ID: MULTICLOUD-708 Change-Id: I46d47e64562d75d8b1f7552fc073b1e59efa443e Signed-off-by: Ritu Sood Co-authored-by: Konrad Bańka --- kud/tests/_functions.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'kud/tests/_functions.sh') diff --git a/kud/tests/_functions.sh b/kud/tests/_functions.sh index 86636ccd..d585086b 100755 --- a/kud/tests/_functions.sh +++ b/kud/tests/_functions.sh @@ -173,6 +173,26 @@ function wait_deployment { done } +# wait_for_pod() - Wait until first pod matched by kubectl filters is in running status +function wait_for_pod { + #Example usage: + # wait_for_pods example_pod + # wait_for_pods --namespace test different_pod + # wait_for_pods -n test -l app=plugin_test + + status_phase="" + while [[ "$status_phase" != "Running" ]]; do + new_phase="$(kubectl get pods -o 'go-template={{ index .items 0 "status" "phase" }}' "$@" )" + if [[ "$new_phase" != "$status_phase" ]]; then + echo "$(date +%H:%M:%S) - Filter=[$*] : $new_phase" + status_phase="$new_phase" + fi + if [[ "$new_phase" == "Err"* ]]; then + exit 1 + fi + done +} + # setup() - Base testing setup shared among functional tests function setup { if ! $(kubectl version &>/dev/null); then -- cgit 1.2.3-korg