mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-02 17:20:50 +00:00
test: announcements contain grid-manager certs
This commit is contained in:
parent
c0f0076a3e
commit
7d30bd53c7
@ -1,4 +1,6 @@
|
||||
import os, sys
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
from functools import (
|
||||
partial,
|
||||
)
|
||||
@ -35,6 +37,7 @@ from testtools.matchers import (
|
||||
AfterPreprocessing,
|
||||
MatchesListwise,
|
||||
MatchesDict,
|
||||
ContainsDict,
|
||||
Always,
|
||||
Is,
|
||||
raises,
|
||||
@ -1543,3 +1546,41 @@ enabled = {storage_enabled}
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
def test_announcement_includes_grid_manager(self):
|
||||
"""
|
||||
When Grid Manager is enabled certificates are included in the
|
||||
announcement
|
||||
"""
|
||||
fake_cert = {
|
||||
"certificate": "{\"expires\":1601687822,\"public_key\":\"pub-v0-cbq6hcf3pxcz6ouoafrbktmkixkeuywpcpbcomzd3lqbkq4nmfga\",\"version\":1}",
|
||||
"signature": "fvjd3uvvupf2v6tnvkwjd473u3m3inyqkwiclhp7balmchkmn3px5pei3qyfjnhymq4cjcwvbpqmcwwnwswdtrfkpnlaxuih2zbdmda",
|
||||
}
|
||||
with self.basedir.child("zero.cert").open("w") as f:
|
||||
json.dump(fake_cert, f)
|
||||
|
||||
config = client.config_from_string(
|
||||
self.basedir.path,
|
||||
"tub.port",
|
||||
self.get_config(
|
||||
storage_enabled=True,
|
||||
more_storage="grid_management = True",
|
||||
more_sections=(
|
||||
"[grid_manager_certificates]\n"
|
||||
"foo = zero.cert\n"
|
||||
)
|
||||
),
|
||||
)
|
||||
|
||||
self.assertThat(
|
||||
client.create_client_from_config(
|
||||
config,
|
||||
_introducer_factory=MemoryIntroducerClient,
|
||||
),
|
||||
succeeded(AfterPreprocessing(
|
||||
lambda client: get_published_announcements(client)[0].ann,
|
||||
ContainsDict({
|
||||
"grid-manager-certificates": Equals([fake_cert]),
|
||||
}),
|
||||
)),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user