| 123456789101112131415161718192021222324 |
- #!/bin/sh
- # Host-side wrapper for the unbound-sec test suite.
- #
- # Creates test fixtures, then runs the suite inside a docker:cli container
- # (Docker socket mounted) so every test target is a container.
- #
- # Usage (from repo root): ./test/run.sh
- set -eu
- REPO="$(cd "$(dirname "$0")/.." && pwd)"
- rm -rf "$REPO/test/fixture-config-ok" "$REPO/test/fixture-config-bad"
- mkdir -p "$REPO/test/fixture-config-ok" "$REPO/test/fixture-config-bad"
- printf 'server:\n verbosity: 2\n' > "$REPO/test/fixture-config-ok/99-test.conf"
- printf 'server:\n this-is-not-a-valid-option: 1\n' > "$REPO/test/fixture-config-bad/99-broken.conf"
- # Mount the repo at the same absolute path inside the runner so that
- # bind mounts for the fixture dirs resolve on the host side.
- docker run --rm \
- -v /var/run/docker.sock:/var/run/docker.sock \
- -v "$REPO":"$REPO" \
- -w "$REPO" \
- -e REPO_PATH="$REPO" \
- docker:cli sh test/run-tests.sh
|