From bbfb7d1cfa3129c371f4fc451df090703dc6e11a Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Fri, 24 Mar 2023 10:19:22 +0100 Subject: [PATCH] Allow running func tests while running containers with crowdsec (#2137) Co-authored-by: Thibault "bui" Koechlin --- test/bin/assert-crowdsec-not-running | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/bin/assert-crowdsec-not-running b/test/bin/assert-crowdsec-not-running index c6f381af9..78e702ea0 100755 --- a/test/bin/assert-crowdsec-not-running +++ b/test/bin/assert-crowdsec-not-running @@ -1,7 +1,8 @@ #!/usr/bin/env bash is_crowdsec_running() { - PIDS=$(pgrep -x 'crowdsec|crowdsec.test|crowdsec.cover') + # ignore processes in containers + PIDS=$(pgrep --ns $$ -x 'crowdsec|crowdsec.test|crowdsec.cover') } # The process can be slow, especially on CI and during test coverage.