Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion test/extended/cli/mustgather.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ var _ = g.Describe("[cli] oc adm must-gather", func() {
// make sure we do not log OAuth tokens
for _, auditDirectory := range auditDirectories {
eventsChecked := 0
wrongPrefix := 0
err := filepath.Walk(path.Join(auditDirectory...), func(path string, info os.FileInfo, err error) error {
g.By(path)
o.Expect(err).ToNot(o.HaveOccurred())
Expand All @@ -147,7 +148,9 @@ var _ = g.Describe("[cli] oc adm must-gather", func() {
if !strings.HasSuffix(text, "}") {
continue // ignore truncated data
}
o.Expect(text).To(o.HavePrefix(`{"kind":"Event",`))
if !strings.HasPrefix(text, `{"kind":"Event",`) {
wrongPrefix++
}
for _, token := range []string{"oauthaccesstokens", "oauthauthorizetokens", tokenName} {
o.Expect(text).ToNot(o.ContainSubstring(token))
}
Expand All @@ -162,6 +165,7 @@ var _ = g.Describe("[cli] oc adm must-gather", func() {
})
o.Expect(err).ToNot(o.HaveOccurred())
o.Expect(eventsChecked).To(o.BeNumerically(">", 10000))
o.Expect(wrongPrefix).To(o.BeNumerically("<", 5))
}
})

Expand Down