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
|
@ -33,6 +33,20 @@
|
|||
- vpc|failed
|
||||
- 'vpc.msg == "state is present but the following are missing: cidr"'
|
||||
|
||||
- name: test create vpc in check mode
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
display_text: "{{ cs_resource_prefix }}_display_text"
|
||||
cidr: 10.10.0.0/16
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: vpc
|
||||
check_mode: true
|
||||
- name: verify test create vpc in check mode
|
||||
assert:
|
||||
that:
|
||||
- vpc|success
|
||||
- vpc|changed
|
||||
|
||||
- name: test create vpc
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
|
@ -80,6 +94,23 @@
|
|||
- vpc.display_text == "{{ cs_resource_prefix }}_display_text"
|
||||
- vpc.cidr == "10.10.0.0/16"
|
||||
|
||||
- name: test update vpc in check mode
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
display_text: "{{ cs_resource_prefix }}_display_text2"
|
||||
cidr: 10.10.0.0/16
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: vpc
|
||||
check_mode: true
|
||||
- name: verify test update vpc in check mode
|
||||
assert:
|
||||
that:
|
||||
- vpc|success
|
||||
- vpc|changed
|
||||
- vpc.name == "{{ cs_resource_prefix }}_vpc"
|
||||
- vpc.display_text == "{{ cs_resource_prefix }}_display_text"
|
||||
- vpc.cidr == "10.10.0.0/16"
|
||||
|
||||
- name: test update vpc
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
|
@ -112,6 +143,22 @@
|
|||
- vpc.display_text == "{{ cs_resource_prefix }}_display_text2"
|
||||
- vpc.cidr == "10.10.0.0/16"
|
||||
|
||||
- name: test create network in vpc in check mode
|
||||
cs_network:
|
||||
name: "{{ cs_resource_prefix }}_net_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
network_offering: Offering for Isolated Vpc networks with Source Nat service enabled
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
gateway: 10.10.0.1
|
||||
netmask: 255.255.255.0
|
||||
register: vpc_net
|
||||
check_mode: true
|
||||
- name: verify test create network in vpc in check mode
|
||||
assert:
|
||||
that:
|
||||
- vpc_net|success
|
||||
- vpc_net|changed
|
||||
|
||||
- name: test create network in vpc
|
||||
cs_network:
|
||||
name: "{{ cs_resource_prefix }}_net_vpc"
|
||||
|
@ -144,6 +191,21 @@
|
|||
- not vpc_net|changed
|
||||
- vpc_net.name == "{{ cs_resource_prefix }}_net_vpc"
|
||||
|
||||
- name: test create instance in vpc in check mode
|
||||
cs_instance:
|
||||
name: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
template: "{{ cs_common_template }}"
|
||||
service_offering: "{{ cs_common_service_offering }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
register: instance
|
||||
check_mode: true
|
||||
- name: verify test create instance in vpc in check mode
|
||||
assert:
|
||||
that:
|
||||
- instance|success
|
||||
- instance|changed
|
||||
|
||||
- name: test create instance in vpc
|
||||
cs_instance:
|
||||
name: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
|
@ -184,6 +246,21 @@
|
|||
register: ip_address
|
||||
when: instance.public_ip is undefined
|
||||
|
||||
- name: test static nat in vpc in check mode
|
||||
cs_staticnat:
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
register: static_nat
|
||||
check_mode: true
|
||||
- name: verify test static nat in vpc in check mode
|
||||
assert:
|
||||
that:
|
||||
- static_nat|success
|
||||
- static_nat|changed
|
||||
|
||||
- name: test static nat in vpc
|
||||
cs_staticnat:
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
|
@ -212,6 +289,22 @@
|
|||
- static_nat|success
|
||||
- not static_nat|changed
|
||||
|
||||
- name: test remove static nat in vpc in check mode
|
||||
cs_staticnat:
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
state: absent
|
||||
register: static_nat
|
||||
check_mode: true
|
||||
- name: verify test remove static nat in vpc in check mode
|
||||
assert:
|
||||
that:
|
||||
- static_nat|success
|
||||
- static_nat|changed
|
||||
|
||||
- name: test remove static nat in vpc
|
||||
cs_staticnat:
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
|
@ -242,6 +335,23 @@
|
|||
- static_nat|success
|
||||
- not static_nat|changed
|
||||
|
||||
- name: test create port forwarding in vpc in check mode
|
||||
cs_portforward:
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: port_forward
|
||||
check_mode: true
|
||||
- name: verify test create port forwarding in vpc in check mode
|
||||
assert:
|
||||
that:
|
||||
- port_forward|success
|
||||
- port_forward|changed
|
||||
|
||||
- name: test create port forwarding in vpc
|
||||
cs_portforward:
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
|
@ -274,6 +384,24 @@
|
|||
- port_forward|success
|
||||
- not port_forward|changed
|
||||
|
||||
- name: test remove port forwarding in vpc in check mode
|
||||
cs_portforward:
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: port_forward
|
||||
check_mode: true
|
||||
- name: verify test remove port forwarding in vpc in check mode
|
||||
assert:
|
||||
that:
|
||||
- port_forward|success
|
||||
- port_forward|changed
|
||||
|
||||
- name: test remove port forwarding in vpc
|
||||
cs_portforward:
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
|
@ -316,12 +444,27 @@
|
|||
ip_address: "{{ ip_address.ip_address }}"
|
||||
state: absent
|
||||
register: ip_address_removed
|
||||
- name: verify test remove static nat in vpc idempotence
|
||||
- name: verify test remove ip address from vpc
|
||||
assert:
|
||||
that:
|
||||
- ip_address_removed|success
|
||||
- ip_address_removed|changed
|
||||
|
||||
- name: test remove instance in vpc in check mdoe
|
||||
cs_instance:
|
||||
name: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: expunged
|
||||
register: instance
|
||||
check_mode: true
|
||||
- name: verify test remove instance in vpc in check mode
|
||||
assert:
|
||||
that:
|
||||
- instance|success
|
||||
- instance|changed
|
||||
- instance.name == "{{ cs_resource_prefix }}-vm-vpc"
|
||||
- instance.state == "Running"
|
||||
|
||||
- name: test remove instance in vpc
|
||||
cs_instance:
|
||||
name: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
|
@ -348,6 +491,21 @@
|
|||
- instance|success
|
||||
- not instance|changed
|
||||
|
||||
- name: test remove network in vpc in check mode
|
||||
cs_network:
|
||||
name: "{{ cs_resource_prefix }}_net_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
state: absent
|
||||
register: vpc_net
|
||||
check_mode: true
|
||||
- name: verify test remove network in vpc in check mode
|
||||
assert:
|
||||
that:
|
||||
- vpc_net|success
|
||||
- vpc_net|changed
|
||||
- vpc_net.name == "{{ cs_resource_prefix }}_net_vpc"
|
||||
|
||||
- name: test remove network in vpc
|
||||
cs_network:
|
||||
name: "{{ cs_resource_prefix }}_net_vpc"
|
||||
|
@ -375,6 +533,22 @@
|
|||
- vpc_net|success
|
||||
- not vpc_net|changed
|
||||
|
||||
- name: test remove vpc in check mode
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
state: absent
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: vpc
|
||||
check_mode: true
|
||||
- name: verify test remove vpc in check mode
|
||||
assert:
|
||||
that:
|
||||
- vpc|success
|
||||
- vpc|changed
|
||||
- vpc.name == "{{ cs_resource_prefix }}_vpc"
|
||||
- vpc.display_text == "{{ cs_resource_prefix }}_display_text2"
|
||||
- vpc.cidr == "10.10.0.0/16"
|
||||
|
||||
- name: test remove vpc
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue