From 9611100d3a0c841770a4cedc7507b6d27331b495 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Wed, 8 Feb 2017 15:37:40 +0100 Subject: Make perf-test work with continuous merge --- test/scripts/perf-test.sh | 44 ++++++++++++++++++++++++++++---------------- tools/mergestatus.py | 7 ++++--- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/test/scripts/perf-test.sh b/test/scripts/perf-test.sh index aaf3b1d..3766cf1 100755 --- a/test/scripts/perf-test.sh +++ b/test/scripts/perf-test.sh @@ -10,32 +10,39 @@ top_srcdir=$(cd $(dirname $0)/../..; pwd) SCRIPTS=${top_srcdir}/test/scripts tests_start() { - ${SCRIPTS}/light-system-test-start.sh + ${SCRIPTS}/light-system-test-start.sh "$@" } tests_stop() { - ${SCRIPTS}/light-system-test-stop.sh + ${SCRIPTS}/light-system-test-stop.sh "$@" +} + +tests_stop_all() { + ${SCRIPTS}/light-system-test-stop.sh mergeprimary mergesecondary frontend storage signing } ${SCRIPTS}/light-system-test-prepare.sh +${top_srcdir}/tools/initlog.py --config machine/merge/catlfish-test.cfg --localconfig machine/merge/catlfish-test-local-merge.cfg cp ${top_srcdir}/test/known_roots/* known_roots -tests_start +tests_start signing +tests_start mergesecondary storage frontend mergeprimary -do_merge +do_merge 0 check_sth assert_equal "Tree size" "$(get_treesize)" 0 -python ${top_srcdir}/tools/submitcert.py --parallel=1 --store ${top_srcdir}/test/bulktestcerts/0000.zip --sct-file=submittedcerts ${BASEURL} --publickey=keys/logkey.pem --cafile httpsca/demoCA/cacert.pem || (tests_stop ; fail "Submission failed") - +python ${top_srcdir}/tools/submitcert.py --parallel=30 --store ${top_srcdir}/test/bulktestcerts/0000.zip --sct-file=submittedcerts ${BASEURL} --publickey=keys/logkey.pem --cafile httpsca/demoCA/cacert.pem || (tests_stop ; fail "Submission failed") -do_merge 2> bench-1 || (tests_stop ; fail "Merge failed") +do_merge 10000 || (tests_stop ; fail "Merge failed") check_sth || (tests_stop ; fail "Check STH failed") +wait_for_equal "Tree size" "${top_srcdir}/tools/mergestatus.py --config machine/merge/catlfish-test.cfg --localconfig machine/merge/catlfish-test-local-merge.cfg" "10000 10000 10000" 400 + sleep 5 -tests_stop +tests_stop mergesecondary storage frontend mergeprimary sleep 5 mv mergedb mergedb-down @@ -44,13 +51,17 @@ mkdir mergedb-secondary touch mergedb-secondary/logorder printf 0 > mergedb-secondary/verifiedsize -tests_start +${top_srcdir}/tools/initlog.py --config machine/merge/catlfish-test.cfg --localconfig machine/merge/catlfish-test-local-merge.cfg --promote-secondary + +tests_start mergesecondary storage frontend mergeprimary -do_merge 2> bench-2 || (tests_stop ; fail "Merge failed") +do_merge 10000 || (tests_stop ; fail "Merge failed") check_sth || (tests_stop ; fail "Check STH failed") +wait_for_equal "Tree size" "${top_srcdir}/tools/mergestatus.py --config machine/merge/catlfish-test.cfg --localconfig machine/merge/catlfish-test-local-merge.cfg" "10000 10000 10000" 400 + sleep 5 -tests_stop +tests_stop mergesecondary storage frontend mergeprimary sleep 5 mv machine/machine-1 machine/machine-1-down @@ -58,14 +69,15 @@ mkdir -p machine/machine-1/db touch machine/machine-1/db/index touch machine/machine-1/db/newentries -tests_start +tests_start mergesecondary storage frontend mergeprimary -do_merge 2> bench-3 || (tests_stop ; fail "Merge failed") +do_merge 10000 || (tests_stop ; fail "Merge failed") +wait_for_equal "Tree size" "${top_srcdir}/tools/mergestatus.py --config machine/merge/catlfish-test.cfg --localconfig machine/merge/catlfish-test-local-merge.cfg" "10000 10000 10000" 400 check_sth || (tests_stop ; fail "Check STH failed") sleep 5 -tests_stop +tests_stop_all sleep 5 -grep timing: bench-[123] > bench.txt -${top_srcdir}/tools/parsebench.py bench.txt > bench.html +#grep timing: bench-[123] > bench.txt +#${top_srcdir}/tools/parsebench.py bench.txt > bench.html diff --git a/tools/mergestatus.py b/tools/mergestatus.py index f47cc68..95cf2e8 100755 --- a/tools/mergestatus.py +++ b/tools/mergestatus.py @@ -28,7 +28,7 @@ def main(): currentsize = json.loads(open(currentsizefile, "r").read()) - print >>sys.stderr, currentsize["index"]+1, + print currentsize["index"]+1, for mergenode in mergenodes: if mergenode["name"] == config["primarymergenode"]: @@ -36,13 +36,14 @@ def main(): verifiedfile = mergedb + "/verified." + mergenode["name"] try: tree = json.loads(open(verifiedfile, "r").read()) - print >>sys.stderr, tree["tree_size"], + print tree["tree_size"], except (IOError, ValueError): pass try: sth = json.loads(open(sthfile, "r").read()) - print >>sys.stderr, sth["tree_size"], + print sth["tree_size"], except IOError, e: + print ".", if e.errno != errno.ENOENT: raise print -- cgit v1.1