Switch test image to a non rate-limited manifest list
Signed-off-by: Phil Estes <estesp@amazon.com>
This commit is contained in:
@@ -887,10 +887,10 @@ func TestContainerUsername(t *testing.T) {
|
||||
io.Copy(buf, direct.Stdout)
|
||||
}()
|
||||
|
||||
// squid user in the alpine image has a uid of 31
|
||||
// the www-data user in the busybox image has a uid of 33
|
||||
container, err := client.NewContainer(ctx, id,
|
||||
WithNewSnapshot(id, image),
|
||||
WithNewSpec(oci.WithImageConfig(image), oci.WithUsername("squid"), oci.WithProcessArgs("id", "-u")),
|
||||
WithNewSpec(oci.WithImageConfig(image), oci.WithUsername("www-data"), oci.WithProcessArgs("id", "-u")),
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -916,16 +916,16 @@ func TestContainerUsername(t *testing.T) {
|
||||
wg.Wait()
|
||||
|
||||
output := strings.TrimSuffix(buf.String(), "\n")
|
||||
if output != "31" {
|
||||
t.Errorf("expected squid uid to be 31 but received %q", output)
|
||||
if output != "33" {
|
||||
t.Errorf("expected www-data uid to be 33 but received %q", output)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerUser(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Run("UserNameAndGroupName", func(t *testing.T) { testContainerUser(t, "squid:squid", "31:31") })
|
||||
t.Run("UserIDAndGroupName", func(t *testing.T) { testContainerUser(t, "1001:squid", "1001:31") })
|
||||
t.Run("UserNameAndGroupID", func(t *testing.T) { testContainerUser(t, "squid:1002", "31:1002") })
|
||||
t.Run("UserNameAndGroupName", func(t *testing.T) { testContainerUser(t, "www-data:www-data", "33:33") })
|
||||
t.Run("UserIDAndGroupName", func(t *testing.T) { testContainerUser(t, "1001:www-data", "1001:33") })
|
||||
t.Run("UserNameAndGroupID", func(t *testing.T) { testContainerUser(t, "www-data:1002", "33:1002") })
|
||||
t.Run("UserIDAndGroupID", func(t *testing.T) { testContainerUser(t, "1001:1002", "1001:1002") })
|
||||
}
|
||||
|
||||
@@ -1225,7 +1225,7 @@ func TestContainerUserID(t *testing.T) {
|
||||
io.Copy(buf, direct.Stdout)
|
||||
}()
|
||||
|
||||
// adm user in the alpine image has a uid of 3 and gid of 4.
|
||||
// sys user in the busybox image has a uid and gid of 3.
|
||||
container, err := client.NewContainer(ctx, id,
|
||||
WithNewSnapshot(id, image),
|
||||
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) {
|
||||
wg.Wait()
|
||||
|
||||
output := strings.TrimSuffix(buf.String(), "\n")
|
||||
if output != "3:4" {
|
||||
t.Errorf("expected uid:gid to be 3:4, but received %q", output)
|
||||
if output != "3:3" {
|
||||
t.Errorf("expected uid:gid to be 3:3, but received %q", output)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user