You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
943 B

  1. #!/usr/bin/env bash
  2. TEST_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
  3. TEST_OUTPUT_DIR="${TEST_DIR}/output"
  4. DNS_SERVER="${DNS_SERVER:-"127.0.0.1"}"
  5. PEBBLE_BIN="${PEBBLE_BIN:-"$HOME/go/bin/pebble"}"
  6. PEBBLE_BIN_SHORT="$(basename "$PEBBLE_BIN")"
  7. PEBBLE_CONFIG="${TEST_OUTPUT_DIR}/pebble-config.json"
  8. PEBBLE_CONFIG_TPL="${TEST_DIR}/assets/pebble-config.tpl.json"
  9. # Prepare the output directory
  10. rm -rf "$TEST_OUTPUT_DIR"
  11. mkdir -p "$TEST_OUTPUT_DIR"
  12. sed "s@{{TEST_DIR}}@$TEST_DIR@g" "$PEBBLE_CONFIG_TPL" >"$PEBBLE_CONFIG"
  13. # Display settings
  14. echo "Pebble binary: $PEBBLE_BIN"
  15. echo "DNS server: $DNS_SERVER"
  16. echo "Test directory: $TEST_DIR"
  17. echo "Test output directory: $TEST_OUTPUT_DIR"
  18. echo "Pebble configuration:"
  19. cat "$PEBBLE_CONFIG"
  20. # Run Pebble and ACMEd
  21. "$PEBBLE_BIN" -config "$PEBBLE_CONFIG" -dnsserver "$DNS_SERVER" -strict &
  22. sleep 15
  23. # Clean before exit
  24. pkill "$PEBBLE_BIN_SHORT"
  25. rm -rf "$TEST_OUTPUT_DIR"
  26. exit 0