Use random port binding for creating 389ds container
jlausuch opened this issue · 3 comments
jlausuch commented
Since we are using always the same port when launching a 390ds container using
extra_launch_args=["-p", "3389:3389"],
https://github.com/SUSE/BCI-tests/blob/main/bci_tester/data.py#L318
The tests that are using this container fail with
Bind for 0.0.0.0:3389 failed: port is already allocated.
It would be better to create some random number for the host side.
A ugly solution would be
port = random.randint(3000, 4000) # or whatever range that fits better
extra_launch_args=["-p", port+":3389"],
with proper syntax, ofc...
dcermak commented
The container is marked as a singleton (
Line 320 in c9a9f89
pytest_container
should only ever launch a single instance of this container image.dcermak commented
It would be better to create some random number for the host side.
That will make testing super ugly, because the 389ds test runs an ldapquery from the host on the 389ds container and you'd therefore need to know the port…
jlausuch commented
ok, then something is wrong with singleton
..