mirror of
https://github.com/containers/podman.git
synced 2025-05-24 02:27:00 +08:00
fix: Docker API compatible bool deserialization
In Docker anything but "", "0", "no", "false", "none" (ignoring case) is considered to be true. Signed-off-by: Matej Vasek <mvasek@redhat.com>
This commit is contained in:
@ -239,6 +239,26 @@ class TestContainers(common.DockerTestCase):
|
||||
ret, _ = ctr.exec_run(["stat", "/workspace/scratch/test"])
|
||||
self.assertEqual(ret, 0, "Working directory created if it doesn't exist")
|
||||
|
||||
def test_build_pull(self):
|
||||
dockerfile = (
|
||||
b"FROM quay.io/libpod/alpine:latest\n"
|
||||
b"USER 1000:1000\n"
|
||||
)
|
||||
img: Image
|
||||
img, logs = self.docker.images.build(fileobj=io.BytesIO(dockerfile), quiet=False, pull=True)
|
||||
has_tried_pull = False
|
||||
for e in logs:
|
||||
if "stream" in e and "trying to pull" in e["stream"].lower():
|
||||
has_tried_pull = True
|
||||
self.assertTrue(has_tried_pull, "the build process has not tried to pull the base image")
|
||||
|
||||
img, logs = self.docker.images.build(fileobj=io.BytesIO(dockerfile), quiet=False, pull=False)
|
||||
has_tried_pull = False
|
||||
for e in logs:
|
||||
if "stream" in e and "trying to pull" in e["stream"].lower():
|
||||
has_tried_pull = True
|
||||
self.assertFalse(has_tried_pull, "the build process has tried tried to pull the base image")
|
||||
|
||||
def test_mount_rw_by_default(self):
|
||||
ctr: Optional[Container] = None
|
||||
vol: Optional[Volume] = None
|
||||
|
Reference in New Issue
Block a user