Skip to content

Commit f7bd43c

Browse files
Merge pull request #5216 from estesp/testimage-429
Switch test image to a non rate-limited manifest list
2 parents a7b456d + 6e343f2 commit f7bd43c

2 files changed

Lines changed: 11 additions & 29 deletions

File tree

integration/client/client_unix_test.go

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
package containerd
2020

2121
import (
22-
"runtime"
2322
"testing"
2423

2524
. "github.com/containerd/containerd"
@@ -33,28 +32,11 @@ const (
3332
)
3433

3534
var (
36-
testImage string
35+
testImage = "mirror.gcr.io/library/busybox:latest"
3736
shortCommand = withProcessArgs("true")
3837
longCommand = withProcessArgs("/bin/sh", "-c", "while true; do sleep 1; done")
3938
)
4039

41-
func init() {
42-
switch runtime.GOARCH {
43-
case "386":
44-
testImage = "docker.io/i386/alpine:latest"
45-
case "arm":
46-
testImage = "docker.io/arm32v6/alpine:latest"
47-
case "arm64":
48-
testImage = "docker.io/arm64v8/alpine:latest"
49-
case "ppc64le":
50-
testImage = "docker.io/ppc64le/alpine:latest"
51-
case "s390x":
52-
testImage = "docker.io/s390x/alpine:latest"
53-
default:
54-
testImage = "docker.io/library/alpine:latest"
55-
}
56-
}
57-
5840
func TestImagePullSchema1WithEmptyLayers(t *testing.T) {
5941
client, err := newClient(t, address)
6042
if err != nil {

integration/client/container_linux_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -887,10 +887,10 @@ func TestContainerUsername(t *testing.T) {
887887
io.Copy(buf, direct.Stdout)
888888
}()
889889

890-
// squid user in the alpine image has a uid of 31
890+
// the www-data user in the busybox image has a uid of 33
891891
container, err := client.NewContainer(ctx, id,
892892
WithNewSnapshot(id, image),
893-
WithNewSpec(oci.WithImageConfig(image), oci.WithUsername("squid"), oci.WithProcessArgs("id", "-u")),
893+
WithNewSpec(oci.WithImageConfig(image), oci.WithUsername("www-data"), oci.WithProcessArgs("id", "-u")),
894894
)
895895
if err != nil {
896896
t.Fatal(err)
@@ -916,16 +916,16 @@ func TestContainerUsername(t *testing.T) {
916916
wg.Wait()
917917

918918
output := strings.TrimSuffix(buf.String(), "\n")
919-
if output != "31" {
920-
t.Errorf("expected squid uid to be 31 but received %q", output)
919+
if output != "33" {
920+
t.Errorf("expected www-data uid to be 33 but received %q", output)
921921
}
922922
}
923923

924924
func TestContainerUser(t *testing.T) {
925925
t.Parallel()
926-
t.Run("UserNameAndGroupName", func(t *testing.T) { testContainerUser(t, "squid:squid", "31:31") })
927-
t.Run("UserIDAndGroupName", func(t *testing.T) { testContainerUser(t, "1001:squid", "1001:31") })
928-
t.Run("UserNameAndGroupID", func(t *testing.T) { testContainerUser(t, "squid:1002", "31:1002") })
926+
t.Run("UserNameAndGroupName", func(t *testing.T) { testContainerUser(t, "www-data:www-data", "33:33") })
927+
t.Run("UserIDAndGroupName", func(t *testing.T) { testContainerUser(t, "1001:www-data", "1001:33") })
928+
t.Run("UserNameAndGroupID", func(t *testing.T) { testContainerUser(t, "www-data:1002", "33:1002") })
929929
t.Run("UserIDAndGroupID", func(t *testing.T) { testContainerUser(t, "1001:1002", "1001:1002") })
930930
}
931931

@@ -1225,7 +1225,7 @@ func TestContainerUserID(t *testing.T) {
12251225
io.Copy(buf, direct.Stdout)
12261226
}()
12271227

1228-
// adm user in the alpine image has a uid of 3 and gid of 4.
1228+
// sys user in the busybox image has a uid and gid of 3.
12291229
container, err := client.NewContainer(ctx, id,
12301230
WithNewSnapshot(id, image),
12311231
WithNewSpec(oci.WithImageConfig(image), oci.WithUserID(3), oci.WithProcessArgs("sh", "-c", "echo $(id -u):$(id -g)")),
@@ -1254,8 +1254,8 @@ func TestContainerUserID(t *testing.T) {
12541254
wg.Wait()
12551255

12561256
output := strings.TrimSuffix(buf.String(), "\n")
1257-
if output != "3:4" {
1258-
t.Errorf("expected uid:gid to be 3:4, but received %q", output)
1257+
if output != "3:3" {
1258+
t.Errorf("expected uid:gid to be 3:3, but received %q", output)
12591259
}
12601260
}
12611261

0 commit comments

Comments
 (0)