asynciodebian/masterdebian/stretch-backportsproxy-ticketupstream
Last change
on this file since 81433f1 was
b0e5dae,
checked in by Thomas Klute <thomas2.klute@…>, 5 years ago
|
Test suite: Add support for SoftHSM 2
./configure now detects SoftHSM version 1 or 2, and test case
"24_pkcs11_cert" can use either to provide its PKCS #11 token.
|
-
Property mode set to
100755
|
File size:
1012 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 |
---|
6 | # config files with absolute paths to the token database from a |
---|
7 | # template. Generating them 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 | if [ "${SOFTHSM_MAJOR_VERSION}" = "1" ]; then |
---|
17 | cat - >"${tmp_softhsm_conf}" <<EOF |
---|
18 | 0:$(realpath $(pwd))/server/softhsm.db |
---|
19 | EOF |
---|
20 | export SOFTHSM_CONF="${tmp_softhsm_conf}" |
---|
21 | elif [ "${SOFTHSM_MAJOR_VERSION}" = "2" ]; then |
---|
22 | cat - >"${tmp_softhsm_conf}" <<EOF |
---|
23 | objectstore.backend = file |
---|
24 | directories.tokendir = $(realpath $(pwd))/server/softhsm2.db |
---|
25 | EOF |
---|
26 | export SOFTHSM2_CONF="${tmp_softhsm_conf}" |
---|
27 | fi |
---|
28 | |
---|
29 | echo "Generated temporary SoftHSM config ${tmp_softhsm_conf}:" |
---|
30 | cat "${tmp_softhsm_conf}" |
---|
31 | |
---|
32 | . $(dirname ${0})/softhsm.bash |
---|
33 | |
---|
34 | set -e |
---|
35 | |
---|
36 | ${srcdir}/runtests t-24 |
---|
37 | |
---|
38 | cleanup_tmpconf |
---|
39 | trap - EXIT |
---|
Note: See
TracBrowser
for help on using the repository browser.