summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--catlfish-benchmark/Dockerfile11
-rwxr-xr-x[-rw-r--r--]catlfish-benchmark/bench.sh38
-rw-r--r--catlfish-benchmark/catlfish.cfg2
-rwxr-xr-xcatlfish-benchmark/createauthkeys.sh12
-rwxr-xr-xcatlfish-benchmark/createca.sh15
-rwxr-xr-xcatlfish-benchmark/createcert.sh7
-rwxr-xr-xcatlfish-benchmark/createlogkey.sh6
-rw-r--r--catlfish-benchmark/merge.cfg2
8 files changed, 82 insertions, 11 deletions
diff --git a/catlfish-benchmark/Dockerfile b/catlfish-benchmark/Dockerfile
index 7ade722..50ccce4 100644
--- a/catlfish-benchmark/Dockerfile
+++ b/catlfish-benchmark/Dockerfile
@@ -1,8 +1,13 @@
FROM catlfish-dev
+USER root
RUN apt-get update
+RUN apt-get install python-pyasn1
+
RUN echo 'debconf debconf/frontend select noninteractive' | debconf-set-selections
-#USER catlfish
-ADD catlfish.config merge.config /usr/local/etc/catlfish/
-ADD bench.sh /var/run/catlfish/
+RUN ln -s /usr/local/catlfish/lib /var/run/catlfish/
+ADD catlfish.cfg merge.cfg /usr/local/etc/catlfish/
+ADD fest.config mergebackup.config signing.config /var/run/catlfish/
+ADD bench.sh submit.sh createca.sh createcert.sh createlogkey.sh createauthkeys.sh /var/run/catlfish/
+ADD testcertca.pem /var/run/catlfish/known_roots/
ENTRYPOINT ["/var/run/catlfish/bench.sh"]
diff --git a/catlfish-benchmark/bench.sh b/catlfish-benchmark/bench.sh
index 126b4af..e53b061 100644..100755
--- a/catlfish-benchmark/bench.sh
+++ b/catlfish-benchmark/bench.sh
@@ -1,9 +1,24 @@
#! /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
-chunksize=10000
[ -n "$1" ] && { ierations=$1; shift; }
-[ -n "$1" ] && { chunksize=$1; shift; }
erlbase=/usr/local/catlfish
@@ -16,18 +31,29 @@ for nodename in mergebackup signing fest; do
"exec $erlbase/bin/erl -config $nodename"
done
-for iter in $iterations; do
+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"
- ./submit.sh $chunksize
+
+ 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
- python /usr/local/src/catlfish/tools/merge.py \
+ /usr/local/src/catlfish/tools/merge \
--config /usr/local/etc/catlfish/catlfish.cfg \
--localconfig /usr/local/etc/catlfish/merge.cfg \
- --timing
+ --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
diff --git a/catlfish-benchmark/catlfish.cfg b/catlfish-benchmark/catlfish.cfg
index 3f93a05..2d48fa5 100644
--- a/catlfish-benchmark/catlfish.cfg
+++ b/catlfish-benchmark/catlfish.cfg
@@ -6,7 +6,7 @@ frontendnodes:
address: localhost:8082
storagenodes:
- - name: storage
+ - name: frontend
address: localhost:8081
signingnodes:
diff --git a/catlfish-benchmark/createauthkeys.sh b/catlfish-benchmark/createauthkeys.sh
new file mode 100755
index 0000000..920cc38
--- /dev/null
+++ b/catlfish-benchmark/createauthkeys.sh
@@ -0,0 +1,12 @@
+NODES="frontend merge signing mergebackup"
+
+mkdir privatekeys
+mkdir publickeys
+
+for node in $NODES; do
+ (
+ cd privatekeys
+ /usr/local/src/catlfish/tools/create-key.sh $node
+ )
+ mv privatekeys/$node.pem publickeys/
+done
diff --git a/catlfish-benchmark/createca.sh b/catlfish-benchmark/createca.sh
new file mode 100755
index 0000000..a9dc06f
--- /dev/null
+++ b/catlfish-benchmark/createca.sh
@@ -0,0 +1,15 @@
+mkdir httpsca
+( cd httpsca ; \
+ mkdir -p demoCA/newcerts ; \
+ touch demoCA/index.txt ; \
+ echo 00 > demoCA/serial ; \
+ echo '[ req ]' > caconfig.txt ; \
+ echo 'distinguished_name = req_distinguished_name' >> caconfig.txt ; \
+ echo 'x509_extensions = v3_ca' >> caconfig.txt ; \
+ echo 'string_mask = utf8only' >> caconfig.txt ; \
+ echo '[ req_distinguished_name ]' >> caconfig.txt ; \
+ echo '[ v3_ca ]' >> caconfig.txt ; \
+ echo 'basicConstraints=CA:true' >> caconfig.txt ; \
+ openssl req -newkey rsa:2048 -keyout key.pem -out req.csr -nodes -subj '/countryName=SE/stateOrProvinceName=Stockholm/organizationName=Test/commonName=ca/O=ca' -config caconfig.txt ; \
+ openssl ca -in req.csr -selfsign -keyfile key.pem -out demoCA/cacert.pem -batch \
+ )
diff --git a/catlfish-benchmark/createcert.sh b/catlfish-benchmark/createcert.sh
new file mode 100755
index 0000000..3dbe81f
--- /dev/null
+++ b/catlfish-benchmark/createcert.sh
@@ -0,0 +1,7 @@
+mkdir httpscert
+openssl req -new -newkey rsa:2048 -keyout httpscert/httpskey.pem -out httpsca/httpscert.csr -nodes -subj '/countryName=SE/stateOrProvinceName=Stockholm/organizationName=Test/CN=localhost'
+(
+ cd httpsca
+ openssl ca -in httpscert.csr -keyfile key.pem -out httpscert.pem -batch
+)
+cp httpsca/httpscert.pem httpscert/
diff --git a/catlfish-benchmark/createlogkey.sh b/catlfish-benchmark/createlogkey.sh
new file mode 100755
index 0000000..48d7324
--- /dev/null
+++ b/catlfish-benchmark/createlogkey.sh
@@ -0,0 +1,6 @@
+mkdir keys
+(
+ cd keys
+ /usr/local/src/catlfish/tools/create-key.sh logkey
+)
+openssl pkcs8 -topk8 -nocrypt -in keys/logkey-private.pem -out keys/logkey-private.pkcs8
diff --git a/catlfish-benchmark/merge.cfg b/catlfish-benchmark/merge.cfg
index 61b41f2..7ce2f89 100644
--- a/catlfish-benchmark/merge.cfg
+++ b/catlfish-benchmark/merge.cfg
@@ -6,5 +6,5 @@ paths:
logpublickey: keys/logkey.pem
privatekeys: privatekeys
known_roots: known_roots/
-
+ verifycert_bin: /usr/local/src/catlfish/verifycert.erl
mergedb: /var/run/catlfish/bench/merge/db