summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc/test_cert.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_xmlrpc/test_cert.py')
-rw-r--r--tests/test_xmlrpc/test_cert.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/test_xmlrpc/test_cert.py b/tests/test_xmlrpc/test_cert.py
index c6d364a11..20aba1652 100644
--- a/tests/test_xmlrpc/test_cert.py
+++ b/tests/test_xmlrpc/test_cert.py
@@ -30,6 +30,7 @@ import tempfile
from ipapython import ipautil
import nose
import base64
+from ipalib.dn import *
# So we can save the cert from issuance and compare it later
cert = None
@@ -92,7 +93,7 @@ class test_cert(XMLRPC_test):
"""
host_fqdn = u'ipatestcert.%s' % api.env.domain
service_princ = u'test/%s@%s' % (host_fqdn, api.env.realm)
- subject = 'CN=%s,O=%s' % (host_fqdn, api.env.realm)
+ subject = DN(('CN',host_fqdn),('O',api.env.realm))
def test_1_cert_add(self):
"""
@@ -103,7 +104,7 @@ class test_cert(XMLRPC_test):
# First create the host that will use this policy
res = api.Command['host_add'](self.host_fqdn, force= True)['result']
- csr = unicode(self.generateCSR(self.subject))
+ csr = unicode(self.generateCSR(str(self.subject)))
try:
res = api.Command['cert_request'](csr, principal=self.service_princ)
assert False
@@ -117,9 +118,9 @@ class test_cert(XMLRPC_test):
# Our host should exist from previous test
global cert
- csr = unicode(self.generateCSR(self.subject))
+ csr = unicode(self.generateCSR(str(self.subject)))
res = api.Command['cert_request'](csr, principal=self.service_princ, add=True)['result']
- assert res['subject'] == self.subject
+ assert DN(res['subject']) == self.subject
# save the cert for the service_show/find tests
cert = res['certificate']
@@ -148,9 +149,9 @@ class test_cert(XMLRPC_test):
"""
global newcert
- csr = unicode(self.generateCSR(self.subject))
+ csr = unicode(self.generateCSR(str(self.subject)))
res = api.Command['cert_request'](csr, principal=self.service_princ)['result']
- assert res['subject'] == self.subject
+ assert DN(res['subject']) == self.subject
# save the cert for the service_show/find tests
newcert = res['certificate']