Merge pull request #1016 from tejal29/fix_test_flake

fix test flake
This commit is contained in:
Tejal Desai
2020-02-01 15:18:54 -08:00
committed by GitHub
+14
View File
@@ -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)
})
}