diff options
author | Linus Nordberg <linus@nordu.net> | 2017-01-23 15:47:12 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2017-01-23 15:47:12 +0100 |
commit | a4709803d2e824cd447e3906cfb5ee89068802fc (patch) | |
tree | e4296ceceb1732404392b9578ba475ed567b12f6 /test/scripts/light-system-test-prepare.sh | |
parent | 08b7a3e0ae682840adb0515273c27ace0f692a31 (diff) | |
parent | a490e6616882ea698a23f1f780ff442479dda0ba (diff) |
Merge remote-tracking branch 'refs/remotes/map/config-api-key'
Diffstat (limited to 'test/scripts/light-system-test-prepare.sh')
-rwxr-xr-x | test/scripts/light-system-test-prepare.sh | 29 |
1 files changed, 18 insertions, 11 deletions
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 |