URL: https://github.com/freeipa/freeipa/pull/5855
Author: mrizwan93
 Title: #5855: ipatests: Test ipa-cert-fix warns when startup directive is 
missing from CS.cfg
Action: opened

PR body:
"""
Earlier it used to fail when startup directive missing from CS.cfg.
With https://github.com/dogtagpki/pki/pull/3466, it changed to display
a warning than failing.

related: https://pagure.io/freeipa/issue/8721

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

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/5855/head:pr5855
git checkout pr5855
From 205536f35f6180cde54a8b2b00022e6ac250ab04 Mon Sep 17 00:00:00 2001
From: Mohammad Rizwan <myu...@redhat.com>
Date: Thu, 24 Jun 2021 13:10:00 +0530
Subject: [PATCH] est ipa-cert-fix warns when startup directive is missing from
 CS.cfg

Earlier it used to fail when startup directive missing from CS.cfg.
With https://github.com/dogtagpki/pki/pull/3466, it changed to display
a warning than failing.

related: https://pagure.io/freeipa/issue/8721

Signed-off-by: Mohammad Rizwan <myu...@redhat.com>
---
 .../test_integration/test_ipa_cert_fix.py     | 20 ++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/ipatests/test_integration/test_ipa_cert_fix.py b/ipatests/test_integration/test_ipa_cert_fix.py
index 212156a001d..ac3afb6c5e8 100644
--- a/ipatests/test_integration/test_ipa_cert_fix.py
+++ b/ipatests/test_integration/test_ipa_cert_fix.py
@@ -205,14 +205,17 @@ def test_ipa_cert_fix_non_ipa(self):
 
     def test_missing_startup(self, expire_cert_critical):
         """
-        Test ipa-cert-fix fails when startup directive is missing from CS.cfg
+        Test ipa-cert-fix warns when startup directive is missing from CS.cfg
+
+        Earlier it used to fail when startup directive missing from CS.cfg.
+        With https://github.com/dogtagpki/pki/pull/3466, it changed to display
+        a warning than failing.
 
         This test checks that if 'selftests.container.order.startup' directive
-        is missing from CS.cfg, ipa-cert-fix fails and throw proper error
-        message. It also checks that underlying command 'pki-server cert-fix'
-        should fail to renew the cert.
+        is missing from CS.cfg, ipa-cert-fix dsplay proper warning.
 
         related: https://pagure.io/freeipa/issue/8721
+
         """
         expire_cert_critical(self.master)
         # pki must be stopped in order to edit CS.cfg
@@ -228,11 +231,10 @@ def test_missing_startup(self, expire_cert_critical):
         result = self.master.run_command(['ipa-cert-fix', '-v'],
                                          stdin_text='yes\n',
                                          raiseonerr=False)
-        err_msg1 = "ERROR: 'selftests.container.order.startup'"
-        # check that pki-server cert-fix command fails
-        err_msg2 = ("ERROR: CalledProcessError(Command "
-                    "['pki-server', 'cert-fix'")
-        assert err_msg1 and err_msg2 in result.stderr_text
+        warn_msg = ("WARNING: No selftests configured in "
+                    f"{paths.CA_CS_CFG_PATH} "
+                    "(selftests.container.order.startup)")
+        assert warn_msg in result.stderr_text
 
     def test_expired_CA_cert(self, expire_ca_cert):
         """Test to check ipa-cert-fix when CA certificate is expired
_______________________________________________
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
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to