Add sc-hsm-pkcs11-test to test matrix.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2023-10-09 21:56:41 +02:00
parent 43c46e9112
commit c3b57b229f
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3
3 changed files with 27 additions and 1 deletions

View file

@ -47,7 +47,7 @@ jobs:
needs: build
strategy:
matrix:
suite: ["pkcs11", "pytest"]
suite: ["pkcs11", "pytest", "sc-hsm-pkcs11"]
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3

View file

@ -4,6 +4,8 @@ source tests/docker_env.sh
if [[ $1 == "pkcs11" ]]; then
run_in_docker ./tests/start-up-and-test-pkcs11.sh
elif [[ $1 == "sc-hsm-pkcs11" ]]; then
run_in_docker ./tests/scripts/sc_hsm_test.sh
else
run_in_docker ./tests/start-up-and-test.sh
fi

24
tests/scripts/sc_hsm_test.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/bash
source ./tests/startup.sh
echo "==== Test SC HSM ===="
echo -n " Running sc-hsm-pkcs11-test..."
pkcs11-tool -l --pin 648219 --keypairgen --key-type ec:secp256r1 --id 1 --label "TestLabel" > /dev/null 2>&1
test $? -eq 0 && echo -n "." || {
echo -e "\t${FAIL}"
exit 1
}
e=$(/usr/local/bin/sc-hsm-pkcs11-test --module /usr/local/lib/libsc-hsm-pkcs11.so --pin 648219 --invasive 2>&1)
test $? -eq 0 && echo -n "." || {
echo -e "\t${FAIL}"
exit 1
}
grep -q "338 tests performed" <<< $e && echo -n "." || {
echo -e "\t${FAIL}"
exit 1
}
grep -q "0 tests failed" <<< $e && echo -e ".\t${OK}" || {
echo -e "\t${FAIL}"
exit 1
}