From 7866729d3bdc814a905e1041d6ee27d9356ce73f Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Tue, 18 Oct 2022 13:00:35 +0200 Subject: [PATCH] func tests: don't return pid of started process unless asked (#1821) --- tests/lib/init/crowdsec-daemon | 7 +++++++ tests/lib/init/crowdsec-systemd | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tests/lib/init/crowdsec-daemon b/tests/lib/init/crowdsec-daemon index 27a92104f..a232f344b 100755 --- a/tests/lib/init/crowdsec-daemon +++ b/tests/lib/init/crowdsec-daemon @@ -37,6 +37,10 @@ start() { -o "${LOG_DIR}/crowdsec.out" \ "${CROWDSEC}" ./bin/wait-for-port 6060 +} + +start_pid() { + start cat "$DAEMON_PID" } @@ -63,6 +67,9 @@ case "$1" in start) start ;; + start-pid) + start_pid + ;; stop) stop ;; diff --git a/tests/lib/init/crowdsec-systemd b/tests/lib/init/crowdsec-systemd index 75e4bd226..fabc0ffa2 100755 --- a/tests/lib/init/crowdsec-systemd +++ b/tests/lib/init/crowdsec-systemd @@ -33,6 +33,10 @@ fi start() { systemctl start crowdsec ./bin/wait-for-port 6060 +} + +start_pid() { + start pidof /usr/bin/crowdsec } @@ -50,6 +54,9 @@ case "$1" in start) start ;; + start-pid) + start_pid + ;; stop) stop ;;