Changeset b0e5dae in mod_gnutls for test/test-24_pkcs11_cert.bash


Ignore:
Timestamp:
Feb 12, 2016, 9:20:46 PM (4 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
aeaf28b
Parents:
6f644fa
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test-24_pkcs11_cert.bash

    r6f644fa rb0e5dae  
    33testdir="$(dirname ${0})/tests/24_pkcs11_cert"
    44
    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
     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
    88# tree was moved.
    99tmp_softhsm_conf="$(mktemp mod_gnutls_test-XXXXXX.conf)"
     
    1414trap cleanup_tmpconf EXIT
    1515
    16 cat - >"${tmp_softhsm_conf}" <<EOF
     16if [ "${SOFTHSM_MAJOR_VERSION}" = "1" ]; then
     17    cat - >"${tmp_softhsm_conf}" <<EOF
    17180:$(realpath $(pwd))/server/softhsm.db
    1819EOF
    19 export SOFTHSM_CONF="${tmp_softhsm_conf}"
     20    export SOFTHSM_CONF="${tmp_softhsm_conf}"
     21elif [ "${SOFTHSM_MAJOR_VERSION}" = "2" ]; then
     22    cat - >"${tmp_softhsm_conf}" <<EOF
     23objectstore.backend = file
     24directories.tokendir = $(realpath $(pwd))/server/softhsm2.db
     25EOF
     26    export SOFTHSM2_CONF="${tmp_softhsm_conf}"
     27fi
     28
    2029echo "Generated temporary SoftHSM config ${tmp_softhsm_conf}:"
    2130cat "${tmp_softhsm_conf}"
Note: See TracChangeset for help on using the changeset viewer.