summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile2
-rw-r--r--test/catlfish-test.cfg.in (renamed from test/catlfish-test.cfg)0
-rwxr-xr-xtest/scripts/light-system-test-prepare.sh29
3 files changed, 19 insertions, 12 deletions
diff --git a/test/Makefile b/test/Makefile
index c92c30d..a033de6 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -11,7 +11,7 @@ tests-wait:
sleep 5
tests-makemk:
- $(PREFIX)/tools/compileconfig.py --config=$(PREFIX)/test/catlfish-test.cfg --testshellvars=$(PREFIX)/test/test.shvars --machines 1
+ $(PREFIX)/tools/compileconfig.py --config=$(PREFIX)/test/catlfish-test.cfg.in --testshellvars=$(PREFIX)/test/test.shvars --machines 1
tests:
@make tests-makemk
diff --git a/test/catlfish-test.cfg b/test/catlfish-test.cfg.in
index 39288c7..39288c7 100644
--- a/test/catlfish-test.cfg
+++ b/test/catlfish-test.cfg.in
diff --git a/test/scripts/light-system-test-prepare.sh b/test/scripts/light-system-test-prepare.sh
index 6f6dd07..df45d25 100755
--- a/test/scripts/light-system-test-prepare.sh
+++ b/test/scripts/light-system-test-prepare.sh
@@ -38,6 +38,7 @@ createcert () {
createca
createcert
+cafingerprint=$(openssl x509 -in httpsca/demoCA/cacert.pem -noout -sha256 -fingerprint | sed -e 's/.*=//' -e 's/://g')
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
@@ -48,6 +49,23 @@ touch mergedb-secondary/logorder
printf 0 > mergedb-secondary/verifiedsize
mkdir known_roots
cp ${top_srcdir}/tools/testcerts/roots/* known_roots
+mkdir privatekeys
+mkdir publickeys
+echo "apikeys:" > api-keys.cfg
+for node in ${NODES}; do \
+ (cd privatekeys ; ${top_srcdir}/tools/create-key.sh ${node})
+ apipk=$(grep -v '^-----' privatekeys/${node}.pem | tr '\n' ' ')
+ mkdir -p nodes/${node}/log
+ echo " - nodename: ${node}" >> api-keys.cfg
+ echo " publickey: ${apipk}" >> api-keys.cfg
+done
+
+logpk=$(grep -v '^-----' keys/logkey.pem | tr '\n' ' ')
+echo "logpublickey: ${logpk}" >> api-keys.cfg
+echo "cafingerprint: ${cafingerprint}" >> api-keys.cfg
+
+
+cat ${top_srcdir}/test/catlfish-test.cfg.in api-keys.cfg > ${top_srcdir}/test/catlfish-test.cfg
for machine in ${MACHINES}; do \
${top_srcdir}/tools/compileconfig.py --config ${top_srcdir}/test/catlfish-test.cfg --localconfig ${top_srcdir}/test/catlfish-test-local-${machine}.cfg
mkdir -p machine/machine-${machine}/db
@@ -55,16 +73,5 @@ for machine in ${MACHINES}; do \
done
${top_srcdir}/tools/compileconfig.py --config ${top_srcdir}/test/catlfish-test.cfg --localconfig ${top_srcdir}/test/catlfish-test-local-merge-2.cfg
${top_srcdir}/tools/compileconfig.py --config ${top_srcdir}/test/catlfish-test.cfg --localconfig ${top_srcdir}/test/catlfish-test-local-signing.cfg
-mkdir privatekeys
-mkdir publickeys
-for node in ${NODES}; do \
- (cd privatekeys ; ${top_srcdir}/tools/create-key.sh ${node}) ; \
- mv privatekeys/${node}.pem publickeys/ ; \
- mkdir -p nodes/${node}/log
-done
-(cd privatekeys ; ${top_srcdir}/tools/create-key.sh merge-1)
-mv privatekeys/merge-1.pem publickeys/
-(cd privatekeys ; ${top_srcdir}/tools/create-key.sh merge-2)
-mv privatekeys/merge-2.pem publickeys/
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