URL: https://github.com/freeipa/freeipa/pull/2266
Author: rcritten
 Title: #2266: Fix the uninstall test, execute in the nightly runs
Action: opened

PR body:
"""
I'm not sure what changed that caused the test to start failing. We didn't 
notice until now because the test wasn't executed in the nightlies.

Rather than only trying to stop dirsrv when it was running just brute-force 
always try to shut it down.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/2266/head:pr2266
git checkout pr2266
From dbc6ec0fb4ea15368f8989866570418d7d33e73c Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcrit...@redhat.com>
Date: Tue, 21 Aug 2018 13:20:01 -0400
Subject: [PATCH 1/2] Fix uninstallation test, use different method to stop
 dirsrv

The API may not be initialized so using ds.is_running() may fail.
Call systemctl directly to ensure the dirsrv instance is stopped.

Signed-off-by: Rob Crittenden <rcrit...@redhat.com>
---
 ipatests/test_integration/test_uninstallation.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ipatests/test_integration/test_uninstallation.py b/ipatests/test_integration/test_uninstallation.py
index ccdf5b3c8a..274f4b3ee2 100644
--- a/ipatests/test_integration/test_uninstallation.py
+++ b/ipatests/test_integration/test_uninstallation.py
@@ -52,10 +52,9 @@ def test_failed_uninstall(self):
             # be marked as uninstalled so server cert will still be
             # tracked and the instances may remain. This can cause
             # subsequent installations to fail so be thorough.
-            ds = dsinstance.DsInstance()
-            ds_running = ds.is_running()
-            if ds_running:
-                ds.stop(serverid)
+            dashed_domain = self.master.domain.realm.replace(".", '-')
+            dirsrv_service = "dirsrv@%s.service" % dashed_domain
+            self.master.run_command(['systemctl', 'stop', dirsrv_service])
 
             # Moving it back should allow the uninstall to finish
             # successfully.
@@ -66,6 +65,7 @@ def test_failed_uninstall(self):
             ])
 
             # DS has been marked as uninstalled so force the issue
+            ds = dsinstance.DsInstance()
             ds.stop_tracking_certificates(serverid)
 
             self.master.run_command([

From 4d99d444b2cc0af3553f173abd651212549d2e2e Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcrit...@redhat.com>
Date: Tue, 21 Aug 2018 13:23:27 -0400
Subject: [PATCH 2/2] Add test_uninstallation to nightly testing

Signed-off-by: Rob Crittenden <rcrit...@redhat.com>
---
 ipatests/prci_definitions/nightly_master.yaml  | 12 ++++++++++++
 ipatests/prci_definitions/nightly_rawhide.yaml | 12 ++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/ipatests/prci_definitions/nightly_master.yaml b/ipatests/prci_definitions/nightly_master.yaml
index c299e4138a..bfa658fc1c 100644
--- a/ipatests/prci_definitions/nightly_master.yaml
+++ b/ipatests/prci_definitions/nightly_master.yaml
@@ -544,6 +544,18 @@ jobs:
         timeout: 7200
         topology: *master_1repl
 
+  fedora-28/test_uninstallation:
+    requires: [fedora-28/build]
+    priority: 50
+    job:
+      class: RunPytest
+      args:
+        build_url: '{fedora-28/build_url}'
+        test_suite: test_integration/test_uninstallation.py
+        template: *ci-master-f28
+        timeout: 7200
+        topology: *master_1repl
+
   fedora-28/test_topology_TestCASpecificRUVs:
     requires: [fedora-28/build]
     priority: 50
diff --git a/ipatests/prci_definitions/nightly_rawhide.yaml b/ipatests/prci_definitions/nightly_rawhide.yaml
index 7856354ea7..042cff4ad7 100644
--- a/ipatests/prci_definitions/nightly_rawhide.yaml
+++ b/ipatests/prci_definitions/nightly_rawhide.yaml
@@ -544,6 +544,18 @@ jobs:
         timeout: 7200
         topology: *master_1repl
 
+  fedora-28/test_uninstallation:
+    requires: [fedora-28/build]
+    priority: 50
+    job:
+      class: RunPytest
+      args:
+        build_url: '{fedora-28/build_url}'
+        test_suite: test_integration/test_uninstallation.py
+        template: *ci-master-frawhide
+        timeout: 7200
+        topology: *master_1repl
+
   fedora-rawhide/test_topology:
     requires: [fedora-rawhide/build]
     priority: 50
_______________________________________________
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/SXNWSAIFYV5JX6M4ARYETJIVV3LVBGO5/

Reply via email to