Skip to content

eBPF-based security platform

testing: refuse to build a VM bundle without libtpms

John Fastabendbe4dc79fc558
diff --git a/Documentation/contribute/testing/testing.rst b/Documentation/contribute/testing/testing.rst
index c9126427..13bd832a 100644
--- a/Documentation/contribute/testing/testing.rst
+++ b/Documentation/contribute/testing/testing.rst
@@ -35,7 +35,10 @@ Before you begin
``dracut-core``, ``file``, ``isc-dhcp-client``, ``libguestfs-tools``,
``qemu-system-x86``, ``qemu-utils``, ``swtpm``, ``swtpm-tools`` and
``tpm2-tools`` among others. :src:`testing/vm/run.sh` names the packages
- it misses with an install command for ``apt-get`` or ``dnf``.
+ it misses with an install command for ``apt-get`` or ``dnf``. The
+ bundle carries the TPM simulator helper, so
+ :src:`testing/vm/build-bundle.sh` builds no bundle without
+ ``libtpms-dev``.
- For the end-to-end tests: Docker on the host.
The ``CI suite`` workflow uses the x86-64 CI kernel package from
diff --git a/testing/vm/build-bundle.sh b/testing/vm/build-bundle.sh
index 78c902b6..9e1bf2ce 100755
--- a/testing/vm/build-bundle.sh
+++ b/testing/vm/build-bundle.sh
@@ -318,6 +318,11 @@ if bundle_is_current; then
exit 0
fi
+# Without libtpms the make rule skips tpmsim-cmd, which the bundle carries.
+require_command pkg-config pkg-config pkgconf-pkg-config
+pkg-config --exists libtpms ||
+ die "libtpms is required for testing/helper/tpmsim-cmd; install it with: $(test_vm_install_cmd "$(test_vm_pkg libtpms-dev libtpms-devel)")"
+
jobs=$(nproc)
log "building host shirudo payload and test helpers"
make -C "$REPO_ROOT" -j"$jobs" all