mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Check if issuer DN is updated after self-signed > external-ca
This test checks if issuer DN is updated properly after CA is renewed from self-signed to external-ca related ticket: https://pagure.io/freeipa/issue/7316 Signed-off-by: Mohammad Rizwan Yusuf <myusuf@redhat.com> Replaced hardcoded issuer CN for external ca with constant Signed-off-by: Mohammad Rizwan Yusuf <myusuf@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
committed by
Tibor Dudlák
parent
89ae434131
commit
e90d90c5c3
@@ -28,6 +28,7 @@ from cryptography.hazmat.primitives import serialization
|
||||
import datetime
|
||||
import six
|
||||
|
||||
ISSUER_CN = 'example.test'
|
||||
|
||||
class ExternalCA(object):
|
||||
"""
|
||||
@@ -37,7 +38,7 @@ class ExternalCA(object):
|
||||
self.now = datetime.datetime.utcnow()
|
||||
self.delta = datetime.timedelta(days=days)
|
||||
|
||||
def create_ca(self, cn='example.test'):
|
||||
def create_ca(self, cn=ISSUER_CN):
|
||||
"""Create root CA.
|
||||
|
||||
:returns: bytes -- Root CA in PEM format.
|
||||
|
||||
@@ -27,7 +27,7 @@ from ipatests.test_integration.base import IntegrationTest
|
||||
from ipaplatform.paths import paths
|
||||
|
||||
from itertools import chain, repeat
|
||||
from ipatests.create_external_ca import ExternalCA
|
||||
from ipatests.create_external_ca import ExternalCA, ISSUER_CN
|
||||
|
||||
IPA_CA = 'ipa_ca.crt'
|
||||
ROOT_CA = 'root_ca.crt'
|
||||
@@ -37,7 +37,7 @@ PKI_START_STR = 'Started pki_tomcatd'
|
||||
|
||||
|
||||
def check_CA_flag(host, nssdb=paths.PKI_TOMCAT_ALIAS_DIR,
|
||||
cn='example.test'):
|
||||
cn=ISSUER_CN):
|
||||
"""
|
||||
Check if external CA (by default 'example.test' in our test env) has
|
||||
CA flag in nssdb.
|
||||
@@ -209,6 +209,15 @@ class TestSelfExternalSelf(IntegrationTest):
|
||||
result = check_CA_flag(self.master)
|
||||
assert bool(result), ('External CA does not have "C" flag')
|
||||
|
||||
def test_issuerDN_after_renew_to_external(self):
|
||||
""" Check if issuer DN is updated after self-signed > external-ca
|
||||
|
||||
This test checks if issuer DN is updated properly after CA is
|
||||
renewed from self-signed to external-ca
|
||||
"""
|
||||
result = self.master.run_command(['ipa', 'ca-show', 'ipa'])
|
||||
assert "Issuer DN: CN={}".format(ISSUER_CN) in result.stdout_text
|
||||
|
||||
def test_switch_back_to_self_signed(self):
|
||||
|
||||
# for journalctl --since
|
||||
|
||||
Reference in New Issue
Block a user