bifrost/scripts/test-bifrost.sh
Julia Kreger 2c1c54d7b7 Fix playbooks for OpenStack CI
The OpenStack CI systems are preconfigured with various components
such as databases, message queues, caching dns resolvers.  The
CI systems also lack things like public/private key pairs, and
known_hosts files.

Due to this, a number of minor changes are required in Bifrost's test
sequence to account for and route around these differences in order
to allow test jobs to run until completion. This also demonstrated
that some steps have been operating under the assumption that the user
likely already had certain things installed, so service restart
tweeks have also been necessary.

Added a step to restart libvirt-bin in order to allow it to pickup
new capabilities due to the install of the qemu emulator.

Added additional steps to collect kernel log and `virsh capabilities`
output.

Removed MySQL step nolog statements as the password is automatically
suppressed and it suppresses information that could be required for
troubleshooting.

Added in specific username/password logic for MySQL steps if ZUUL
is detected in order to use the OpenStack CI defaults.

Changed VM test node creation to occur upon every attempt.

Extended the startup wait for a test node to be 900 seconds from 600
seconds.

Added collection of process list and listening sockets if ZUUL is
detected.

Added report of VM console log and various commands to assist in
troubleshooting a failing job.

Added auto-generation of a user ssh keypair if absent when operating
in OpenStack CI.

Added explicit adjustment of iptables to permit connections on the
network interface that the hosts are being provisioned via on
8080/tcp and 6385/tcp.

Change-Id: I3c37c5c21af0aefb5007c5775043f7f837389c2d
2015-05-16 06:18:48 +00:00

46 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
set -eux
set -o pipefail
export PYTHONUNBUFFERED=1
SCRIPT_HOME=$(dirname $0)
BIFROST_HOME=$SCRIPT_HOME/..
# Install Ansible
$SCRIPT_HOME/env-setup.sh
# Source Ansible
source /opt/stack/ansible/hacking/env-setup
# Change working directory
cd $BIFROST_HOME/playbooks
# Perform a syntax check
ansible-playbook -vvvv -i inventory/localhost test-bifrost.yaml --syntax-check --list-tasks
set +e
# Execute test playbook
ansible-playbook -vvvv -i inventory/localhost test-bifrost.yaml
EXITCODE=$?
if [ $EXITCODE != 0 ]; then
echo "*************************"
echo "Test failed. Test VM log:"
sudo cat /var/log/libvirt/baremetal_logs/testvm1_console.log
echo "*************************"
echo "Kernel log:"
sudo dmesg
echo "*************************"
echo "Network Sockets in LISTEN state:"
sudo netstat -apn|grep LISTEN
echo "*************************"
echo "Firewalling settings:"
sudo iptables -L -n -v
echo "*************************"
echo "Ironic API log, last 1000 lines:"
sudo cat /var/log/upstart/ironic-api.log
echo "*************************"
echo "Ironic Conductor log, last 1000 lines:"
sudo cat /var/log/upstart/ironic-conductor.log
fi
exit $EXITCODE