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 <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2022-01-15 11:57:55 -08:00 committed by James Valleroy
parent ec3236d89c
commit 2e2a9db195
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 5 additions and 3 deletions

View File

@ -28,7 +28,7 @@
</p>
<p>
<pre>{{ data }}</pre>
<pre class="status-log">{{ data }}</pre>
</p>
{% endblock %}

View File

@ -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())