Skip to content

Commit

Permalink
unbound_domain - updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Jul 5, 2023
1 parent a20a1b0 commit 96227f7
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions tests/unbound_domain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
domain: 'opnsense.test.ansibleguy.net'
server: '192.168.0.1'
state: 'absent'
description: 'ANSIBLE_TEST_1_1'
register: opn1
failed_when: >
opn1.failed or
Expand All @@ -40,29 +41,31 @@
ansibleguy.opnsense.unbound_domain:
domain: 'opnsense.test.ansibleguy.net'
server: 'INVALID-IP'
description: 'ANSIBLE_TEST_1_1'
register: opn11
failed_when: not opn11.failed

- name: Adding 1 - failing because of invalid domain
ansibleguy.opnsense.unbound_domain:
domain: '!INVALID-DOMAIN!'
server: 'INVALID-IP'
description: 'ANSIBLE_TEST_1_1'
register: opn12
failed_when: not opn12.failed

- name: Adding 1 - failing because of invalid value
- name: Adding 1 - failing because of invalid ip-port combinations
ansibleguy.opnsense.unbound_domain:
domain: 'opnsense.test.ansibleguy.net'
server: '192.168.0.1@INVALID-PORT'
server: "{{ item }}"
description: 'ANSIBLE_TEST_1_1'
register: opn14
failed_when: not opn14.failed

- name: Adding 1 - failing because of invalid value
ansibleguy.opnsense.unbound_domain:
domain: 'opnsense.test.ansibleguy.net'
server: '192.168.0.1@53530@'
register: opn15
failed_when: not opn15.failed
loop:
- 'INVALID-IP@INVALID-PORT'
- '192.168.0.1@INVALID-PORT'
- '192.168.0.1@53530@'
- '192.168.X.1@53530'
- '192.168.0.1@535300'

- name: Adding 1
ansibleguy.opnsense.unbound_domain:
Expand Down Expand Up @@ -142,10 +145,10 @@
server: '192.168.1.1@1053'
description: 'ANSIBLE_TEST_1_2'
reload: false # speed
register: opn16
register: opn15
failed_when: >
opn16.failed or
not opn16.changed
opn15.failed or
not opn15.changed
when: not ansible_check_mode

- name: Adding 2 - nothing changed
Expand All @@ -154,10 +157,10 @@
server: '192.168.1.1@1053'
description: 'ANSIBLE_TEST_1_2'
reload: false # speed
register: opn17
register: opn16
failed_when: >
opn17.failed or
opn17.changed
opn16.failed or
opn16.changed
when: not ansible_check_mode

- name: Removing 2
Expand Down

0 comments on commit 96227f7

Please sign in to comment.