ipa/0038-ipatests-verify-that-getcert-output-includes-the-iss.patch
Florence Blanc-Renaud 6ff3da92fc ipa-4.9.6-5
- Resolves: rhbz#1988383 Do SRV discovery in ipa-getkeytab if -s and -H aren't provided
- Resolves: rhbz#1986329 ipa-server install failure without DNS
- Resolves: rhbz#1980734 Remove python3-pexpect as dependency for ipatests pkg
- Resolves: rhbz#1992538 Backport recent test fixes in python3-ipatests
2021-08-17 10:34:03 +02:00

52 lines
2.0 KiB
Diff

From 826b5825bd644fc69a9bee17626d71fe03cc0190 Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Mon, 26 Jul 2021 16:14:19 -0400
Subject: [PATCH] ipatests: verify that getcert output includes the issued date
certmonger 0.79.14 included a new feature that provides the
NotBefore (or issued) date to the certificate list output.
Verify that it is present in the output.
https://bugzilla.redhat.com/show_bug.cgi?id=1940261
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Mohammad Rizwan <myusuf@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
---
ipatests/test_integration/test_cert.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/ipatests/test_integration/test_cert.py b/ipatests/test_integration/test_cert.py
index b6bb2f08a..9a90db5e2 100644
--- a/ipatests/test_integration/test_cert.py
+++ b/ipatests/test_integration/test_cert.py
@@ -19,6 +19,7 @@ from ipaplatform.paths import paths
from cryptography import x509
from cryptography.x509.oid import ExtensionOID
from cryptography.hazmat.backends import default_backend
+from pkg_resources import parse_version
from ipatests.pytest_ipa.integration import tasks
from ipatests.test_integration.base import IntegrationTest
@@ -257,6 +258,16 @@ class TestInstallMasterClient(IntegrationTest):
raise AssertionError("certmonger request is "
"in state {}". format(status))
+ def test_getcert_notafter_output(self):
+ """Test that currrent certmonger includes NotBefore in output"""
+ result = self.master.run_command(["certmonger", "-v"]).stdout_text
+ if parse_version(result.split()[1]) < parse_version('0.79.14'):
+ raise pytest.skip("not_before not provided in this version")
+ result = self.master.run_command(
+ ["getcert", "list", "-f", paths.HTTPD_CERT_FILE]
+ ).stdout_text
+ assert 'issued:' in result
+
class TestCertmongerRekey(IntegrationTest):
--
2.31.1