test_introducer.py: add a test for the python2.4.0/2.4.1 bug in base64.b32decode

This commit is contained in:
Brian Warner 2009-05-18 20:41:01 -07:00
parent 79437baade
commit 9f0bc04d32

View File

@ -12,6 +12,7 @@ from twisted.application import service
from allmydata.interfaces import InsufficientVersionError
from allmydata.introducer.client import IntroducerClient
from allmydata.introducer.server import IntroducerService
from allmydata.introducer.common import make_index
# test compatibility with old introducer .tac files
from allmydata.introducer import IntroducerNode
from allmydata.introducer import old
@ -272,3 +273,14 @@ class NonV1Server(SystemTestMixin, unittest.TestCase):
d.addCallback(_done)
return d
class Index(unittest.TestCase):
def test_make_index(self):
# make sure we have a working base64.b32decode. The one in
# python2.4.[01] was broken.
ann = ('pb://t5g7egomnnktbpydbuijt6zgtmw4oqi5@127.0.0.1:51857/hfzv36i',
'storage', 'RIStorageServer.tahoe.allmydata.com',
'plancha', 'allmydata-tahoe/1.4.1', '1.0.0')
(nodeid, service_name) = make_index(ann)
self.failUnlessEqual(nodeid, "\x9fM\xf2\x19\xcckU0\xbf\x03\r\x10\x99\xfb&\x9b-\xc7A\x1d")
self.failUnlessEqual(service_name, "storage")