Browse Source

Allow running func tests while running containers with crowdsec (#2137)

Co-authored-by: Thibault "bui" Koechlin <thibault@crowdsec.net>
mmetc 2 years ago
parent
commit
bbfb7d1cfa
1 changed files with 2 additions and 1 deletions
  1. 2 1
      test/bin/assert-crowdsec-not-running

+ 2 - 1
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.