diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-06-17 21:38:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-17 21:38:25 +0200 |
commit | 058c93f8505e14cfcc718b84b66766d7ea18975d (patch) | |
tree | 26035631cd69d019a797ab798f65b3772e2b4229 /contrib/cirrus/logcollector.sh | |
parent | bce4a93575234a99e5e252482a0c15690b13e91a (diff) | |
parent | 4e9f5e5f2bd6a812581af0efada7219ce8eebf50 (diff) | |
download | podman-058c93f8505e14cfcc718b84b66766d7ea18975d.tar.gz podman-058c93f8505e14cfcc718b84b66766d7ea18975d.tar.bz2 podman-058c93f8505e14cfcc718b84b66766d7ea18975d.zip |
Merge pull request #3308 from cevich/always_collect_logs
Cirrus: Simplify log collection commands
Diffstat (limited to 'contrib/cirrus/logcollector.sh')
-rwxr-xr-x | contrib/cirrus/logcollector.sh | 36 |
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 |