From 78ce88e2656aedee8b38b36edcf1e074b90ff53a Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sun, 26 Jan 2025 20:06:36 +0000 Subject: [PATCH 1/3] test: install stub package for test-ukify unit test --- .github/workflows/unit_tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit_tests.sh b/.github/workflows/unit_tests.sh index 7275a72dc5..94ecdc6072 100755 --- a/.github/workflows/unit_tests.sh +++ b/.github/workflows/unit_tests.sh @@ -24,6 +24,7 @@ ADDITIONAL_DEPS=( python3-pyparsing python3-pytest rpm + systemd-boot-efi zstd ) From bcca98c6326b2766d6b769661b15e292c12cf8ac Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sun, 26 Jan 2025 19:50:22 +0000 Subject: [PATCH 2/3] test: use local stub if available in test-ukify It might not be available on a CI system in the system path, so use the local one if it was built --- src/ukify/test/test_ukify.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ukify/test/test_ukify.py b/src/ukify/test/test_ukify.py index 0f974b3558..24359129bb 100755 --- a/src/ukify/test/test_ukify.py +++ b/src/ukify/test/test_ukify.py @@ -59,6 +59,8 @@ except ValueError: slow_tests = True arg_tools = ['--tools', build_root] if build_root else [] +if build_root and pathlib.Path(f"{build_root}/linux{ukify.guess_efi_arch()}.efi.stub").exists(): + arg_tools += ['--stub', f"{build_root}/linux{ukify.guess_efi_arch()}.efi.stub"] def systemd_measure(): opts = ukify.create_parser().parse_args(arg_tools) @@ -657,7 +659,7 @@ def test_inspect(kernel_initrd, tmp_path, capsys): f'--os-release={osrel_arg}', f'--uname={uname_arg}', f'--output={output}', - ] + ] + arg_tools if slow_tests: args += [ f'--secureboot-certificate={cert.name}', From 25a253084a16dcc077592ff85d62f69fa940d1de Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sun, 26 Jan 2025 17:35:06 +0000 Subject: [PATCH 3/3] test: support slow test-ukify on Debian/Ubuntu Kernels are installed in /boot/ so find them there too --- src/ukify/test/test_ukify.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ukify/test/test_ukify.py b/src/ukify/test/test_ukify.py index 24359129bb..0de7e8904d 100755 --- a/src/ukify/test/test_ukify.py +++ b/src/ukify/test/test_ukify.py @@ -411,6 +411,8 @@ def test_help_error(capsys): @pytest.fixture(scope='session') def kernel_initrd(): items = sorted(glob.glob('/lib/modules/*/vmlinuz')) + if not items: + items = sorted(glob.glob('/boot/vmlinuz*')) if not items: return None