Commit dc2fef14 authored by Rafael Monnerat's avatar Rafael Monnerat

tests: Invoke creation of certification Authority more often

parent 65d5d08a
...@@ -83,13 +83,22 @@ class testSlapOSMixin(ERP5TypeTestCase): ...@@ -83,13 +83,22 @@ class testSlapOSMixin(ERP5TypeTestCase):
os.mkdir(os.path.join(ca_path, 'private')) os.mkdir(os.path.join(ca_path, 'private'))
os.mkdir(os.path.join(ca_path, 'crl')) os.mkdir(os.path.join(ca_path, 'crl'))
os.mkdir(os.path.join(ca_path, 'certs')) os.mkdir(os.path.join(ca_path, 'certs'))
os.mkdir(os.path.join(ca_path, 'requests'))
os.mkdir(os.path.join(ca_path, 'newcerts'))
shutil.copy(os.path.join(os.environ['TEST_CA_PATH'], 'openssl.cnf'), original_openssl_cnf = open(
os.path.join(ca_path, 'openssl.cnf')) os.path.join(os.environ['TEST_CA_PATH'], 'openssl.cnf'), "r").read()
openssl_cnf = original_openssl_cnf.replace(os.environ['TEST_CA_PATH'], ca_path)
with open(os.path.join(ca_path, 'openssl.cnf'), "w") as f:
f.write(openssl_cnf)
shutil.copy(os.path.join(os.environ['TEST_CA_PATH'], 'cacert.pem'), shutil.copy(os.path.join(os.environ['TEST_CA_PATH'], 'cacert.pem'),
os.path.join(ca_path, 'cacert.pem')) os.path.join(ca_path, 'cacert.pem'))
shutil.copy(os.path.join(os.environ['TEST_CA_PATH'], 'private', 'cakey.pem'),
os.path.join(ca_path, 'private', 'cakey.pem'))
# reset test CA to have it always count from 0 # reset test CA to have it always count from 0
open(os.path.join(ca_path, 'serial'), 'w').write('01') open(os.path.join(ca_path, 'serial'), 'w').write('01')
open(os.path.join(ca_path, 'crlnumber'), 'w').write('01') open(os.path.join(ca_path, 'crlnumber'), 'w').write('01')
...@@ -161,6 +170,7 @@ class testSlapOSMixin(ERP5TypeTestCase): ...@@ -161,6 +170,7 @@ class testSlapOSMixin(ERP5TypeTestCase):
return return
self.portal.portal_caches.erp5_site_global_id = '%s' % random.random() self.portal.portal_caches.erp5_site_global_id = '%s' % random.random()
self.portal.portal_caches._p_changed = 1 self.portal.portal_caches._p_changed = 1
self.createCertificateAuthorityFile()
self.commit() self.commit()
self.portal.portal_caches.updateCache() self.portal.portal_caches.updateCache()
...@@ -214,7 +224,6 @@ class testSlapOSMixin(ERP5TypeTestCase): ...@@ -214,7 +224,6 @@ class testSlapOSMixin(ERP5TypeTestCase):
def bootstrapSite(self): def bootstrapSite(self):
self.setupPortalAlarms() self.setupPortalAlarms()
self.createCertificateAuthorityFile()
self.getDefaultSystemPreference().setPreferredHateoasUrl("http://dummy/") self.getDefaultSystemPreference().setPreferredHateoasUrl("http://dummy/")
self.clearCache() self.clearCache()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment