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

Fixes for end-to-end tests #2827

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion tests_e2e/orchestrator/lib/agent_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def _setup_node(self) -> None:
#
log.info('Installing tools on the test node')
command = f"tar xf {target_path/tarball_path.name} && ~/bin/install-tools"
log.info("%s\n%s", command, self.context.ssh_client.run_command(command))
log.info("Remote command [%s] completed:\n%s", command, self.context.ssh_client.run_command(command))

if self.context.is_vhd:
log.info("Using a VHD; will not install the Test Agent.")
Expand Down
13 changes: 9 additions & 4 deletions tests_e2e/orchestrator/scripts/install-agent
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,18 @@ fi
python=$(get-agent-python)
waagent=$(get-agent-bin-path)

echo "============================================================"
echo "========== Initial Status =========="
echo "Service Name: $service_name"
echo "Agent Path: $waagent"
echo "Agent Version:"
$python "$waagent" --version
echo "Service Status:"
service-status $service_name
echo "============================================================"

#
# Install the package
#
echo "========== Installing Agent =========="
echo "Installing $package as version $version..."
unzip.py "$package" "/var/lib/waagent/WALinuxAgent-$version"

Expand Down Expand Up @@ -116,7 +116,8 @@ service-start $service_name
echo "Verifying agent installation..."

check-version() {
for i in {0..5}
# We need to wait for the extension handler to start, give it a couple of minutes
for i in {1..12}
do
if $python "$waagent" --version | grep -E "Goal state agent:\s+$version" > /dev/null; then
return 0
Expand All @@ -131,10 +132,14 @@ if check-version "$version"; then
printf "\nThe agent was installed successfully\n"
exit_code=0
else
printf "\nFailed to install agent.\n"
printf "************************************\n"
printf " * ERROR: Failed to install agent. *\n"
printf "************************************\n"
exit_code=1
fi

printf "\n"
echo "========== Final Status =========="
$python "$waagent" --version
printf "\n"
service-status $service_name
Expand Down
2 changes: 1 addition & 1 deletion tests_e2e/tests/lib/agent_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def matches_ignore_rule(record: AgentLogRecord, ignore_rules: List[Dict[str, Any
# Extension: 2021/03/30 19:45:31 Azure Monitoring Agent for Linux started to handle.
# 2021/03/30 19:45:31 [Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-1.7.0] cwd is /var/lib/waagent/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-1.7.0
#
_NEWER_AGENT_RECORD = re.compile(r'(?P<when>[\d-]+T[\d:.]+Z)\s(?P<level>VERBOSE|INFO|WARNING|ERROR)\s(?P<thread>\S+)\s(?P<prefix>(Daemon)|(ExtHandler)|(\[\S+\]))\s(?P<message>.*)')
_NEWER_AGENT_RECORD = re.compile(r'(?P<when>[\d-]+T[\d:.]+Z)\s(?P<level>VERBOSE|INFO|WARNING|ERROR)\s(?P<thread>\S+)\s(?P<prefix>(Daemon)|(ExtHandler)|(LogCollector)|(\[\S+\]))\s(?P<message>.*)')
_2_2_46_AGENT_RECORD = re.compile(r'(?P<when>[\d-]+T[\d:.]+Z)\s(?P<level>VERBOSE|INFO|WARNING|ERROR)\s(?P<thread>)(?P<prefix>Daemon|ExtHandler|\[\S+\])\s(?P<message>.*)')
_OLDER_AGENT_RECORD = re.compile(r'(?P<when>[\d/]+\s[\d:.]+)\s(?P<level>VERBOSE|INFO|WARNING|ERROR)\s(?P<thread>)(?P<prefix>\S*)\s(?P<message>.*)')
_EXTENSION_RECORD = re.compile(r'(?P<when>[\d/]+\s[\d:.]+)\s(?P<level>)(?P<thread>)((?P<prefix>\[[^\]]+\])\s)?(?P<message>.*)')
Expand Down