ci: add smoke test for htpasswd
Docker Build and Push / lint (push) Failing after 9s
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 7s
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 9s
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 7s
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,30 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
IMAGE="$1"
|
||||
FAILED=0
|
||||
PASSED=0
|
||||
|
||||
assert_contains() {
|
||||
local desc="$1" pattern="$2" file="$3"
|
||||
if grep -qEi "$pattern" "$file"; then
|
||||
echo "PASS: $desc"
|
||||
PASSED=$((PASSED + 1))
|
||||
else
|
||||
echo "FAIL: $desc"
|
||||
FAILED=$((FAILED + 1))
|
||||
fi
|
||||
}
|
||||
|
||||
TMPDIR="$(mktemp -d)"
|
||||
trap 'rm -rf "$TMPDIR"' EXIT
|
||||
|
||||
# Test 1: Container runs without error
|
||||
docker run --rm "$IMAGE" -nb user pass > "$TMPDIR/output" 2>&1 || true
|
||||
assert_contains "Command produces output" "apr1|sha" "$TMPDIR/output"
|
||||
|
||||
echo ""
|
||||
echo "$PASSED/$((PASSED + FAILED)) tests passed"
|
||||
if [ "$FAILED" -gt 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user