Skip to content

Commit

Permalink
oci: fix loop iterator aliasing
Browse files Browse the repository at this point in the history
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit ef2560d)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Feb 10, 2023
1 parent 0070ab7 commit 3018234
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions oci/spec_opts_linux_test.go
Expand Up @@ -69,6 +69,7 @@ guest:x:405:100:guest:/dev/null:/sbin/nologin
},
}
for _, testCase := range testCases {
testCase := testCase
t.Run(fmt.Sprintf("user %d", testCase.userID), func(t *testing.T) {
t.Parallel()
s := Spec{
Expand Down Expand Up @@ -128,6 +129,7 @@ guest:x:405:100:guest:/dev/null:/sbin/nologin
},
}
for _, testCase := range testCases {
testCase := testCase
t.Run(testCase.user, func(t *testing.T) {
t.Parallel()
s := Spec{
Expand Down Expand Up @@ -177,11 +179,11 @@ sys:x:3:root,bin,adm
}{
{
user: "root",
expected: []uint32{},
expected: []uint32{1, 2, 3},
},
{
user: "1000",
expected: []uint32{},
expected: nil,
},
{
user: "bin",
Expand All @@ -197,6 +199,7 @@ sys:x:3:root,bin,adm
},
}
for _, testCase := range testCases {
testCase := testCase
t.Run(testCase.user, func(t *testing.T) {
t.Parallel()
s := Spec{
Expand Down Expand Up @@ -489,6 +492,7 @@ daemon:x:2:root,bin,daemon
}

for _, testCase := range testCases {
testCase := testCase
t.Run(testCase.name, func(t *testing.T) {
t.Parallel()
s := Spec{
Expand Down

0 comments on commit 3018234

Please sign in to comment.