URL: https://github.com/freeipa/freeipa/pull/2004
Author: gkaihorodova
 Title: #2004: [Tests] Test for removal server with verbose option
Action: opened

PR body:
"""
Test for removal server with verbose option
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1480502
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/2004/head:pr2004
git checkout pr2004
From 1c2b0c53a9f513d83e98ebce98743b5a36561e76 Mon Sep 17 00:00:00 2001
From: Ganna Kaihorodova <gkaih...@redhat.com>
Date: Tue, 5 Jun 2018 13:22:24 +0200
Subject: [PATCH 1/4] [Tests] check nsds5ReplicaReleaseTimeout option was set

check for nsds5ReplicaReleaseTimeout option was set

relates to: https://pagure.io/freeipa/issue/7488
---
 ipatests/test_integration/test_external_ca.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/ipatests/test_integration/test_external_ca.py b/ipatests/test_integration/test_external_ca.py
index 2030ae706d..083f1d170d 100644
--- a/ipatests/test_integration/test_external_ca.py
+++ b/ipatests/test_integration/test_external_ca.py
@@ -136,6 +136,20 @@ def test_external_ca(self):
         # check that we can also install replica
         tasks.install_replica(self.master, self.replicas[0])
 
+        # check that nsds5ReplicaReleaseTimeout option was set
+        result = self.master.run_command([
+            'ldapsearch',
+            '-x',
+            '-D',
+            'cn=directory manager',
+            '-w', self.master.config.dirman_password,
+            '-b', 'cn=mapping tree','cn=config',
+            '(cn=replica)',
+            '-LLL',
+            '-o',
+            'ldif-wrap=no'])
+        assert 'nsds5ReplicaReleaseTimeout: 60' in result.stdout_text
+
     def test_client_installation_with_otp(self):
         # Test for issue 7526: client installation fails with one-time
         # password when the master is installed with an externally signed

From 123209ff923d1adeca6aef4180a97ed0aea33088 Mon Sep 17 00:00:00 2001
From: Ganna Kaihorodova <gkaih...@redhat.com>
Date: Thu, 7 Jun 2018 14:19:08 +0200
Subject: [PATCH 2/4] test commit

---
 .freeipa-pr-ci.yaml | 173 +---------------------------------------------------
 1 file changed, 2 insertions(+), 171 deletions(-)

diff --git a/.freeipa-pr-ci.yaml b/.freeipa-pr-ci.yaml
index 21f1c004d7..5f7b7821e6 100644
--- a/.freeipa-pr-ci.yaml
+++ b/.freeipa-pr-ci.yaml
@@ -27,30 +27,6 @@ jobs:
         timeout: 1800
         topology: *build
 
-  fedora-28/simple_replication:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_simple_replication.py
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-28/caless:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_caless.py::TestServerReplicaCALessToCAFull
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl
-
   fedora-28/external_ca:
     requires: [fedora-28/build]
     priority: 50
@@ -58,152 +34,7 @@ jobs:
       class: RunPytest
       args:
         build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_external_ca.py::TestExternalCA test_integration/test_external_ca.py::TestSelfExternalSelf test_integration/test_external_ca.py::TestExternalCAInstall
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-28/test_topologies:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_topologies.py
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-28/test_sudo:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_sudo.py
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-28/test_commands:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_commands.py
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-28/test_kerberos_flags:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_kerberos_flags.py
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-28/test_http_kdc_proxy:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_http_kdc_proxy.py
+        test_suite: test_integration/test_external_ca.py::TestExternalCA
         template: *ci-master-f28
-        timeout: 3600
+        timeout: 9600
         topology: *master_1repl_1client
-
-  fedora-28/test_forced_client_enrolment:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_forced_client_reenrollment.py
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-28/test_advise:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_advise.py
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-28/test_testconfig:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_testconfig.py
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-28/test_service_permissions:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_service_permissions.py
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-28/test_netgroup:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_netgroup.py
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-28/test_vault:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_vault.py
-        template: *ci-master-f28
-        timeout: 4500
-        topology: *master_1repl
-
-  fedora-28/test_authconfig:
-    requires: [fedora-28/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-28/build_url}'
-        test_suite: test_integration/test_authselect.py
-        template: *ci-master-f28
-        timeout: 3600
-        topology: *master_1repl_1client
-

From db3ecd274002ebf2321ae73f048faa7c5265c9aa Mon Sep 17 00:00:00 2001
From: Ganna Kaihorodova <gkaih...@redhat.com>
Date: Fri, 8 Jun 2018 13:26:10 +0200
Subject: [PATCH 3/4] [Test] Test for server removal with verbose option

Test for server removal with verbose option
---
 ipatests/test_integration/test_server_del.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ipatests/test_integration/test_server_del.py b/ipatests/test_integration/test_server_del.py
index c35bcb87d3..a641ba040c 100644
--- a/ipatests/test_integration/test_server_del.py
+++ b/ipatests/test_integration/test_server_del.py
@@ -309,3 +309,11 @@ def test_forced_removal_of_master(self):
             self.replicas[0], self.master.hostname,
             ignore_last_of_role=True
         )
+    def test_removal_with_verbose_option(self):
+        """
+        Test remove master with verbose option
+        """
+
+        result = tasks.run_server_del(self.master,
+                self.master.hostname, verbose=True)
+        assert result.returncode == 0

From 773b740c016e8cf063a48b76156b9937994311eb Mon Sep 17 00:00:00 2001
From: Ganna Kaihorodova <gkaih...@redhat.com>
Date: Fri, 8 Jun 2018 13:27:36 +0200
Subject: [PATCH 4/4] [Tests] Add verbose option for server removal

Add verbose option for server removal task
---
 ipatests/pytest_plugins/integration/tasks.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ipatests/pytest_plugins/integration/tasks.py b/ipatests/pytest_plugins/integration/tasks.py
index e4dee190d1..c80fcfcbb8 100644
--- a/ipatests/pytest_plugins/integration/tasks.py
+++ b/ipatests/pytest_plugins/integration/tasks.py
@@ -1270,7 +1270,7 @@ def wrapped(*args):
 
 def run_server_del(host, server_to_delete, force=False,
                    ignore_topology_disconnect=False,
-                   ignore_last_of_role=False):
+                   ignore_last_of_role=False, verbose=False):
     kinit_admin(host)
     args = ['ipa', 'server-del', server_to_delete]
     if force:
@@ -1279,6 +1279,8 @@ def run_server_del(host, server_to_delete, force=False,
         args.append('--ignore-topology-disconnect')
     if ignore_last_of_role:
         args.append('--ignore-last-of-role')
+    if verbose:
+        args.append('-v')
 
     return host.run_command(args, raiseonerr=False)
 
_______________________________________________
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://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/freeipa-devel@lists.fedorahosted.org/message/TRJ3JJRIX3UJUDRGID3KOAE57AMAPL7K/

Reply via email to