Fix and improve test job data collection
Corrected the netstat data collection as the --version flag causes a non-zero exit code with netstat. Added interface counter data collection to allow for additional troubleshooting context. Change-Id: I7e0e26cc735d6c0ad9052547bc0eefe3ed3877ae
This commit is contained in:
parent
d4e765189c
commit
917983e5ce
@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -eux
|
# Note(TheJulia): We should proceed with attempting to collect information
|
||||||
|
# even if a command fails, and as such set -e should not be present.
|
||||||
|
set -ux
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
# Note(TheJulia): If there is a workspace variable, we want to utilize that as
|
# Note(TheJulia): If there is a workspace variable, we want to utilize that as
|
||||||
@ -13,12 +15,14 @@ echo "Making logs directory and collecting logs."
|
|||||||
sudo cp /var/log/libvirt/baremetal_logs/testvm1_console.log ${LOG_LOCATION}
|
sudo cp /var/log/libvirt/baremetal_logs/testvm1_console.log ${LOG_LOCATION}
|
||||||
sudo chown $USER ${LOG_LOCATION}/testvm1_console.log
|
sudo chown $USER ${LOG_LOCATION}/testvm1_console.log
|
||||||
dmesg &> ${LOG_LOCATION}/dmesg.log
|
dmesg &> ${LOG_LOCATION}/dmesg.log
|
||||||
if $(netstat --version &>/dev/null); then
|
# NOTE(TheJulia): Netstat exits with error code 5 when --version is used.
|
||||||
sudo netstat -apn &> ${LOG_LOCATION}/netstat.log
|
sudo netstat -apn &> ${LOG_LOCATION}/netstat.log
|
||||||
fi
|
|
||||||
if $(iptables --version &>/dev/null); then
|
if $(iptables --version &>/dev/null); then
|
||||||
sudo iptables -L -n -v &> ${LOG_LOCATION}/iptables.log
|
sudo iptables -L -n -v &> ${LOG_LOCATION}/iptables.log
|
||||||
fi
|
fi
|
||||||
|
if $(ip link &>/dev/null); then
|
||||||
|
ip -s link &> ${LOG_LOCATION}/interface_counters.log
|
||||||
|
fi
|
||||||
if $(journalctl --version &>/dev/null); then
|
if $(journalctl --version &>/dev/null); then
|
||||||
sudo journalctl -u ironic-api &> ${LOG_LOCATION}/ironic-api.log
|
sudo journalctl -u ironic-api &> ${LOG_LOCATION}/ironic-api.log
|
||||||
sudo journalctl -u ironic-conductor &> ${LOG_LOCATION}/ironic-conductor.log
|
sudo journalctl -u ironic-conductor &> ${LOG_LOCATION}/ironic-conductor.log
|
||||||
|
Loading…
x
Reference in New Issue
Block a user