Skip to content

Commit 6ede9e4

Browse files
committed
check log lines for specific error
1 parent 1f6e6b4 commit 6ede9e4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/suite/graceful_recovery_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,13 @@ func checkContainerLogsForErrors(ngfPodName string) {
280280
&core.PodLogOptions{Container: ngfContainerName},
281281
)
282282
Expect(err).ToNot(HaveOccurred())
283-
if !*plusEnabled {
284-
Expect(logs).ToNot(ContainSubstring("\"level\":\"error\""), logs)
283+
284+
for _, line := range strings.Split(logs, "\n") {
285+
if *plusEnabled && strings.Contains(line, "[error]") {
286+
Expect(line).To(ContainSubstring("Usage reporting must be enabled when using NGINX Plus"), line)
287+
} else {
288+
Expect(line).ToNot(ContainSubstring("[error]"), line)
289+
}
285290
}
286291
}
287292

0 commit comments

Comments
 (0)