mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 08:54:40 +02:00
@@ -1279,6 +1279,10 @@ func TestUpdateWhitelist(t *testing.T) {
|
||||
Path: "/var/run",
|
||||
PrefixMatchOnly: false,
|
||||
},
|
||||
{
|
||||
Path: "/tmp/apt-key-gpghome",
|
||||
PrefixMatchOnly: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1292,6 +1296,10 @@ func TestUpdateWhitelist(t *testing.T) {
|
||||
Path: "/etc/mtab",
|
||||
PrefixMatchOnly: false,
|
||||
},
|
||||
{
|
||||
Path: "/tmp/apt-key-gpghome",
|
||||
PrefixMatchOnly: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1300,6 +1308,12 @@ func TestUpdateWhitelist(t *testing.T) {
|
||||
whitelist = initialWhitelist
|
||||
defer func() { whitelist = initialWhitelist }()
|
||||
UpdateWhitelist(tt.whitelistVarRun)
|
||||
sort.Slice(tt.expected, func(i, j int) bool {
|
||||
return tt.expected[i].Path < tt.expected[j].Path
|
||||
})
|
||||
sort.Slice(whitelist, func(i, j int) bool {
|
||||
return whitelist[i].Path < whitelist[j].Path
|
||||
})
|
||||
testutil.CheckDeepEqual(t, tt.expected, whitelist)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user