summaryrefslogtreecommitdiff
path: root/catlfish-benchmark/bench.sh
blob: e53b06195b5558055651b08512882a8a77fe8862 (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
#! /bin/sh

./createca.sh
./createcert.sh
./createlogkey.sh
./createauthkeys.sh

mkdir -p bench/merge/db/
touch bench/merge/db/logorder

mkdir -p bench/fest/db/
touch bench/fest/db/index
touch bench/fest/db/newentries

mkdir -p bench/mergebackup/db/
touch bench/mergebackup/db/logorder
printf 0 > bench/mergebackup/db/verifiedsize


iterations=2
[ -n "$1" ] && { ierations=$1; shift; }

erlbase=/usr/local/catlfish

for nodename in mergebackup signing fest; do
    mkdir -p /var/run/catlfish/erlang_log/$nodename
    echo "Starting $nodename"
    $erlbase/bin/run_erl -daemon \
        /var/run/catlfish/ \
        /var/run/catlfish/erlang_log/$nodename/ \
        "exec $erlbase/bin/erl -config $nodename"
done

sleep 3

/usr/local/src/catlfish/tools/merge \
    --config /usr/local/etc/catlfish/catlfish.cfg \
    --localconfig /usr/local/etc/catlfish/merge.cfg \
    --timing 2>mergeoutput.0 || exit 1


for iter in $(seq $iterations); do
    echo "Iteration ${iter}/${iterations} starting"

    
    until /usr/local/src/catlfish/tools/submitcert.py --parallel 8 --store /var/local/testcerts/bulk-1.zip --cafile httpsca/demoCA/cacert.pem --sct-file=sct-iter-$iter https://localhost:8080/ ; do sleep 10; done

    echo "$0: merging"
    date
    /usr/local/src/catlfish/tools/merge \
           --config /usr/local/etc/catlfish/catlfish.cfg \
           --localconfig /usr/local/etc/catlfish/merge.cfg \
           --timing 2>mergeoutput.$iter || exit 1
    date

    /usr/local/src/catlfish/tools/verifysct.py --sct-file sct-iter-$iter --cafile httpsca/demoCA/cacert.pem --publickey keys/logkey.pem https://localhost:8080/ || exit 1

    echo "Iteration ${iter}/${iterations} finished"
done