eBPF-based security platform
testing: group signing tests
John Fastabend103ac38fa07f
diff --git a/contrib/test-vm.sh b/contrib/test-vm.shindex 060910d5..e1f37ebc 100755--- a/contrib/test-vm.sh+++ b/contrib/test-vm.sh@@ -1473,7 +1473,7 @@ log "booting $(basename "$KERNEL") with ${CPUS} CPUs and ${MEMORY} memory"# The bpf keyring is left open for init to enrol the certificate and# seal it, as a production initrd does.KERNEL_LSM_ARGS="lsm=bpf bpf.keyring_unsealed=1"-KERNEL_LSM_ARGS+=" dm_verity.keyring_unsealed=1"+KERNEL_LSM_ARGS+=" dm_verity.keyring_unsealed=1 initcall_debug ignore_loglevel"KERNEL_NET_DEVICE="virtio-net-pci,netdev=net0"# The virt machine has no if=virtio mapping, so its disks are explicit PCIdiff --git a/testing/Makefile b/testing/Makefileindex 7346f57d..96bfb92b 100644--- a/testing/Makefile+++ b/testing/Makefile@@ -126,6 +126,7 @@ TEST_VM_BUNDLE_SOURCES := $(sort $(wildcard \$(ROOT)/systemd/*.timer $(ROOT)/testing/fixtures/*.c $(ROOT)/testing/fixtures/*.lua \$(ROOT)/testing/fixtures/*.conf $(ROOT)/testing/fixtures/*.sh \$(ROOT)/testing/fixtures/decoders/* \+ $(ROOT)/testing/signing/*.sh \$(ROOT)/upatches/kernel-obs/*.c $(ROOT)/upatches/kernel-obs/*.h $(ROOT)/upatches/kernel-obs/*.list \$(ROOT)/upatches/kernel-obs/*.py $(ROOT)/upatches/kernel-obs/Beefile \$(ROOT)/upatches/kernel-obs/decoders/*))diff --git a/testing/run-target-tests.sh b/testing/run-target-tests.shindex f8ff0345..b0e405bc 100755--- a/testing/run-target-tests.sh+++ b/testing/run-target-tests.sh@@ -40,6 +40,9 @@ for t in \tamperproof/t1138-mode-objects.sh \t1200-target-fixtures.sh \t1122-initrd.sh \+ signing/t1123-keys.sh \+ signing/t1124-keys-add.sh \+ signing/t1126-keys-revoke.sh \tamperproof/t1105-siggate.sh \t1133-upatch-arena-serializer.sh \t1103-version-gate.sh \diff --git a/testing/run-tests.sh b/testing/run-tests.shindex 75fe7968..2770e7d5 100755--- a/testing/run-tests.sh+++ b/testing/run-tests.sh@@ -28,6 +28,19 @@ for t in t0[0-9][0-9][0-9]-*.sh; dofidone+for t in signing/t0[0-9][0-9][0-9]-*.sh; do+ [ -e "$t" ] || continue+ found=1+ if sh "$t"; then+ :+ else+ fail=$((fail + 1))+ if [ -n "$SHIRUDO_TEST_SUITE_FAILURES_FILE" ]; then+ printf '%s\n' "$t" >>"$SHIRUDO_TEST_SUITE_FAILURES_FILE" 2>/dev/null || :+ fi+ fi+done+for t in otel/t0[0-9][0-9][0-9]-*.sh; do[ -e "$t" ] || continuefound=1diff --git a/testing/t0037-keys-set.sh b/testing/signing/t0037-keys-set.shsimilarity index 99%rename from testing/t0037-keys-set.shrename to testing/signing/t0037-keys-set.shindex 2185986d..910e706b 100755--- a/testing/t0037-keys-set.sh+++ b/testing/signing/t0037-keys-set.sh@@ -7,7 +7,7 @@# digest the init event covers, which attest predict must compute the# same way from the same certificates in any order.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./test-lib.shH=helper/test-keysSHB=../tools/shirudo-build/shirudo-builddiff --git a/testing/t0038-keys-vouch.sh b/testing/signing/t0038-keys-vouch.shsimilarity index 99%rename from testing/t0038-keys-vouch.shrename to testing/signing/t0038-keys-vouch.shindex 822f5e67..dff32522 100755--- a/testing/t0038-keys-vouch.sh+++ b/testing/signing/t0038-keys-vouch.sh@@ -7,7 +7,7 @@# verifies under a member of the set, and the loader admits nothing# dropped in without one.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./test-lib.shS=../shirudoSHB=../tools/shirudo-build/shirudo-builddiff --git a/testing/t0039-keys-signer.sh b/testing/signing/t0039-keys-signer.shsimilarity index 98%rename from testing/t0039-keys-signer.shrename to testing/signing/t0039-keys-signer.shindex 0a988fa0..2c294008 100755--- a/testing/t0039-keys-signer.sh+++ b/testing/signing/t0039-keys-signer.sh@@ -7,7 +7,7 @@# no other, and a revoke event predicts the same digest the target# measures.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./test-lib.shS=../shirudoSHB=../tools/shirudo-build/shirudo-builddiff --git a/testing/t1123-keys.sh b/testing/signing/t1123-keys.shsimilarity index 98%rename from testing/t1123-keys.shrename to testing/signing/t1123-keys.shindex 4e845cf0..bc4f80ce 100755--- a/testing/t1123-keys.sh+++ b/testing/signing/t1123-keys.sh@@ -7,7 +7,7 @@# init, so the bpf keyring holds two keys and a upatch signed by either# loads.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guarddiff --git a/testing/t1124-keys-add.sh b/testing/signing/t1124-keys-add.shsimilarity index 98%rename from testing/t1124-keys-add.shrename to testing/signing/t1124-keys-add.shindex ace8a121..3c1d60cb 100755--- a/testing/t1124-keys-add.sh+++ b/testing/signing/t1124-keys-add.sh@@ -5,7 +5,7 @@# t1124 -- a signed CONFIG owns the trusted set, so live `keys add`# refuses changes and leaves the boot-enrolled membership intact.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guarddiff --git a/testing/t1126-keys-revoke.sh b/testing/signing/t1126-keys-revoke.shsimilarity index 99%rename from testing/t1126-keys-revoke.shrename to testing/signing/t1126-keys-revoke.shindex f9b2ee9d..48b8806a 100755--- a/testing/t1126-keys-revoke.sh+++ b/testing/signing/t1126-keys-revoke.sh@@ -5,7 +5,7 @@# t1126 -- a signed CONFIG owns signer revocation. A live revoke is# refused without changing the boot-enrolled keyring or loaded upatch.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guarddiff --git a/testing/t0015-test-vm-cli.sh b/testing/t0015-test-vm-cli.shindex bb7e4bab..8600b7cd 100755--- a/testing/t0015-test-vm-cli.sh+++ b/testing/t0015-test-vm-cli.sh@@ -885,11 +885,14 @@ test_expect_success 'make -C testing test runs the complete pipeline in order' 'test_expect_success 'operator and target runners have disjoint explicit scopes' 'grep -q "for t in t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&+ grep -q "for t in signing/t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&grep -q "for t in otel/t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&grep -q "bpm/t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&grep -q "tpm/t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&! grep -q "t1101" ../testing/run-tests.sh &&for test_name in t1200-target-fixtures.sh t1107-load-unload.sh \+ signing/t1123-keys.sh signing/t1124-keys-add.sh \+ signing/t1126-keys-revoke.sh \bpm/t1118-bpm-tree.sh tamperproof/t1140-verity-authority.sh \tamperproof/t1154-verity-config.sh tamperproof/t1158-verity-interruption.shdo