shaker/scenarios/misc/instance_metadata.yaml
Ilya Shakhat 37ac860fb8 Terminate if accommodation is not satisfied
Also rename parameter 'vm_accommodation' into 'accommodation'.

Change-Id: I362213023f2fd7bdb7133044d67ffddd18571884
2015-04-24 18:32:57 +03:00

27 lines
762 B
YAML

description:
This scenario launches instances on a single compute node and retrieves
their metadata.
deployment:
template: instance_metadata.hot
accommodation: [single_room, density: 2, compute_nodes: 1]
execution:
tests:
-
title: Instance Metadata
class: shell
script: |
#!/bin/sh
metadata=`curl http://169.254.169.254/latest/meta-data/ 2>/dev/null`
echo "{"
for line in ${metadata}; do
val=`curl http://169.254.169.254/latest/meta-data/$line 2>/dev/null | tr "\n" ","`
echo "\"$line\": \"${val}\","
done
key=`curl http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key 2>/dev/null | tr "\n" ""`
echo "\"public-keys/0/openssh-key\": \"${key}\""
echo "}"