Skip to content

Commit

Permalink
Merge branch 'develop' into agent-disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
narrieta authored May 24, 2023
2 parents 75b1cba + 841ee1d commit 988e402
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
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, install_test_agent: bool) -> 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
12 changes: 8 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,11 +132,14 @@ if check-version "$version"; then
printf "The agent was installed successfully\n"
exit_code=0
else
printf "ERROR: Failed 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 @@ -402,7 +402,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

0 comments on commit 988e402

Please sign in to comment.