Merge "Add functional test for key-name and glean"
This commit is contained in:
commit
db27ad2c8f
@ -15,6 +15,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
NODEPOOL_KEY=$HOME/.ssh/id_nodepool
|
NODEPOOL_KEY=$HOME/.ssh/id_nodepool
|
||||||
|
NODEPOOL_KEY_NAME=root
|
||||||
NODEPOOL_PUBKEY=$HOME/.ssh/id_nodepool.pub
|
NODEPOOL_PUBKEY=$HOME/.ssh/id_nodepool.pub
|
||||||
NODEPOOL_INSTALL=$HOME/nodepool-venv
|
NODEPOOL_INSTALL=$HOME/nodepool-venv
|
||||||
NODEPOOL_CACHE_GET_PIP=/opt/stack/cache/files/get-pip.py
|
NODEPOOL_CACHE_GET_PIP=/opt/stack/cache/files/get-pip.py
|
||||||
@ -78,6 +79,13 @@ function nodepool_create_keypairs {
|
|||||||
if [[ ! -f $NODEPOOL_KEY ]]; then
|
if [[ ! -f $NODEPOOL_KEY ]]; then
|
||||||
ssh-keygen -f $NODEPOOL_KEY -P ""
|
ssh-keygen -f $NODEPOOL_KEY -P ""
|
||||||
fi
|
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 {
|
function nodepool_write_elements {
|
||||||
@ -278,36 +286,42 @@ providers:
|
|||||||
username: devuser
|
username: devuser
|
||||||
private-key: $NODEPOOL_KEY
|
private-key: $NODEPOOL_KEY
|
||||||
config-drive: true
|
config-drive: true
|
||||||
|
key-name: $NODEPOOL_KEY_NAME
|
||||||
- name: debian-jessie
|
- name: debian-jessie
|
||||||
min-ram: 512
|
min-ram: 512
|
||||||
name-filter: 'nodepool'
|
name-filter: 'nodepool'
|
||||||
username: devuser
|
username: devuser
|
||||||
private-key: $NODEPOOL_KEY
|
private-key: $NODEPOOL_KEY
|
||||||
config-drive: true
|
config-drive: true
|
||||||
|
key-name: $NODEPOOL_KEY_NAME
|
||||||
- name: fedora-25
|
- name: fedora-25
|
||||||
min-ram: 1024
|
min-ram: 1024
|
||||||
name-filter: 'nodepool'
|
name-filter: 'nodepool'
|
||||||
username: devuser
|
username: devuser
|
||||||
private-key: $NODEPOOL_KEY
|
private-key: $NODEPOOL_KEY
|
||||||
config-drive: true
|
config-drive: true
|
||||||
|
key-name: $NODEPOOL_KEY_NAME
|
||||||
- name: opensuse-42.2
|
- name: opensuse-42.2
|
||||||
min-ram: 1024
|
min-ram: 1024
|
||||||
name-filter: 'nodepool'
|
name-filter: 'nodepool'
|
||||||
username: devuser
|
username: devuser
|
||||||
private-key: $NODEPOOL_KEY
|
private-key: $NODEPOOL_KEY
|
||||||
config-drive: true
|
config-drive: true
|
||||||
|
key-name: $NODEPOOL_KEY_NAME
|
||||||
- name: ubuntu-trusty
|
- name: ubuntu-trusty
|
||||||
min-ram: 512
|
min-ram: 512
|
||||||
name-filter: 'nodepool'
|
name-filter: 'nodepool'
|
||||||
username: devuser
|
username: devuser
|
||||||
private-key: $NODEPOOL_KEY
|
private-key: $NODEPOOL_KEY
|
||||||
config-drive: true
|
config-drive: true
|
||||||
|
key-name: $NODEPOOL_KEY_NAME
|
||||||
- name: ubuntu-xenial
|
- name: ubuntu-xenial
|
||||||
min-ram: 512
|
min-ram: 512
|
||||||
name-filter: 'nodepool'
|
name-filter: 'nodepool'
|
||||||
username: devuser
|
username: devuser
|
||||||
private-key: $NODEPOOL_KEY
|
private-key: $NODEPOOL_KEY
|
||||||
config-drive: true
|
config-drive: true
|
||||||
|
key-name: $NODEPOOL_KEY_NAME
|
||||||
|
|
||||||
diskimages:
|
diskimages:
|
||||||
- name: centos-7
|
- name: centos-7
|
||||||
@ -502,6 +516,10 @@ function start_nodepool {
|
|||||||
secgroup-add-rule default udp 1 65535 0.0.0.0/0
|
secgroup-add-rule default udp 1 65535 0.0.0.0/0
|
||||||
fi
|
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
|
export PATH=$NODEPOOL_INSTALL/bin:$PATH
|
||||||
|
|
||||||
# start gearman server
|
# 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_TRUSTY_DIB=${NODEPOOL_PAUSE_UBUNTU_TRUSTY_DIB:-false}
|
||||||
NODEPOOL_PAUSE_UBUNTU_XENIAL_DIB=${NODEPOOL_PAUSE_UBUNTU_XENIAL_DIB:-true}
|
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 {
|
function waitforimage {
|
||||||
name=$1
|
name=$1
|
||||||
state='ready'
|
state='ready'
|
||||||
@ -46,6 +54,8 @@ if [ $NODEPOOL_PAUSE_CENTOS_7_DIB = 'false' ]; then
|
|||||||
waitforimage centos-7
|
waitforimage centos-7
|
||||||
# check image was bootable
|
# check image was bootable
|
||||||
waitfornode centos-7
|
waitfornode centos-7
|
||||||
|
# check ssh for root user
|
||||||
|
sshintonode centos-7
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $NODEPOOL_PAUSE_DEBIAN_JESSIE_DIB = 'false' ]; then
|
if [ $NODEPOOL_PAUSE_DEBIAN_JESSIE_DIB = 'false' ]; then
|
||||||
@ -53,6 +63,8 @@ if [ $NODEPOOL_PAUSE_DEBIAN_JESSIE_DIB = 'false' ]; then
|
|||||||
waitforimage debian-jessie
|
waitforimage debian-jessie
|
||||||
# check image was bootable
|
# check image was bootable
|
||||||
waitfornode debian-jessie
|
waitfornode debian-jessie
|
||||||
|
# check ssh for root user
|
||||||
|
sshintonode debian-jessie
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $NODEPOOL_PAUSE_FEDORA_25_DIB = 'false' ]; then
|
if [ $NODEPOOL_PAUSE_FEDORA_25_DIB = 'false' ]; then
|
||||||
@ -60,6 +72,8 @@ if [ $NODEPOOL_PAUSE_FEDORA_25_DIB = 'false' ]; then
|
|||||||
waitforimage fedora-25
|
waitforimage fedora-25
|
||||||
# check image was bootable
|
# check image was bootable
|
||||||
waitfornode fedora-25
|
waitfornode fedora-25
|
||||||
|
# check ssh for root user
|
||||||
|
sshintonode fedora-25
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $NODEPOOL_PAUSE_OPENSUSE_42_2_DIB = 'false' ]; then
|
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
|
waitforimage opensuse-42.2
|
||||||
# check image was bootable
|
# check image was bootable
|
||||||
waitfornode opensuse-42.2
|
waitfornode opensuse-42.2
|
||||||
|
# check ssh for root user
|
||||||
|
sshintonode opensuse-42.2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $NODEPOOL_PAUSE_UBUNTU_TRUSTY_DIB = 'false' ]; then
|
if [ $NODEPOOL_PAUSE_UBUNTU_TRUSTY_DIB = 'false' ]; then
|
||||||
@ -74,6 +90,8 @@ if [ $NODEPOOL_PAUSE_UBUNTU_TRUSTY_DIB = 'false' ]; then
|
|||||||
waitforimage ubuntu-trusty
|
waitforimage ubuntu-trusty
|
||||||
# check image was bootable
|
# check image was bootable
|
||||||
waitfornode ubuntu-trusty
|
waitfornode ubuntu-trusty
|
||||||
|
# check ssh for root user
|
||||||
|
sshintonode ubuntu-trusty
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $NODEPOOL_PAUSE_UBUNTU_XENIAL_DIB = 'false' ]; then
|
if [ $NODEPOOL_PAUSE_UBUNTU_XENIAL_DIB = 'false' ]; then
|
||||||
@ -81,6 +99,8 @@ if [ $NODEPOOL_PAUSE_UBUNTU_XENIAL_DIB = 'false' ]; then
|
|||||||
waitforimage ubuntu-xenial
|
waitforimage ubuntu-xenial
|
||||||
# check image was bootable
|
# check image was bootable
|
||||||
waitfornode ubuntu-xenial
|
waitfornode ubuntu-xenial
|
||||||
|
# check ssh for root user
|
||||||
|
sshintonode ubuntu-xenial
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
Loading…
Reference in New Issue
Block a user