From deb563410a5e6816718ed2ac3aa4725fd74e4860 Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Wed, 16 Aug 2023 02:06:38 +0100 Subject: [PATCH] cheribsd: Add missing CHERI(-PURECAP)-CAPREVOKE-QEMU-MFS-ROOT kernels Otherwise cheribsd-mfs-root-kernel-riscv64-{hybrid,purecap} hit an assertion failure when --cheribsd/caprevoke-kernel is passed. --- pycheribuild/projects/cross/cheribsd.py | 2 ++ tests/test_argument_parsing.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/pycheribuild/projects/cross/cheribsd.py b/pycheribuild/projects/cross/cheribsd.py index 75ea69596..cdabf7a9a 100644 --- a/pycheribuild/projects/cross/cheribsd.py +++ b/pycheribuild/projects/cross/cheribsd.py @@ -234,6 +234,8 @@ def make_all(self) -> "list[CheriBSDConfig]": configs.append(self.make_config({ConfigPlatform.QEMU}, kernel_abi, caprevoke=True, default=True)) configs.append( self.make_config({ConfigPlatform.QEMU}, kernel_abi, caprevoke=True, benchmark=True, default=True)) + configs.append( + self.make_config({ConfigPlatform.QEMU}, kernel_abi, caprevoke=True, mfsroot=True, default=True)) configs.append( self.make_config({ConfigPlatform.QEMU}, kernel_abi, caprevoke=True, benchmark=True, mfsroot=True, default=True)) diff --git a/tests/test_argument_parsing.py b/tests/test_argument_parsing.py index e3f782250..285b86fa5 100644 --- a/tests/test_argument_parsing.py +++ b/tests/test_argument_parsing.py @@ -930,6 +930,14 @@ def test_kernel_configs(target, config_options: "list[str]", expected_kernels: " ["--cheribsd/build-bench-kernels", "--cheribsd/default-kernel-abi=hybrid"], ["GENERIC-MFS-ROOT"], ), + # Another regression test for assert len(configs) != 0, "No matching default kernel configuration"; we were + # missing CHERI(-PURECAP)-CAPREVOKE-QEMU-MFS-ROOT + pytest.param( + "cheribsd-mfs-root-kernel-riscv64-purecap", + ["--cheribsd/caprevoke-kernel"], + ["CHERI-CAPREVOKE-QEMU-MFS-ROOT", "CHERI-QEMU-MFS-ROOT", "CHERI-PURECAP-CAPREVOKE-QEMU-MFS-ROOT", + "CHERI-PURECAP-QEMU-MFS-ROOT"], + ), ], ) def test_mfsroot_kernel_configs(target: str, config_options: "list[str]", expected_kernels: "list[str]"):