summaryrefslogtreecommitdiff
path: root/test/scripts/perf-test.sh
blob: 085de14b9c834503ca51ab7c06a723916f05df4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/sh

set -o nounset
set -o errexit

top_srcdir=$(cd $(dirname $0)/../..; pwd)

. ${top_srcdir}/test/scripts/testutils.sh

SCRIPTS=${top_srcdir}/test/scripts

tests_start() {
    ${SCRIPTS}/light-system-test-start.sh "$@"
}

tests_stop() {
    ${SCRIPTS}/light-system-test-stop.sh "$@"
}

tests_stop_all() {
    ${SCRIPTS}/light-system-test-stop.sh mergeprimary mergesecondary frontend signing
}

${SCRIPTS}/light-system-test-prepare.sh
${top_srcdir}/tools/initlog.py --config machine/merge-1/catlfish-test.cfg --localconfig machine/merge-1/catlfish-test-local-merge-1.cfg

cp ${top_srcdir}/test/known_roots/* known_roots

tests_start signing
tests_start merge_2only frontendexceptlast mergeprimary

do_merge 0
check_sth

assert_equal "Tree size" "$(get_treesize)" 0

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 10000 || (tests_stop ; fail "Merge failed")
check_sth || (tests_stop ; fail "Check STH failed")

python ${top_srcdir}/tools/storagegc.py --config machine/machine-frontend-1/catlfish-test.cfg --localconfig machine/machine-frontend-1/catlfish-test-local-frontend-1.cfg  || fail "GC failed" &
python ${top_srcdir}/tools/storagegc.py --config machine/machine-frontend-1/catlfish-test.cfg --localconfig machine/machine-frontend-2/catlfish-test-local-frontend-2.cfg  || fail "GC failed" &

wait_for_equal "Tree size" "${top_srcdir}/tools/mergestatus.py --config machine/merge-1/catlfish-test.cfg --localconfig current-merge-localconfig.cfg" "10000 10000 10000" 400


sleep 5
tests_stop merge_2only mergeprimary
sleep 5

${top_srcdir}/tools/genconfig.sh ${top_srcdir}/test/catlfish-test-mergefailover.cfg.in privatekeys keys/logkey.pem httpsca/demoCA/cacert.pem ${top_srcdir}/test/logadminkey-private.pem catlfish-test-generated.cfg
${top_srcdir}/test/scripts/reload-config.sh
${SCRIPTS}/light-system-test-prepare-merge-takeover.sh

tests_start mergeprimary merge_3only

python ${top_srcdir}/tools/submitcert.py --parallel=1 --store ${top_srcdir}/tools/testcerts/cert3.txt --check-sct --sct-file=submittedcerts ${BASEURL} --publickey=keys/logkey.pem --cafile httpsca/demoCA/cacert.pem || fail "Submission failed"

do_merge 10001 || (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-1/catlfish-test.cfg --localconfig current-merge-localconfig.cfg" "10001 10001 10001" 400


sleep 5
tests_stop mergesecondary frontendexceptlast mergeprimary
sleep 5
${top_srcdir}/tools/genconfig.sh ${top_srcdir}/test/catlfish-test-redistribute-frontend.cfg.in privatekeys keys/logkey.pem httpsca/demoCA/cacert.pem ${top_srcdir}/test/logadminkey-private.pem catlfish-test-generated.cfg
${top_srcdir}/test/scripts/reload-config.sh

. ${top_srcdir}/test/test.shvars

tests_start mergesecondary frontendexceptfirst mergeprimary

python ${top_srcdir}/tools/submitcert.py --parallel=1 --store ${top_srcdir}/tools/testcerts/cert2.txt --check-sct --sct-file=submittedcerts https://localhost:8090/ --publickey=keys/logkey.pem --cafile httpsca/demoCA/cacert.pem || fail "Submission failed"

do_merge 10002 || (tests_stop ; fail "Merge failed")
wait_for_equal "Tree size" "${top_srcdir}/tools/mergestatus.py --config machine/merge-1/catlfish-test.cfg --localconfig current-merge-localconfig.cfg" "10002 10002 10002" 800
check_sth || (tests_stop ; fail "Check STH failed")

sleep 5
tests_stop_all
sleep 5

echo Success

#grep timing: bench-[123] > bench.txt
#${top_srcdir}/tools/parsebench.py bench.txt > bench.html