feat(test): enhance test_local.sh with better cleanup

- Replace `curl` with `wget` for Vault health check.
- Ensure cleanup of temporary files and directories.
This commit is contained in:
Harald Hoyer 2025-03-20 15:49:47 +01:00
parent fbc8e689d4
commit c662dfbfd8

View file

@ -41,6 +41,7 @@ fi
echo "Starting Vault server in non-dev mode..." echo "Starting Vault server in non-dev mode..."
# Create temporary config file # Create temporary config file
rm -fr /tmp/vault-test/data /tmp/vault-test/config
mkdir -p /tmp/vault-test/data /tmp/vault-test/config mkdir -p /tmp/vault-test/data /tmp/vault-test/config
cat > /tmp/vault-test/config/vault.hcl << EOF cat > /tmp/vault-test/config/vault.hcl << EOF
@ -70,7 +71,7 @@ sleep 5
# Check if Vault is up and running # Check if Vault is up and running
for i in {1..10}; do for i in {1..10}; do
if curl -fs -m 1 http://127.0.0.1:8200/v1/sys/health?standbyok=true\&sealedok=true\&uninitok=true > /dev/null 2>&1; then if wget -q -O- --no-check-certificate http://127.0.0.1:8200/v1/sys/health?standbyok=true\\&sealedok=true\\&uninitok=true > /dev/null 2>&1; then
echo "Vault is up and running!" echo "Vault is up and running!"
break break
fi fi