From 2b38ef94a1141ec3ef6f907a12f2ff4e7804be56 Mon Sep 17 00:00:00 2001 From: Lukas Puehringer Date: Mon, 29 Apr 2024 17:26:23 +0200 Subject: [PATCH] Remove workaround and refine process name to be killed Signed-off-by: Lukas Puehringer --- tests/scripts/init-vault.sh | 4 +--- tests/scripts/stop-vault.sh | 10 +--------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/scripts/init-vault.sh b/tests/scripts/init-vault.sh index 27330c65..f6fc1cd6 100644 --- a/tests/scripts/init-vault.sh +++ b/tests/scripts/init-vault.sh @@ -1,8 +1,6 @@ #!/usr/bin/env bash -# Start vault in background. `|| true` eats the non-zero exit code, when the -# background process is killed, so that it does not fail the Github Action. -{ vault server -dev -dev-root-token-id="${VAULT_TOKEN}" & } || true +vault server -dev -dev-root-token-id="${VAULT_TOKEN}" & until vault status do diff --git a/tests/scripts/stop-vault.sh b/tests/scripts/stop-vault.sh index 8d55954e..fe4f59f4 100644 --- a/tests/scripts/stop-vault.sh +++ b/tests/scripts/stop-vault.sh @@ -1,11 +1,3 @@ #!/usr/bin/env bash -pid=$(pgrep -f vault) -kill $pid - -# make sure to exit with 0 -while kill -0 $pid -do - sleep 1 -done -exit 0 +pkill -f "vault server -dev"