]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: delete private images on clean-again
authorLuca Boccassi <bluca@debian.org>
Wed, 20 Mar 2024 12:55:02 +0000 (12:55 +0000)
committerLuca Boccassi <bluca@debian.org>
Thu, 21 Mar 2024 11:08:18 +0000 (11:08 +0000)
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

test/test-functions

index b99580bfd84a8e6f69efee274220bcd81d9f133a..0c0ffa1545edcceea60ee99a2d4dfc65286fcceb 100644 (file)
@@ -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() {