self.init_introducer_client()
self.init_stats_provider()
self.init_secrets()
+ self.init_node_key()
self.init_storage()
self.init_control()
self.helper = None
self.convergence = base32.a2b(convergence_s)
self._secret_holder = SecretHolder(lease_secret, self.convergence)
- def _maybe_create_node_key(self):
+ def init_node_key(self):
# we only create the key once. On all subsequent runs, we re-use the
# existing key
def _make_key():
return
readonly = self.get_config("storage", "readonly", False, boolean=True)
- self._maybe_create_node_key()
-
storedir = os.path.join(self.basedir, self.STOREDIR)
data = self.get_config("storage", "reserved_space", None)
cancel_secret = c.get_cancel_secret()
self.failUnless(base32.b2a(cancel_secret))
+ def test_nodekey_yes_storage(self):
+ basedir = "test_client.Basic.test_nodekey_yes_storage"
+ os.mkdir(basedir)
+ fileutil.write(os.path.join(basedir, "tahoe.cfg"),
+ BASECONFIG)
+ c = client.Client(basedir)
+ self.failUnless(c.get_long_nodeid().startswith("v0-"))
+
+ def test_nodekey_no_storage(self):
+ basedir = "test_client.Basic.test_nodekey_no_storage"
+ os.mkdir(basedir)
+ fileutil.write(os.path.join(basedir, "tahoe.cfg"),
+ BASECONFIG + "[storage]\n" + "enabled = false\n")
+ c = client.Client(basedir)
+ self.failUnless(c.get_long_nodeid().startswith("v0-"))
+
def test_reserved_1(self):
basedir = "client.Basic.test_reserved_1"
os.mkdir(basedir)