From 23be951a6d1611836526d9f5a1ac7063bc23f3d2 Mon Sep 17 00:00:00 2001 From: Nageswara Nandigam <84482346+nagworld9@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:06:20 -0800 Subject: [PATCH] fix for installing agent in e2e tests (#3271) * install agent after stop * verbose on rm --- tests_e2e/orchestrator/scripts/install-agent | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests_e2e/orchestrator/scripts/install-agent b/tests_e2e/orchestrator/scripts/install-agent index cf5a9e810..1cbcd5a70 100755 --- a/tests_e2e/orchestrator/scripts/install-agent +++ b/tests_e2e/orchestrator/scripts/install-agent @@ -101,12 +101,6 @@ if [ $started == false ]; then exit 1 fi -# -# Install the package -# -echo "========== Installing Agent ==========" -echo "Installing $package as version $version..." -unzip.py "$package" "/var/lib/waagent/WALinuxAgent-$version" python=$(get-agent-python) # Ensure that AutoUpdate is enabled. some distros, e.g. Flatcar have a waagent.conf in different path @@ -162,14 +156,21 @@ if [[ $(uname -a) == *"flatcar"* ]]; then fi # -# Restart the service +# Install the package # -echo "Restarting service..." +echo "========== Installing Agent ==========" + agent-service stop # Rename the previous log to ensure the new log starts with the agent we just installed mv /var/log/waagent.log /var/log/waagent."$(date --iso-8601=seconds)".log +echo "Cleaning up the existing agents" +rm -rfv /var/lib/waagent/WALinuxAgent-* + +echo "Installing $package as version $version..." +unzip.py "$package" "/var/lib/waagent/WALinuxAgent-$version" + agent-service start #