from allmydata.node import Node, OldConfigError, OldConfigOptionError, MissingConfigEntry, UnescapedHashError
from allmydata import client
from allmydata.storage_client import StorageFarmBroker
+from allmydata.manhole import AuthorizedKeysManhole
from allmydata.util import base32, fileutil
from allmydata.interfaces import IFilesystemNode, IFileNode, \
IImmutableFileNode, IMutableFileNode, IDirectoryNode
"reserved_space = bogus\n")
self.failUnlessRaises(ValueError, client.Client, basedir)
+ def test_web_staticdir(self):
+ basedir = u"client.Basic.test_web_staticdir"
+ os.mkdir(basedir)
+ fileutil.write(os.path.join(basedir, "tahoe.cfg"),
+ BASECONFIG +
+ "[node]\n" +
+ "web.port = tcp:0:interface=127.0.0.1\n" +
+ "web.static = relative\n")
+ c = client.Client(basedir)
+ w = c.getServiceNamed("webish")
+ abs_basedir = fileutil.abspath_expanduser_unicode(basedir)
+ expected = fileutil.abspath_expanduser_unicode(u"relative", abs_basedir)
+ self.failUnlessReallyEqual(w.staticdir, expected)
+
+ def test_manhole_keyfile(self):
+ basedir = u"client.Basic.test_manhole_keyfile"
+ os.mkdir(basedir)
+ fileutil.write(os.path.join(basedir, "tahoe.cfg"),
+ BASECONFIG +
+ "[node]\n" +
+ "ssh.port = tcp:0:interface=127.0.0.1\n" +
+ "ssh.authorized_keys_file = relative\n")
+ c = client.Client(basedir)
+ m = [s for s in c if isinstance(s, AuthorizedKeysManhole)][0]
+ abs_basedir = fileutil.abspath_expanduser_unicode(basedir)
+ expected = fileutil.abspath_expanduser_unicode(u"relative", abs_basedir)
+ self.failUnlessReallyEqual(m.keyfile, expected)
+
def _permute(self, sb, key):
return [ s.get_longname() for s in sb.get_servers_for_psi(key) ]
def log(self, msg, **kw):
log.msg(msg, **kw)
-class Node(testutil.SignalMixin, unittest.TestCase):
+class Node(testutil.SignalMixin, testutil.ReallyEqualMixin, unittest.TestCase):
def test_furl(self):
basedir = "introducer.IntroducerNode.test_furl"
os.mkdir(basedir)
d.addCallback(_check_furl)
return d
+ def test_web_static(self):
+ basedir = u"introducer.Node.test_web_static"
+ os.mkdir(basedir)
+ fileutil.write(os.path.join(basedir, "tahoe.cfg"),
+ "[node]\n" +
+ "web.port = tcp:0:interface=127.0.0.1\n" +
+ "web.static = relative\n")
+ c = IntroducerNode(basedir)
+ w = c.getServiceNamed("webish")
+ abs_basedir = fileutil.abspath_expanduser_unicode(basedir)
+ expected = fileutil.abspath_expanduser_unicode(u"relative", abs_basedir)
+ self.failUnlessReallyEqual(w.staticdir, expected)
+
+
class ServiceMixin:
def setUp(self):
self.parent = LoggingMultiService()