Skip to content

Commit

Permalink
Improve integration tests readability
Browse files Browse the repository at this point in the history
  • Loading branch information
mariolenz committed Sep 19, 2022
1 parent fc42ad8 commit 6c70a35
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
allowed_hosts:
all_ip: true
register: all_hosts_result

- debug: msg="{{ all_hosts_result }}"

- name: ensure everything is changed for all hosts of {{ ccr1 }}
assert:
that:
Expand Down Expand Up @@ -47,7 +49,9 @@
- name: vvold
enabled: false
register: host_result

- debug: msg="{{ host_result }}"

- name: ensure vvold is disabled for {{ host1 }}
assert:
that:
Expand Down Expand Up @@ -77,7 +81,9 @@
all_ip: true
register: all_hosts_result_check_mode
check_mode: true

- debug: var=all_hosts_result_check_mode

- name: ensure everything is changed for all hosts of {{ ccr1 }}
assert:
that:
Expand All @@ -103,7 +109,9 @@
enabled: false
register: host_result_check_mode
check_mode: true

- debug: msg="{{ host_result_check_mode }}"

- name: ensure vvold is disabled for {{ host1 }}
assert:
that:
Expand Down Expand Up @@ -137,7 +145,9 @@
ip_network:
- "192.168.200.0/24"
register: all_hosts_ip_specific

- debug: var=all_hosts_ip_specific

- name: ensure everything is changed for all hosts of {{ ccr1 }}
assert:
that:
Expand Down Expand Up @@ -180,10 +190,14 @@
ip_address:
- "192.168.100.11"
register: single_host_ip_specific

- set_fact:
nfc_state: "{{ single_host_ip_specific.rule_set_state[esxi1]['NFC'] }}"

- debug: var=single_host_ip_specific

- debug: var=nfc_state

- name: ensure NFC is configured on that host
assert:
that:
Expand Down Expand Up @@ -215,13 +229,17 @@
ip_address:
- "1.2.3.4"
register: using_list

- debug: var=using_list

- set_fact:
nfc_state: "{{ using_list.rule_set_state[esxi1]['NFC'] }}"

- name: ensure the correct host is set
assert:
that:
- nfc_state.allowed_hosts.current_allowed_ip == ["1.2.3.4"]

- name: Clean up the firewall rules
community.vmware.vmware_host_firewall_manager:
cluster_name: '{{ ccr1 }}'
Expand Down

0 comments on commit 6c70a35

Please sign in to comment.