commit cd9bee6b524245634c89fb003504ed4d51046754 parent ca4dc82767029ad1f47752ce54bcc4b4f6030c37 Author: Marcello Stanisci <stanisci.m@gmail.com> Date: Tue, 9 Jan 2018 16:05:25 +0100 more diagnostics from failed-to-restart services Diffstat:
| M | buildbot/checks.sh | | | 73 | +++++++++++++++++++++++++++++++++++++++++++++++++++---------------------- |
1 file changed, 51 insertions(+), 22 deletions(-)
diff --git a/buildbot/checks.sh b/buildbot/checks.sh @@ -8,50 +8,79 @@ if test $active = "test-blue"; then nonactive="green" fi -if ! test 200 = $(curl \ +error_stringify () +{ + case $1 in + 28) echo "connection timed out" ;; + 7) echo "failed to connect to host" ;; + *) echo "unknown, see curl man page" ;; + esac +} + +error_fmt="%s (http status code: %s)/(curl exit code: %s - %s)\n" + +http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ -s https://exchange.test.taler.net/ -o /dev/null \ - -w "%{http_code}"); then - echo Exchange did not restart correctly + -w "%{http_code}") +if ! test 200 = $http_status_code; then + printf "%s (http status code: %s)/(curl exit code: %s - %s)\n" \ + "Exchange did not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi -if ! test 200 = $(curl \ +http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ -s http://backend.test.taler.net/ -o /dev/null \ - -w "%{http_code}"); then - echo Merchant backend did not restart correctly + -w "%{http_code}") +if ! test 200 = $http_status_code; then + printf $error_fmt \ + "Merchant backend did not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi -if ! test 200 = $(curl \ +http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://shop.test.taler.net/ -o /dev/null \ - -w "%{http_code}"); then - echo Blog did not restart correctly + -s http://shop.test.taler.net/ -o /dev/null \ + -w "%{http_code}") +if ! test 200 = $http_status_code; then + printf $error_fmt \ + "Blog did not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi -if ! test 200 = $(curl \ +http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://donations.test.taler.net/ -o /dev/null \ - -w "%{http_code}"); then - echo Donations shop did not restart correctly + -s http://donations.test.taler.net/ -o /dev/null \ + -w "%{http_code}") +if ! test 200 = $http_status_code; then + printf $error_fmt \ + "Donations shop did not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi -if ! test 302 = $(curl \ +http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://bank.test.taler.net/ -o /dev/null \ - -w "%{http_code}"); then - echo Bank did not restart correctly + -s http://bank.test.taler.net/ -o /dev/null \ + -w "%{http_code}") +if ! test 302 = $http_status_code; then + printf $error_fmt \ + "Bank did not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi -if ! test 200 = $(curl \ +http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://test.taler.net/en/index.html -o /dev/null \ - -w "%{http_code}"); then - echo Landing page did not restart correctly + -s http://test.taler.net/ -o /dev/null \ + -w "%{http_code}") +if ! test 200 = $http_status_code; then + printf $error_fmt \ + "Landing page not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi