@@ -270,7 +270,7 @@ docker stop http-echo-tests
270270sleep 5
271271
272272
273- message " Start container with LOG_IGNORE_PATH "
273+ message " Start container with LOG_IGNORE_PATH (normal path) "
274274docker run -d --rm -e LOG_IGNORE_PATH=/ping --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
275275sleep 5
276276curl -s -k -X POST -d " banana" https://localhost:8443/ping > /dev/null
@@ -285,6 +285,38 @@ else
285285 exit 1
286286fi
287287
288+ message " Stop containers "
289+ docker stop http-echo-tests
290+ sleep 5
291+
292+ message " Start container with LOG_IGNORE_PATH (regex path)"
293+ docker run -d --rm -e LOG_IGNORE_PATH=" ^\/ping|^\/health|^\/metrics" --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
294+ sleep 5
295+ curl -s -k -X POST -d " banana" https://localhost:8443/metrics > /dev/null
296+
297+ if [ $( docker logs http-echo-tests | wc -l) == 2 ] && \
298+ ! [ $( docker logs http-echo-tests | grep banana) ]
299+ then
300+ passed " LOG_IGNORE_PATH ignored the /metrics path"
301+ else
302+ failed " LOG_IGNORE_PATH failed"
303+ docker logs http-echo-tests
304+ exit 1
305+ fi
306+
307+ # Test a positive case where the path is not ignored
308+ curl -s -k -X POST -d " strawberry" https://localhost:8443/veryvisible > /dev/null
309+
310+ if [[ $( docker logs http-echo-tests | grep strawberry) ]]
311+ then
312+ passed " LOG_IGNORE_PATH didn't ignore the /veryvisible path"
313+ else
314+ failed " LOG_IGNORE_PATH failed, it should not ignore the /veryvisible path"
315+ docker logs http-echo-tests
316+ exit 1
317+ fi
318+
319+
288320
289321message " Stop containers "
290322docker stop http-echo-tests
0 commit comments