summaryrefslogtreecommitdiff
path: root/test/scripts/testutils.sh
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2016-10-14 16:54:57 +0200
committerMagnus Ahltorp <map@kth.se>2016-10-14 16:54:57 +0200
commitc8af4e40e0096f60a5cf5039be775ff002619c4d (patch)
treee059ba998a4624fa950c12e2ca369be30d92c61d /test/scripts/testutils.sh
parentc1dfe32e2ba948e62535102ab6dbafa60c3c6eda (diff)
Test failing merge backup
Refactor tests
Diffstat (limited to 'test/scripts/testutils.sh')
-rw-r--r--test/scripts/testutils.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/scripts/testutils.sh b/test/scripts/testutils.sh
new file mode 100644
index 0000000..94d6223
--- /dev/null
+++ b/test/scripts/testutils.sh
@@ -0,0 +1,22 @@
+. ${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 --localconfig ${top_srcdir}/test/catlfish-test-local-merge.cfg || fail "Merge failed"
+}