1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

cloudstack: cs_volume: add tests for volume resize

See https://github.com/ansible/ansible-modules-extras/pull/1333
This commit is contained in:
Rene Moser 2015-12-05 15:19:43 +01:00
parent 8b5e553828
commit b0525da8c8
2 changed files with 33 additions and 1 deletions

View file

@ -3,4 +3,4 @@ test_cs_instance_1: "{{ cs_resource_prefix }}-vm1"
test_cs_instance_2: "{{ cs_resource_prefix }}-vm2"
test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
test_cs_instance_offering_1: Small Instance
test_cs_disk_offering_1: Small
test_cs_disk_offering_1: Custom

View file

@ -43,22 +43,54 @@
cs_volume:
name: "{{ cs_resource_prefix }}_vol"
disk_offering: "{{ test_cs_disk_offering_1 }}"
size: 20
register: vol
- name: verify results test create volume
assert:
that:
- vol|changed
- vol.size == 20 * 1024 ** 3
- vol.name == "{{ cs_resource_prefix }}_vol"
- name: test create volume idempotence
cs_volume:
name: "{{ cs_resource_prefix }}_vol"
disk_offering: "{{ test_cs_disk_offering_1 }}"
size: 20
register: vol
- name: verify results test create volume idempotence
assert:
that:
- not vol|changed
- vol.size == 20 * 1024 ** 3
- vol.name == "{{ cs_resource_prefix }}_vol"
- name: test shrink volume
cs_volume:
name: "{{ cs_resource_prefix }}_vol"
disk_offering: "{{ test_cs_disk_offering_1 }}"
size: 10
shrink_ok: yes
register: vol
- name: verify results test create volume
assert:
that:
- vol|changed
- vol.size == 10 * 1024 ** 3
- vol.name == "{{ cs_resource_prefix }}_vol"
- name: test shrink volume idempotence
cs_volume:
name: "{{ cs_resource_prefix }}_vol"
disk_offering: "{{ test_cs_disk_offering_1 }}"
size: 10
shrink_ok: yes
register: vol
- name: verify results test create volume
assert:
that:
- not vol|changed
- vol.size == 10 * 1024 ** 3
- vol.name == "{{ cs_resource_prefix }}_vol"
- name: test attach volume