URL: https://github.com/freeipa/freeipa/pull/4983
Author: kaleemsiddiqu
 Title: #4983: Tests for fake_mname parameter setup
Action: opened

PR body:
"""
fake_mname can be set through dnsserver-mod's --soa-mname-override
option which was not doable through same parameter setup in
/etc/named.conf

https://bugzilla.redhat.com/show_bug.cgi?id=1488732

Signed-off-by: Kaleemullah Siddiqui <ksidd...@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/4983/head:pr4983
git checkout pr4983
From 6137f75af844c594e9c01144de25e7f8a38c8c34 Mon Sep 17 00:00:00 2001
From: Kaleemullah Siddiqui <ksidd...@redhat.com>
Date: Tue, 4 Aug 2020 16:49:22 +0530
Subject: [PATCH] Tests for fake_mname parameter setup

fake_mname can be set through dnsserver-mod's --soa-mname-override
option which was not doable through same parameter setup in
/etc/named.conf

https://bugzilla.redhat.com/show_bug.cgi?id=1488732

Signed-off-by: Kaleemullah Siddiqui <ksidd...@redhat.com>
---
 .freeipa-pr-ci.yaml                        |  2 +-
 ipatests/prci_definitions/temp_commit.yaml |  4 +--
 ipatests/test_integration/test_dns.py      | 41 ++++++++++++++++++++++
 3 files changed, 44 insertions(+), 3 deletions(-)
 create mode 100644 ipatests/test_integration/test_dns.py

diff --git a/.freeipa-pr-ci.yaml b/.freeipa-pr-ci.yaml
index abcf8c5b63..8065669008 120000
--- a/.freeipa-pr-ci.yaml
+++ b/.freeipa-pr-ci.yaml
@@ -1 +1 @@
-ipatests/prci_definitions/gating.yaml
\ No newline at end of file
+ipatests/prci_definitions/temp_commit.yaml
\ No newline at end of file
diff --git a/ipatests/prci_definitions/temp_commit.yaml b/ipatests/prci_definitions/temp_commit.yaml
index e337068145..a9d7b76bba 100644
--- a/ipatests/prci_definitions/temp_commit.yaml
+++ b/ipatests/prci_definitions/temp_commit.yaml
@@ -68,7 +68,7 @@ jobs:
       class: RunPytest
       args:
         build_url: '{fedora-latest/build_url}'
-        test_suite: test_integration/test_REPLACEME.py
+        test_suite: test_integration/test_dns.py
         template: *ci-master-latest
         timeout: 3600
-        topology: *master_1repl_1client
+        topology: *master_1repl
diff --git a/ipatests/test_integration/test_dns.py b/ipatests/test_integration/test_dns.py
new file mode 100644
index 0000000000..b679e24ae7
--- /dev/null
+++ b/ipatests/test_integration/test_dns.py
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2020  FreeIPA Contributors see COPYING for license
+#
+"""This covers tests for dns related feature"""
+
+from __future__ import absolute_import
+
+from ipatests.pytest_ipa.integration import tasks
+from ipatests.test_integration.base import IntegrationTest
+
+
+class TestDNS(IntegrationTest):
+    """Tests for DNS feature.
+
+    This test class covers the tests for DNS feature.
+    """
+    topology = 'line'
+
+    def test_fake_mname_param(self):
+        """Test that fake_mname param is set using dnsserver-mod option.
+
+        Test for BZ 1488732 which checks that  --soa-mname-override option
+        from dnsserver-mod sets the fake_mname.
+        """
+        tasks.kinit_admin(self.master)
+        self.master.run_command(['ipa', 'dnsserver-mod', master.hostname,
+                                 '--soa-mname-override', 'fake'])
+        tasks.restart_named(self.master)
+        cmd = self.master.run_command(['dig', '+short', '-t', 'SOA',
+                                       self.master.domain.name])
+        assert 'fake' in cmd.stdout_text
+        assert master.hostname not in cmd.stdout_text
+
+        # reverting the fake_mname change to check it is reverted correctly
+        self.master.run_command(['ipa', 'dnsserver-mod', master.hostname,
+                                 '--soa-mname-override', ''])
+        tasks.restart_named(self.master)
+        cmd = self.master.run_command(['dig', '+short', '-t', 'SOA',
+                                       self.master.domain.name])
+        assert 'fake' not in cmd.stdout_text
+        assert master.hostname in cmd.stdout_text
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org

Reply via email to