eBPF-based security platform
testing: group TPM tests
John Fastabend184db2f2badf
diff --git a/Documentation/requirements.rst b/Documentation/requirements.rstindex 09d00eff..6e529f5e 100644--- a/Documentation/requirements.rst+++ b/Documentation/requirements.rst@@ -352,8 +352,8 @@ binary, as described in `operations <operations.rst>`__.docutils' ``rst2html`` (``python3-docutils``).* The host-side suite, ``make -C testing test-op``, runs its Pythonhelpers on the standard library alone. With the ``cryptography``- module installed, ``t0033-tpm-wire.sh`` also cross-checks the TPM- credential blob it builds against an independent implementation;+ module installed, ``testing/tpm/t0033-tpm-wire.sh`` also cross-checks+ the TPM credential blob it builds against an independent implementation;without it that one check is skipped.* ``make -C testing fuzz`` builds the parsers' libFuzzer targets with``clang`` and needs its fuzzer and sanitizer runtimediff --git a/Documentation/tpm.rst b/Documentation/tpm.rstindex b414dbc8..55f1e82e 100644--- a/Documentation/tpm.rst+++ b/Documentation/tpm.rst@@ -573,10 +573,10 @@ context and the deferred mitigations the plan.8) Testing-----------``testing/t0033-tpm-wire.sh`` checks the policy digests, names, wire+``testing/tpm/t0033-tpm-wire.sh`` checks the policy digests, names, wireparsers, the key derivations, the endorsement policy and thecredential blob against known vectors and an independent-implementation, without a TPM. ``testing/t0034-register.sh`` drives the+implementation, without a TPM. ``testing/tpm/t0034-register.sh`` drives thewhole register and attestation path, the initrd phases simulated asPCR 11 extensions, the credential challenge with an ECC and an RSAendorsement key included, against libtpms:diff --git a/testing/run-target-tests.sh b/testing/run-target-tests.shindex b8fe9128..e388a018 100755--- a/testing/run-target-tests.sh+++ b/testing/run-target-tests.sh@@ -18,11 +18,11 @@ for t in \bpm/t1118-bpm-tree.sh \bpm/t1119-bpm-tree-sequential.sh \bpm/t1120-bpm-tree-delete.sh \- t1102-eventlog-full.sh \+ tpm/t1102-eventlog-full.sh \t1103-version-gate.sh \t1104-payload-mismatch.sh \t1107-load-unload.sh \- t1108-tpm-chain.sh \+ tpm/t1108-tpm-chain.sh \t1111-upatch-get.sh \t1114-uprobe-multi.sh \otel/t1115-map-export-all.sh \diff --git a/testing/run-tests.sh b/testing/run-tests.shindex 1d9cc9c7..75fe7968 100755--- a/testing/run-tests.sh+++ b/testing/run-tests.sh@@ -54,6 +54,19 @@ for t in bpm/t0[0-9][0-9][0-9]-*.sh; dofidone+for t in tpm/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 upatch/kernel-obs/dns/t0[0-9][0-9][0-9]-*.sh; do[ -e "$t" ] || continuefound=1diff --git a/testing/t0015-test-vm-cli.sh b/testing/t0015-test-vm-cli.shindex 72866133..e6ca022b 100755--- a/testing/t0015-test-vm-cli.sh+++ b/testing/t0015-test-vm-cli.sh@@ -902,17 +902,18 @@ 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 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 \bpm/t1118-bpm-tree.sh \bpm/t1119-bpm-tree-sequential.sh \bpm/t1120-bpm-tree-delete.sh \- t1102-eventlog-full.sh \+ tpm/t1102-eventlog-full.sh \t1103-version-gate.sh \t1104-payload-mismatch.sh \t1107-load-unload.sh \- t1108-tpm-chain.sh \+ tpm/t1108-tpm-chain.sh \t1111-upatch-get.sh \t1114-uprobe-multi.sh \otel/t1115-map-export-all.sh \diff --git a/testing/t0003-chain.sh b/testing/tpm/t0003-chain.shsimilarity index 97%rename from testing/t0003-chain.shrename to testing/tpm/t0003-chain.shindex 62fed3b2..ccfc8bce 100644--- a/testing/t0003-chain.sh+++ b/testing/tpm/t0003-chain.sh@@ -6,7 +6,7 @@# and constant-time compare. These underpin the measurement register;# a drift here silently breaks attestation.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./test-lib.shH=helper/test-chaindiff --git a/testing/t0033-tpm-wire.sh b/testing/tpm/t0033-tpm-wire.shsimilarity index 99%rename from testing/t0033-tpm-wire.shrename to testing/tpm/t0033-tpm-wire.shindex 5bc9f426..1536f408 100644--- a/testing/t0033-tpm-wire.sh+++ b/testing/tpm/t0033-tpm-wire.sh@@ -6,7 +6,7 @@# under, NV and object names, and the attestation structures the# verifier parses, each against values computed independently here.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./test-lib.shH=helper/test-tpm-wirediff --git a/testing/t0034-register.sh b/testing/tpm/t0034-register.shsimilarity index 99%rename from testing/t0034-register.shrename to testing/tpm/t0034-register.shindex 36051043..ffb191b7 100644--- a/testing/t0034-register.sh+++ b/testing/tpm/t0034-register.sh@@ -8,7 +8,7 @@# a verifier accepts or refuses. Needs the libtpms-backed# helper/tpmsim-cmd; skipped where libtpms is not installed.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./test-lib.shR=helper/test-registerdiff --git a/testing/t0035-eventlog-pending.sh b/testing/tpm/t0035-eventlog-pending.shsimilarity index 98%rename from testing/t0035-eventlog-pending.shrename to testing/tpm/t0035-eventlog-pending.shindex 88e7435d..db05134e 100755--- a/testing/t0035-eventlog-pending.sh+++ b/testing/tpm/t0035-eventlog-pending.sh@@ -7,7 +7,7 @@# system's init adopts it, and adoption appends it to the eventlog# exactly once.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./test-lib.shH=helper/test-eventlogW=$(mktemp -d)diff --git a/testing/t1102-eventlog-full.sh b/testing/tpm/t1102-eventlog-full.shsimilarity index 97%rename from testing/t1102-eventlog-full.shrename to testing/tpm/t1102-eventlog-full.shindex 12c5da04..e56ad336 100644--- a/testing/t1102-eventlog-full.sh+++ b/testing/tpm/t1102-eventlog-full.sh@@ -6,7 +6,7 @@# shirudo.conf, a valid load refuses with category eventlog_full at# pre-flight. No BPF_PROG_LOAD, no chain extend, no append. Non-destructive.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guarddiff --git a/testing/t1108-tpm-chain.sh b/testing/tpm/t1108-tpm-chain.shsimilarity index 97%rename from testing/t1108-tpm-chain.shrename to testing/tpm/t1108-tpm-chain.shindex b1746da3..6ff38df7 100644--- a/testing/t1108-tpm-chain.sh+++ b/testing/tpm/t1108-tpm-chain.sh@@ -8,7 +8,7 @@# usable TPM; init refuses to run without one, so a host with no chain# has no shirudo state and the test skips (it runs on the CI vTPM runner).-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guard