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_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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue