mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-02 02:02:24 +00:00
test: avoid errors in exit_handler
Avoid generating errors in the exit_handler, as those could be misinterpreted as red herrings for the actual error being trapped. Signed-off-by: Marco Vedovati <mvedovati@suse.com>
This commit is contained in:
parent
eb92306c48
commit
9c0773a399
@ -153,11 +153,26 @@ exit_handler()
|
|||||||
info "ERROR: test failed"
|
info "ERROR: test failed"
|
||||||
|
|
||||||
# The test failed so dump what we can
|
# The test failed so dump what we can
|
||||||
info "images:"
|
if [ -d "${tmp_rootfs}" ]; then
|
||||||
sudo -E ls -l "${images_dir}" >&2
|
info "rootfs:"
|
||||||
|
sudo -E ls -l "${tmp_rootfs}" >&2
|
||||||
|
else
|
||||||
|
info "no rootfs created"
|
||||||
|
# If no rootfs are created, no need to dump other info
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
info "rootfs:"
|
if [ -d "${images_dir}" ]; then
|
||||||
sudo -E ls -l "${tmp_rootfs}" >&2
|
info "images:"
|
||||||
|
sudo -E ls -l "${images_dir}" >&2
|
||||||
|
else
|
||||||
|
info "no images created"
|
||||||
|
# If no images are created, no need to dump other info
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Travis tests do not install kata
|
||||||
|
[ -n "${TRAVIS:-}" ] && return
|
||||||
|
|
||||||
info "local runtime config:"
|
info "local runtime config:"
|
||||||
cat /etc/kata-containers/configuration.toml >&2
|
cat /etc/kata-containers/configuration.toml >&2
|
||||||
@ -172,7 +187,7 @@ exit_handler()
|
|||||||
sudo -E ps -efwww | egrep "docker|kata" >&2
|
sudo -E ps -efwww | egrep "docker|kata" >&2
|
||||||
|
|
||||||
# Restore the default image in config file
|
# Restore the default image in config file
|
||||||
[ -n "${TRAVIS:-}" ] || chronic $mgr configure-image
|
chronic $mgr configure-image
|
||||||
}
|
}
|
||||||
|
|
||||||
die()
|
die()
|
||||||
|
Loading…
Reference in New Issue
Block a user