Skip to content

Commit

Permalink
Make helper write titles to provider debug file
Browse files Browse the repository at this point in the history
Makes it easier to check what operations each test sends to the token
by writing the title of "PARA" sections to the provider's debug file.

Signed-off-by: Simo Sorce <[email protected]>
  • Loading branch information
simo5 committed Aug 1, 2024
1 parent 49f4697 commit 4d42717
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ title()
shift 1
echo ""
echo "## $*"
if [ -f "${PPDBGFILE}" ]; then
echo "[TEST]: $*" >> "${PPDBGFILE}"
fi
;;
"LINE")
shift 1
Expand Down
1 change: 1 addition & 0 deletions tests/setup-kryoptic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ title LINE "Export test variables to ${TMPPDIR}/testvars"
cat >> "${TMPPDIR}/testvars" <<DBGSCRIPT
export P11LIB=${P11LIB}
export PKCS11_PROVIDER_MODULE=${P11LIB}
export PPDBGFILE=${TMPPDIR}/p11prov-debug.log
export PKCS11_PROVIDER_DEBUG="file:${TMPPDIR}/p11prov-debug.log"
export OPENSSL_CONF="${OPENSSL_CONF}"
export KRYOPTIC_CONF="${TMPPDIR}/tokens/kryoptic.sql"
Expand Down
1 change: 1 addition & 0 deletions tests/setup-softhsm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ title LINE "Export test variables to ${TMPPDIR}/testvars"
cat >> "${TMPPDIR}/testvars" <<DBGSCRIPT
export P11LIB=${P11LIB}
export PKCS11_PROVIDER_MODULE=${P11LIB}
export PPDBGFILE=${TMPPDIR}/p11prov-debug.log
export PKCS11_PROVIDER_DEBUG="file:${TMPPDIR}/p11prov-debug.log"
export OPENSSL_CONF="${OPENSSL_CONF}"
export SOFTHSM2_CONF=${TMPPDIR}/softhsm.conf
Expand Down
1 change: 1 addition & 0 deletions tests/setup-softokn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ sed -e "s|@libtoollibs@|${LIBSPATH}|g" \

title LINE "Export tests variables to ${TMPPDIR}/testvars"
cat > "${TMPPDIR}/testvars" <<DBGSCRIPT
export PPDBGFILE=${TMPPDIR}/p11prov-debug.log
export PKCS11_PROVIDER_DEBUG="file:${TMPPDIR}/p11prov-debug.log"
export PKCS11_PROVIDER_MODULE="${SOFTOKNPATH%%/}/libsoftokn3${SHARED_EXT}"
export OPENSSL_CONF="${OPENSSL_CONF}"
Expand Down

0 comments on commit 4d42717

Please sign in to comment.