mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 04:57:54 +00:00
A lot closer to passing grid manager integration tests.
This commit is contained in:
parent
c0be036e04
commit
02cb4105b3
@ -194,7 +194,7 @@ def test_reject_storage_server(reactor, request, temp_dir, flog_gatherer, port_a
|
||||
"storage0", pubkey_str,
|
||||
stdinBytes=gm_config,
|
||||
)
|
||||
assert json.loads(gm_config)['storage_servers'].keys() == ['storage0']
|
||||
assert json.loads(gm_config)['storage_servers'].keys() == {'storage0'}
|
||||
|
||||
print("inserting certificate")
|
||||
cert = yield _run_gm(
|
||||
@ -221,7 +221,7 @@ def test_reject_storage_server(reactor, request, temp_dir, flog_gatherer, port_a
|
||||
|
||||
config = configutil.get_config(join(diana.process.node_dir, "tahoe.cfg"))
|
||||
config.add_section("grid_managers")
|
||||
config.set("grid_managers", "test", ed25519.string_from_verifying_key(gm_pubkey))
|
||||
config.set("grid_managers", "test", str(ed25519.string_from_verifying_key(gm_pubkey), "ascii"))
|
||||
with open(join(diana.process.node_dir, "tahoe.cfg"), "w") as f:
|
||||
config.write(f)
|
||||
|
||||
@ -235,7 +235,7 @@ def test_reject_storage_server(reactor, request, temp_dir, flog_gatherer, port_a
|
||||
yield util.run_tahoe(
|
||||
reactor, request, "--node-directory", diana.process.node_dir,
|
||||
"put", "-",
|
||||
stdin="some content\n" * 200,
|
||||
stdin=b"some content\n" * 200,
|
||||
)
|
||||
assert False, "Should get a failure"
|
||||
except util.ProcessFailed as e:
|
||||
|
@ -225,3 +225,7 @@ def _config_path_from_option(config: str) -> Optional[FilePath]:
|
||||
if config == "-":
|
||||
return None
|
||||
return FilePath(config)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
grid_manager()
|
||||
|
@ -37,8 +37,9 @@ from os import urandom
|
||||
import re
|
||||
import time
|
||||
import hashlib
|
||||
|
||||
from io import StringIO
|
||||
from configparser import NoSectionError
|
||||
import json
|
||||
|
||||
import attr
|
||||
from zope.interface import (
|
||||
@ -67,7 +68,7 @@ from allmydata.interfaces import (
|
||||
IFoolscapStoragePlugin,
|
||||
)
|
||||
from allmydata.grid_manager import (
|
||||
create_grid_manager_verifier,
|
||||
create_grid_manager_verifier, SignedCertificate
|
||||
)
|
||||
from allmydata.crypto import (
|
||||
ed25519,
|
||||
@ -289,7 +290,7 @@ class StorageFarmBroker(service.MultiService):
|
||||
handler_overrides = server.get("connections", {})
|
||||
gm_verifier = create_grid_manager_verifier(
|
||||
self.storage_client_config.grid_manager_keys,
|
||||
server["ann"].get("grid-manager-certificates", []),
|
||||
[SignedCertificate.load(StringIO(json.dumps(data))) for data in server["ann"].get("grid-manager-certificates", [])],
|
||||
"pub-{}".format(str(server_id, "ascii")), # server_id is v0-<key> not pub-v0-key .. for reasons?
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user