From: Lennart Poettering Date: Wed, 26 Nov 2025 12:24:57 +0000 (+0100) Subject: ci: split out nvpcr test, so that it runs before rest of pcrextend (#39915) X-Git-Tag: v259-rc2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ceba02ad965a02e28f98d5ebf086eacf6d385b2;p=thirdparty%2Fsystemd.git ci: split out nvpcr test, so that it runs before rest of pcrextend (#39915) in pcrextend we destroy pcr 11, and if we are booted in a kernel that has pcr11 sigs, we cannot use that signature anymore. hence, let's do the nvpcr test first, before doing the pcrextend stuff. Fixes: #39582 --- diff --git a/test/units/TEST-70-TPM2.nvpcr.sh b/test/units/TEST-70-TPM2.nvpcr.sh new file mode 100755 index 00000000000..8827acc6ed5 --- /dev/null +++ b/test/units/TEST-70-TPM2.nvpcr.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -eux +set -o pipefail + +# shellcheck source=test/units/util.sh +. "$(dirname "$0")"/util.sh + +export SYSTEMD_LOG_LEVEL=debug +SD_PCREXTEND="/usr/lib/systemd/systemd-pcrextend" + +if [[ ! -x "${SD_PCREXTEND:?}" ]] || ! tpm_has_pcr sha256 11; then + echo "$SD_PCREXTEND or PCR sysfs files not found, skipping PCR extension tests" + exit 0 +fi + +at_exit() { + if [[ $? -ne 0 ]]; then + # Dump the event log on fail, to make debugging a bit easier + jq --seq --slurp /run/nvpcr/test.nvpcr </run/nvpcr/test.nvpcr <