Files
docker-stacks/tests/utils/get_container_health.py
Ayaz Salikhov b35f1554d6 Test server listening on IPv4/IPv6 (#2255)
* Test server listening on IPv4/IPv6

* Set up Docker in create-dev-env

* Show docker version

* Add info about docker client

* Check requests

* Show docker client version

* Try to pass docker sock

* Fix

* Break fast

* Revert

* Cleanup

* Better naming

* Always use docker.from_env

* Revert "Always use docker.from_env"

This reverts commit d03069ac28.

* Use custom docker client for only one test

* More logs

* Use cont_data_dir in test, so workdir doesn't matter

* Use common variable names

* Move patch to a separate function

* Try to use set-host option

* Use the same docker client in get_health

* Use .api

* Rewrite check_listening.py to use one function for both ipv4 and ipv6

* Add links to explain why we need to set up docker manually
2025-03-20 17:12:22 +00:00

10 lines
377 B
Python

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import docker
from docker.models.containers import Container
def get_health(container: Container, client: docker.DockerClient) -> str:
inspect_results = client.api.inspect_container(container.name)
return inspect_results["State"]["Health"]["Status"] # type: ignore