spiegel_podman/hack/ci/logcollector.sh
Paul Holzinger eec74abe89
New GHA lima ci testing setup
The main gh action is just there to install lima and then call the main
ci.sh script which uses lima to start the right VM and then run the
tests inside there mostly for linux tasks where possible.

Inside the VM we use the runner.sh script to setup the env and launch the
final test.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
(cherry picked from commit 399e822ca4)

[fixed merge conflict]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-04 20:04:26 +02:00

82 lines
2.4 KiB
Bash
Executable file

#!/usr/bin/env bash
set -e
# shellcheck source=hack/ci/lib.sh
source $(dirname $0)/lib.sh
# Assume there are other log collection commands to follow - Don't
# let one break another that may be useful, but also keep any
# actual script-problems fatal so they are noticed right away.
showrun() {
echo '+ '$(printf " %q" "$@")
set +e
echo '------------------------------------------------------------'
"$@"
local status=$?
[[ $status -eq 0 ]] || \
echo "[ rc = $status -- proceeding anyway ]"
echo '------------------------------------------------------------'
set -e
}
bad_os_id_ver() {
die "Unknown OS '$OS_RELEASE_ID'"
}
case $1 in
audit)
case $OS_RELEASE_ID in
debian) showrun cat /var/log/kern.log ;;
fedora) showrun cat /var/log/audit/audit.log ;;
*) bad_os_id_ver ;;
esac
;;
df) showrun df -lhTx tmpfs ;;
journal) showrun journalctl -b ;;
podman) showrun ./bin/podman system info ;;
packages)
# These names are common to Fedora and Debian
PKG_NAMES=(\
aardvark-dns
buildah
conmon
containernetworking-plugins
criu
crun
golang
netavark
passt
podman
skopeo
slirp4netns
)
case $OS_RELEASE_ID in
fedora)
cat /etc/fedora-release
PKG_LST_CMD='rpm -q --qf=%{N}-%{V}-%{R}-%{ARCH}\n'
PKG_NAMES+=(\
container-selinux
containers-common
libseccomp
)
;;
debian)
cat /etc/issue
PKG_LST_CMD='dpkg-query --show --showformat=${Package}-${Version}-${Architecture}\n'
PKG_NAMES+=(\
golang-github-containers-common
golang-github-containers-image
libseccomp2
)
;;
*) bad_os_id_ver ;;
esac
echo "Kernel: " $(uname -r)
echo "Cgroups: " $(stat -f -c %T /sys/fs/cgroup)
# Any not-present packages will be listed as such
$PKG_LST_CMD "${PKG_NAMES[@]}" | sort -u
;;
ip) showrun sh -c "ip addr && ip route && ip -6 route" ;;
esac