URL: https://github.com/freeipa/freeipa/pull/5926
Author: rcritten
 Title: #5926: ipatests: verify that getcert output includes the issued date
Action: opened

PR body:
"""
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 <rcrit...@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/5926/head:pr5926
git checkout pr5926
From f53412c5f51b260930d5c959df58eb100442757b Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcrit...@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 <rcrit...@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 b6bb2f08ac0..f36f76176ae 100644
--- a/ipatests/test_integration/test_cert.py
+++ b/ipatests/test_integration/test_cert.py
@@ -19,6 +19,7 @@
 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 @@ def test_getcert_list_profile_using_subca(self, test_subca_certs):
             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"]).stderr_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):
 
_______________________________________________
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