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

Capture logcollector pattern only once #3194

Merged
merged 2 commits into from
Aug 27, 2024
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
8 changes: 4 additions & 4 deletions tests_e2e/tests/log_collector/log_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ def run(self):

# Get any agent logs between log collector start and finish
try:
output = ssh_client.run_command(
"sed -n " +
"'/INFO CollectLogsHandler ExtHandler Starting log collection/, /INFO CollectLogsHandler ExtHandler Successfully uploaded logs/p' " +
"/var/log/waagent.log").rstrip().splitlines()
# We match the first full log collector run in the agent log (this test just needs to validate any full log collector run, does not matter if it's the first or last)
lc_start_pattern = "INFO CollectLogsHandler ExtHandler Starting log collection"
lc_end_pattern = "INFO CollectLogsHandler ExtHandler Successfully uploaded logs"
output = ssh_client.run_command("sed -n '/{0}/,/{1}/{{p;/{1}/q}}' /var/log/waagent.log".format(lc_start_pattern, lc_end_pattern)).rstrip().splitlines()
except Exception as e:
raise Exception("Unable to get log collector logs from waagent.log: {0}".format(e))

Expand Down
Loading