mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-17 18:29:54 +00:00
Merge pull request #85 from leif/isolate-keygen-test
Isolate test_keygen in its own base directory. This also causes KeyGeneratorService to create its base directory if it does not exist.
This commit is contained in:
commit
04ed7d0705
@ -6,7 +6,7 @@ from foolscap.api import Referenceable, Tub
|
|||||||
from zope.interface import implements
|
from zope.interface import implements
|
||||||
from twisted.internet import reactor
|
from twisted.internet import reactor
|
||||||
from twisted.application import service
|
from twisted.application import service
|
||||||
from allmydata.util import log
|
from allmydata.util import log, fileutil
|
||||||
|
|
||||||
from pycryptopp.publickey import rsa
|
from pycryptopp.publickey import rsa
|
||||||
from allmydata.interfaces import RIKeyGenerator
|
from allmydata.interfaces import RIKeyGenerator
|
||||||
@ -79,6 +79,7 @@ class KeyGeneratorService(service.MultiService):
|
|||||||
def __init__(self, basedir='.', display_furl=True, default_key_size=2048):
|
def __init__(self, basedir='.', display_furl=True, default_key_size=2048):
|
||||||
service.MultiService.__init__(self)
|
service.MultiService.__init__(self)
|
||||||
self.basedir = basedir
|
self.basedir = basedir
|
||||||
|
fileutil.make_dirs(self.basedir)
|
||||||
self.tub = Tub(certFile=os.path.join(self.basedir, 'key_generator.pem'))
|
self.tub = Tub(certFile=os.path.join(self.basedir, 'key_generator.pem'))
|
||||||
self.tub.setOption("expose-remote-exception-types", False)
|
self.tub.setOption("expose-remote-exception-types", False)
|
||||||
self.tub.setServiceParent(self)
|
self.tub.setServiceParent(self)
|
||||||
|
@ -43,7 +43,7 @@ class KeyGenService(unittest.TestCase, pollmixin.PollMixin):
|
|||||||
|
|
||||||
#print 'starting key generator service'
|
#print 'starting key generator service'
|
||||||
keysize = TEST_RSA_KEY_SIZE
|
keysize = TEST_RSA_KEY_SIZE
|
||||||
kgs = key_generator.KeyGeneratorService(display_furl=False, default_key_size=keysize)
|
kgs = key_generator.KeyGeneratorService(display_furl=False, default_key_size=keysize, basedir="key_generator_service")
|
||||||
kgs.key_generator.verbose = True
|
kgs.key_generator.verbose = True
|
||||||
kgs.setServiceParent(self.parent)
|
kgs.setServiceParent(self.parent)
|
||||||
kgs.key_generator.pool_size = 8
|
kgs.key_generator.pool_size = 8
|
||||||
|
Loading…
Reference in New Issue
Block a user