diff --git a/pico-hsm-sdk b/pico-hsm-sdk index 910b2fb..30a2707 160000 --- a/pico-hsm-sdk +++ b/pico-hsm-sdk @@ -1 +1 @@ -Subproject commit 910b2fb75a2ce2c6660fe70334c24c9407910a1a +Subproject commit 30a2707dd89ec6c677415171f7e46521689b5b76 diff --git a/tests/docker/bullseye/Dockerfile b/tests/docker/bullseye/Dockerfile index 91f008a..4444398 100644 --- a/tests/docker/bullseye/Dockerfile +++ b/tests/docker/bullseye/Dockerfile @@ -15,12 +15,21 @@ RUN apt install -y libccid \ gcc \ make \ build-essential \ - opensc \ python3 \ python3-pip \ swig \ + libssl-dev \ cmake \ vsmartcard-vpcd \ && rm -rf /var/lib/apt/lists/* RUN pip3 install pytest pycvc cryptography pyscard base58 WORKDIR / +RUN git clone https://github.com/OpenSC/OpenSC +WORKDIR /OpenSC +#RUN git checkout tags/0.23.0 +RUN ./bootstrap +RUN ./configure --enable-openssl +RUN make -j `nproc` +RUN make install +RUN ldconfig +WORKDIR / diff --git a/tests/scripts/initialize.sh b/tests/scripts/initialize.sh index ce2fb9d..8fceb2a 100755 --- a/tests/scripts/initialize.sh +++ b/tests/scripts/initialize.sh @@ -1,4 +1,4 @@ -#!/bin/bash -eu +#!/bin/bash python3 tools/pico-hsm-tool.py --pin 648219 initialize --so-pin 57621880 --silent test $? -eq 0 || exit $? @@ -40,5 +40,5 @@ grep -q CKR_PIN_LOCKED <<< $e || exit $? pkcs11-tool --login --login-type so --so-pin 3537363231383830 --init-pin --new-pin 648219 test $? -eq 0 || exit $? -pkcs11-tool --login --pin 648219 -I > /dev/null +pkcs11-tool --login --pin 648219 -I test $? -eq 0 || exit $? diff --git a/tests/start-up-and-test.sh b/tests/start-up-and-test.sh index 46b8c9a..93b9875 100755 --- a/tests/start-up-and-test.sh +++ b/tests/start-up-and-test.sh @@ -1,4 +1,4 @@ -#!/bin/bash -eu +#!/bin/bash rm -rf pypicohsm git clone https://github.com/polhenarejos/pypicohsm.git @@ -7,12 +7,11 @@ pip3 install -e pypicohsm sleep 2 rm -f memory.flash tar -xf tests/memory.tar.gz -./build_in_docker/pico_hsm > /dev/null & -#pytest tests -W ignore::DeprecationWarning +./build_in_docker/pico_hsm > /dev/null 2>&1 & +pytest tests -W ignore::DeprecationWarning chmod a+x tests/scripts/*.sh echo -n "Test initialization... " -./tests/scripts/initialize.sh -echo "\tok" - +./tests/scripts/initialize.sh > /dev/null 2>&1 +test $? -eq 0 && echo -e '\tok' || (echo -e '\tfail' && exit 1)