From c3af303468ed30aa2ebb15d715e9cb3de4c9ed37 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 9 Oct 2023 00:58:49 +0200 Subject: [PATCH] Split pytest and pkcs11 test suites. Signed-off-by: Pol Henarejos --- .github/workflows/test.yml | 2 ++ tests/run-test-pkcs11-in-docker.sh | 5 +++++ tests/start-up-and-test-pkcs11.sh | 15 +++++++++++++++ tests/start-up-and-test.sh | 5 ----- 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 tests/run-test-pkcs11-in-docker.sh create mode 100644 tests/start-up-and-test-pkcs11.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c55029..230db48 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,3 +35,5 @@ jobs: run: ./tests/build-in-docker.sh - name: Start emulation and test run: ./tests/run-test-in-docker.sh + - name: Test PKCS11 + run: ./tests/run-test-pkcs11-in-docker.sh diff --git a/tests/run-test-pkcs11-in-docker.sh b/tests/run-test-pkcs11-in-docker.sh new file mode 100644 index 0000000..ca3486e --- /dev/null +++ b/tests/run-test-pkcs11-in-docker.sh @@ -0,0 +1,5 @@ +#!/bin/bash -eu + +source tests/docker_env.sh +run_in_docker ./tests/start-up-and-test.sh + diff --git a/tests/start-up-and-test-pkcs11.sh b/tests/start-up-and-test-pkcs11.sh new file mode 100644 index 0000000..8f0834e --- /dev/null +++ b/tests/start-up-and-test-pkcs11.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +rm -rf pypicohsm +git clone https://github.com/polhenarejos/pypicohsm.git +pip3 install -e pypicohsm +/usr/sbin/pcscd & +sleep 2 +rm -f memory.flash +tar -xf tests/memory.tar.gz +./build_in_docker/pico_hsm > /dev/null 2>&1 & + +chmod a+x tests/scripts/*.sh + +echo "======== PKCS11 Test suite ========" +./tests/scripts/pkcs11.sh diff --git a/tests/start-up-and-test.sh b/tests/start-up-and-test.sh index f10091a..4825b6b 100755 --- a/tests/start-up-and-test.sh +++ b/tests/start-up-and-test.sh @@ -9,8 +9,3 @@ rm -f memory.flash tar -xf tests/memory.tar.gz ./build_in_docker/pico_hsm > /dev/null 2>&1 & pytest tests -W ignore::DeprecationWarning - -chmod a+x tests/scripts/*.sh - -echo "======== PKCS11 Test suite ========" -./tests/scripts/pkcs11.sh