source: mod_gnutls/test/test-24_pkcs11_cert.bash @ 05984a0

asyncioproxy-ticket
Last change on this file since 05984a0 was 05984a0, checked in by Fiona Klute <fiona.klute@…>, 11 months ago

Replace "runtests" with "runtest.py"

This is the next step from handling HTTP requests and responses in
Python. In particular error handling is a lot easier to do in Python
than using Bash trap functions.

  • Property mode set to 100755
File size: 1.0 KB
RevLine 
[3f00958]1#!/bin/bash
2
[33af2b7]3testdir="$(dirname ${0})/tests/24_pkcs11_cert"
4
[b0e5dae]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
[33af2b7]8# tree was moved.
9tmp_softhsm_conf="$(mktemp mod_gnutls_test-XXXXXX.conf)"
10function cleanup_tmpconf
11{
12    rm "${tmp_softhsm_conf}"
13}
14trap cleanup_tmpconf EXIT
15
[b0e5dae]16if [ "${SOFTHSM_MAJOR_VERSION}" = "1" ]; then
17    cat - >"${tmp_softhsm_conf}" <<EOF
[db6bac4]180:$(realpath $(pwd))/server/softhsm.db
19EOF
[b0e5dae]20    export SOFTHSM_CONF="${tmp_softhsm_conf}"
21elif [ "${SOFTHSM_MAJOR_VERSION}" = "2" ]; then
22    cat - >"${tmp_softhsm_conf}" <<EOF
23objectstore.backend = file
[c825c3a]24directories.tokendir = $(realpath $(pwd))/authority/server/softhsm2.db
[b0e5dae]25EOF
26    export SOFTHSM2_CONF="${tmp_softhsm_conf}"
27fi
28
[33af2b7]29echo "Generated temporary SoftHSM config ${tmp_softhsm_conf}:"
30cat "${tmp_softhsm_conf}"
31
32. $(dirname ${0})/softhsm.bash
[3f00958]33
34set -e
35
[05984a0]36${srcdir}/netns_py.bash ${srcdir}/runtest.py --test-number 24
[33af2b7]37
38cleanup_tmpconf
39trap - EXIT
Note: See TracBrowser for help on using the repository browser.