def make_server(self, i, readonly=False):
serverid = hashutil.tagged_hash("serverid", str(i))[:20]
serverdir = os.path.join(self.basedir, "servers",
- idlib.shortnodeid_b2a(serverid))
+ idlib.shortnodeid_b2a(serverid), "storage")
fileutil.make_dirs(serverdir)
ss = StorageServer(serverdir, serverid, stats_provider=SimpleStats(),
readonly_storage=readonly)
shares = []
for i,ss in self.g.servers_by_number.items():
serverid = ss.my_nodeid
- basedir = os.path.join(ss.storedir, "shares", prefixdir)
+ basedir = os.path.join(ss.sharedir, prefixdir)
if not os.path.exists(basedir):
continue
for f in os.listdir(basedir):
from foolscap.logging import log
from allmydata.storage_client import StorageFarmBroker
from allmydata.storage.common import storage_index_to_dir
+from allmydata.scripts import debug
from allmydata.mutable.filenode import MutableFileNode, BackoffAgent
from allmydata.mutable.common import ResponseCache, \
d.addCallback(lambda ign: self.do_upload_sdmf())
return d
+ def test_debug(self):
+ d = self.do_upload_mdmf()
+ def _debug(n):
+ fso = debug.FindSharesOptions()
+ storage_index = base32.b2a(n.get_storage_index())
+ fso.si_s = storage_index
+ fso.nodedirs = [unicode(os.path.dirname(os.path.abspath(storedir)))
+ for (i,ss,storedir)
+ in self.iterate_servers()]
+ fso.stdout = StringIO()
+ fso.stderr = StringIO()
+ debug.find_shares(fso)
+ sharefiles = fso.stdout.getvalue().split()
+ expected = self.nm.default_encoding_parameters["n"]
+ self.failUnlessEqual(len(sharefiles), expected)
+ d.addCallback(_debug)
+ return d
+
def test_get_sequence_number(self):
d = self.do_upload()
d.addCallback(lambda ign: self.mdmf_node.get_best_readable_version())