This commit is contained in:
Debarshi Ray 2025-05-31 02:08:39 +02:00
parent fdce5e4f52
commit 1c616f04bf
3 changed files with 30 additions and 7 deletions

View File

@ -35,7 +35,7 @@ readonly RESOLVER_SH='resolvectl --legend false --no-pager --type "$0" query "$1
setup_file() {
bats_require_minimum_version 1.10.0
cleanup_all
# cleanup_all
pushd "$HOME" || return 1
if echo "$TOOLBX_TEST_SYSTEM_TAGS" | grep "arch" >/dev/null 2>/dev/null; then

View File

@ -55,8 +55,31 @@ declare -Ag IMAGES=([arch]="quay.io/toolbx/arch-toolbox" \
function cleanup_all() {
podman rm --all --force >/dev/null
podman rmi --all --force >/dev/null
ctr_id="$(podman ps --all --format "{{ .ID }}" --no-trunc | head --lines 1)"
cat "$XDG_RUNTIME_DIR/crun/$ctr_id/status"
echo "Container to kill: $ctr_id"
if [ "$ctr_id" != "" ]; then
crun --debug --log-level=debug kill --all "$ctr_id" 15
echo "Container to kill: crun: $?"
fi
ctr_id="$(podman ps --all --format "{{ .ID }}" --no-trunc | head --lines 2 | tail --lines 1)"
echo "Container to kill: $ctr_id"
if [ "$ctr_id" != "" ]; then
crun --debug --log-level=debug kill --all "$ctr_id" 15
echo "Container to kill: crun: $?"
fi
ctr_id="$(podman ps --all --format "{{ .ID }}" --no-trunc | head --lines 3 | tail --lines 1)"
echo "Container to kill: $ctr_id"
if [ "$ctr_id" != "" ]; then
crun --debug --log-level=debug kill --all "$ctr_id" 15
echo "Container to kill: crun: $?"
fi
podman --log-level debug stop --all
podman rm --all
podman rmi --all
}

View File

@ -69,7 +69,7 @@ setup_suite() {
_pull_and_cache_distro_image fedora "$((system_version-2))" || false
fi
_setup_docker_registry
# _setup_docker_registry
fi
}
@ -86,9 +86,9 @@ teardown_suite() {
dbus_daemon_pid=0
fi
if echo "$TOOLBX_TEST_SYSTEM_TAGS" | grep "commands-options" >/dev/null 2>/dev/null; then
_clean_docker_registry
fi
# if echo "$TOOLBX_TEST_SYSTEM_TAGS" | grep "commands-options" >/dev/null 2>/dev/null; then
# _clean_docker_registry
# fi
podman system reset --force >/dev/null
}