From 530175009c4f753569f968ad9fafdf762521ccca Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 26 Aug 2019 15:13:22 +0200 Subject: [PATCH] tests/common: Add different path to softhsm pkcs11 library to test also on different architectures --- tests/common.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/common.sh b/tests/common.sh index 4fa1fba0..bc9747f2 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -4,7 +4,22 @@ SOPIN="12345678" PIN="123456" PKCS11_TOOL="../src/tools/pkcs11-tool" -P11LIB="/usr/lib64/pkcs11/libsofthsm2.so" + +softhsm_paths="/usr/local/lib/softhsm/libsofthsm2.so \ + /usr/lib64/pkcs11/libsofthsm2.so \ + /usr/lib/x86_64-linux-gnu/softhsm/libsofthsm2.so" + +for LIB in $softhsm_paths; do + echo "Testing $LIB" + if [[ -f $LIB ]]; then + P11LIB=$LIB + echo "Setting P11LIB=$LIB" + break + fi +done +if [[ -z "$P11LIB" ]]; then + echo "Warning: Could not find the softhsm pkcs11 module" +fi ERRORS=0 function assert() {