mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-31 20:04:45 +00:00
Merge pull request #1030 from t-woerner/use_yml_extension_for_pytest_tests
Use yml extension for pytest tests
This commit is contained in:
@@ -38,7 +38,7 @@ def pytest_configure(config):
|
|||||||
|
|
||||||
config_dir = os.path.join(test_dir, "config")
|
config_dir = os.path.join(test_dir, "config")
|
||||||
if os.path.exists(config_dir):
|
if os.path.exists(config_dir):
|
||||||
inventory_path = os.path.join(config_dir, "test.inventory.yaml")
|
inventory_path = os.path.join(config_dir, "test.inventory.yml")
|
||||||
inventory = get_inventory(inventory_path)
|
inventory = get_inventory(inventory_path)
|
||||||
print("Configuring execution using {}".format(inventory_path))
|
print("Configuring execution using {}".format(inventory_path))
|
||||||
ipaservers = inventory["all"]["children"]["ipaserver"]["hosts"]
|
ipaservers = inventory["all"]["children"]["ipaserver"]["hosts"]
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class TestDNSZone(AnsibleFreeIPATestCase):
|
|||||||
"""TC-01: Add dns zone without forwarder."""
|
"""TC-01: Add dns zone without forwarder."""
|
||||||
zone01 = "01testzone.test"
|
zone01 = "01testzone.test"
|
||||||
self.check_notexists([zone01], "dnszone-find")
|
self.check_notexists([zone01], "dnszone-find")
|
||||||
self.run_playbook(BASE_PATH + "dnszone_add_without_forwarder.yaml")
|
self.run_playbook(BASE_PATH + "dnszone_add_without_forwarder.yml")
|
||||||
self.check_details([zone01], "dnszone-find")
|
self.check_details([zone01], "dnszone-find")
|
||||||
|
|
||||||
def test_dnszone_add_multiple_ipv4_ipv6_forwarders(self):
|
def test_dnszone_add_multiple_ipv4_ipv6_forwarders(self):
|
||||||
@@ -41,7 +41,7 @@ class TestDNSZone(AnsibleFreeIPATestCase):
|
|||||||
|
|
||||||
# add dns zone with multiple forwarders
|
# add dns zone with multiple forwarders
|
||||||
self.run_playbook(
|
self.run_playbook(
|
||||||
(BASE_PATH + "dnszone_add_multiple_ipv4_ipv6_forwarders.yaml")
|
(BASE_PATH + "dnszone_add_multiple_ipv4_ipv6_forwarders.yml")
|
||||||
)
|
)
|
||||||
|
|
||||||
exp_forwarders = [
|
exp_forwarders = [
|
||||||
@@ -58,7 +58,7 @@ class TestDNSZone(AnsibleFreeIPATestCase):
|
|||||||
zone26 = "26testzone.test"
|
zone26 = "26testzone.test"
|
||||||
self.check_notexists([zone26], "dnszone-find")
|
self.check_notexists([zone26], "dnszone-find")
|
||||||
# add dns zone
|
# add dns zone
|
||||||
self.run_playbook(BASE_PATH + "dnszone_with_forward_policy_only.yaml")
|
self.run_playbook(BASE_PATH + "dnszone_with_forward_policy_only.yml")
|
||||||
self.check_details(["Forward policy: only"], "dnszone-find", [zone26])
|
self.check_details(["Forward policy: only"], "dnszone-find", [zone26])
|
||||||
|
|
||||||
def test_dnszone_disable(self):
|
def test_dnszone_disable(self):
|
||||||
@@ -68,7 +68,7 @@ class TestDNSZone(AnsibleFreeIPATestCase):
|
|||||||
["Active zone: (TRUE|True)"], "dnszone-find", [zone26]
|
["Active zone: (TRUE|True)"], "dnszone-find", [zone26]
|
||||||
)
|
)
|
||||||
# Disable dns zone
|
# Disable dns zone
|
||||||
self.run_playbook(BASE_PATH + "dnszone_disable.yaml")
|
self.run_playbook(BASE_PATH + "dnszone_disable.yml")
|
||||||
self.check_details(
|
self.check_details(
|
||||||
["Active zone: (FALSE|False)"], "dnszone-find", [zone26]
|
["Active zone: (FALSE|False)"], "dnszone-find", [zone26]
|
||||||
)
|
)
|
||||||
@@ -80,7 +80,7 @@ class TestDNSZone(AnsibleFreeIPATestCase):
|
|||||||
["Active zone: (FALSE|False)"], "dnszone-find", [zone26]
|
["Active zone: (FALSE|False)"], "dnszone-find", [zone26]
|
||||||
)
|
)
|
||||||
# Enable dns zone
|
# Enable dns zone
|
||||||
self.run_playbook(BASE_PATH + "dnszone_enable.yaml")
|
self.run_playbook(BASE_PATH + "dnszone_enable.yml")
|
||||||
self.check_details(
|
self.check_details(
|
||||||
["Active zone: (TRUE|True)"], "dnszone-find", [zone26]
|
["Active zone: (TRUE|True)"], "dnszone-find", [zone26]
|
||||||
)
|
)
|
||||||
@@ -96,7 +96,7 @@ class TestDNSZone(AnsibleFreeIPATestCase):
|
|||||||
reason="Fix is not available for BZ-1845056",
|
reason="Fix is not available for BZ-1845056",
|
||||||
)
|
)
|
||||||
|
|
||||||
self.run_playbook(BASE_PATH + "dnszone_name_from_ip.yaml")
|
self.run_playbook(BASE_PATH + "dnszone_name_from_ip.yml")
|
||||||
self.check_details([expected_msg], "dnszone-find", [zone])
|
self.check_details([expected_msg], "dnszone-find", [zone])
|
||||||
|
|
||||||
def test_dnszone_del_multiple(self):
|
def test_dnszone_del_multiple(self):
|
||||||
@@ -113,7 +113,7 @@ class TestDNSZone(AnsibleFreeIPATestCase):
|
|||||||
reason="Fix is not available for BZ-1845058",
|
reason="Fix is not available for BZ-1845058",
|
||||||
)
|
)
|
||||||
|
|
||||||
self.run_playbook(BASE_PATH + "dnszone_del_multiple.yaml")
|
self.run_playbook(BASE_PATH + "dnszone_del_multiple.yml")
|
||||||
# verify multiple dnszones are removed
|
# verify multiple dnszones are removed
|
||||||
for add_zone in zone:
|
for add_zone in zone:
|
||||||
error = "ipa: ERROR: {0}.: DNS zone not found".format(add_zone)
|
error = "ipa: ERROR: {0}.: DNS zone not found".format(add_zone)
|
||||||
@@ -131,7 +131,7 @@ class TestDNSZone(AnsibleFreeIPATestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.run_playbook_with_exp_msg(
|
self.run_playbook_with_exp_msg(
|
||||||
BASE_PATH + "dnszone_invalid_ip.yaml", expected_error,
|
BASE_PATH + "dnszone_invalid_ip.yml", expected_error,
|
||||||
)
|
)
|
||||||
self.check_notexists(
|
self.check_notexists(
|
||||||
[invalid_zone_ip], "dnszone-show", [invalid_zone_name],
|
[invalid_zone_ip], "dnszone-show", [invalid_zone_name],
|
||||||
|
|||||||
Reference in New Issue
Block a user