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>
This commit is contained in:
Rob Crittenden authored and Florence Blanc-Renaud committed 2021-08-04 08:44:46 +02:00
1 parent 9a4a6cdd27
commit 826b5825bd
1 file changed
+11
+11
View File
@@ -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):