From 3272780439a579f5bfa6a609aa3c5094764c4109 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Aug 03 2021 15:09:28 +0000 Subject: 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 Reviewed-By: Mohammad Rizwan Reviewed-By: Florence Blanc-Renaud --- diff --git a/ipatests/test_integration/test_cert.py b/ipatests/test_integration/test_cert.py index b6bb2f0..9a90db5 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):