fix: handle unset crond_line (nounset crash) and improve test diagnostics
Docker Build and Push / lint (push) Successful in 8s
Docker Build and Push / lint (pull_request) Successful in 6s
Docker Build and Push / build (pull_request) Successful in 12s
Docker Build and Push / build (push) Successful in 17s
Docker Build and Push / test (pull_request) Successful in 15s
Docker Build and Push / test (push) Successful in 15s
Docker Build and Push / push (pull_request) Has been skipped
Docker Build and Push / push (push) Successful in 17s

This commit is contained in:
2026-06-08 23:10:54 +00:00
parent 9fb7bcae49
commit d1c751ee31
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -11,8 +11,13 @@ CONTAINER_NAME="test-crond-$$"
# Test 1: Container starts and crond is running
docker run -d --name "$CONTAINER_NAME" "$IMAGE"
sleep 3
if docker exec "$CONTAINER_NAME" pgrep crond > /dev/null 2>&1; then
sleep 4
if [ "$(docker inspect "$CONTAINER_NAME" --format='{{.State.Running}}')" != "true" ]; then
echo "FAIL: container exited prematurely"
echo "=== Container logs ==="
docker logs "$CONTAINER_NAME" 2>&1 || true
FAILED=$((FAILED + 1))
elif docker exec "$CONTAINER_NAME" pgrep crond > /dev/null 2>&1; then
echo "PASS: crond is running"
PASSED=$((PASSED + 1))
else