test/system: Remove redundant clean-up

The IMAGE_CACHE_DIR environment variable is defined as
"${BATS_SUITE_TMPDIR}/image-cache" [1].  Earlier, it used to be
"${BATS_RUN_TMPDIR}/image-cache".

There's no need to clean up anything inside BATS_RUN_TMPDIR or
BATS_SUITE_TMPDIR after the test suite has finished running, because
their life cycle is managed by Bats [2].

[1] Commit 3a549a6252
    https://github.com/containers/toolbox/commit/3a549a6252e990d6
    https://github.com/containers/toolbox/pull/1452

[2] https://bats-core.readthedocs.io/en/stable/writing-tests.html

Fallout from 9820550c82

https://github.com/containers/toolbox/pull/1645
This commit is contained in:
Debarshi Ray 2025-05-12 17:48:16 +02:00
parent d64682af0d
commit a5a0d5350f
2 changed files with 1 additions and 8 deletions

View File

@ -120,12 +120,6 @@ function _pull_and_cache_distro_image() {
}
# Removes the folder with cached images
function _clean_cached_images() {
rm --force --recursive "${IMAGE_CACHE_DIR}"
}
# Prepares a locally hosted image registry
#
# The registry is set up with Podman set to an alternative root. It won't

View File

@ -1,6 +1,6 @@
# shellcheck shell=bash
#
# Copyright © 2021 2024 Red Hat, Inc.
# Copyright © 2021 2025 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -85,6 +85,5 @@ teardown_suite() {
_clean_docker_registry
fi
_clean_cached_images
podman system reset --force >/dev/null
}