URL: https://github.com/freeipa/freeipa/pull/1572
Author: Rezney
 Title: #1572: [Backport][ipa-4-5] - cn to san backport
Action: opened

PR body:
"""
https://pagure.io/freeipa/issue/7334

Reviewed-By: Fraser Tweedale <ftwee...@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1572/head:pr1572
git checkout pr1572
From 5b0fe9acef48accf75e38b4c8a485e3c32911e8f Mon Sep 17 00:00:00 2001
From: Michal Reznik <mrez...@redhat.com>
Date: Wed, 20 Dec 2017 16:05:37 +0100
Subject: [PATCH] test_cert_plugin: check if SAN is added with default profile

https://pagure.io/freeipa/issue/7334

Reviewed-By: Fraser Tweedale <ftwee...@redhat.com>
---
 ipatests/test_xmlrpc/test_cert_plugin.py | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/ipatests/test_xmlrpc/test_cert_plugin.py b/ipatests/test_xmlrpc/test_cert_plugin.py
index dc9e8cba7b..7315f5f30b 100644
--- a/ipatests/test_xmlrpc/test_cert_plugin.py
+++ b/ipatests/test_xmlrpc/test_cert_plugin.py
@@ -242,16 +242,14 @@ def test_0009_cert_find(self):
         assert 'valid_not_before' in res
         assert 'valid_not_after' in res
 
-    def test_00010_cleanup(self):
+    def test_00010_san_in_cert(self):
         """
-        Clean up cert test data
+        Test if SAN extension is automatically added with default profile.
         """
-        # Now clean things up
-        api.Command['host_del'](self.host_fqdn)
-
-        # Verify that the service is gone
-        res = api.Command['service_find'](self.service_princ)
-        assert res['count'] == 0
+        csr = self.generateCSR(str(self.subject))
+        res = api.Command[
+            'cert_request'](csr, principal=self.service_princ)['result']
+        assert 'san_dnsname' in res
 
     def test_00011_emails_are_valid(self):
         """
@@ -276,6 +274,17 @@ def test_00011_emails_are_valid(self):
         result = _emails_are_valid(email_addrs, [])
         assert False == result, result
 
+    def test_99999_cleanup(self):
+        """
+        Clean up cert test data
+        """
+        # Now clean things up
+        api.Command['host_del'](self.host_fqdn)
+
+        # Verify that the service is gone
+        res = api.Command['service_find'](self.service_princ)
+        assert res['count'] == 0
+
 
 @pytest.mark.tier1
 class test_cert_find(XMLRPC_test):
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to