mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
automated integration tests for cloudstack (#20552)
This commit is contained in:
parent
b58cf0d23a
commit
aaf4f04574
92 changed files with 1248 additions and 193 deletions
101
test/integration/targets/cs_vmsnapshot/tasks/main.yml
Normal file
101
test/integration/targets/cs_vmsnapshot/tasks/main.yml
Normal file
|
@ -0,0 +1,101 @@
|
|||
---
|
||||
- name: setup instance
|
||||
cs_instance:
|
||||
name: "{{ cs_resource_prefix }}-vm-snapshot"
|
||||
template: "{{ test_cs_instance_template }}"
|
||||
service_offering: "{{ test_cs_instance_offering_1 }}"
|
||||
register: instance
|
||||
- name: verify create instance
|
||||
assert:
|
||||
that:
|
||||
- instance|success
|
||||
|
||||
- name: ensure no snapshot exists
|
||||
cs_vmsnapshot:
|
||||
name: "{{ cs_resource_prefix }}_snapshot"
|
||||
vm: "{{ cs_resource_prefix }}-vm-snapshot"
|
||||
state: absent
|
||||
register: snap
|
||||
- name: verify setup
|
||||
assert:
|
||||
that:
|
||||
- snap|success
|
||||
|
||||
- name: test fail if missing name
|
||||
action: cs_vmsnapshot
|
||||
register: snap
|
||||
ignore_errors: true
|
||||
- name: verify results of fail if missing params
|
||||
assert:
|
||||
that:
|
||||
- snap|failed
|
||||
- 'snap.msg == "missing required arguments: vm,name"'
|
||||
|
||||
- name: test create snapshot
|
||||
cs_vmsnapshot:
|
||||
name: "{{ cs_resource_prefix }}_snapshot"
|
||||
vm: "{{ cs_resource_prefix }}-vm-snapshot"
|
||||
snapshot_memory: yes
|
||||
register: snap
|
||||
- name: verify test create snapshot
|
||||
assert:
|
||||
that:
|
||||
- snap|changed
|
||||
- snap.display_name == "{{ cs_resource_prefix }}_snapshot"
|
||||
|
||||
- name: test create snapshot idempotence
|
||||
cs_vmsnapshot:
|
||||
name: "{{ cs_resource_prefix }}_snapshot"
|
||||
vm: "{{ cs_resource_prefix }}-vm-snapshot"
|
||||
snapshot_memory: yes
|
||||
register: snap
|
||||
- name: verify test create snapshot idempotence
|
||||
assert:
|
||||
that:
|
||||
- not snap|changed
|
||||
- snap.display_name == "{{ cs_resource_prefix }}_snapshot"
|
||||
|
||||
- name: test revert snapshot
|
||||
cs_vmsnapshot:
|
||||
name: "{{ cs_resource_prefix }}_snapshot"
|
||||
vm: "{{ cs_resource_prefix }}-vm-snapshot"
|
||||
state: revert
|
||||
register: snap
|
||||
- name: verify test revert snapshot
|
||||
assert:
|
||||
that:
|
||||
- snap|changed
|
||||
- snap.display_name == "{{ cs_resource_prefix }}_snapshot"
|
||||
|
||||
- name: test remove snapshot
|
||||
cs_vmsnapshot:
|
||||
name: "{{ cs_resource_prefix }}_snapshot"
|
||||
vm: "{{ cs_resource_prefix }}-vm-snapshot"
|
||||
state: absent
|
||||
register: snap
|
||||
- name: verify test remove snapshot
|
||||
assert:
|
||||
that:
|
||||
- snap|changed
|
||||
- snap.display_name == "{{ cs_resource_prefix }}_snapshot"
|
||||
|
||||
- name: test remove snapshot idempotence
|
||||
cs_vmsnapshot:
|
||||
name: "{{ cs_resource_prefix }}_snapshot"
|
||||
vm: "{{ cs_resource_prefix }}-vm-snapshot"
|
||||
state: absent
|
||||
register: snap
|
||||
- name: verify test remove snapshot idempotence
|
||||
assert:
|
||||
that:
|
||||
- not snap|changed
|
||||
|
||||
- name: cleanup instance
|
||||
cs_instance:
|
||||
name: "{{ cs_resource_prefix }}-vm-snapshot"
|
||||
state: expunged
|
||||
register: instance
|
||||
- name: verify destroy instance
|
||||
assert:
|
||||
that:
|
||||
- instance|success
|
Loading…
Add table
Add a link
Reference in a new issue