cloudstack: test_cs_instance: make it more configurable

pull/12058/head
Rene Moser 9 years ago
parent 15a7f818e1
commit eb44f85dc8

@ -1,2 +1,5 @@
---
instance_number: 1
test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
test_cs_instance_offering_1: Small Instance
test_cs_instance_offering_2: Medium Instance

@ -1,11 +1,6 @@
---
- include: setup.yml
tags: any
- include: present.yml
tags: test_cs_instance_present
#- include: tags.yml
# tags: test_cs_instance_tags
- include: absent.yml
tags: test_cs_instance_absent
- include: cleanup.yml
tags: test_cs_instance_cleanup

@ -2,8 +2,8 @@
- name: test create instance
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
template: Linux Debian 7 64-bit
service_offering: Tiny
template: "{{ test_cs_instance_template }}"
service_offering: "{{ test_cs_instance_offering_1 }}"
affinity_group: "{{ cs_resource_prefix }}-ag"
security_group: "{{ cs_resource_prefix }}-sg"
ssh_key: "{{ cs_resource_prefix }}-sshkey"
@ -16,7 +16,7 @@
- instance|changed
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.display_name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.service_offering == "Tiny"
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
- instance.state == "Running"
- instance.ssh_key == "{{ cs_resource_prefix }}-sshkey"
- not instance.tags
@ -25,8 +25,8 @@
- name: test create instance idempotence
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
template: Linux Debian 7 64-bit
service_offering: Tiny
template: "{{ test_cs_instance_template }}"
service_offering: "{{ test_cs_instance_offering_1 }}"
affinity_group: "{{ cs_resource_prefix }}-ag"
security_group: "{{ cs_resource_prefix }}-sg"
ssh_key: "{{ cs_resource_prefix }}-sshkey"
@ -39,7 +39,7 @@
- not instance|changed
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.display_name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.service_offering == "Tiny"
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
- instance.state == "Running"
- instance.ssh_key == "{{ cs_resource_prefix }}-sshkey"
- not instance.tags
@ -48,7 +48,7 @@
- name: test running instance not updated
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
service_offering: Micro
service_offering: "{{ test_cs_instance_offering_2 }}"
register: instance
- name: verify running instance not updated
assert:
@ -57,7 +57,7 @@
- not instance|changed
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.display_name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.service_offering == "Tiny"
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
- instance.state == "Running"
@ -73,7 +73,7 @@
- instance|changed
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.display_name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.service_offering == "Tiny"
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
- instance.state == "Stopped"
@ -94,7 +94,7 @@
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
display_name: "{{ cs_resource_prefix }}-display-{{ instance_number }}"
service_offering: Micro
service_offering: "{{ test_cs_instance_offering_2 }}"
register: instance
- name: verify updating stopped instance
assert:
@ -103,7 +103,7 @@
- instance|changed
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.display_name == "{{ cs_resource_prefix }}-display-{{ instance_number }}"
- instance.service_offering == "Micro"
- instance.service_offering == "{{ test_cs_instance_offering_2 }}"
- instance.state == "Stopped"
@ -119,7 +119,7 @@
- instance|changed
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.display_name == "{{ cs_resource_prefix }}-display-{{ instance_number }}"
- instance.service_offering == "Micro"
- instance.service_offering == "{{ test_cs_instance_offering_2 }}"
- instance.state == "Running"
@ -138,7 +138,7 @@
- name: test force update running instance
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
service_offering: Tiny
service_offering: "{{ test_cs_instance_offering_1 }}"
force: true
register: instance
- name: verify force update running instance
@ -148,13 +148,13 @@
- instance|changed
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.display_name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.service_offering == "Tiny"
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
- instance.state == "Running"
- name: test force update running instance idempotence
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
service_offering: Tiny
service_offering: "{{ test_cs_instance_offering_1 }}"
force: true
register: instance
- name: verify force update running instance idempotence
@ -164,5 +164,5 @@
- not instance|changed
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.display_name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
- instance.service_offering == "Tiny"
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
- instance.state == "Running"

Loading…
Cancel
Save