mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
caless tests: make debug log of certificates sensible
CA-less tests debug logging uses representation of a variable containing the certificate object, which does not help very much. Use the actual DER representation of the certificate on such places. Reviewed-By: Michal Reznik <mreznik@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
@@ -360,8 +360,8 @@ class CALessBase(IntegrationTest):
|
|||||||
logger.debug('Expected /etc/ipa/ca.crt contents:\n%s',
|
logger.debug('Expected /etc/ipa/ca.crt contents:\n%s',
|
||||||
expected_cacrt.decode('utf-8'))
|
expected_cacrt.decode('utf-8'))
|
||||||
expected_cacrt = x509.load_unknown_x509_certificate(expected_cacrt)
|
expected_cacrt = x509.load_unknown_x509_certificate(expected_cacrt)
|
||||||
logger.debug('Expected binary CA cert:\n%r',
|
logger.debug('Expected CA cert:\n%r',
|
||||||
expected_cacrt)
|
expected_cacrt.public_bytes(x509.Encoding.PEM))
|
||||||
for host in [self.master] + self.replicas:
|
for host in [self.master] + self.replicas:
|
||||||
# Check the LDAP entry
|
# Check the LDAP entry
|
||||||
ldap = host.ldap_connect()
|
ldap = host.ldap_connect()
|
||||||
@@ -370,7 +370,7 @@ class CALessBase(IntegrationTest):
|
|||||||
('cn', 'etc'), host.domain.basedn))
|
('cn', 'etc'), host.domain.basedn))
|
||||||
cert_from_ldap = entry.single_value['cACertificate']
|
cert_from_ldap = entry.single_value['cACertificate']
|
||||||
logger.debug('CA cert from LDAP on %s:\n%r',
|
logger.debug('CA cert from LDAP on %s:\n%r',
|
||||||
host, cert_from_ldap)
|
host, cert_from_ldap.public_bytes(x509.Encoding.PEM))
|
||||||
assert cert_from_ldap == expected_cacrt
|
assert cert_from_ldap == expected_cacrt
|
||||||
|
|
||||||
# Verify certmonger was not started
|
# Verify certmonger was not started
|
||||||
@@ -384,7 +384,7 @@ class CALessBase(IntegrationTest):
|
|||||||
host, remote_cacrt)
|
host, remote_cacrt)
|
||||||
cacrt = x509.load_unknown_x509_certificate(remote_cacrt)
|
cacrt = x509.load_unknown_x509_certificate(remote_cacrt)
|
||||||
logger.debug('%s: Decoded /etc/ipa/ca.crt:\n%r',
|
logger.debug('%s: Decoded /etc/ipa/ca.crt:\n%r',
|
||||||
host, cacrt)
|
host, cacrt.public_bytes(x509.Encoding.PEM))
|
||||||
assert expected_cacrt == cacrt
|
assert expected_cacrt == cacrt
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user