ci: add daemon smoke test for crond
Docker Build and Push / lint (push) Failing after 7s
Docker Build and Push / build (push) Has been skipped
Docker Build and Push / test (push) Has been skipped
Docker Build and Push / push (push) Has been skipped
Docker Build and Push / lint (pull_request) Failing after 5s
Docker Build and Push / build (pull_request) Has been skipped
Docker Build and Push / test (pull_request) Has been skipped
Docker Build and Push / push (pull_request) Has been skipped
Docker Build and Push / lint (push) Failing after 7s
Docker Build and Push / build (push) Has been skipped
Docker Build and Push / test (push) Has been skipped
Docker Build and Push / push (push) Has been skipped
Docker Build and Push / lint (pull_request) Failing after 5s
Docker Build and Push / build (pull_request) Has been skipped
Docker Build and Push / test (pull_request) Has been skipped
Docker Build and Push / push (pull_request) Has been skipped
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
IMAGE="$1"
|
||||
FAILED=0
|
||||
PASSED=0
|
||||
|
||||
TMPDIR="$(mktemp -d)"
|
||||
trap 'rm -rf "$TMPDIR"' EXIT
|
||||
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
|
||||
echo "PASS: crond is running"
|
||||
PASSED=$((PASSED + 1))
|
||||
else
|
||||
echo "FAIL: crond is not running"
|
||||
FAILED=$((FAILED + 1))
|
||||
fi
|
||||
|
||||
docker rm -f "$CONTAINER_NAME" > /dev/null 2>&1 || true
|
||||
|
||||
echo ""
|
||||
echo "$PASSED/$((PASSED + FAILED)) tests passed"
|
||||
if [ "$FAILED" -gt 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user