Commit 1cf3b228 authored by Kirill Smelkov's avatar Kirill Smelkov

X zstor_2zurl += NEO

parent 46fda8ad
# setup to run tests on Nexedi testing infrastructure.
# https://stack.nexedi.com/test_status
#storv = ['fs', 'zeo', 'neo'] # storage backends to test against
storv = ['fs', 'zeo'] # XXX reenable zeo and neo
storv = ['fs', 'zeo', 'neo'] # storage backends to test against
#storv = ['fs', 'zeo'] # XXX reenable zeo and neo
# some bugs are only likely to trigger when there is only 1 or 2 main OS thread(s) in wcfs
# GOMAXPROCS='' means use `nproc`
......
......@@ -354,8 +354,8 @@ def test_zodb_onresync():
# test that zurl does not change from one open to another storage open.
def test_zurlstable():
if not isinstance(testdb, (testing.TestDB_FileStorage, testing.TestDB_ZEO)):
pytest.xfail(reason="zstor_2zurl is TODO for NEO")
if not isinstance(testdb, (testing.TestDB_FileStorage, testing.TestDB_ZEO, testing.TestDB_NEO)):
pytest.xfail(reason="zstor_2zurl is TODO for %r" % testdb)
zurl0 = None
for i in range(10):
zstor = testdb.getZODBStorage()
......
......@@ -349,5 +349,23 @@ def zstor_2zurl(zstor):
# TODO ssl
return u
# TODO NEO support
# NEO
if ztype == "neo.client.Storage.Storage":
# neo://<cluster>@<master>
u = "neo://"
app = zstor.app
u += "%s@" % app.name
masterv = app.nm.getMasterList()
if len(masterv) == 0:
raise RuntimeError("%r has empty master list" % zstor)
if len(masterv) > 1:
raise NotImplementedError("NEO client has multiple configured masters: %r" % (masterv,)) # XXX masterv -> string
master = masterv[0]
host, port = master.getAddress()
u += "%s:%s" % (host, port)
# TODO ssl
return u
raise NotImplementedError("don't know how to extract zurl from %r" % zstor)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment