From: Frantisek Sumsal Date: Sun, 17 May 2020 08:48:16 +0000 (+0200) Subject: test: introduce TEST_PARALLELIZE to support running tests in parallel X-Git-Tag: v246-rc1~307^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7a57256c7355e187adbd5f5bc37e529a0a0715c3;p=thirdparty%2Fsystemd.git test: introduce TEST_PARALLELIZE to support running tests in parallel Support running tests in parallel by switching to copying of the base image instead of symlinking it.. This still requires some setup steps, like running `make setup` on tests which have unique $IMAGE_NAME beforehand (and sequentially), otherwise they'll all try to create the same base image when started in parallel, leading to nasty issues. However, as running the integration tests in parallel is such an unusual use case it should be good enough, for now. --- diff --git a/test/test-functions b/test/test-functions index 0df8896fd6d..f5a798b4b83 100644 --- a/test/test-functions +++ b/test/test-functions @@ -18,6 +18,7 @@ EFI_MOUNT="${EFI_MOUNT:-$(bootctl -x 2>/dev/null || echo /boot)}" QEMU_MEM="${QEMU_MEM:-512M}" IMAGE_NAME=${IMAGE_NAME:-default} TEST_REQUIRE_INSTALL_TESTS="${TEST_REQUIRE_INSTALL_TESTS:-1}" +TEST_PARALLELIZE="${TEST_PARALLELIZE:-0}" LOOPDEV= # Decide if we can (and want to) run QEMU with KVM acceleration. @@ -2006,7 +2007,11 @@ test_setup() { mount_initdir elif [ -e "$IMAGE_PUBLIC" ]; then echo "Reusing existing cached image $IMAGE_PUBLIC → $(realpath $IMAGE_PUBLIC)" - ln -s "$(realpath $IMAGE_PUBLIC)" "$IMAGE_PRIVATE" + if [ ${TEST_PARALLELIZE} -ne 0 ]; then + cp -v "$(realpath $IMAGE_PUBLIC)" "$IMAGE_PRIVATE" + else + ln -sv "$(realpath $IMAGE_PUBLIC)" "$IMAGE_PRIVATE" + fi mount_initdir else test_create_image