summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2019-06-12 09:59:31 -0400
committerChris Evich <cevich@redhat.com>2019-06-14 08:49:18 -0400
commit4e9f5e5f2bd6a812581af0efada7219ce8eebf50 (patch)
tree07494e292a185e20084274cd37c500b85d35f067 /contrib
parent2784cf3ca3c635b1383823dd9bc47d26274e60e3 (diff)
downloadpodman-4e9f5e5f2bd6a812581af0efada7219ce8eebf50.tar.gz
podman-4e9f5e5f2bd6a812581af0efada7219ce8eebf50.tar.bz2
podman-4e9f5e5f2bd6a812581af0efada7219ce8eebf50.zip
Cirrus: Simplify log collection commands
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/cirrus/logcollector.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/contrib/cirrus/logcollector.sh b/contrib/cirrus/logcollector.sh
new file mode 100755
index 000000000..425a619b0
--- /dev/null
+++ b/contrib/cirrus/logcollector.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+set -e
+
+source $(dirname $0)/lib.sh
+
+req_env_var CIRRUS_WORKING_DIR OS_RELEASE_ID
+
+# 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
+}
+
+case $1 in
+ audit)
+ case $OS_RELEASE_ID in
+ ubuntu) showrun cat /var/log/kern.log ;;
+ fedora) showrun cat /var/log/audit/audit.log ;;
+ *) bad_os_id_ver ;;
+ esac
+ ;;
+ df) showrun df -lhTx tmpfs ;;
+ ginkgo) showrun cat $CIRRUS_WORKING_DIR/test/e2e/ginkgo-node-*.log ;;
+ journal) showrun journalctl -b ;;
+ *) die 1 "Warning, $(basename $0) doesn't know how to handle the parameter '$1'"
+esac