From c125edc1bbc93f77fdab0736ccdbc7bb7e662b5a Mon Sep 17 00:00:00 2001 From: Nageswara Nandigam <84482346+nagworld9@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:07:30 -0700 Subject: [PATCH] wait for provision to complete before install test agent (#3094) * wait for provision to complete * address comments --- tests_e2e/orchestrator/scripts/install-agent | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests_e2e/orchestrator/scripts/install-agent b/tests_e2e/orchestrator/scripts/install-agent index d28164f6d3..240be052ad 100755 --- a/tests_e2e/orchestrator/scripts/install-agent +++ b/tests_e2e/orchestrator/scripts/install-agent @@ -85,19 +85,19 @@ echo "Agent Version:" $python "$waagent" --version echo "Service Status:" -# Sometimes the service can take a while to start; give it a few minutes, +# We need to wait for the provisioning code to complete before stopping the agent's service to do the test setup started=false for i in {1..6} do - if service-status $service_name; then + if [[ -f /var/lib/waagent/provisioned ]]; then started=true break fi - echo "Waiting for service to start..." + echo "Waiting for agent to complete provisioning." sleep 30 done if [ $started == false ]; then - echo "Service failed to start." + echo "Provisioning did not complete within the given timeout (cannot find /var/lib/waagent/provisioned)" exit 1 fi