浏览代码

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

Co-authored-by: Thibault "bui" Koechlin <thibault@crowdsec.net>
mmetc 2 年之前
父节点
当前提交
bbfb7d1cfa
共有 1 个文件被更改,包括 2 次插入1 次删除
  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.