Skip to content

integration: fix TestBuildUserNamespaceValidateCapabilitiesAreV2 not using frozen image#41865

Merged
thaJeztah merged 1 commit into
moby:masterfrom
thaJeztah:load_frozen_images
Jan 13, 2021
Merged

integration: fix TestBuildUserNamespaceValidateCapabilitiesAreV2 not using frozen image#41865
thaJeztah merged 1 commit into
moby:masterfrom
thaJeztah:load_frozen_images

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

Commit f2f5106 (#41740) added this test to verify loading of images that were built with user-namespaces enabled.

However, because this test spins up a new daemon, not the daemon that's set up by the test-suite's TestMain() (which loads the frozen images).

As a result, the debian:bullseye image was pulled from Docker Hub when running the test;

Calling POST /v1.41/images/load?quiet=1
Applying tar in /go/src/github.com/docker/docker/bundles/test-integration/TestBuildUserNamespaceValidateCapabilitiesAreV2/d4d366b15997b/root/165536.165536/overlay2/3f7f9375197667acaf7bc810b34689c21f8fed9c52c6765c032497092ca023d6/diff" storage-driver=overlay
Applied tar sha256:845f0e5159140e9dbcad00c0326c2a506fbe375aa1c229c43f082867d283149c to 3f7f9375197667acaf7bc810b34689c21f8fed9c52c6765c032497092ca023d6, size: 5922359
Calling POST /v1.41/build?buildargs=null&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=0&networkmode=&rm=0&shmsize=0&t=capabilities%3A1.0&target=&ulimits=null&version=
Trying to pull debian from https://registry-1.docker.io v2
Fetching manifest from remote" digest="sha256:f169dbadc9021fc0b08e371d50a772809286a167f62a8b6ae86e4745878d283d" error="<nil>" remote="docker.io/library/debian:bullseye
Pulling ref from V2 registry: debian:bullseye
...

This patch updates TestBuildUserNamespaceValidateCapabilitiesAreV2 to load the frozen image. StartWithBusybox is also changed to Start, because the test is not using the busybox image, so there's no need to load it.

In a followup, we should probably add some utilities to make this easier to set up (and to allow passing the list frozen images that we want to load, without having to "hard-code" the image name to load).

…using frozen image

Commit f2f5106 added this test to verify loading
of images that were built with user-namespaces enabled.

However, because this test spins up a new daemon, not the daemon that's set up by
the test-suite's `TestMain()` (which loads the frozen images).

As a result, the `debian:bullseye` image was pulled from Docker Hub when running
the test;

    Calling POST /v1.41/images/load?quiet=1
    Applying tar in /go/src/github.com/docker/docker/bundles/test-integration/TestBuildUserNamespaceValidateCapabilitiesAreV2/d4d366b15997b/root/165536.165536/overlay2/3f7f9375197667acaf7bc810b34689c21f8fed9c52c6765c032497092ca023d6/diff" storage-driver=overlay
    Applied tar sha256:845f0e5159140e9dbcad00c0326c2a506fbe375aa1c229c43f082867d283149c to 3f7f9375197667acaf7bc810b34689c21f8fed9c52c6765c032497092ca023d6, size: 5922359
    Calling POST /v1.41/build?buildargs=null&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=0&networkmode=&rm=0&shmsize=0&t=capabilities%3A1.0&target=&ulimits=null&version=
    Trying to pull debian from https://registry-1.docker.io v2
    Fetching manifest from remote" digest="sha256:f169dbadc9021fc0b08e371d50a772809286a167f62a8b6ae86e4745878d283d" error="<nil>" remote="docker.io/library/debian:bullseye
    Pulling ref from V2 registry: debian:bullseye
    ...

This patch updates `TestBuildUserNamespaceValidateCapabilitiesAreV2` to load the
frozen image. `StartWithBusybox` is also changed to `Start`, because the test
is not using the busybox image, so there's no need to load it.

In a followup, we should probably add some utilities to make this easier to set up
(and to allow passing the list frozen images that we want to load, without having
to "hard-code" the image name to load).

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah

Copy link
Copy Markdown
Member Author

@cpuguy83 @AkihiroSuda @tonistiigi PTAL

@cpuguy83 cpuguy83 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah

Copy link
Copy Markdown
Member Author

s390x failure is unrelated; the test that was modified passed; https://ci-next.docker.com/public/blue/rest/organizations/jenkins/pipelines/moby/branches/PR-41865/runs/3/nodes/32/log/?start=0

[2021-01-13T09:57:25.056Z] === RUN   TestBuildUserNamespaceValidateCapabilitiesAreV2
[2021-01-13T09:57:35.426Z] Loaded image: buildpack-deps:buster
[2021-01-13T09:57:35.426Z] Loaded image: busybox:latest
[2021-01-13T09:57:35.426Z] Loaded image: busybox:glibc
[2021-01-13T09:57:35.426Z] Loaded image: debian:bullseye
[2021-01-13T09:57:35.717Z] Loaded image: hello-world:latest
[2021-01-13T09:57:35.717Z] Loaded image: arm32v7/hello-world:latest
[2021-01-13T09:57:42.609Z] --- PASS: TestBuildUserNamespaceValidateCapabilitiesAreV2 (17.19s)
[2021-01-13T09:57:42.609Z] PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants