From 029704b14a46645bb4d8ba6056d83f5f08ea0af8 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Sun, 27 Mar 2022 15:16:29 +0200 Subject: integration: add basic alive test --- integration/test.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'integration') diff --git a/integration/test.sh b/integration/test.sh index fe09ad0..9ca8df5 100755 --- a/integration/test.sh +++ b/integration/test.sh @@ -145,7 +145,18 @@ function check_setup() { } function run_tests() { - info "TODO: add tests" + log_url=$ssrv_endpoint/$ssrv_prefix/sigsum/v0 + + test_alive + + warn "many tests are missing" +} + +function test_alive() { + [[ $(curl -s -w "%{http_code}" $log_url/get-tree-head-to-sign | tail -n1) == 200 ]] || + fail "get an HTTP 200 OK response" + + pass "get an HTTP 200 OK response" } function die() { @@ -161,4 +172,13 @@ function warn() { echo -e "\e[90m$(date +"%Y-%m-%d %H:%M:%S")\e[0m [\e[33mWARN\e[0m] $@" >&2 } +function pass() { + echo -e "\e[90m$(date +"%Y-%m-%d %H:%M:%S")\e[0m [\e[32mPASS\e[0m] $@" >&2 +} + +function fail() { + echo -e "\e[90m$(date +"%Y-%m-%d %H:%M:%S")\e[0m [\e[1;31mFAIL\e[0m] $@" >&2 + die "abort due to failed tests" +} + main -- cgit v1.2.3