summaryrefslogtreecommitdiff
path: root/test/scripts/light-system-test-prepare.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/scripts/light-system-test-prepare.sh')
-rwxr-xr-xtest/scripts/light-system-test-prepare.sh40
1 files changed, 15 insertions, 25 deletions
diff --git a/test/scripts/light-system-test-prepare.sh b/test/scripts/light-system-test-prepare.sh
index 1f68ed1..9b500c9 100755
--- a/test/scripts/light-system-test-prepare.sh
+++ b/test/scripts/light-system-test-prepare.sh
@@ -41,39 +41,29 @@ createcert
mkdir keys
(cd keys ; ${top_srcdir}/tools/create-key.sh logkey)
openssl pkcs8 -topk8 -nocrypt -in keys/logkey-private.pem -out keys/logkey-private.pkcs8
-mkdir mergedb
-mkdir mergedb-secondary
-touch mergedb-secondary/logorder
-printf 0 > mergedb-secondary/verifiedsize
+
mkdir known_roots
cp ${top_srcdir}/tools/testcerts/roots/* known_roots
mkdir privatekeys
-for node in ${NODES}; do \
+for node in ${NODES}; do
(cd privatekeys ; ${top_srcdir}/tools/create-key.sh ${node})
mkdir -p nodes/${node}/log
+ mkdir -p machine/${node}/db
+ cp ${top_srcdir}/test/catlfish-test-local-${node}.cfg machine/${node}/
done
-${top_srcdir}/tools/genconfig.sh ${top_srcdir}/test/catlfish-test.cfg.in privatekeys keys/logkey.pem httpsca/demoCA/cacert.pem ${top_srcdir}/test/logadminkey-private.pem catlfish-test-generated.cfg
-
-for machine in ${MACHINES}; do \
- mkdir -p machine/machine-${machine}/db
- cp ${top_srcdir}/test/catlfish-test-local-${machine}.cfg machine/machine-${machine}/
- ${top_srcdir}/tools/getconfig.py --localconfig machine/machine-${machine}/catlfish-test-local-${machine}.cfg --dest machine/machine-${machine}/catlfish-test.cfg
- ${top_srcdir}/tools/compileconfig.py --config machine/machine-${machine}/catlfish-test.cfg --localconfig machine/machine-${machine}/catlfish-test-local-${machine}.cfg
- touch machine/machine-${machine}/db/index && touch machine/machine-${machine}/db/newentries
+for node in ${MERGESECONDARYNODES}; do
+ nodename=$(echo ${node} | cut -f 1 -d ':')
+ printf 0 > machine/${nodename}/db/verifiedsize
done
-mkdir -p machine/merge
-cp ${top_srcdir}/test/catlfish-test-local-merge.cfg machine/merge/
-${top_srcdir}/tools/getconfig.py --localconfig machine/merge/catlfish-test-local-merge.cfg --dest machine/merge/catlfish-test.cfg
-${top_srcdir}/tools/compileconfig.py --config machine/merge/catlfish-test.cfg --localconfig machine/merge/catlfish-test-local-merge.cfg
-mkdir -p machine/merge-2
-cp ${top_srcdir}/test/catlfish-test-local-merge-2.cfg machine/merge-2/
-${top_srcdir}/tools/getconfig.py --localconfig machine/merge-2/catlfish-test-local-merge-2.cfg --dest machine/merge-2/catlfish-test.cfg
-${top_srcdir}/tools/compileconfig.py --config machine/merge-2/catlfish-test.cfg --localconfig machine/merge-2/catlfish-test-local-merge-2.cfg
-mkdir -p machine/signing
-cp ${top_srcdir}/test/catlfish-test-local-signing.cfg machine/signing/
-${top_srcdir}/tools/getconfig.py --localconfig machine/signing/catlfish-test-local-signing.cfg --dest machine/signing/catlfish-test.cfg
-${top_srcdir}/tools/compileconfig.py --config machine/signing/catlfish-test.cfg --localconfig machine/signing/catlfish-test-local-signing.cfg
+
+
test -x ${SOFTHSM} && ${SOFTHSM} --init-token --slot=0 --label=mylabel --so-pin=ffff --pin=ffff || true
test -x ${SOFTHSM} && ${SOFTHSM} --import keys/logkey-private.pkcs8 --slot 0 --label mylabel --pin ffff --id 00 || true
+
+${top_srcdir}/tools/genconfig.sh ${top_srcdir}/test/catlfish-test.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
+
+cp machine/merge-1/catlfish-test-local-merge-1.cfg current-merge-localconfig.cfg