Added ability to add pytest tests

Until now ansible-freeipa repository only had playbook tests. This
commit introduces the ability of creating TestCase classes connected to
the master host. This connection can be used to run commands in the
managed host after the ansible playbook execution is the allowing the
verification of the machine state.
This commit is contained in:
Sergio Oliveira Campos
2020-08-28 11:37:54 -03:00
parent 48db01a5fa
commit af7060d3a9
20 changed files with 644 additions and 134 deletions

View File

@@ -0,0 +1,15 @@
---
- name: Playbook to ensure the DNS zones is present with multiple forwarder ipv4, ipv6, and port.
hosts: ipaserver
tasks:
- ipadnszone:
ipaadmin_password: SomeADMINpassword
name: 04testzone.test
forwarders:
- ip_address: 192.11.22.33
- ip_address: 192.11.22.34
port: 23
- ip_address: 2001:db8:cafe:1::1
- ip_address: 2001:db8:cafe:1::4
port: 34

View File

@@ -0,0 +1,9 @@
---
- name: Playbook to ensure the DNS zones is present without forwarder as well.
hosts: ipaserver
tasks:
- ipadnszone:
ipaadmin_password: SomeADMINpassword
name: 01testzone.test
forwarders: []

View File

@@ -0,0 +1,10 @@
---
- name: Playbook to ensure remove multiple dnszone.
hosts: ipaserver
become: true
tasks:
- ipadnszone:
ipaadmin_password: SomeADMINpassword
name: delzone1.com,delzone2.com,delzone3.com
state: absent

View File

@@ -0,0 +1,9 @@
---
- name: Playbook to ensure the DNS zones disabled.
hosts: ipaserver
tasks:
- ipadnszone:
ipaadmin_password: SomeADMINpassword
name: 26testzone.test
state: disabled

View File

@@ -0,0 +1,9 @@
---
- name: Playbook to ensure the DNS zones enabled.
hosts: ipaserver
tasks:
- ipadnszone:
ipaadmin_password: SomeADMINpassword
name: 26testzone.test
state: enabled

View File

@@ -0,0 +1,11 @@
---
- name: Playbook to with invalid IPs in allow_transfer.
hosts: ipaserver
become: true
tasks:
- ipadnszone:
ipaadmin_password: SomeADMINpassword
name: invalidzone.test
forwarders:
- ip_address: in.va.li.d

View File

@@ -0,0 +1,10 @@
---
- name: Playbook to ensure, not able to add invalid(more than 4294967295) serial numbers.
hosts: ipaserver
become: true
tasks:
- ipadnszone:
ipaadmin_password: SomeADMINpassword
name: invalidserialzone.test
serial: 429496729599

View File

@@ -0,0 +1,8 @@
---
- name: Playbook to ensure reverse zone is added by the IP..
hosts: ipaserver
tasks:
- ipadnszone:
ipaadmin_password: SomeADMINpassword
name_from_ip: 192.8.2.0/22

View File

@@ -0,0 +1,9 @@
---
- name: Playbook to ensure the DNS zones is present with forward_policy only.
hosts: ipaserver
tasks:
- ipadnszone:
ipaadmin_password: SomeADMINpassword
name: 26testzone.test
forward_policy: only