mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 01:18:06 +00:00
Add sc-hsm-pkcs11-test to test matrix.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
43c46e9112
commit
c3b57b229f
3 changed files with 27 additions and 1 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -47,7 +47,7 @@ jobs:
|
||||||
needs: build
|
needs: build
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
suite: ["pkcs11", "pytest"]
|
suite: ["pkcs11", "pytest", "sc-hsm-pkcs11"]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository and submodules
|
- name: Checkout repository and submodules
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ source tests/docker_env.sh
|
||||||
|
|
||||||
if [[ $1 == "pkcs11" ]]; then
|
if [[ $1 == "pkcs11" ]]; then
|
||||||
run_in_docker ./tests/start-up-and-test-pkcs11.sh
|
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
|
else
|
||||||
run_in_docker ./tests/start-up-and-test.sh
|
run_in_docker ./tests/start-up-and-test.sh
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
24
tests/scripts/sc_hsm_test.sh
Executable file
24
tests/scripts/sc_hsm_test.sh
Executable 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
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue