From 2e2a9db195eac575602e1e273bd13e3014d24856 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 15 Jan 2022 11:57:55 -0800 Subject: [PATCH] help: tests: Fix functional test to check for status logs Fixes: #2171. Since systemd version 250, journalctl does not print the header line '-- Journal begins... --'. To accommodate those changes, read the status log lines accurately and check that they are not empty. Tests: - Run help functional tests on stable, testing and unstable. - Modify code to not print status logs and notice that the functional test fails. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/help/templates/statuslog.html | 2 +- plinth/modules/help/tests/test_functional.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plinth/modules/help/templates/statuslog.html b/plinth/modules/help/templates/statuslog.html index 895aec912..f82473ee2 100644 --- a/plinth/modules/help/templates/statuslog.html +++ b/plinth/modules/help/templates/statuslog.html @@ -28,7 +28,7 @@

-

{{ data }}
+
{{ data }}

{% endblock %} diff --git a/plinth/modules/help/tests/test_functional.py b/plinth/modules/help/tests/test_functional.py index 636aafb74..3658648de 100644 --- a/plinth/modules/help/tests/test_functional.py +++ b/plinth/modules/help/tests/test_functional.py @@ -4,6 +4,7 @@ Functional, browser based tests for help app. """ import pytest + from plinth.tests import functional pytestmark = [pytest.mark.system, pytest.mark.essential, pytest.mark.help] @@ -32,5 +33,6 @@ def _go_to_status_logs(browser): def _are_status_logs_shown(browser): - return (browser.is_text_present('Logs begin') - or browser.is_text_present('Journal begins')) + status_log = browser.find_by_css('.status-log').first.text + return ('-- No entries --' in status_log + or status_log.strip().splitlines())