Skip to content

Instantly share code, notes, and snippets.

@ramr
Created September 6, 2018 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramr/ced20f285c07b26942f90ae5a961b249 to your computer and use it in GitHub Desktop.
Save ramr/ced20f285c07b26942f90ae5a961b249 to your computer and use it in GitHub Desktop.
healthz test
#!/bin/bash
echo " - Test 1: [gG][eE][tT] "
echo " - Test 1.1: Get"
echo "Get /healthz HTTP/1.1
host:apps.ocp.example.com
connection:close
" | socat stdio TCP4:127.0.0.1:1936
echo ""
echo " - Test 1.2: get"
echo "get /healthz HTTP/1.1
host: metrics.test
connection: close
" | socat stdio TCP4:127.0.0.1:1936
echo ""
echo " - Test 1.3: gEt"
echo "gEt /healthz HTTP/1.1
Host: metrics.test
Connection: close
" | socat stdio TCP4:127.0.0.1:1936
echo ""
echo " - Test 1.4: gET"
echo "gET /healthz HTTP/1.1
Host: metrics.test
Connection: close
" | socat stdio TCP4:127.0.0.1:1936
echo ""
echo " - Test 1.5: GET"
echo "GET /healthz HTTP/1.1
Host: metrics.test
Connection: close
" | socat stdio TCP4:127.0.0.1:1936
echo ""
echo " - Test 2: Bad request"
echo "test-/healthz-HTTP/1.1
host:metrics.test
connection:close
" | socat stdio TCP4:127.0.0.1:1936
echo ""
echo " - Test 3: secure content"
echo "GET /some/other/uri HTTP/1.1
Host: metrics.test
Connection: close
" | socat stdio TCP4:127.0.0.1:1936
echo ""
echo " - Test 4: curl "
echo " - Test 4.1: curl http "
curl http://127.0.0.1:1936/healthz
echo ""
echo " - Test 4.2: curl https "
curl -k https://127.0.0.1:1936/healthz
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment