nodepool/tools/check_devstack_plugin.sh
Monty Taylor e1f4a12949 Use shade for all OpenStack interactions
We wrote shade as an extraction of the logic we had in nodepool, and
have since expanded it to support more clouds. It's time to start
using it in nodepool, since that will allow us to add more clouds
and also to handle a wider variety of them.

Making a patch series was too tricky because of the way fakes and
threading work, so this is everything in one stab.

Depends-On: I557694b3931d81a3524c781ab5dabfb5995557f5
Change-Id: I423716d619aafb2eca5c1748bc65b38603a97b6a
Co-Authored-By: James E. Blair <jeblair@linux.vnet.ibm.com>
Co-Authored-By: David Shrewsbury <shrewsbury.dave@gmail.com>
Co-Authored-By: Yolanda Robla <yolanda.robla-mota@hpe.com>
2016-03-26 10:23:25 +01:00

53 lines
1.5 KiB
Bash
Executable File

#!/bin/bash -x
NODEPOOL_CONFIG=${NODEPOOL_CONFIG:-/etc/nodepool/nodepool.yaml}
NODEPOOL_SECURE=${NODEPOOL_SECURE:-/etc/nodepool/secure.conf}
NODEPOOL="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