From 93f913c0835963ae643233d9b2cbec5a385870f9 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Wed, 26 Jan 2022 01:01:50 +0100 Subject: integration: Add a basic "it runs test" --- integration/run | 84 +++++++++++++++++++++++++++++++++++++++++++ integration/start_sigsum_serv | 17 +++++++++ integration/start_tlog_seq | 10 ++++++ integration/start_tlog_serv | 6 ++++ 4 files changed, 117 insertions(+) create mode 100755 integration/run create mode 100755 integration/start_sigsum_serv create mode 100755 integration/start_tlog_seq create mode 100755 integration/start_tlog_serv diff --git a/integration/run b/integration/run new file mode 100755 index 0000000..f04ddf5 --- /dev/null +++ b/integration/run @@ -0,0 +1,84 @@ +#!/bin/bash + +# +# You will need to configure Trillian locally on your test machine. See +# +# cmd/sigsum_log_go/README.md. +# +# for some pointers. Ensure that trillian_log_server and trillian_log_signer +# are in $GOPATH, and set the appropriate Trillian id in start_sigsum_server. +# +# You will also need to install into your $GOPATH: +# +# go install cmd/sigsum_log_go/main.go +# go install cmd/tmp/cosign/main.go +# go install cmd/tmp/submit/main.go +# +# Run the test as follows: +# +# 1. start_tlog_seq ("terminal 1") +# 2. start_tlog_serv ("terminal 2") +# 3. start_sigsum_serv ("terminal 3") +# 4. run ("terminal 4") +# +# What you expect to see is if the different endpoints function. +# +# - There is a to-cosign tree head +# - Submitting four entries work +# - Adding a cosignature works +# - Cosigned tree head is not available (waiting for rotate) +# - Experimental checkpoint works +# - Consistency proof works +# - Fetching entries work +# - Cosigned tree head is available (tree heads rotated) +# +# Warning: it is assumed that there are at least 4 leaves in the database. +# Warning: the get-inclusion-proof endpoint is not poked. +# Warning: this needs to be replaced, see issues/add-integration-test.md. +# +now=$(date +%s) +url=http://localhost:6965/testonly/sigsum/v0 +log_vk=8cf3ac85aadd42891c5ae9aef27244cb2a546a2312f80020aad3f2ae1af73314 +wit_sk=e1d7c494dacb0ddf809a17e4528b01f584af22e3766fa740ec52a1711c59500d711090dd2286040b50961b0fe09f58aa665ccee5cb7ee042d819f18f6ab5046b +submit_sk=094277235c42f5f8cba2b63cb14506938b4408730732e3e82e1473e63217767c5aed7ffc3bc088221f6579567b2e6e3c4ac3579bd5e77670755179052c68d5d3 +shard_hint=$(date +%s) +domain_hint=sigsum.rgdd.se + +wait_seconds=5 + +echo "test: get-tree-head-to-sign" +curl $url/get-tree-head-to-sign +sleep $wait_seconds; echo "" + +echo "test: submitting four..." +$GOPATH/bin/submit --sk=$submit_sk --shard_hint=$shard_hint --domain_hint=$domain_hint | bash +sleep $wait_seconds + +echo "test: cosigning..." +$GOPATH/bin/cosign --url=$url --log_vk=$log_vk --sk=$wit_sk +sleep $wait_seconds +echo "" + +echo "test: get-tree-head-cosigned" +curl $url/get-tree-head-cosigned +sleep $wait_seconds +echo "" + +echo "test: get-checkpoint" +curl $url/get-checkpoint +sleep $wait_seconds +echo "" + +echo "test: get-consistency-proof" +printf "old_size=1\nnew_size=4\n" | curl --data-binary @- $url/get-consistency-proof +sleep $wait_seconds +echo "" + +echo "test: get-leaves (first and second)" +printf "start_size=0\nend_size=1\n" | curl --data-binary @- $url/get-leaves +sleep $wait_seconds +echo "" + +echo "with 30s interval we should now have a cosigned tree head" +curl $url/get-tree-head-cosigned +echo "" diff --git a/integration/start_sigsum_serv b/integration/start_sigsum_serv new file mode 100755 index 0000000..b5768e9 --- /dev/null +++ b/integration/start_sigsum_serv @@ -0,0 +1,17 @@ +#!/bin/bash + +sk=5f69afebc2d6f23c5e56fcbd5bab45b0bf76d70b3f82f8f071a72ceb75c277a48cf3ac85aadd42891c5ae9aef27244cb2a546a2312f80020aad3f2ae1af73314 +vk=8cf3ac85aadd42891c5ae9aef27244cb2a546a2312f80020aad3f2ae1af73314 +wit=711090dd2286040b50961b0fe09f58aa665ccee5cb7ee042d819f18f6ab5046b +tree_id=4251255065613170469 +shard_start=1 +prefix=testonly + +echo "running sigsum-log-go with vk: $vk" +$GOPATH/bin/sigsum_log_go \ + --logtostderr --v 3\ + --prefix $prefix \ + --key $sk \ + --trillian_id $tree_id \ + --witnesses $wit \ + --shard_interval_start $shard_start diff --git a/integration/start_tlog_seq b/integration/start_tlog_seq new file mode 100755 index 0000000..29d1fb3 --- /dev/null +++ b/integration/start_tlog_seq @@ -0,0 +1,10 @@ +#!/bin/bash + +$GOPATH/bin/trillian_log_signer \ + --logtostderr \ + --force_master \ + --rpc_endpoint=localhost:6961 \ + --http_endpoint=localhost:6964 \ + --num_sequencers 1 \ + --sequencer_interval 100ms \ + --batch_size 100 diff --git a/integration/start_tlog_serv b/integration/start_tlog_serv new file mode 100755 index 0000000..a9fc5dd --- /dev/null +++ b/integration/start_tlog_serv @@ -0,0 +1,6 @@ +#!/bin/bash + +$GOPATH/bin/trillian_log_server \ + --logtostderr \ + --rpc_endpoint=localhost:6962 \ + --http_endpoint=localhost:6963 -- cgit v1.2.3