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:
parent
8b5e553828
commit
b0525da8c8
2 changed files with 33 additions and 1 deletions
|
@ -3,4 +3,4 @@ test_cs_instance_1: "{{ cs_resource_prefix }}-vm1"
|
||||||
test_cs_instance_2: "{{ cs_resource_prefix }}-vm2"
|
test_cs_instance_2: "{{ cs_resource_prefix }}-vm2"
|
||||||
test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
|
test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
|
||||||
test_cs_instance_offering_1: Small Instance
|
test_cs_instance_offering_1: Small Instance
|
||||||
test_cs_disk_offering_1: Small
|
test_cs_disk_offering_1: Custom
|
||||||
|
|
|
@ -43,22 +43,54 @@
|
||||||
cs_volume:
|
cs_volume:
|
||||||
name: "{{ cs_resource_prefix }}_vol"
|
name: "{{ cs_resource_prefix }}_vol"
|
||||||
disk_offering: "{{ test_cs_disk_offering_1 }}"
|
disk_offering: "{{ test_cs_disk_offering_1 }}"
|
||||||
|
size: 20
|
||||||
register: vol
|
register: vol
|
||||||
- name: verify results test create volume
|
- name: verify results test create volume
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- vol|changed
|
- vol|changed
|
||||||
|
- vol.size == 20 * 1024 ** 3
|
||||||
- vol.name == "{{ cs_resource_prefix }}_vol"
|
- vol.name == "{{ cs_resource_prefix }}_vol"
|
||||||
|
|
||||||
- name: test create volume idempotence
|
- name: test create volume idempotence
|
||||||
cs_volume:
|
cs_volume:
|
||||||
name: "{{ cs_resource_prefix }}_vol"
|
name: "{{ cs_resource_prefix }}_vol"
|
||||||
disk_offering: "{{ test_cs_disk_offering_1 }}"
|
disk_offering: "{{ test_cs_disk_offering_1 }}"
|
||||||
|
size: 20
|
||||||
register: vol
|
register: vol
|
||||||
- name: verify results test create volume idempotence
|
- name: verify results test create volume idempotence
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- not vol|changed
|
- 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"
|
- vol.name == "{{ cs_resource_prefix }}_vol"
|
||||||
|
|
||||||
- name: test attach volume
|
- name: test attach volume
|
||||||
|
|
Loading…
Reference in a new issue