mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-08 22:30:04 -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
|
@ -59,6 +59,22 @@
|
|||
- lb|failed
|
||||
- "lb.msg.startswith('missing required arguments: ')"
|
||||
|
||||
|
||||
- name: test create rule in check mode
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
public_ip: "{{ ip_address.ip_address }}"
|
||||
algorithm: roundrobin
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
register: lb
|
||||
check_mode: true
|
||||
- name: verify test create rule in check mode
|
||||
assert:
|
||||
that:
|
||||
- lb|success
|
||||
- lb|changed
|
||||
|
||||
- name: test create rule
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
|
@ -97,6 +113,26 @@
|
|||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
|
||||
- name: test update rule in check mode
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
public_ip: "{{ ip_address.ip_address }}"
|
||||
algorithm: source
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
register: lb
|
||||
check_mode: true
|
||||
- name: verify test update rule in check mode
|
||||
assert:
|
||||
that:
|
||||
- lb|success
|
||||
- lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "roundrobin"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
|
||||
- name: test update rule
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
|
@ -145,6 +181,24 @@
|
|||
- lb|failed
|
||||
- "lb.msg.startswith('missing required arguments: ')"
|
||||
|
||||
- name: test add members to rule in check mode
|
||||
cs_loadbalancer_rule_member:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
vm: "{{ cs_resource_prefix }}-vm-lb"
|
||||
register: lb
|
||||
check_mode: true
|
||||
- name: verify add members to rule in check mode
|
||||
assert:
|
||||
that:
|
||||
- lb|success
|
||||
- lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "source"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
- "'{{ cs_resource_prefix }}-vm-lb' not in lb.vms"
|
||||
|
||||
- name: test add members to rule
|
||||
cs_loadbalancer_rule_member:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
|
@ -179,6 +233,25 @@
|
|||
- lb.private_port == 8080
|
||||
- "'{{ cs_resource_prefix }}-vm-lb' in lb.vms"
|
||||
|
||||
- name: test remove members to rule in check mode
|
||||
cs_loadbalancer_rule_member:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
vm: "{{ cs_resource_prefix }}-vm-lb"
|
||||
state: absent
|
||||
register: lb
|
||||
check_mode: true
|
||||
- name: verify remove members to rule in check mode
|
||||
assert:
|
||||
that:
|
||||
- lb|success
|
||||
- lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "source"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
- "'{{ cs_resource_prefix }}-vm-lb' in lb.vms"
|
||||
|
||||
- name: test remove members to rule
|
||||
cs_loadbalancer_rule_member:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
|
@ -209,6 +282,24 @@
|
|||
- lb|success
|
||||
- not lb|changed
|
||||
|
||||
- name: test remove rule in check mode
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
public_ip: "{{ ip_address.ip_address }}"
|
||||
state: absent
|
||||
register: lb
|
||||
check_mode: true
|
||||
- name: verify remove rule in check mode
|
||||
assert:
|
||||
that:
|
||||
- lb|success
|
||||
- lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "source"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
|
||||
- name: test remove rule
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue