Skip to content

Commit

Permalink
azure_rm_securitygroup - adding testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
tfmark committed Apr 21, 2021
1 parent 6ad65e7 commit 09f2949
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions tests/integration/targets/azure_rm_securitygroup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,18 @@
source_address_prefix: 174.109.158.0/24
destination_port_range: 22-23
priority: 102
- name: AllowHTTPandHTTPS
protocol: Tcp
source_address_prefix: 174.109.158.0/24
destination_port_range:
- 80
- 443
priority: 103
register: output

- assert:
- assert:
that:
- "{{ output.state.rules | length }} == 3"
- "{{ output.state.rules | length }} == 4"
- output.state.rules[0].source_address_prefix == '174.108.158.0/24'

- name: Test idempotence
Expand All @@ -84,6 +91,13 @@
source_address_prefix: 174.109.158.0/24
destination_port_range: 22-23
priority: 102
- name: AllowHTTPandHTTPS
protocol: Tcp
source_address_prefix: 174.109.158.0/24
destination_port_range:
- 80
- 443
priority: 103
register: output

- assert:
Expand All @@ -102,7 +116,7 @@

- assert:
that:
- output.state.tags | length == 3
- output.state.tags | length == 4
- output.state.tags.delete == 'never'

- name: Purge tags
Expand Down Expand Up @@ -214,7 +228,7 @@
register: output

- assert:
that:
that:
- output.changed
- "{{ output.state.rules | length }} == 2"

Expand Down

0 comments on commit 09f2949

Please sign in to comment.