asynciodebian/masterdebian/stretch-backportsjessie-backportsproxy-ticketupstream
Last change
on this file since db6bac4 was
db6bac4,
checked in by Thomas Klute <thomas2.klute@…>, 7 years ago
|
PKCS #11 test case: Generate temporary SoftHSM config from here-document
Makes the test easier to understand, it needs one less static file,
and it will be easier to add SoftHSM 2 support this way.
|
-
Property mode set to
100755
|
File size:
729 bytes
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | testdir="$(dirname ${0})/tests/24_pkcs11_cert" |
---|
4 | |
---|
5 | # The Apache/SoftHSM configuration mixes up directories, so generate a |
---|
6 | # config file with an absolute path to the token database from a |
---|
7 | # template. Generating it on every run avoids problems if the source |
---|
8 | # tree was moved. |
---|
9 | tmp_softhsm_conf="$(mktemp mod_gnutls_test-XXXXXX.conf)" |
---|
10 | function cleanup_tmpconf |
---|
11 | { |
---|
12 | rm "${tmp_softhsm_conf}" |
---|
13 | } |
---|
14 | trap cleanup_tmpconf EXIT |
---|
15 | |
---|
16 | cat - >"${tmp_softhsm_conf}" <<EOF |
---|
17 | 0:$(realpath $(pwd))/server/softhsm.db |
---|
18 | EOF |
---|
19 | export SOFTHSM_CONF="${tmp_softhsm_conf}" |
---|
20 | echo "Generated temporary SoftHSM config ${tmp_softhsm_conf}:" |
---|
21 | cat "${tmp_softhsm_conf}" |
---|
22 | |
---|
23 | . $(dirname ${0})/softhsm.bash |
---|
24 | |
---|
25 | set -e |
---|
26 | |
---|
27 | ${srcdir}/runtests t-24 |
---|
28 | |
---|
29 | cleanup_tmpconf |
---|
30 | trap - EXIT |
---|
Note: See
TracBrowser
for help on using the repository browser.