diff --git a/tests/test_389ds.py b/tests/test_389ds.py index 5dbf3081..675d49cc 100644 --- a/tests/test_389ds.py +++ b/tests/test_389ds.py @@ -1,5 +1,8 @@ """Basic tests for the 389-ds Application container image.""" from pytest_container.runtime import LOCALHOST +from tenacity import retry +from tenacity import stop_after_delay +from tenacity import wait_fixed from bci_tester.data import CONTAINER_389DS_CONTAINERS @@ -8,6 +11,19 @@ def test_ldapwhoami(auto_container_per_test): + # Wait for the container to have started up. This is + # done as a HEALTHCHECK, but HEALTHCHECKs do not exist + # in OCI container builds + # https://github.com/opencontainers/image-spec/issues/749 + + @retry(wait=wait_fixed(5), stop=stop_after_delay(60)) + def wait_liveness(): + auto_container_per_test.connection.run_expect( + [0], "/usr/lib/dirsrv/dscontainer -H" + ) + + wait_liveness() + auto_container_per_test.connection.run_expect( [0], "dsconf localhost backend create --suffix dc=example,dc=com --be-name userRoot",