summaryrefslogtreecommitdiff
path: root/test/scripts/testutils.sh
blob: 6879695d9e6704294a6e1d7a6b9b7b809cf71992 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
. ${top_srcdir}/test/test.shvars

fail() {
    echo "$@"
    false
}

assert_equal() {
    test "$2" = "$3" || fail "$1 $2 != expected $3"
}

get_treesize() {
    ${top_srcdir}/tools/loginfo.py --config ${top_srcdir}/test/catlfish-test.cfg --localconfig ${top_srcdir}/test/catlfish-test-local-merge.cfg --treesize https://localhost:8080/
}

check_sth() {
    ${top_srcdir}/tools/check-sth.py ${BASEURL} --publickey=keys/logkey.pem --cur-sth=stored-sth --cafile httpsca/demoCA/cacert.pem || fail "Check STH failed"
}

do_merge() {
    ${top_srcdir}/tools/merge --config ${top_srcdir}/test/catlfish-test.cfg --timing --localconfig ${top_srcdir}/test/catlfish-test-local-merge.cfg || fail "Merge failed"
    sleep 5                     # FIXME: Just wait for dist instead.
}