mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
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:
parent
2af5556901
commit
d5b04aa1f1
32 changed files with 1838 additions and 33 deletions
|
@ -32,6 +32,22 @@
|
|||
- pod|failed
|
||||
- "pod.msg == 'missing required arguments: name'"
|
||||
|
||||
|
||||
- name: test create pod in check mode
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
zone: "{{ cs_resource_prefix }}-zone"
|
||||
start_ip: 10.100.10.101
|
||||
gateway: 10.100.10.1
|
||||
netmask: 255.255.255.0
|
||||
register: pod_origin
|
||||
check_mode: true
|
||||
- name: verify test create pod in check mode
|
||||
assert:
|
||||
that:
|
||||
- pod_origin|changed
|
||||
- pod_origin.zone == "{{ cs_resource_prefix }}-zone"
|
||||
|
||||
- name: test create pod
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
|
@ -70,6 +86,26 @@
|
|||
- pod.netmask == "255.255.255.0"
|
||||
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
||||
|
||||
- name: test update pod in check mode
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
zone: "{{ cs_resource_prefix }}-zone"
|
||||
start_ip: 10.100.10.102
|
||||
gateway: 10.100.10.1
|
||||
netmask: 255.255.255.0
|
||||
register: pod
|
||||
check_mode: true
|
||||
- name: verify test update pod in check mode
|
||||
assert:
|
||||
that:
|
||||
- pod|changed
|
||||
- pod.allocation_state == "Enabled"
|
||||
- pod.start_ip == "10.100.10.101"
|
||||
- pod.end_ip == "10.100.10.254"
|
||||
- pod.gateway == "10.100.10.1"
|
||||
- pod.netmask == "255.255.255.0"
|
||||
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
||||
|
||||
- name: test update pod
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
|
@ -108,6 +144,25 @@
|
|||
- pod.netmask == "255.255.255.0"
|
||||
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
||||
|
||||
- name: test disable pod in check mode
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
zone: "{{ cs_resource_prefix }}-zone"
|
||||
state: disabled
|
||||
register: pod
|
||||
check_mode: true
|
||||
- name: verify test enable pod in check mode
|
||||
assert:
|
||||
that:
|
||||
- pod|changed
|
||||
- pod.allocation_state == "Enabled"
|
||||
- pod.id == pod_origin.id
|
||||
- pod.start_ip == "10.100.10.102"
|
||||
- pod.end_ip == "10.100.10.254"
|
||||
- pod.gateway == "10.100.10.1"
|
||||
- pod.netmask == "255.255.255.0"
|
||||
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
||||
|
||||
- name: test disable pod
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
|
@ -144,6 +199,25 @@
|
|||
- pod.netmask == "255.255.255.0"
|
||||
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
||||
|
||||
- name: test enable pod in check mode
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
zone: "{{ cs_resource_prefix }}-zone"
|
||||
state: enabled
|
||||
register: pod
|
||||
check_mode: true
|
||||
- name: verify test disable pod in check mode
|
||||
assert:
|
||||
that:
|
||||
- pod|changed
|
||||
- pod.allocation_state == "Disabled"
|
||||
- pod.id == pod_origin.id
|
||||
- pod.start_ip == "10.100.10.102"
|
||||
- pod.end_ip == "10.100.10.254"
|
||||
- pod.gateway == "10.100.10.1"
|
||||
- pod.netmask == "255.255.255.0"
|
||||
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
||||
|
||||
- name: test enable pod
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
|
@ -181,6 +255,25 @@
|
|||
- pod.netmask == "255.255.255.0"
|
||||
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
||||
|
||||
- name: test absent pod in check mode
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
zone: "{{ cs_resource_prefix }}-zone"
|
||||
state: absent
|
||||
register: pod
|
||||
check_mode: true
|
||||
- name: verify test create pod in check mode
|
||||
assert:
|
||||
that:
|
||||
- pod|changed
|
||||
- pod.id == pod_origin.id
|
||||
- pod.allocation_state == "Enabled"
|
||||
- pod.start_ip == "10.100.10.102"
|
||||
- pod.end_ip == "10.100.10.254"
|
||||
- pod.gateway == "10.100.10.1"
|
||||
- pod.netmask == "255.255.255.0"
|
||||
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
||||
|
||||
- name: test absent pod
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue