Skip to content

Commit

Permalink
Sleep longer for the 389ds container tests
Browse files Browse the repository at this point in the history
the Tumbleweed containers are build as OCI images, so "HEALTHCHECK" is
not implemented anymore. we still however need to wait for the container
to finish initalization.
  • Loading branch information
dirkmueller committed Sep 22, 2023
1 parent 36c1d18 commit 46b7cc6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_389ds.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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",
Expand Down

0 comments on commit 46b7cc6

Please sign in to comment.