From d06df36a395a3d0072df03ce34716057ea5524ce Mon Sep 17 00:00:00 2001 From: Aphral Griffin Date: Thu, 17 Oct 2024 16:56:13 +0100 Subject: [PATCH] add unit test --- src/plugins/nginx_test.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/nginx_test.go b/src/plugins/nginx_test.go index cdc1833b42..3e73fc4376 100644 --- a/src/plugins/nginx_test.go +++ b/src/plugins/nginx_test.go @@ -1172,14 +1172,20 @@ func TestNginx_monitorLog(t *testing.T) { expected: "", }, { - name: "ignore usage report test", - errorLog: "2023/06/20 11:01:56 [emerg] 4138#4138: usage report", + name: "ignore error log: usage report ", + errorLog: "2025/06/25 15:08:04 [error] 123456#123456: certificate verify error: (10:certificate has expired) during usage report", treatWarningsAsErrors: false, expected: "", }, { - name: "ignore license expired test", - errorLog: "2023/06/20 11:01:56 [emerg] 4138#4138: license expired", + name: "ignore error log: license expired ", + errorLog: "2025/06/25 15:07:24 [alert] 123456#123456: license expired; the grace period will end in 71 days", + treatWarningsAsErrors: false, + expected: "", + }, + { + name: "ignore error log: usaage report 400", + errorLog: "2024/12/25 15:00:04 [error] 123456#123456: server returned 400 during usage report", treatWarningsAsErrors: false, expected: "", },