cloudstack: add check mode tests (#24908)

* cloudstack: test: cs_network_acl: add check_mode tests

* cloudstack: test: cs_pod: add check_mode tests

* cloudstack: test: cs_user: add check_mode tests

* cloudstack: test: cs_sshkeypair: add check_mode tests

* cloudstack: test: cs_project: add check_mode tests

* cloudstack: test: cs_vpc: add check_mode tests

* cloudstack: test: cs_vpn_gateway: add check_mode tests

* cloudstack: test: cs_volume: add check_mode tests

* cloudstack: test: cs_vmsnapshot: add check_mode tests

* cloudstack: test: cs_account: add check_mode tests

* cloudstack: test: cs_affinitygroup: add check_mode tests

* cloudstack: test: cs_cluster: add check_mode tests

* cloudstack: test: cs_domain: add check_mode tests

* cloudstack: test: cs_instancegroup: add check_mode tests

* cloudstack: test: cs_iso: add check_mode tests

* cloudstack: test: cs_loadbalancer_rule: add check_mode tests

* cloudstack: test: cs_portforward: add check_mode tests

* cloudstack: test: cs_resourcelimit: add check_mode tests

* cloudstack: test: cs_securitygroup: add check_mode tests

* cloudstack: test: cs_securitygroup_rule: add check_mode tests

* cloudstack: test: cs_configuration: add check_mode tests

* cloudstack: test: cs_firewall: add check_mode tests

* cloudstack: test: cs_instance: add check_mode tests

* cloudstack: query current tags from API

Fixes unexpected tags returned in check mode.
This commit is contained in:
René Moser 2017-05-26 12:19:47 +02:00 committed by GitHub
commit d5b04aa1f1
32 changed files with 1838 additions and 33 deletions

View file

@ -31,6 +31,18 @@
- snap|failed
- 'snap.msg.startswith("missing required arguments: ")'
- name: test create snapshot in check mode
cs_vmsnapshot:
name: "{{ cs_resource_prefix }}_snapshot"
vm: "{{ cs_resource_prefix }}-vm-snapshot"
snapshot_memory: yes
register: snap
check_mode: true
- name: verify test create snapshot in check mode
assert:
that:
- snap|changed
- name: test create snapshot
cs_vmsnapshot:
name: "{{ cs_resource_prefix }}_snapshot"
@ -55,6 +67,19 @@
- not snap|changed
- snap.display_name == "{{ cs_resource_prefix }}_snapshot"
- name: test revert snapshot in check mode
cs_vmsnapshot:
name: "{{ cs_resource_prefix }}_snapshot"
vm: "{{ cs_resource_prefix }}-vm-snapshot"
state: revert
register: snap
check_mode: true
- name: verify test revert snapshot in check mode
assert:
that:
- snap|changed
- snap.display_name == "{{ cs_resource_prefix }}_snapshot"
- name: test revert snapshot
cs_vmsnapshot:
name: "{{ cs_resource_prefix }}_snapshot"
@ -67,6 +92,19 @@
- snap|changed
- snap.display_name == "{{ cs_resource_prefix }}_snapshot"
- name: test remove snapshot in check mode
cs_vmsnapshot:
name: "{{ cs_resource_prefix }}_snapshot"
vm: "{{ cs_resource_prefix }}-vm-snapshot"
state: absent
register: snap
check_mode: true
- name: verify test remove snapshot in check mode
assert:
that:
- snap|changed
- snap.display_name == "{{ cs_resource_prefix }}_snapshot"
- name: test remove snapshot
cs_vmsnapshot:
name: "{{ cs_resource_prefix }}_snapshot"