mirror of
https://github.com/containers/podman.git
synced 2025-05-25 11:06:18 +08:00

* Make endpoint compatibile with docker-py network expectations * Update specgen helper when called from compat endpoint * Update godoc on types * Add test for network/container create using docker-py method * Add syslog logging when DEBUG=1 for tests Fixes #8361 Signed-off-by: Jhon Honce <jhonce@redhat.com>
22 lines
623 B
Python
22 lines
623 B
Python
from docker import DockerClient
|
|
|
|
from test.python.docker import constant
|
|
|
|
|
|
def run_top_container(client: DockerClient):
|
|
c = client.containers.create(constant.ALPINE, command="top", detach=True, tty=True, name="top")
|
|
c.start()
|
|
return c.id
|
|
|
|
|
|
def remove_all_containers(client: DockerClient):
|
|
for ctnr in client.containers.list(all=True):
|
|
ctnr.remove(force=True)
|
|
|
|
|
|
def remove_all_images(client: DockerClient):
|
|
for img in client.images.list():
|
|
# FIXME should DELETE /images accept the sha256: prefix?
|
|
id_ = img.id.removeprefix("sha256:")
|
|
client.images.remove(id_, force=True)
|