Files
nodepool/tools/check_devstack_plugin.sh
Monty Taylor 362f0a0cd2 Also use the virtualenv for checking
There is a script we use to check the results of the nodepool devstack
tests. It needs to use the nodepool virtualenv.

Change-Id: I40f5165d36060643943bcb91df14e5e34cd5e3fa
2016-08-27 08:01:07 -05:00

54 lines
1.5 KiB
Bash
Executable File

#!/bin/bash -x
NODEPOOL_INSTALL=${NODEPOOL_INSTALL:-/opt/stack/new/nodepool-venv}
NODEPOOL_CONFIG=${NODEPOOL_CONFIG:-/etc/nodepool/nodepool.yaml}
NODEPOOL_SECURE=${NODEPOOL_SECURE:-/etc/nodepool/secure.conf}
NODEPOOL="$NODEPOOL_INSTALL/bin/nodepool -c $NODEPOOL_CONFIG -s $NODEPOOL_SECURE"
function waitforimage {
name=$1
state='ready'
while ! $NODEPOOL image-list | grep $name | grep $state; do
$NODEPOOL image-list > /tmp/.nodepool-image-list.txt
$NODEPOOL list > /tmp/.nodepool-list.txt
sudo mv /tmp/.nodepool-image-list.txt $WORKSPACE/logs/nodepool-image-list.txt
sudo mv /tmp/.nodepool-list.txt $WORKSPACE/logs/nodepool-list.txt
sleep 10
done
}
function waitfornode {
name=$1
state='ready'
while ! $NODEPOOL list | grep $name | grep $state; do
$NODEPOOL image-list > /tmp/.nodepool-image-list.txt
$NODEPOOL list > /tmp/.nodepool-list.txt
sudo mv /tmp/.nodepool-image-list.txt $WORKSPACE/logs/nodepool-image-list.txt
sudo mv /tmp/.nodepool-list.txt $WORKSPACE/logs/nodepool-list.txt
sleep 10
done
}
# Check that snapshot image built
waitforimage trusty-server
# check that dib image built
waitforimage ubuntu-dib
# check snapshot image was bootable
waitfornode trusty-server
# check dib image was bootable
waitfornode ubuntu-dib
set -o errexit
# Show the built nodes
$NODEPOOL list
# Try to delete the nodes that were just built
$NODEPOOL delete --now 1
$NODEPOOL delete --now 2
# show the deleted nodes (and their replacements may be building)
$NODEPOOL list