URL: https://github.com/freeipa/freeipa/pull/3166
Author: mrizwan93
 Title: #3166: ipatest : Test if ipactl restart restarts the pki-tomcatd 
properly
Action: opened

PR body:
"""
Wrong logic was triggering the start instead of restart
for pki-tomcatd. This test validates that restart
called on pki-tomcat properly.

related ticket : https://pagure.io/freeipa/issue/7927

Signed-off-by: Mohammad Rizwan Yusuf <myu...@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/3166/head:pr3166
git checkout pr3166
From e3ac04cda9deebff52bc4e8120c7af74fef815e0 Mon Sep 17 00:00:00 2001
From: Mohammad Rizwan Yusuf <myu...@redhat.com>
Date: Tue, 21 May 2019 11:45:20 +0530
Subject: [PATCH] Test if ipactl restart restarts the pki-tomcatd

Wrong logic was triggering the start instead of restart
for pkic-tomcatd. This test check validates that restart
called on pki-tomcat properly.

related ticket : https://pagure.io/freeipa/issue/7927

Signed-off-by: Mohammad Rizwan Yusuf <myu...@redhat.com>
---
 .../test_integration/test_installation.py     | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/ipatests/test_integration/test_installation.py b/ipatests/test_integration/test_installation.py
index 42a70c69f7..fc95ab7d3d 100644
--- a/ipatests/test_integration/test_installation.py
+++ b/ipatests/test_integration/test_installation.py
@@ -404,6 +404,41 @@ def test_install_dns(self):
             extra_args=['--dnssec-master', '--no-dnssec-validation']
         )
 
+    def test_ipactl_restart_pki_tomcat(self):
+        """ Test if ipactl restart restarts the pki-tomcatd
+
+        Wrong logic was triggering the start instead of restart
+        for pkic-tomcatd. This test check validates that restart
+        called on pki-tomcat properly.
+
+        related ticket : https://pagure.io/freeipa/issue/7927
+        """
+	cmd = self.master.run_command(['ps', '-ef', '|',
+				       'grep', 'pki-tomcatd'])
+        # get process id of pki-tomcatd
+	splitted = cmd.stdout_text.split()
+        pki_pid = splitted[1]
+
+        # check if pki-tomcad restarted
+        cmd = self.master.run_command(['ipactl', 'restart'])
+	assert "Restarting pki-tomcatd Service" in cmd.stdout_text
+
+        # check if pid for pki-tomcad changed
+        cmd = self.master.run_command(['ps', '-ef', '|',
+                                       'grep', 'pki-tomcatd'])
+        assert pki_pid not in cmd.stdout_text
+        splitted = cmd.stdout_text.split()
+        pki_pid = splitted[1]
+
+        # check if pki-tomcad restarted
+        cmd = self.master.run_command(['ipactl', 'restart'])
+        assert "Restarting pki-tomcatd Service" in cmd.stdout_text
+
+        # check if pid for pki-tomcad changed
+        cmd = self.master.run_command(['ps', '-ef', '|',
+                                       'grep', 'pki-tomcatd'])
+        assert pki_pid not in cmd.stdout_text
+
     def test_WSGI_worker_process(self):
         """ Test if WSGI worker process count is set to 4
 
_______________________________________________
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.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org

Reply via email to