From e62bbf096dddc2e4deab3fd9019b6f59b1336ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Tue, 10 Nov 2020 12:31:52 +0100 Subject: [PATCH] test/integration: delete composes after we're done The integration tests are leaving the composes (which include images) in osbuild-composer. This can lead to exhausting the disk space we have available on our tiny testing machines. This commit adds a removal of the composes after each integration test is finished. This issue is not present in koji.sh and api.sh as they use different osbuild-composer APIs that doesn't use the artifact feature. This issue occurred when I worked on enabling the Fedora 33 tests, see: https://osbuildci.cloud.paas.psi.redhat.com/blue/organizations/jenkins/osbuild%2Fosbuild-composer/detail/PR-1014/23/pipeline --- test/cases/aws.sh | 3 +++ test/cases/qemu.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/cases/aws.sh b/test/cases/aws.sh index 12f32f9bd..b99265fcb 100755 --- a/test/cases/aws.sh +++ b/test/cases/aws.sh @@ -270,6 +270,9 @@ $AWS_CMD ec2 terminate-instances --instance-id "${INSTANCE_ID}" $AWS_CMD ec2 deregister-image --image-id "${AMI_IMAGE_ID}" $AWS_CMD ec2 delete-snapshot --snapshot-id "${SNAPSHOT_ID}" +# Also delete the compose so we don't run out of disk space +sudo composer-cli compose delete "${COMPOSE_ID}" > /dev/null + # Use the return code of the smoke test to determine if we passed or failed. # On rhel continue with the cloudapi test if [[ $RESULTS == 1 ]]; then diff --git a/test/cases/qemu.sh b/test/cases/qemu.sh index 5eb7c4968..804882f3e 100755 --- a/test/cases/qemu.sh +++ b/test/cases/qemu.sh @@ -301,6 +301,9 @@ else fi sudo rm -f "$LIBVIRT_IMAGE_PATH" $CLOUD_INIT_PATH +# Also delete the compose so we don't run out of disk space +sudo composer-cli compose delete "${COMPOSE_ID}" > /dev/null + # Use the return code of the smoke test to determine if we passed or failed. if [[ $RESULTS == 1 ]]; then greenprint "💚 Success"