Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for log message in AgentNotProvisioned test #2861

Merged
merged 2 commits into from
Jun 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions tests_e2e/tests/agent_not_provisioned/agent_not_provisioned.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,19 @@ def run(self):
log.info("Checking the Agent's log to verify that it is disabled.")
try:
output = ssh_client.run_command("""
grep -E 'WARNING.*Daemon.*Disabling guest agent in accordance with ovf-env.xml' /var/log/waagent.log || \
grep -E 'WARNING.*Daemon.*Disabling the guest agent by sleeping forever; to re-enable, remove /var/lib/waagent/disable_agent and restart' /var/log/waagent.log
# We need to wait for the agent to start and hit the disable code, give it a few minutes
n=18
for i in $(seq $n); do
grep -E 'WARNING.*Daemon.*Disabling guest agent in accordance with ovf-env.xml' /var/log/waagent.log || \
grep -E 'WARNING.*Daemon.*Disabling the guest agent by sleeping forever; to re-enable, remove /var/lib/waagent/disable_agent and restart' /var/log/waagent.log
if [[ $? == 0 ]]; then
exit 0
fi
echo "Did not find the expected message in the agent's log, retrying after sleeping for a few seconds (attempt $i/$n)..."
sleep 10
done
echo "Did not find the expected message in the agent's log, giving up."
exit 1
""")
log.info("The Agent is disabled, log message: [%s]", output.rstrip())
except CommandError as e:
Expand Down