#!/bin/bash
SOURCE_PATH=${SOURCE_PATH:-../}

source $SOURCE_PATH/tests/common.sh

echo "======================================================="
echo "Setup SoftHSM"
echo "======================================================="
if [[ ! -f $P11LIB ]]; then
    echo "WARNINIG: The SoftHSM is not installed. Can not run this test"
    exit 77;
fi

card_setup

echo "======================================================="
echo "Test pkcs11 threads IN "
echo "======================================================="
$PKCS11_TOOL --test-threads IN -L
assert $? "Failed running tests"


echo "======================================================="
echo "Test pkcs11 threads ILGISLT0 "
echo "======================================================="
$PKCS11_TOOL --test-threads ILGISLT0 -L
assert $? "Failed running tests"

echo "======================================================="
echo "Cleanup"
echo "======================================================="
card_cleanup

exit $ERRORS

#!/bin/bash
SOURCE_PATH=${SOURCE_PATH:-../}

source $SOURCE_PATH/tests/common.sh

# Test our PKCS #11 module here
P11LIB="../src/pkcs11/.libs/opensc-pkcs11.so"

echo "======================================================="
echo "Test pkcs11 threads IN "
echo "======================================================="
$PKCS11_TOOL --test-threads IN -L --module="$P11LIB"
assert $? "Failed running tests"


echo "======================================================="
echo "Test pkcs11 threads ILGISLT0 "
echo "======================================================="
$PKCS11_TOOL --test-threads ILGISLT0 -L --module="$P11LIB"
assert $? "Failed running tests"

exit $ERRORS

Use explicit pkcs11 library in thread test
tests: Use explicit pkcs11 library in thread test

Previously, the system-installed opensc was used, but there is no
guarantee that it exists when running tests. Use the locally built
library, even though there will probably not be any slots.

Using softhsm causes a lot of failures as it looks like this is not well
handled in there.
