From eb44f85dc8e18b1af43870c7eb33c8e61fe0619e Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Sun, 23 Aug 2015 22:49:45 +0200 Subject: [PATCH] cloudstack: test_cs_instance: make it more configurable --- .../roles/test_cs_instance/defaults/main.yml | 3 ++ .../roles/test_cs_instance/tasks/main.yml | 5 --- .../roles/test_cs_instance/tasks/present.yml | 32 +++++++++---------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/test/integration/roles/test_cs_instance/defaults/main.yml b/test/integration/roles/test_cs_instance/defaults/main.yml index 585947ab43e..bb2f5c9d824 100644 --- a/test/integration/roles/test_cs_instance/defaults/main.yml +++ b/test/integration/roles/test_cs_instance/defaults/main.yml @@ -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 diff --git a/test/integration/roles/test_cs_instance/tasks/main.yml b/test/integration/roles/test_cs_instance/tasks/main.yml index 479ea01c15d..a457a3c710c 100644 --- a/test/integration/roles/test_cs_instance/tasks/main.yml +++ b/test/integration/roles/test_cs_instance/tasks/main.yml @@ -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 diff --git a/test/integration/roles/test_cs_instance/tasks/present.yml b/test/integration/roles/test_cs_instance/tasks/present.yml index 4337f0acf4d..10242a57fd2 100644 --- a/test/integration/roles/test_cs_instance/tasks/present.yml +++ b/test/integration/roles/test_cs_instance/tasks/present.yml @@ -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"