diff --git a/pkg/util/fs_util_test.go b/pkg/util/fs_util_test.go index 1b714fb591..e2529ed972 100644 --- a/pkg/util/fs_util_test.go +++ b/pkg/util/fs_util_test.go @@ -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) }) }