aboutsummaryrefslogtreecommitdiff
path: root/integration/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'integration/test.sh')
-rwxr-xr-xintegration/test.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/integration/test.sh b/integration/test.sh
index 5305f20..8826d4b 100755
--- a/integration/test.sh
+++ b/integration/test.sh
@@ -148,6 +148,7 @@ function run_tests() {
log_url=$ssrv_endpoint/$ssrv_prefix/sigsum/v0
test_alive
+ test_add_leaf
warn "many tests are missing"
}
@@ -159,6 +160,26 @@ function test_alive() {
pass "get an HTTP 200 OK response"
}
+function test_add_leaf() {
+ desc="add one leaf"
+ output=$(leaf_req $desc | curl -s -w "%{http_code}" --data-binary @- $log_url/add-leaf)
+ if [[ $output != 200 ]]; then
+ fail "$desc: valid ($output)"
+ return
+ fi
+
+ pass $desc
+}
+
+function leaf_req() {
+ data=$1
+ echo "shard_hint=$ssrv_shard_start"
+ echo "checksum=$(openssl dgst -binary <(echo $data) | base16)"
+ echo "signature=$(echo $data | sigsum-debug sign -k $cli_priv -s $ssrv_shard_start)"
+ echo "verification_key=$cli_pub"
+ echo "domain_hint=$cli_domain_hint"
+}
+
function die() {
echo -e "\e[37m$(date +"%y-%m-%d %H:%M:%S %Z")\e[0m [\e[31mFATA\e[0m] $@" >&2
exit 1