run.sh 914 B

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