osbuild: auto-generate socket addresses for APIs

Rely on the ability of `BaseAPI` to auto-generate socket addresses
when no one was provided. The `BuildRoot` does not rely on the
sockets being created in the `BuildRoot.api` directory anymore and
will instead bind-mount each individual socket address to the well
known location via the `BaseAPI.endpoint` identifier.
Convert all API providers to take the `socket_address` as an
optional keyword argument.
This commit is contained in:
Christian Kellner 2020-07-24 19:25:49 +02:00 committed by Tom Gundersen
parent 6f26b49b9f
commit 0c7284572e
6 changed files with 10 additions and 11 deletions

View file

@ -74,7 +74,7 @@ class TestMonitor(unittest.TestCase):
logfile = os.path.join(tmpdir, "log.txt")
with open(logfile, "w") as log, \
API(path, args, LogMonitor(log.fileno())) as api:
API(args, LogMonitor(log.fileno()), socket_address=path) as api:
p = mp.Process(target=echo, args=(path, ))
p.start()
p.join()

View file

@ -97,9 +97,9 @@ class TestSources(test.TestBase):
with tempfile.TemporaryDirectory() as tmpdir, \
fileServer(self.locate_test_data()), \
osbuild.sources.SourcesServer(
f"{tmpdir}/sources-api",
"./", source_options,
f"{tmpdir}/cache", f"{tmpdir}/dst"):
f"{tmpdir}/cache", f"{tmpdir}/dst",
socket_address=f"{tmpdir}/sources-api"):
self.check_case(source, case_options, f"{tmpdir}/sources-api")
self.check_case(source, case_options, f"{tmpdir}/sources-api")