validate-simple: small improvements

* silence the console output from curl but keep error output to avoid
  garbled download output in the logs
* acquire the floating IP address from the stack output to test the same
  way as tripleo-ci
* follow up the heat template differences (key -> key_pair)

Change-Id: I4c2bbbc3d542bf62f375d81f70069dff2490fc36
This commit is contained in:
Attila Darazs 2017-01-30 17:01:43 +01:00
parent 5a0e394294
commit 9ddd43f440
2 changed files with 33 additions and 16 deletions

View File

@ -54,9 +54,9 @@ fi
IMAGE_PATH={{ validate_image_dir }}/cirros.img
INITRAMFS_PATH={{ validate_image_dir }}/cirros.initramfs
KERNEL_PATH={{ validate_image_dir }}/cirros.kernel
curl -L -o $IMAGE_PATH {{ validate_image_url }}{{ image_disk }}
curl -L -o $INITRAMFS_PATH {{ validate_image_url }}{{ image_initramfs }}
curl -L -o $KERNEL_PATH {{ validate_image_url }}{{ image_kernel }}
curl -L -s -S -o $IMAGE_PATH {{ validate_image_url }}{{ image_disk }}
curl -L -s -S -o $INITRAMFS_PATH {{ validate_image_url }}{{ image_initramfs }}
curl -L -s -S -o $KERNEL_PATH {{ validate_image_url }}{{ image_kernel }}
## * Upload cirros image into glance
## ::
@ -99,25 +99,41 @@ fi
heat stack-create {{ validate_stack_name }} --template-file {{ working_dir }}/tenantvm_floatingip.yaml
## * Wait for the stack creation to complete
## * Give time to the instance to boot
### --stop_docs
# wait for stack complete or failed
/bin/bash /usr/libexec/openstack-tripleo/wait_for -w 600 --delay 30 \
--success-match {{ validate_success_status }} -- heat stack-show {{ validate_stack_name }}
# let time to the instance to boot
sleep 30
### --start_docs
## * Get the floating ip
## ::
novaid=`nova list|grep {{ validate_server_name }} |awk '{print $2}'`
floating_ip=`nova floating-ip-list | grep $novaid | awk '{print $4}'`
nova console-log {{ validate_server_name }}
ping -c 1 $floating_ip
nova show {{ validate_server_name }} || :
nova service-list || :
neutron agent-list ||:
nova console-log {{ validate_server_name }}
### --stop_docs
set +e
### --start_docs
vm1_ip=`openstack stack output show {{ validate_stack_name }} server1_public_ip --f json | \
jq -r '.["output_value"]'`
ping -c 1 $vm1_ip
## * Print debug output if ping fails
## ::
if [ "$?" == "0" ]; then
echo "Overcloud pingtest, SUCCESS"
exit 0
else
nova console-log {{ validate_server_name }}
nova show {{ validate_server_name }}
nova service-list
neutron agent-list
openstack stack show {{ validate_stack_name }}
echo "Overcloud pingtest, FAIL"
exit 1
fi
### --stop_docs

View File

@ -47,7 +47,8 @@ parameters:
{% endif %}
resources:
key:
key_pair:
type: OS::Nova::KeyPair
properties:
save_private_key: true
@ -100,7 +101,7 @@ resources:
{% else %}
flavor: { get_resource: test_flavor }
{% endif %}
key_name: { get_resource: key }
key_name: { get_resource: key_pair }
networks:
- port: { get_resource: server1_port }