diff --git a/tests_e2e/orchestrator/scripts/install-agent b/tests_e2e/orchestrator/scripts/install-agent index 00200f3a11..7c80f6caf6 100755 --- a/tests_e2e/orchestrator/scripts/install-agent +++ b/tests_e2e/orchestrator/scripts/install-agent @@ -116,6 +116,20 @@ sed -i 's/AutoUpdate.Enabled=n/AutoUpdate.Enabled=y/g' "$waagent_conf_path" # By default GAUpdates flag set to True, so that agent go through update logic to look for new agents. # But in e2e tests this flag needs to be off in test version 9.9.9.9 to stop the agent updates, so that our scenarios run on 9.9.9.9. sed -i '$a Debug.DownloadNewAgents=n' "$waagent_conf_path" +# Logging and exiting tests if Extensions.Enabled flag is disabled for other distros than debian +if grep -q "Extensions.Enabled=n" $waagent_conf_path; then + pypy_get_distro=$(pypy3 -c 'from azurelinuxagent.common.version import get_distro; print(get_distro())') + python_get_distro=$($python -c 'from azurelinuxagent.common.version import get_distro; print(get_distro())') + # As we know debian distros disable extensions by default, so we need to enable them to verify agent extension scenarios + # If rest of the distros disable extensions, then we exit the test setup to fail the test. + if [[ $pypy_get_distro == *"debian"* ]] || [[ $python_get_distro == *"debian"* ]]; then + echo "Extensions.Enabled flag is disabled and this is expected in debian distro, so enabling it" + update-waagent-conf Extensions.Enabled=y + else + echo "Extensions.Enabled flag is disabled which is unexpected in this distro, so exiting test setup to fail the test" + exit 1 + fi +fi # # Restart the service