Skip to content

eBPF-based security platform

testing: boot two VMs at once in each functional CI shard

Martynas Pumputis71fbc3c7f06d
diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh
index 5735b96d..a3e25fe3 100755
--- a/.github/scripts/tests.sh
+++ b/.github/scripts/tests.sh
@@ -127,7 +127,9 @@ case "${2:-}" in
'') goals=tests ;;
unit) goals='-C testing unit ci-checks' ;;
functional|end2end) goals="-C testing $2" ;;
-functional-ci-[1-4]) goals="-C testing -k $2" ;;
+# A shard boots two families' VMs at once, of 4 GB each on a runner of
+# 16, and prints each family's output whole, once it is done.
+functional-ci-[1-4]) goals="-C testing -k -j2 -Otarget $2" ;;
*)
echo "usage: $0 setup|run [unit|functional|functional-ci-[1-4]|end2end]" >&2
exit 2
diff --git a/Documentation/contribute/code/developer-guide.rst b/Documentation/contribute/code/developer-guide.rst
index 2cae1cd3..b55de621 100644
--- a/Documentation/contribute/code/developer-guide.rst
+++ b/Documentation/contribute/code/developer-guide.rst
@@ -555,7 +555,7 @@ the commit at ``HEAD`` alone without them.
one part of it: ``unit`` runs the unit and ``ci-checks`` tests,
``functional`` and ``end2end`` the tier of that name.
``functional-ci-N`` runs one of the four functional shards,
- where ``N`` is 1 through 4. The ``CI suite`` workflow runs
+ where ``N`` is 1 through 4, two families' VMs at a time. The ``CI suite`` workflow runs
the unit and script checks, functional shards, and end-to-end
tests in parallel on x86-64.
With ``VM=0``, setup uses the kernel CI artifact's BTF and installs
diff --git a/Documentation/contribute/testing/test-coverage.rst b/Documentation/contribute/testing/test-coverage.rst
index e117dee9..bee14c2f 100644
--- a/Documentation/contribute/testing/test-coverage.rst
+++ b/Documentation/contribute/testing/test-coverage.rst
@@ -275,7 +275,8 @@ signed config image.
``uprobe`` and ``uretprobe`` loads that run once, report their
checked ``/proc/self/fd/<n>`` target paths and unload
* - ``t3108-status-many``
- - ``status --json`` with eighty loaded upatches lists all of them
+ - In ``functional/upatch-many/``, a VM of its own: ``status --json``
+ with eighty loaded upatches lists all of them
* - ``t3109-policy-labels``
- A loaded upatch labels executable and ordinary files, ORing
multiple policy bits with a preexisting xattr; its signed policy
diff --git a/Documentation/contribute/testing/testing.rst b/Documentation/contribute/testing/testing.rst
index 7c3d66dc..d1350efa 100644
--- a/Documentation/contribute/testing/testing.rst
+++ b/Documentation/contribute/testing/testing.rst
@@ -54,9 +54,10 @@ Before you begin
The ``CI suite`` workflow runs the x86-64 unit and script checks,
four functional shards, and the end-to-end tests in parallel jobs.
-The functional shards run upatch, tamperproof, the BPM families, and
-the remaining families. The arm64 host job runs unit, script, and host
-functional tests together.
+The functional shards run the two upatch families, tamperproof, the BPM
+families, and the remaining families, each booting two families' VMs at
+a time. The arm64 host job runs unit, script, and host functional tests
+together.
The merge queue tests a pull request again on top of the changes that
land before it, and runs only what such a change most often breaks: the
@@ -277,9 +278,11 @@ A shell test is named ``t<F><K><NN>-<what>.sh``:
- ``functional/signing/``
- Keys, signatures, vouching, revocation and the trusted set
* - 3
- - ``functional/upatch/``
+ - ``functional/upatch/``, ``functional/upatch-many/``
- The ``.upatch`` container, attach metadata, decoders,
- serializers, signed policy labels, load, unload and ``upatch get``
+ serializers, signed policy labels, load, unload and ``upatch get``;
+ ``upatch-many`` boots a VM of its own for the eighty upatches
+ ``t3108`` loads, which CI boots beside ``upatch``'s
* - 4
- ``functional/tpm/``
- TPM structures, the measurement register, the eventlog,
diff --git a/testing/Makefile b/testing/Makefile
index bbbe24bb..306c789d 100644
--- a/testing/Makefile
+++ b/testing/Makefile
@@ -319,12 +319,14 @@ $(addprefix functional/,$(FAMILIES)): functional/%: build-operator
$(Q)$(ROOT)/testing/run-tests.sh functional/$*
+$(Q)$(call vm-tests,$(filter $*,$(VM_SUITES)))
-# Keep the slow upatch and tamperproof VMs on their own runners. The last
-# shard also picks up new families outside BPM.
-functional-ci-1: functional/upatch
+# Keep the slow upatch and tamperproof VMs on their own runners, the
+# upatch VMs two, which tests.sh boots at once. The last shard also picks
+# up new families outside BPM.
+CI_UPATCH_FAMILIES := upatch upatch-many
+functional-ci-1: $(addprefix functional/,$(CI_UPATCH_FAMILIES))
functional-ci-2: functional/tamperproof
functional-ci-3: $(addprefix functional/,$(CI_BPM_FAMILIES))
-functional-ci-4: $(addprefix functional/,$(filter-out upatch tamperproof $(CI_BPM_FAMILIES),$(FAMILIES)))
+functional-ci-4: $(addprefix functional/,$(filter-out $(CI_UPATCH_FAMILIES) tamperproof $(CI_BPM_FAMILIES),$(FAMILIES)))
# The end-to-end test boots the operator VM, which builds the operator
# package and alone gets the signing key on its own disk; while it serves,
diff --git a/testing/functional/build/t1007-test-vm-cli.sh b/testing/functional/build/t1007-test-vm-cli.sh
index 42282ce5..dfb507f7 100755
--- a/testing/functional/build/t1007-test-vm-cli.sh
+++ b/testing/functional/build/t1007-test-vm-cli.sh
@@ -952,7 +952,7 @@ test_expect_success 'the runners split the tests by number' '
! grep -q "/t[0-9]1[0-9][0-9]-" "$WORK/operator-tests" &&
families=$(make -s -C .. -f testing/Makefile help |
sed -n "s/.*families: //p") &&
- [ "$families" = "build signing upatch tpm image image-reboot labels tamperproof bpm bpm-pending bpm-segments otel" ] &&
+ [ "$families" = "build signing upatch upatch-many tpm image image-reboot labels tamperproof bpm bpm-pending bpm-segments otel" ] &&
for d in functional/*/; do
f=${d#functional/}
case " $families " in *" ${f%/} "*) ;; *) return 1 ;; esac
diff --git a/testing/functional/upatch/t3108-status-many.sh b/testing/functional/upatch-many/t3108-status-many.sh
similarity index 100%
rename from testing/functional/upatch/t3108-status-many.sh
rename to testing/functional/upatch-many/t3108-status-many.sh