@@ -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
924924func 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