diff --git a/Atomic/syscontainers.py b/Atomic/syscontainers.py index 51f0c17..53c0d14 100644 --- a/Atomic/syscontainers.py +++ b/Atomic/syscontainers.py @@ -262,6 +262,11 @@ class SystemContainers(object): shutil.rmtree(unitfileout) except OSError: pass + try: + if not upgrade: + shutil.rmtree(tmpfilesout) + except OSError: + pass raise e def _do_checkout_system_container(self, repo, name, img, upgrade, values, destination, unitfileout, tmpfilesout, extract_only, remote): diff --git a/tests/integration/test_system_containers.sh b/tests/integration/test_system_containers.sh index f65e49b..c3c24a7 100755 --- a/tests/integration/test_system_containers.sh +++ b/tests/integration/test_system_containers.sh @@ -87,6 +87,7 @@ teardown () { systemctl stop $NAME-failed &> /dev/null || true systemctl disable $NAME-failed &> /dev/null || true rm -rf /etc/systemd/system/${NAME}-failed.service || true + rm /etc/tmpfiles.d/${NAME}.conf || true } trap teardown EXIT @@ -132,26 +133,26 @@ assert_matches "running" ps.out # A duplicate will fail due to using the same port ${ATOMIC} install --name=${NAME}-failed --set=RECEIVER=${SECRET} --system oci:atomic-test-system systemctl start ${NAME}-failed -${ATOMIC} containers list --all | grep "test-system" > ps.out +${ATOMIC} containers list --all --no-trunc | grep "test-system" > ps.out assert_matches "failed" ps.out systemctl stop ${NAME} systemctl stop ${NAME}-failed ${ATOMIC} uninstall ${NAME}-failed -${ATOMIC} containers list --all | grep "test-system" > ps.out +${ATOMIC} containers list --all --no-trunc | grep "test-system" > ps.out assert_matches "inactive" ps.out # Test that containers can be started/stopped with run/stop ${ATOMIC} run ${NAME} -${ATOMIC} containers list --all | grep "test-system" > ps.out +${ATOMIC} containers list --all --no-trunc | grep "test-system" > ps.out assert_matches "running" ps.out ${ATOMIC} stop ${NAME} -${ATOMIC} containers list --all | grep "test-system" > ps.out +${ATOMIC} containers list --all --no-trunc | grep "test-system" > ps.out assert_matches "inactive" ps.out -${ATOMIC} containers list --quiet > ps.out +${ATOMIC} containers list --no-trunc --quiet > ps.out assert_not_matches "test-system" ps.out test -e /etc/systemd/system/${NAME}.service