Skip to content

Commit

Permalink
Merge pull request #1016 from tejal29/fix_test_flake
Browse files Browse the repository at this point in the history
fix test flake
  • Loading branch information
tejal29 authored Feb 1, 2020
2 parents de4b734 + 0e833e4 commit c0c26bd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/util/fs_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,10 @@ func TestUpdateWhitelist(t *testing.T) {
Path: "/var/run",
PrefixMatchOnly: false,
},
{
Path: "/tmp/apt-key-gpghome",
PrefixMatchOnly: true,
},
},
},
{
Expand All @@ -1292,6 +1296,10 @@ func TestUpdateWhitelist(t *testing.T) {
Path: "/etc/mtab",
PrefixMatchOnly: false,
},
{
Path: "/tmp/apt-key-gpghome",
PrefixMatchOnly: true,
},
},
},
}
Expand All @@ -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)
})
}
Expand Down

0 comments on commit c0c26bd

Please sign in to comment.