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

test: Update journal check in TestHistoryMetrics.testEvents to current systemd #20317

Merged
merged 1 commit into from
Apr 16, 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
20 changes: 10 additions & 10 deletions test/verify/check-metrics
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,8 @@ class TestHistoryMetrics(testlib.MachineCase):
b.wait_in_text("#metrics-hour-1615197600000 div.metrics-minute[data-minute='39'] .metrics-events span.spikes_info", "Load")

# Now add the journal
# Journal was recorded on Fedora 33 and when trying to use it with older systemd it fails with:
# `Journal file /var/log/journal/*/journal.journal uses an unsupported feature, ignoring file.`

if self.machine.image == "centos-8-stream" or self.machine.image.startswith("rhel-8-"):
# Older systemds get a slightly wrong log window with --since/until, so only run on newer ones
if re.search(r"centos-9|rhel-9|debian-stable|ubuntu-2204|ubuntu-stable", self.machine.image):
return

m.upload(["verify/files/metrics-archives/journal.journal.gz"], "/tmp")
Expand All @@ -426,23 +424,25 @@ class TestHistoryMetrics(testlib.MachineCase):
b.reload()
b.enter_page("/metrics")

# details for load event at 10:39
b.wait_in_text(".metrics-heading", "CPU")
b.click("#metrics-hour-1615197600000 button.metrics-events-expander")
b.click("#metrics-hour-1615197600000 div.metrics-minute[data-minute='39'] .metrics-events button.spikes_info")
b.wait_visible(".cockpit-log-message:contains('Created slice cockpittest.slice.')")
b.wait_in_text(".cockpit-logline:first-child .cockpit-log-message", "cpu-piglet")
b.click(".cockpit-logline:first-child .cockpit-log-message")
b.wait_in_text(".cockpit-log-panel", "load-hog.service: Succeeded.")
b.wait_in_text(".cockpit-log-panel", "Stopping /usr/bin/sh -ec for i in `seq 500`")
b.click(".cockpit-logline:contains('Stopping /usr/bin/sh -ec for i in `seq 500`') .cockpit-log-message")
b.enter_page("/system/logs")
b.wait_in_text(".pf-v5-c-card__title", "cpu-piglet")
b.wait_in_text(".pf-v5-c-card__header", "load-hog.service")
b.wait_in_text(".pf-v5-c-card__title", "Stopping /usr/bin/sh -ec")
b.click("li:contains('Logs')")
b.wait_visible(".cockpit-log-message:contains('Created slice cockpittest.slice.')")
b.wait_visible(".cockpit-log-message:contains('Stopping /usr/bin/sh -ec')")

b.go("/metrics")
b.enter_page("/metrics")
# logs exist, should show tight range
b.click("button:contains('View detailed logs')")
b.enter_page("/system/logs")
b.wait_visible(".cockpit-log-message:contains('Created slice cockpittest.slice.')")
b.wait_visible(".cockpit-log-message:contains('load-hog.service: Succeeded.')")
url = b.eval_js('window.location.hash')
self.assertIn("priority=info", url)
self.assertIn("since=2021-3-8%2010%3A39%3A0", url)
Expand Down