aboutsummaryrefslogtreecommitdiff
path: root/integration
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@mullvad.net>2022-03-27 15:16:29 +0200
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2022-04-21 19:20:05 +0200
commit029704b14a46645bb4d8ba6056d83f5f08ea0af8 (patch)
tree13be528a717adb5c9b48473ce01e9c171cde9e3d /integration
parenta01d5c61f72579f5f5c3fc6a4a5331225587fc36 (diff)
integration: add basic alive test
Diffstat (limited to 'integration')
-rwxr-xr-xintegration/test.sh22
1 files changed, 21 insertions, 1 deletions
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