[PATCH 3/5] test: py: efiloader: prepare get_dmesg for more general usage

Ahmad Fatoum a.fatoum at barebox.org
Fri Jan 9 08:57:29 PST 2026


Despite the generic sounding name, get_dmesg actually filter for the 'efit'
string, which is not always what's intended. Rename it to get_journalctl
to make the dependency clearer and make it more generic.

Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 test/py/test_linux_efiloader.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/test/py/test_linux_efiloader.py b/test/py/test_linux_efiloader.py
index 22531bff81f4..8530747a7a6b 100644
--- a/test/py/test_linux_efiloader.py
+++ b/test/py/test_linux_efiloader.py
@@ -4,8 +4,13 @@ import re
 import pytest
 
 
-def get_dmesg(shell):
-    stdout, _, ret = shell.run("journalctl -k --no-pager --grep efi -o cat")
+def get_journalctl(shell, kernel=True, grep=None):
+    opts = ''
+    if grep is not None:
+        opts += f" --grep={grep}"
+    if kernel:
+        opts += " -k"
+    stdout, _, ret = shell.run(f"journalctl --no-pager {opts} -o cat")
     assert ret == 0
     return stdout
 
@@ -19,7 +24,7 @@ def test_efi_kernel_no_warn(shell):
 
 @pytest.mark.lg_feature(['bootable', 'efi'])
 def test_expected_efi_messages(shell, env):
-    dmesg = get_dmesg(shell)
+    dmesg = get_journalctl(shell, 'efi')
 
     expected_patterns = [
         r"efi:\s+EFI v2\.8 by barebox",
-- 
2.47.3




More information about the barebox mailing list