Merge "Add functional test for key-name and glean"
This commit is contained in:
commit
db27ad2c8f
@ -15,6 +15,7 @@
|
||||
# under the License.
|
||||
|
||||
NODEPOOL_KEY=$HOME/.ssh/id_nodepool
|
||||
NODEPOOL_KEY_NAME=root
|
||||
NODEPOOL_PUBKEY=$HOME/.ssh/id_nodepool.pub
|
||||
NODEPOOL_INSTALL=$HOME/nodepool-venv
|
||||
NODEPOOL_CACHE_GET_PIP=/opt/stack/cache/files/get-pip.py
|
||||
@ -78,6 +79,13 @@ function nodepool_create_keypairs {
|
||||
if [[ ! -f $NODEPOOL_KEY ]]; then
|
||||
ssh-keygen -f $NODEPOOL_KEY -P ""
|
||||
fi
|
||||
|
||||
cat > /tmp/ssh_wrapper <<EOF
|
||||
#!/bin/bash -ex
|
||||
sudo -H -u stack ssh -o StrictHostKeyChecking=no -i $NODEPOOL_KEY root@\$@
|
||||
|
||||
EOF
|
||||
sudo chmod 0755 /tmp/ssh_wrapper
|
||||
}
|
||||
|
||||
function nodepool_write_elements {
|
||||
@ -278,36 +286,42 @@ providers:
|
||||
username: devuser
|
||||
private-key: $NODEPOOL_KEY
|
||||
config-drive: true
|
||||
key-name: $NODEPOOL_KEY_NAME
|
||||
- name: debian-jessie
|
||||
min-ram: 512
|
||||
name-filter: 'nodepool'
|
||||
username: devuser
|
||||
private-key: $NODEPOOL_KEY
|
||||
config-drive: true
|
||||
key-name: $NODEPOOL_KEY_NAME
|
||||
- name: fedora-25
|
||||
min-ram: 1024
|
||||
name-filter: 'nodepool'
|
||||
username: devuser
|
||||
private-key: $NODEPOOL_KEY
|
||||
config-drive: true
|
||||
key-name: $NODEPOOL_KEY_NAME
|
||||
- name: opensuse-42.2
|
||||
min-ram: 1024
|
||||
name-filter: 'nodepool'
|
||||
username: devuser
|
||||
private-key: $NODEPOOL_KEY
|
||||
config-drive: true
|
||||
key-name: $NODEPOOL_KEY_NAME
|
||||
- name: ubuntu-trusty
|
||||
min-ram: 512
|
||||
name-filter: 'nodepool'
|
||||
username: devuser
|
||||
private-key: $NODEPOOL_KEY
|
||||
config-drive: true
|
||||
key-name: $NODEPOOL_KEY_NAME
|
||||
- name: ubuntu-xenial
|
||||
min-ram: 512
|
||||
name-filter: 'nodepool'
|
||||
username: devuser
|
||||
private-key: $NODEPOOL_KEY
|
||||
config-drive: true
|
||||
key-name: $NODEPOOL_KEY_NAME
|
||||
|
||||
diskimages:
|
||||
- name: centos-7
|
||||
@ -502,6 +516,10 @@ function start_nodepool {
|
||||
secgroup-add-rule default udp 1 65535 0.0.0.0/0
|
||||
fi
|
||||
|
||||
# create root keypair to use with glean for devstack cloud.
|
||||
nova --os-project-name demo --os-username demo \
|
||||
keypair-add --pub-key $NODEPOOL_PUBKEY $NODEPOOL_KEY_NAME
|
||||
|
||||
export PATH=$NODEPOOL_INSTALL/bin:$PATH
|
||||
|
||||
# start gearman server
|
||||
|
@ -15,6 +15,14 @@ NODEPOOL_PAUSE_OPENSUSE_42_2_DIB=${NODEPOOL_PAUSE_OPENSUSE_42_2_DIB:-true}
|
||||
NODEPOOL_PAUSE_UBUNTU_TRUSTY_DIB=${NODEPOOL_PAUSE_UBUNTU_TRUSTY_DIB:-false}
|
||||
NODEPOOL_PAUSE_UBUNTU_XENIAL_DIB=${NODEPOOL_PAUSE_UBUNTU_XENIAL_DIB:-true}
|
||||
|
||||
function sshintonode {
|
||||
name=$1
|
||||
state='ready'
|
||||
|
||||
node=`$NODEPOOL list | grep $name | grep $state | cut -d '|' -f11 | tr -d ' '`
|
||||
/tmp/ssh_wrapper $node ls /
|
||||
}
|
||||
|
||||
function waitforimage {
|
||||
name=$1
|
||||
state='ready'
|
||||
@ -46,6 +54,8 @@ if [ $NODEPOOL_PAUSE_CENTOS_7_DIB = 'false' ]; then
|
||||
waitforimage centos-7
|
||||
# check image was bootable
|
||||
waitfornode centos-7
|
||||
# check ssh for root user
|
||||
sshintonode centos-7
|
||||
fi
|
||||
|
||||
if [ $NODEPOOL_PAUSE_DEBIAN_JESSIE_DIB = 'false' ]; then
|
||||
@ -53,6 +63,8 @@ if [ $NODEPOOL_PAUSE_DEBIAN_JESSIE_DIB = 'false' ]; then
|
||||
waitforimage debian-jessie
|
||||
# check image was bootable
|
||||
waitfornode debian-jessie
|
||||
# check ssh for root user
|
||||
sshintonode debian-jessie
|
||||
fi
|
||||
|
||||
if [ $NODEPOOL_PAUSE_FEDORA_25_DIB = 'false' ]; then
|
||||
@ -60,6 +72,8 @@ if [ $NODEPOOL_PAUSE_FEDORA_25_DIB = 'false' ]; then
|
||||
waitforimage fedora-25
|
||||
# check image was bootable
|
||||
waitfornode fedora-25
|
||||
# check ssh for root user
|
||||
sshintonode fedora-25
|
||||
fi
|
||||
|
||||
if [ $NODEPOOL_PAUSE_OPENSUSE_42_2_DIB = 'false' ]; then
|
||||
@ -67,6 +81,8 @@ if [ $NODEPOOL_PAUSE_OPENSUSE_42_2_DIB = 'false' ]; then
|
||||
waitforimage opensuse-42.2
|
||||
# check image was bootable
|
||||
waitfornode opensuse-42.2
|
||||
# check ssh for root user
|
||||
sshintonode opensuse-42.2
|
||||
fi
|
||||
|
||||
if [ $NODEPOOL_PAUSE_UBUNTU_TRUSTY_DIB = 'false' ]; then
|
||||
@ -74,6 +90,8 @@ if [ $NODEPOOL_PAUSE_UBUNTU_TRUSTY_DIB = 'false' ]; then
|
||||
waitforimage ubuntu-trusty
|
||||
# check image was bootable
|
||||
waitfornode ubuntu-trusty
|
||||
# check ssh for root user
|
||||
sshintonode ubuntu-trusty
|
||||
fi
|
||||
|
||||
if [ $NODEPOOL_PAUSE_UBUNTU_XENIAL_DIB = 'false' ]; then
|
||||
@ -81,6 +99,8 @@ if [ $NODEPOOL_PAUSE_UBUNTU_XENIAL_DIB = 'false' ]; then
|
||||
waitforimage ubuntu-xenial
|
||||
# check image was bootable
|
||||
waitfornode ubuntu-xenial
|
||||
# check ssh for root user
|
||||
sshintonode ubuntu-xenial
|
||||
fi
|
||||
|
||||
set -o errexit
|
||||
|
Loading…
Reference in New Issue
Block a user