Skip to content

Commit ec5504a

Browse files
committed
test/e2e: Use "frozen" tag to reference test images
This makes it possible to update the image loaded for e2e tests without modifying all tests that use them. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
1 parent 41b6ec0 commit ec5504a

7 files changed

Lines changed: 12 additions & 12 deletions

File tree

cli/command/image/build_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestRunBuildDockerfileFromStdinWithCompress(t *testing.T) {
3434

3535
cli := test.NewFakeCli(&fakeClient{imageBuildFunc: fakeImageBuild})
3636
dockerfile := bytes.NewBufferString(`
37-
FROM alpine:3.6
37+
FROM alpine:frozen
3838
COPY foo /
3939
`)
4040
cli.SetIn(streams.NewIn(io.NopCloser(dockerfile)))
@@ -66,7 +66,7 @@ func TestRunBuildResetsUidAndGidInContext(t *testing.T) {
6666
dir := fs.NewDir(t, "test-build-context",
6767
fs.WithFile("foo", "some content", fs.AsUser(65534, 65534)),
6868
fs.WithFile("Dockerfile", `
69-
FROM alpine:3.6
69+
FROM alpine:frozen
7070
COPY foo bar /
7171
`),
7272
)
@@ -155,7 +155,7 @@ func TestRunBuildFromLocalGitHubDir(t *testing.T) {
155155
func TestRunBuildWithSymlinkedContext(t *testing.T) {
156156
t.Setenv("DOCKER_BUILDKIT", "0")
157157
dockerfile := `
158-
FROM alpine:3.6
158+
FROM alpine:frozen
159159
RUN echo hello world
160160
`
161161

e2e/image/build_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestBuildFromContextDirectoryWithTag(t *testing.T) {
4444
result.Assert(t, icmd.Expected{Err: buildkitDisabledWarning})
4545
output.Assert(t, result.Stdout(), map[int]func(string) error{
4646
0: output.Prefix("Sending build context to Docker daemon"),
47-
1: output.Suffix("Step 1/4 : FROM registry:5000/alpine:3.6"),
47+
1: output.Suffix("Step 1/4 : FROM registry:5000/alpine:frozen"),
4848
3: output.Suffix("Step 2/4 : COPY run /usr/bin/run"),
4949
5: output.Suffix("Step 3/4 : RUN run"),
5050
7: output.Suffix("running"),

e2e/image/pull_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestPullWithContentTrust(t *testing.T) {
4141
func TestPullQuiet(t *testing.T) {
4242
result := icmd.RunCommand("docker", "pull", "--quiet", fixtures.AlpineImage)
4343
result.Assert(t, icmd.Success)
44-
assert.Check(t, is.Equal(result.Stdout(), "registry:5000/alpine:3.6\n"))
44+
assert.Check(t, is.Equal(result.Stdout(), "registry:5000/alpine:frozen\n"))
4545
assert.Check(t, is.Equal(result.Stderr(), ""))
4646
}
4747

e2e/internal/fixtures/fixtures.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ const (
1515
// EvilNotaryURL is the location of the evil notary server
1616
EvilNotaryURL = "https://evil-notary-server:4444"
1717
// AlpineImage is an image in the test registry
18-
AlpineImage = "registry:5000/alpine:3.6"
18+
AlpineImage = "registry:5000/alpine:frozen"
1919
// AlpineSha is the sha of the alpine image
2020
AlpineSha = "641b95ddb2ea9dc2af1a0113b6b348ebc20872ba615204fbe12148e98fd6f23d"
2121
// BusyboxImage is an image in the test registry
22-
BusyboxImage = "registry:5000/busybox:1.27.2"
22+
BusyboxImage = "registry:5000/busybox:frozen"
2323
// BusyboxSha is the sha of the busybox image
2424
BusyboxSha = "030fcb92e1487b18c974784dcc110a93147c9fc402188370fbfd17efabffc6af"
2525
)

e2e/stack/testdata/full-stack.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ version: '3.3'
22

33
services:
44
one:
5-
image: registry:5000/alpine:3.6
5+
image: registry:5000/alpine:frozen
66
command: top
77
two:
8-
image: registry:5000/alpine:3.6
8+
image: registry:5000/alpine:frozen
99
command: top

e2e/stack/testdata/stack-with-named-resources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.5'
22
services:
33
web:
4-
image: registry:5000/alpine:3.6
4+
image: registry:5000/alpine:frozen
55
command: top
66
networks: [network1, network2]
77
volumes: [volume1, volume2]

scripts/test/e2e/load-image

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
set -eu -o pipefail
44

55
alpine_src=alpine@sha256:f006ecbb824d87947d0b51ab8488634bf69fe4094959d935c0c103f4820a417d
6-
alpine_dest=registry:5000/alpine:3.6
6+
alpine_dest=registry:5000/alpine:frozen
77

88
busybox_src=busybox@sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7
9-
busybox_dest=registry:5000/busybox:1.27.2
9+
busybox_dest=registry:5000/busybox:frozen
1010

1111
fetch_tag_image() {
1212
docker pull "$1"

0 commit comments

Comments
 (0)