From: Luca Boccassi Date: Wed, 20 Mar 2024 12:55:02 +0000 (+0000) Subject: test: delete private images on clean-again X-Git-Tag: v256-rc1~446^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a82cf4902d39e52b85bcf110bf7f1ca465239769;p=thirdparty%2Fsystemd.git test: delete private images on clean-again Private images are not reused, they are unique to tests, so delete them as they take a lot of disk space, and we are starting to run in /var/tmp space issues on the Ubuntu CI --- diff --git a/test/test-functions b/test/test-functions index b99580bfd84..0c0ffa1545e 100644 --- a/test/test-functions +++ b/test/test-functions @@ -3338,6 +3338,13 @@ test_cleanup_again() { [ -n "$TESTDIR" ] || return rm -rf "$TESTDIR/unprivileged-nspawn-root" [[ -n "$initdir" ]] && _umount_dir "$initdir" + # Test specific images are not reused, so delete them or we run out of disk space + if [[ -n "$IMAGE_PUBLIC" ]] && [ "$(basename "$IMAGE_PUBLIC")" != "default.img" ]; then + rm -vf "$IMAGE_PUBLIC" + fi + if [[ -n "$IMAGE_PRIVATE" ]] && [ "$(basename "$IMAGE_PRIVATE")" != "default.img" ]; then + rm -vf "$IMAGE_PRIVATE" + fi } test_create_image() {