No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

33 líneas
1.1KB

  1. #!/usr/bin/env bash
  2. # Frontend-agnostic test runner: plain curl + a JSON parser, no PowerShell,
  3. # no cscript, no SSH access to the VM required. Runnable from any CLI that
  4. # can reach the site over HTTP.
  5. #
  6. # Usage: ./run-self-test.sh http://100.127.62.31:8090
  7. set -euo pipefail
  8. BASE_URL="${1:?Usage: run-self-test.sh <base-url>, e.g. http://100.127.62.31:8090}"
  9. response=$(curl -sf "$BASE_URL/self-test")
  10. echo "$response" | python3 -m json.tool
  11. ok=$(echo "$response" | python3 -c 'import json, sys; print("true" if json.load(sys.stdin)["ok"] else "false")')
  12. if [ "$ok" != "true" ]; then
  13. echo "RESULT: FAILURE"
  14. exit 1
  15. fi
  16. # URL Rewrite is not the only entry path: Default.asp is directly addressable.
  17. # Prove this test app still cannot activate a production route through its
  18. # internal route query string.
  19. hello_status=$(curl -sS -o /dev/null -w '%{http_code}' "$BASE_URL/Default.asp?route=/hello")
  20. if [ "$hello_status" != "404" ]; then
  21. echo "FAIL: test app direct Default.asp activated production route (HTTP $hello_status)" >&2
  22. exit 1
  23. fi
  24. echo "PASS: test app rejects production route through direct Default.asp"
  25. echo "RESULT: ALL PASS"

Powered by TurnKey Linux.